Isabelles use of unifjcation When using rule , erule , drule Isabelle - - PowerPoint PPT Presentation

isabelle s use of unifjcation
SMART_READER_LITE
LIVE PREVIEW

Isabelles use of unifjcation When using rule , erule , drule Isabelle - - PowerPoint PPT Presentation

Isabelles use of unifjcation When using rule , erule , drule Isabelle uses a process known as higher-order unifjcation What is: Unifjcation ...and specifjcally, higher-order unifjcation? 1 Isabelles use of unifjcation When using


slide-1
SLIDE 1

Isabelle’s use of unifjcation

When using rule, erule, drule Isabelle uses a process known as higher-order unifjcation What is:

  • Unifjcation
  • ...and specifjcally, higher-order unifjcation?

1

slide-2
SLIDE 2

Isabelle’s use of unifjcation

When using rule, erule, drule Isabelle uses a process known as higher-order unifjcation What is:

  • Unifjcation
  • ...and specifjcally, higher-order unifjcation?

1

slide-3
SLIDE 3

Unifjcation

Given two terms t, u defjned over:

  • Set of variables
  • Constant symbols

can we fjnd a substitution θ such that: tθ = uθ for some notion of equivalence or equality?

2

slide-4
SLIDE 4

First-order unifjcation

In fjrst-order unifjcation terms are fjrst-order terms: t, u, v ::= X | c | f(t1, . . . , tn) Equality is syntactic identity Substitutions are fjnite functions from variables to terms This process may be familiar:

  • Part of operational semantics of logic programming (e.g. Prolog)
  • Used widely in fjrst-order theorem proving

3

slide-5
SLIDE 5

First-order unifjcation

In fjrst-order unifjcation terms are fjrst-order terms: t, u, v ::= X | c | f(t1, . . . , tn) Equality is syntactic identity Substitutions are fjnite functions from variables to terms This process may be familiar:

  • Part of operational semantics of logic programming (e.g. Prolog)
  • Used widely in fjrst-order theorem proving

3

slide-6
SLIDE 6

First-order unifjcation

In fjrst-order unifjcation terms are fjrst-order terms: t, u, v ::= X | c | f(t1, . . . , tn) Equality is syntactic identity Substitutions are fjnite functions from variables to terms This process may be familiar:

  • Part of operational semantics of logic programming (e.g. Prolog)
  • Used widely in fjrst-order theorem proving

3

slide-7
SLIDE 7

Example

Suppose + is a function symbol and 5 and 6 are constants Suppose X and Y are variables Unify: 5 6 Y with X 5 5 Solution X 5 6 and Y 5 5

4

slide-8
SLIDE 8

Example

Suppose + is a function symbol and 5 and 6 are constants Suppose X and Y are variables Unify: +(+(5, 6), Y) with + (X, +(5, 5)) Solution X 5 6 and Y 5 5

4

slide-9
SLIDE 9

Example

Suppose + is a function symbol and 5 and 6 are constants Suppose X and Y are variables Unify: +(+(5, 6), Y) with + (X, +(5, 5)) Solution X → +(5, 6) and Y → +(5, 5)

4

slide-10
SLIDE 10

Properties of fjrst-order unifjcation

Has many nice properties:

  • Decidable
  • Most general unifjers exist
  • Linear-time algorithm via Martelli and Montanori

5

slide-11
SLIDE 11

Isabelle’s terms

Terms in Isabelle are typed λ-terms First-order unifjcation inappropriate:

  • Notion of equality is
  • equivalence
  • Substitutions are capture avoiding substitutions from
  • calculus

Need higher-order unifjcation...

6

slide-12
SLIDE 12

Isabelle’s terms

Terms in Isabelle are typed λ-terms First-order unifjcation inappropriate:

  • Notion of equality is β(η)-equivalence
  • Substitutions are capture avoiding substitutions from λ-calculus

Need higher-order unifjcation...

6

slide-13
SLIDE 13

Isabelle’s terms

Terms in Isabelle are typed λ-terms First-order unifjcation inappropriate:

  • Notion of equality is β(η)-equivalence
  • Substitutions are capture avoiding substitutions from λ-calculus

Need higher-order unifjcation...

6

slide-14
SLIDE 14

Properties of higher-order unifjcation

  • Unifjability test is undecidable (Goldfarb and Huet)
  • When unifjers do exist, most general unifjers need not
  • Unifjer set may be infjnite

Example: Unify (where F is a variable of function type and c is a constant): F c and c Consider two different solutions: F x c and F x x Note x c c and x x c are both equivalent to c (in equational theory of simply-typed

  • calculus)

7

slide-15
SLIDE 15

Properties of higher-order unifjcation

  • Unifjability test is undecidable (Goldfarb and Huet)
  • When unifjers do exist, most general unifjers need not
  • Unifjer set may be infjnite

Example: Unify (where F is a variable of function type and c is a constant): F c and c Consider two different solutions: F → λx.c and F → λx.x Note (λx.c)c and (λx.x)c are both equivalent to c (in equational theory of simply-typed λ-calculus)

7

slide-16
SLIDE 16

All is not lost!

Gerard Huet discovered a semi-decision procedure for higher-order unifjcation in 1970s Huet’s algorithm:

  • Finds unifjers when they exist
  • May not terminate if unifjers do not exist
  • Generally works well in practice

Most Isabelle unifjcation problems are pattern unifjcation problems:

  • Decidable subfragment
  • Discovered by Miller whilst working on

Prolog

  • Most general unifjers exist
  • Effjcient algorithms exist for pattern unifjcation (Qian: linear

time/space) Isabelle uses pattern unifjcation to reduce calls to Huet’s algorithm

8

slide-17
SLIDE 17

All is not lost!

Gerard Huet discovered a semi-decision procedure for higher-order unifjcation in 1970s Huet’s algorithm:

  • Finds unifjers when they exist
  • May not terminate if unifjers do not exist
  • Generally works well in practice

Most Isabelle unifjcation problems are pattern unifjcation problems:

  • Decidable subfragment
  • Discovered by Miller whilst working on λProlog
  • Most general unifjers exist
  • Effjcient algorithms exist for pattern unifjcation (Qian: linear

time/space) Isabelle uses pattern unifjcation to reduce calls to Huet’s algorithm

8