Unification for first order terms.
Function or value | Description | ||||
|
Example
Evaluates to [("x", ``0``); ("y", ``0``)] .
Example
Throws System.Exception: cyclic .
Example
Throws System.Exception: cyclic .
|
||||
Full Usage:
istriv env x t
Parameters:
func<string, term>
-
The environment of mappings (represented as a finite partial function) from variables to terms in which to check the new assignment.
x : string
-
The variable to be assigned.
t : term
-
The term assigned to the variable.
Returns: bool
true, if the assignment is trivial (t = x ); otherwise, if
there are no cycle, false.
|
ExampleTrivial assignment
Evaluates to true .
ExampleAcyclic nontrivial assignment
Evaluates to false .
ExampleCyclic nontrivial assignment
Throws System.Exception: cyclic .
|
||||
Removes useless mappings from the input variable-term
mappings Note
The function never fails. However, it would cause a StackOverflow
crash if called on a cyclic ExampleThe following reduces \(x \mapsto y, x \mapsto 0\) to \(x \mapsto 0\).
Evaluates to [("x", ``0``)] .
ExampleThe following returns the input unchanged \(x \mapsto 1, y \mapsto 0\) since the input is already an MGU.
Evaluates to [("x", ``1``); ("y", ``0``)] .
ExampleThe following would cause a StackOverflow crash.
|
|||||
Full Usage:
unify env eqs
Parameters:
func<string, term>
-
An environment of mappings (represented as a finite partial function) from variables to terms, used as an accumulator for the final result of the unification procedure.
eqs : (term * term) list
-
The list of term-term pairs to be unified.
Returns: func<string, term>
A variable-term mappings that unify eqs , if the unification is
possible and there are no cycles.
|
It applies some transformations to
ExampleNo previous assignments
Evaluates to [("x", ``0``)] .
ExampleAugmented assignment
Evaluates to [("x", ``y``); ("y", ``0``)] .
ExampleDirect cycle (\(y \mapsto f(y)\))
Throws System.Exception: cyclic .
ExampleDerived cycle (\(x \mapsto y, y \mapsto f(x)\))
Throws System.Exception: cyclic .
ExampleImpossible unification
Throws System.Exception: impossible unification .
|
||||
|
Finds an MGU for a list of term-term pairs
Example
Evaluates to [(``f(f(z),g(y))``, ``f(f(z),g(y))``)] .
Example
Throws System.Exception: cyclic .
Example
Throws System.Exception: impossible unification .
|