Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unifying c -> a -> b and (a -> b) -> c

Tags:

types

haskell

What is the type inferred by a Haskell type synthesizer when unifying the types c -> a -> b and (a -> b) -> c?

Can someone explain me how can I solve it?

Thanks!

like image 622
yonutix Avatar asked Sep 03 '15 06:09

yonutix


People also ask

What is unification give an example?

An Example of Unification from. It would be convenient if there were one way to represent the equation of a plane that includes both (1.32) and (1.33) as special cases. The process of creating this new, encompassing representation is an example of another mathematical technique called unification.

What is the basic conditions for unification?

Conditions for Unification:Predicate symbol must be same, atoms or expression with different predicate symbol can never be unified. Number of Arguments in both expressions must be identical. Unification will fail if there are two similar variables present in the same expression.

What is unification algorithm?

In logic and computer science, unification is an algorithmic process of solving equations between symbolic expressions.

What is unification and resolution?

Unification is a key concept in proofs by resolutions. Resolution is a single inference rule which can efficiently operate on the conjunctive normal form or clausal form. Clause: Disjunction of literals (an atomic sentence) is called a clause. It is also known as a unit clause.


1 Answers

This seems to be some kind of exercise/homework so I will not spoil everything but give you some hints first:

  • the type c -> a -> b is actually c -> (a -> b)
  • so you have to unify c -> (a -> b) with (a -> b) -> c, that is:
    • c with a -> b (first part)
    • a -> b with c (second part)

now what could that (try to get rid of c ;) ) be now?

PS: I am assuming you want those types a, b, .. to be the same

like image 126
Random Dev Avatar answered Oct 04 '22 08:10

Random Dev