Add sub_all_clause
This commit is contained in:
parent
46bbcca1b8
commit
ad4ed220b6
13
ir.py
13
ir.py
|
@ -181,6 +181,19 @@ Applies every substitution to the term in order
|
||||||
kismesis(Karkat(), Karkat())
|
kismesis(Karkat(), Karkat())
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
sub_all_clause: Callable[[Substitutions, Clause], Clause] = uncurry2(c(p_map, cur2(sub_all))) #type:ignore
|
||||||
|
"""
|
||||||
|
Perform a series of substitutions on every term in a list
|
||||||
|
|
||||||
|
Effectively calls `sub_all()` on every element of the list.
|
||||||
|
|
||||||
|
>>> sub_all_clause(
|
||||||
|
... [Subst('x1', IRVar('Dave')), Subst('x2', IRProp('Karkat'))],
|
||||||
|
... [IRProp('dating', [IRVar('x1'), IRVar('x2')]), IRVar('x1')],
|
||||||
|
... )
|
||||||
|
[dating(Dave(),Karkat()), Dave()]
|
||||||
|
"""
|
||||||
|
|
||||||
def unify(t1: IRTerm, t2: IRTerm) -> Result[Substitutions, UnificationError]:
|
def unify(t1: IRTerm, t2: IRTerm) -> Result[Substitutions, UnificationError]:
|
||||||
"""
|
"""
|
||||||
Attempt to find a substitution that unifies two terms
|
Attempt to find a substitution that unifies two terms
|
||||||
|
|
Loading…
Reference in a new issue