introduction to unification theory
play

Introduction to Unification Theory Higher-Order Unification Temur - PowerPoint PPT Presentation

Introduction to Unification Theory Higher-Order Unification Temur Kutsia RISC, Johannes Kepler University of Linz, Austria kutsia@risc.jku.at Overview Introduction Preliminaries Higher-Order Unification Procedure Outline Introduction


  1. Long Normal Form Long Normal Form Assume ▸ t = λ x 1 ....λ x m . ( r s 1 ... s k ) is in the βη -normal form, ▸ T 1 → ⋯ → T n → U is a type of t , ▸ U is atomic and n ≥ m . Then the long normal form of t is the term t ′ = λ x 1 ....λ x m .λ x m + 1 ....λ x n . ( r s ′ 1 ... s ′ k x ′ m + 1 ... x ′ n ) where ▸ s ′ i is the long normal form of s i . ▸ x ′ i is the long normal form of x i . The long normal form of any term is that of its normal form.

  2. Long Normal Form Long Normal Form Assume ▸ t = λ x 1 ....λ x m . ( r s 1 ... s k ) is in the βη -normal form, ▸ T 1 → ⋯ → T n → U is a type of t , ▸ U is atomic and n ≥ m . Then the long normal form of t is the term t ′ = λ x 1 ....λ x m .λ x m + 1 ....λ x n . ( r s ′ 1 ... s ′ k x ′ m + 1 ... x ′ n ) where ▸ s ′ i is the long normal form of s i . ▸ x ′ i is the long normal form of x i . The long normal form of any term is that of its normal form. Since t is in the normal form, r (called the head of t ) is either a constant or a variable.

  3. Long Normal Form Example Let the type of f be T 1 → T 2 → U , with U atomic. Let t be λ x . ( f (( λ y . ( yx )) λ z . z )) .

  4. Long Normal Form Example Let the type of f be T 1 → T 2 → U , with U atomic. Let t be λ x . ( f (( λ y . ( yx )) λ z . z )) . ▸ The long normal form of t is λ x .λ y . ( f x y ) .

  5. Long Normal Form Example Let the type of f be T 1 → T 2 → U , with U atomic. Let t be λ x . ( f (( λ y . ( yx )) λ z . z )) . ▸ The long normal form of t is λ x .λ y . ( f x y ) . ▸ λ x .λ y . ( f x y ) is a long normal form of λ x . ( f x ) as well, which is a β -normal form of t .

  6. Long Normal Form Example Let the type of f be T 1 → T 2 → U , with U atomic. Let t be λ x . ( f (( λ y . ( yx )) λ z . z )) . ▸ The long normal form of t is λ x .λ y . ( f x y ) . ▸ λ x .λ y . ( f x y ) is a long normal form of λ x . ( f x ) as well, which is a β -normal form of t . ▸ In general, to compute long normal form, it is not necessary to perform η -reductions.

  7. Long Normal Form ▸ In the rest, “normal form” stands for “long normal form”. ▸ Notation: We write λ x 1 ....λ x n . r ( t 1 ,..., t m ) for λ x 1 ....λ x n . ( r t 1 ... t m ) in normal form. r is either a constant or a variable.

  8. Outline Introduction Preliminaries Higher-Order Unification Procedure

  9. Higher Order Unification Higher-Order Unification Problem, Unifier ▸ Higher-Order Unification problem: a finite set of equations P = { s 1 ≐ ? t 1 ,..., s n ≐ ? t n } , where s i , t i are λ -terms. ▸ Unifier of P : a substitution σ such that s i σ and t i σ have the same normal form for each 1 ≤ i ≤ n . We will use capital letters to denote free variables in unification problems.

  10. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} .

  11. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Unifier: σ 1 = { F ↦ λ x . f ( x , b )} .

  12. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Unifier: σ 1 = { F ↦ λ x . f ( x , b )} . ▸ Justification: F ( f ( a , b )) σ 1 = (( λ x . f ( x , b )) f ( a , b )) ⊳ β f ( f ( a , b ) , b ) .

  13. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Unifier: σ 1 = { F ↦ λ x . f ( x , b )} . ▸ Justification: F ( f ( a , b )) σ 1 = (( λ x . f ( x , b )) f ( a , b )) ⊳ β f ( f ( a , b ) , b ) . f ( F ( a ) , b ) σ 1 = f ((( λ x . f ( x , b )) a ) , b ) ⊳ β f ( f ( a , b ) , b ) .

  14. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} .

  15. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Another unifier: σ 2 = { F ↦ λ x . f ( f ( x , b ) , b )} .

  16. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Another unifier: σ 2 = { F ↦ λ x . f ( f ( x , b ) , b )} . ▸ Justification: F ( f ( a , b )) σ 2 = (( λ x . f ( f ( x , b ) , b )) f ( a , b )) ⊳ β f ( f ( f ( a , b ) , b ) , b ) .

  17. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Another unifier: σ 2 = { F ↦ λ x . f ( f ( x , b ) , b )} . ▸ Justification: F ( f ( a , b )) σ 2 = (( λ x . f ( f ( x , b ) , b )) f ( a , b )) ⊳ β f ( f ( f ( a , b ) , b ) , b ) . f ( F ( a ) , b ) σ 2 = f ((( λ x . f ( f ( x , b ) , b )) a ) , b ) ⊳ β f ( f ( f ( a , b ) , b ) , b ) .

  18. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} .

  19. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Infinitely many unifiers, of the shape { F ↦ λ x . f ( ... f ( x , b ) ,... b )} .

  20. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Infinitely many unifiers, of the shape { F ↦ λ x . f ( ... f ( x , b ) ,... b )} . ▸ Incomparable wrt instantiation quasi-ordering.

  21. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Infinitely many unifiers, of the shape { F ↦ λ x . f ( ... f ( x , b ) ,... b )} . ▸ Incomparable wrt instantiation quasi-ordering. ▸ Minimal complete set of unifiers.

  22. Higher Order Unification Example ▸ P = { F ( f ( a , b )) ≐ ? f ( F ( a ) , b )} . ▸ Infinitely many unifiers, of the shape { F ↦ λ x . f ( ... f ( x , b ) ,... b )} . ▸ Incomparable wrt instantiation quasi-ordering. ▸ Minimal complete set of unifiers. ▸ There are problems for which this set does not exist!

  23. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} .

  24. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms):

  25. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms): σ = { F ↦ λ x .λ y . H ( x )} H ( λ x . G ( x ))

  26. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms): σ = { F ↦ λ x .λ y . H ( x )} H ( λ x . G ( x )) σ 0 = { F ↦ λ x .λ y . x , G ↦ λ x . Y } λ x . Y

  27. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms): σ = { F ↦ λ x .λ y . H ( x )} H ( λ x . G ( x )) σ 0 = { F ↦ λ x .λ y . x , G ↦ λ x . Y } λ x . Y σ 1 = { F ↦ λ x .λ y . G 1 ( x , x ( H 1 1 ( x , y ))) , G ↦ λ x . Y } G 1 ( λ x . Y , Y )

  28. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms): σ = { F ↦ λ x .λ y . H ( x )} H ( λ x . G ( x )) σ 0 = { F ↦ λ x .λ y . x , G ↦ λ x . Y } λ x . Y σ 1 = { F ↦ λ x .λ y . G 1 ( x , x ( H 1 1 ( x , y ))) , G ↦ λ x . Y } G 1 ( λ x . Y , Y ) σ 2 = { F ↦ λ x .λ y . G 2 ( x , x ( H 2 1 ( x , y )) , x ( H 2 2 ( x , y ))) , G ↦ λ x . Y } G 2 ( λ x . Y , Y , Y )

  29. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions (together with the instance terms): σ = { F ↦ λ x .λ y . H ( x )} H ( λ x . G ( x )) σ 0 = { F ↦ λ x .λ y . x , G ↦ λ x . Y } λ x . Y σ 1 = { F ↦ λ x .λ y . G 1 ( x , x ( H 1 1 ( x , y ))) , G ↦ λ x . Y } G 1 ( λ x . Y , Y ) σ 2 = { F ↦ λ x .λ y . G 2 ( x , x ( H 2 1 ( x , y )) , x ( H 2 2 ( x , y ))) , G ↦ λ x . Y } G 2 ( λ x . Y , Y , Y ) ... σ n = { F ↦ λ x .λ y . G n ( x , x ( H n 1 ( x , y )) ,..., x ( H n n ( x , y ))) , G ↦ λ x . Y } G n ( λ x . Y , Y ,..., Y ) (There are n Y ’s here.)

  30. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions: σ = { F ↦ λ x .λ y . H ( x )} σ 0 = { F ↦ λ x . x , G ↦ λ x . Y } σ n = { F ↦ λ x .λ y . G n ( x , x ( H n 1 ( x , y )) ,..., x ( H n n ( x , y ))) , G ↦ λ x . Y }

  31. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions: σ = { F ↦ λ x .λ y . H ( x )} σ 0 = { F ↦ λ x . x , G ↦ λ x . Y } σ n = { F ↦ λ x .λ y . G n ( x , x ( H n 1 ( x , y )) ,..., x ( H n n ( x , y ))) , G ↦ λ x . Y } ⩿ { F , G } σ j , σ / ⩿ { F , G } σ i , σ i / ⩿ { F , G } σ , and ▸ No mcsu. For all i , j > i : σ i / σ i ≖ { F , G } σ i + 1 ϑ i where ϑ i = { G i + 1 ↦ λ x .λ y 1 ....λ y i + 1 . G i ( x , y 1 ,..., y i ) , H i + 1 1 ,..., H i + 1 ↦ H i ↦ H i i } 1 i

  32. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ Complete set of solutions: σ = { F ↦ λ x .λ y . H ( x )} σ 0 = { F ↦ λ x . x , G ↦ λ x . Y } σ n = { F ↦ λ x .λ y . G n ( x , x ( H n 1 ( x , y )) ,..., x ( H n n ( x , y ))) , G ↦ λ x . Y } ⩿ { F , G } σ j , σ / ⩿ { F , G } σ i , σ i / ⩿ { F , G } σ , and ▸ No mcsu. For all i , j > i : σ i / σ i ≖ { F , G } σ i + 1 ϑ i where ϑ i = { G i + 1 ↦ λ x .λ y 1 ....λ y i + 1 . G i ( x , y 1 ,..., y i ) , H i + 1 1 ,..., H i + 1 ↦ H i ↦ H i i } 1 i ▸ Infinite descending chain: σ 1 ⪀ { F , G } σ 2 ⪀ { F , G } ⋯

  33. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} .

  34. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ The problem is of third order.

  35. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ The problem is of third order. ▸ Higher-order unification of the order 3 and above is of type 0.

  36. Higher Order Unification Is of Type 0 ▸ Unification problem: P = { F ( λ x . G ( x ) , a ) ≐ ? F ( λ x . G ( x ) , b )} . ▸ The problem is of third order. ▸ Higher-order unification of the order 3 and above is of type 0. ▸ Second order unification is infinitary.

  37. Higher Order Unification Is Undecidable ▸ Idea: Reduce Hilbert’s 10th problem to a higher-order unification problem. ▸ Hilbert’s 10th problem is undecidable: There is no algorithm that takes as input two polynomials P ( X 1 ,..., X n ) and Q ( X 1 ,..., X n ) with natural coefficients and answers if there exist natural numbers m 1 ,..., m n such that P ( m 1 ,..., m n ) = Q ( m 1 ,..., m n ) . ▸ Reduction requires to represent ▸ natural numbers, ▸ addition, ▸ multiplication in terms of higher-order unification.

  38. Higher Order Unification Is Undecidable Representation (Goldfarb 1981): ▸ Natural number n represented as a λ -term denoted by n : λ x . g ( a , g ( a ,... g ( a , x ) ... )) with n occurrences of g and a . The type of g is i → i → i and the type of a is i . Such terms are called Goldfarb numbers. ▸ Goldfarb numbers are exactly those that solve the unification problem { g ( a , X ( a )) ≐ ? X ( g ( a , a ))} and have the type i → i .

  39. Higher Order Unification Is Undecidable Representation: ▸ Addition is represented by the λ -term add : λ n .λ m .λ x . n ( m ( x )) . ▸ Multiplication is represented by the higher-order unification problem { Y ( a , b , g ( g ( X 3 ( a ) , X 2 ( b )) , a )) ≐ ? g ( g ( a , b ) , Y ( X 1 ( a ) , g ( a , b ) , a )) Y ( b , a , g ( g ( X 3 ( b ) , X 2 ( a )) , a )) ≐ ? g ( g ( b , a ) , Y ( X 1 ( b ) , g ( a , a ) , a ))} that has a solution { X 1 ↦ m 1 , X 2 ↦ m 2 , X 3 ↦ m 3 , Y ↦ t } for some t iff m 1 × m 2 = m 3 .

  40. Higher Order Unification Is Undecidable Reduction from Hilbert’s 10th problem: ▸ Every equation P ( X 1 ,..., X n ) = Q ( X 1 ,..., X n ) can be decomposed into a system of equations of the form: X i + X j = X k , X i × X j = X k , X i = m . ▸ With each such system associate a unification problem containing ▸ for each X i an equation g ( a , X i ( a )) ≐ ? X i ( g ( a , a )) , ▸ for each X i + X j = X k the equation add ( X i , X j ) ≐ ? X k , ▸ for each X i × X j = X k the two equations used to define multiplication, ▸ for each X i = m the equation X i ≐ ? m .

  41. Second Order Unification Is Undecidable ▸ The reduction implies undecidability of higher-order unification. ▸ Since the reduction is actually to second-order unification, the result is sharper: Theorem Second-order unification is undecidable. For the details of undecidability of second-order unification, see W. D. Goldfarb The undecidability of the second-order unification problem. Theoretical Computer Science 13 , 225–230.

  42. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design:

  43. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions).

  44. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions). 2. For a given unification problem, take the first untried substitution and check whether it is a solution.

  45. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions). 2. For a given unification problem, take the first untried substitution and check whether it is a solution. 3. If yes, stop with success. If not, mark the substitution as tried and iterate.

  46. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions). 2. For a given unification problem, take the first untried substitution and check whether it is a solution. 3. If yes, stop with success. If not, mark the substitution as tried and iterate. ▸ Checking is not hard: Apply the substitution to both sides of each equation, normalize, and compare the normal forms.

  47. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions). 2. For a given unification problem, take the first untried substitution and check whether it is a solution. 3. If yes, stop with success. If not, mark the substitution as tried and iterate. ▸ Checking is not hard: Apply the substitution to both sides of each equation, normalize, and compare the normal forms. ▸ If the problem is solvable, the procedure will detect it after finite steps.

  48. Higher-Order Unification Procedure ▸ Higher-order semi-decision procedure is easy to design: 1. Enumerate all substitutions (in fact, it is enough to enumerate all closed substitutions). 2. For a given unification problem, take the first untried substitution and check whether it is a solution. 3. If yes, stop with success. If not, mark the substitution as tried and iterate. ▸ Checking is not hard: Apply the substitution to both sides of each equation, normalize, and compare the normal forms. ▸ If the problem is solvable, the procedure will detect it after finite steps. ▸ Then... why to bother with looking for another unification procedure?

  49. Higher-Order Unification Procedure Why to look for a “better” procedure?

  50. Higher-Order Unification Procedure Why to look for a “better” procedure? ▸ To find solutions faster.

  51. Higher-Order Unification Procedure Why to look for a “better” procedure? ▸ To find solutions faster. ▸ To report failure for many unsolvable cases.

  52. Higher-Order Unification Procedure Why to look for a “better” procedure? ▸ To find solutions faster. ▸ To report failure for many unsolvable cases. ▸ To reduce redundancy. ▸ etc.

  53. Higher-Order Unification Procedure ▸ System: a pair P ; σ , where P is a higher-order unification problem and σ is a substitution. ▸ Procedure is given by transformation rules on systems. ▸ The description essentially follows the paper W. Snyder and J. Gallier. Higher-Order Unification Revisited: Complete Sets of Transformations. J. Symbolic Computation , 8 (1–2), 101–140, 1989.

  54. Important Observation ▸ Flex-flex equation has a form λ x 1 ....λ x k . F ( s 1 ,..., s n ) ≐ ? λ x 1 ....λ x k . G ( t 1 ,..., t m ) . The head of both sides are free variables.

  55. Important Observation ▸ Flex-flex equation has a form λ x 1 ....λ x k . F ( s 1 ,..., s n ) ≐ ? λ x 1 ....λ x k . G ( t 1 ,..., t m ) . The head of both sides are free variables. ▸ Any flex-flex equation is solvable. Just take { F ↦ λ y 1 ....λ y n . c , G ↦ λ y 1 ....λ y m . c } .

  56. Important Observation ▸ Flex-flex equation has a form λ x 1 ....λ x k . F ( s 1 ,..., s n ) ≐ ? λ x 1 ....λ x k . G ( t 1 ,..., t m ) . The head of both sides are free variables. ▸ Any flex-flex equation is solvable. Just take { F ↦ λ y 1 ....λ y n . c , G ↦ λ y 1 ....λ y m . c } . ▸ The appropriate c always exists because for each type we have at least one constant of that type.

  57. Important Observation ▸ Flex-flex equation has a form λ x 1 ....λ x k . F ( s 1 ,..., s n ) ≐ ? λ x 1 ....λ x k . G ( t 1 ,..., t m ) . The head of both sides are free variables. ▸ Any flex-flex equation is solvable. Just take { F ↦ λ y 1 ....λ y n . c , G ↦ λ y 1 ....λ y m . c } . ▸ The appropriate c always exists because for each type we have at least one constant of that type. ▸ Flex-flex equations may introduce infinite branching in the search tree (very undesirable property).

  58. Important Observation ▸ Flex-flex equation has a form λ x 1 ....λ x k . F ( s 1 ,..., s n ) ≐ ? λ x 1 ....λ x k . G ( t 1 ,..., t m ) . The head of both sides are free variables. ▸ Any flex-flex equation is solvable. Just take { F ↦ λ y 1 ....λ y n . c , G ↦ λ y 1 ....λ y m . c } . ▸ The appropriate c always exists because for each type we have at least one constant of that type. ▸ Flex-flex equations may introduce infinite branching in the search tree (very undesirable property). ▸ Idea: Do not try to solve flex-flex equations. Assume them solved. Preunification.

  59. Preunification Preunifier ▸ Let ≅ be the least congruence relation on the set of λ -terms that contains the set of flex-flex pairs. ▸ A substitution σ is a preunifier for a unification problem { s 1 ≐ ? t 1 ,..., s n ≐ ? t n } iff normal - form ( s i σ ) ≅ normal - form ( t i σ ) for each 1 ≤ i ≤ n . Convention ▸ x n abbreviates x 1 ,..., x n . ▸ λ x n abbreviates λ x 1 .....λ x n .

  60. One Technical Notion Partial Binding A partial binding of type T 1 → ⋯ → T n → U ( U atomic) is a term of the form λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) where l is a constant or a variable, and

  61. One Technical Notion Partial Binding A partial binding of type T 1 → ⋯ → T n → U ( U atomic) is a term of the form λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) where l is a constant or a variable, and ▸ the type of x i is T i for 1 ≤ i ≤ n ,

  62. One Technical Notion Partial Binding A partial binding of type T 1 → ⋯ → T n → U ( U atomic) is a term of the form λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) where l is a constant or a variable, and ▸ the type of x i is T i for 1 ≤ i ≤ n , ▸ the type of l is S 1 → ⋯ → S k → U , where S i is R i 1 → ⋯ → R i m i → S ′ i ( S ′ i atomic) for 1 ≤ i ≤ k ,

  63. One Technical Notion Partial Binding A partial binding of type T 1 → ⋯ → T n → U ( U atomic) is a term of the form λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) where l is a constant or a variable, and ▸ the type of x i is T i for 1 ≤ i ≤ n , ▸ the type of l is S 1 → ⋯ → S k → U , where S i is R i 1 → ⋯ → R i m i → S ′ i ( S ′ i atomic) for 1 ≤ i ≤ k , ▸ the type of y i j is R i j for 1 ≤ i ≤ k and 1 ≤ j ≤ m i .

  64. One Technical Notion Partial Binding A partial binding of type T 1 → ⋯ → T n → U ( U atomic) is a term of the form λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) where l is a constant or a variable, and ▸ the type of x i is T i for 1 ≤ i ≤ n , ▸ the type of l is S 1 → ⋯ → S k → U , where S i is R i 1 → ⋯ → R i m i → S ′ i ( S ′ i atomic) for 1 ≤ i ≤ k , ▸ the type of y i j is R i j for 1 ≤ i ≤ k and 1 ≤ j ≤ m i . m i → S ′ ▸ the type of H i is T 1 → ⋯ → T n → R i 1 → ⋯ → R i i for 1 ≤ i ≤ k .

  65. Partial Binding λ x n . l ( λ y 1 m 1 . H 1 ( x n , y 1 m 1 ) ,...,λ y k m k . H k ( x n , y k m k )) ▸ Imitation binding: l is a constant or a free variable. ▸ ( i th ) Projection binding: l is x i . ▸ A partial binding t is appropriate to F if t and F have the same types. ▸ F ↦ t : Appropriate partial (imitation, projection) binding if t is partial (imitation, projection) binding appropriate to F .

  66. Higher-Order Preunification Procedure ▸ The inference system U HOP consists of the rules: ▸ Trivial ▸ Decomposition ▸ Variable Elimination ▸ Orient ▸ Imitation ▸ Projection ▸ The rules transform systems: pairs P ; σ , where P is a higher-order unification problem and σ is a substitution. ▸ A system P ; σ is in presolved form if P is either empty or consists of flex-flex equations only.

  67. Higher-Order Preunification Procedure. Rules { t ≐ ? t } ∪ P ′ ; ϑ � Trivial: ⇒ P ′ ; ϑ

  68. Higher-Order Preunification Procedure. Rules { t ≐ ? t } ∪ P ′ ; ϑ � Trivial: ⇒ P ′ ; ϑ Decomposition: { λ x k . l ( s 1 ,..., s n ) ≐ ? λ x k . l ( t 1 ,..., t n )} ∪ P ′ ; ϑ � ⇒ { λ x k . s 1 ≐ ? λ x k . t 1 ,...,λ x k . s n ≐ ? λ x k . t n , } ∪ P ′ ; ϑ. where l is either a constant or one of the bound variables x 1 ,..., x k .

  69. Higher-Order Preunification Procedure. Rules { t ≐ ? t } ∪ P ′ ; ϑ � Trivial: ⇒ P ′ ; ϑ Decomposition: { λ x k . l ( s 1 ,..., s n ) ≐ ? λ x k . l ( t 1 ,..., t n )} ∪ P ′ ; ϑ � ⇒ { λ x k . s 1 ≐ ? λ x k . t 1 ,...,λ x k . s n ≐ ? λ x k . t n , } ∪ P ′ ; ϑ. where l is either a constant or one of the bound variables x 1 ,..., x k . Variable Elimination: { λ x 1 ....λ x k . F ( x 1 ,..., x k ) ≐ ? t } ∪ P ′ ; ϑ � ⇒ P ′ { F ↦ t } ; ϑ { F ↦ t } . If F ∉ fvars ( t )

  70. Higher-Order Preunification Procedure. Rules Orient: { λ x k . l ( t 1 ,..., t m ) ≐ ? λ x k . F ( s 1 ,..., s n )} ∪ P ′ ; ϑ � ⇒ { λ x k . F ( s 1 ,..., s n ) ≐ ? λ x k . l ( t 1 ,..., t m )} ∪ P ′ ; ϑ where l is not a free variable.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend