unification

How to unify overlapping id systems into a single system?

What's the best way to unify several overlapping id systems into a unified one while maintaining the old id system. I have several different ids on my website... (E.g /publisher/1234 and /designer/1234) I would like to unify the ids into a new system, but want to preserve the functionality of the older system. ...

Type inference to unification problem

Has anyone an idea how the type inference problem E > hd (cons 1 nil) : α0 with the typing environment E={ hd : list(α1 ) → α1 , cons : α2 → list(α2 ) → list(α2 ), nil : list(α3 ), 1 : int } can be transferred in an unificat...

Is there a system where executing a program and calling a function is unified?

I would like to be able to do one or more of the following from the shell: - call any function from the program not only the main - pass parameters that are not only strings (not only argv) - have a program return not only int (the return code from main) - assign returned values to shell-level variables to be able to pass them to oth...

What is the optimal "most general unifier" algorithm?

The Question What is the most efficient MGU algorithm? What is its time complexity? Is it simple enough to describe as a stack overflow answer? I've been trying to find the answer on Google but keep finding private .PDFs that I can only access via an ACM subscription. I found one discussion in SICP: here Explanation of what a "most ...

Simplest example of need for "unification" in type inference

I'm trying to get my head around how type inference is implemented. In particularly, I don't quite see where/why the heavy lifting of "unification" comes into play. I'll give an example in "pseudo C#" to help clarify: The naive way to do it would be something like this: Suppose you "parse" your program into an expression tree such tha...

Seemingly unnecessary case in the unification algorithm in SICP

Hi guys, I'm trying to understand the unification algorithm described in SICP here In particular, in the procedure "extend-if-possible", there's a check (the first place marked with asterix "*") which is checking to see if the right hand "expression" is a variable that is already bound to something in the current frame: (define (extend...

How can I implement the unification algorithm in a language like Java or C#?

I'm working through my AI textbook I got and I've come to the last homework problem for my section: "Implement the Unification Algorithm outlined on page 69 in any language of your choice." On page 69, you have the following pseudo-code for the unification algorithm: function unify(E1, E2); begin case both E1 a...

prolog unification resolution

Why does this work: power(_,0,1) :- !. power(X,Y,Z) :- Y1 is Y - 1, power(X,Y1,Z1), Z is X * Z1. And this gives a stack overflow exception? power(_,0,1) :- !. power(X,Y,Z) :- power(X,Y - 1,Z1), Z is X * Z1. ...

Prolog is vs = with lists.

Why does this fail L is [1,2,3,4], and this works: L = [1,2,3]? But L is 1, and L = 1 both work the same. ...

What's an elegant way to unify X,Y with (1,2), (1,-2), (-1,2), (-1,-2), (2,1), (2,-1) , (-2,1), (-2,-1)?

What's an elegant way to unify X,Y with (1,2), (1,-2), (-1,2), (-1,-2), (2,1), (2,-1) , (-2,1), (-2,-1)? Doing it this way seems error prone and tedious: foo(1,2). foo(1,-2). foo(-1,-2). ... ... ... And this way seems too expensive: foo(X,Y) :- L = [1,-1,2,-2], member(X,L), member(Y,L), abs(X,X1), abs(Y,Y1), X1 =\= Y1. ...

Applications of Unification?

What are (practical) applications of Unification ? Where it is been used in real world? I couldn't get the whole idea of what it is really about and why its considered as a part of Artificial Intelligence. ...

Higher-order unification

I'm working on a higher-order theorem prover, of which unification seems to be the most difficult subproblem. If Huet's algorithm is still considered state-of-the-art, does anyone have any links to explanations of it that are written to be understood by a programmer rather than a mathematician? Or even any examples of where it works an...

Why won't this Prolog predicate unify?

Hi, I'm writing a predicate to find all possible successor states for an iteration of A* and put them in a list like [(cost, state), ...] , which stands at this at the moment: addSuccessors(L, [], _). addSuccessors(L, [X|T], OrigList) :- memb(OrigList, Index, X), add((X, Index), L, List2), ...

Type Parameter Unification

Why is this disallowed in C#? Actually I'd like to be able to write alias Y<A, B> : X<A, B>, X<B, A> The unification is actually desired here; if the A = B then just one method should be defined. ...

Real world example of Unification in First Order Logic?

I know this is only part of a programming question, but at the moment, I'm doing a little bit of logic programming. One thing I still don't understand correctly is Unification in First Order Logic. I read the Wikipedia article and it is more or less clear that the purpose is searching a term that unifies two sentences... There are also ...

Which of these extensions to my little logic language are unifiable?

I plan to make a little obfuscatory logic language. It's going have some features prolog doesn't. Probable some of the features I want aren't possible to unify. But before I ask what features I should drop you should know what my language is. A comma means and. A semicolon means or. Things which would be zero-ary constructors take one ar...