TFL/examples/Subst/Unify.thy
author paulson
Fri, 18 Oct 1996 12:54:19 +0200
changeset 2113 21266526ac42
permissions -rw-r--r--
Subst as modified by Konrad Slind
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2113
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     1
Unify = Unifier + WF1 + "NNF" + 
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     2
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     3
datatype 'a subst = Fail | Subst ('a list)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     4
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     5
consts
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     6
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     7
 "##"  :: "('a => 'b) => ('a => 'c) => 'a => ('b * 'c)"  (infixr 50)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     8
   R0  :: "('a set * 'a set) set"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     9
   R1  :: "(('a uterm * 'a uterm) * ('a uterm * 'a uterm)) set"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    10
   R   :: "(('a uterm * 'a uterm) * ('a uterm * 'a uterm)) set"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    11
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    12
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    13
rules
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    14
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    15
  point_to_prod_def "(f ## g) x == (f x, g x)"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    16
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    17
  (* finite proper subset -- should go in WF1.thy maybe *)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    18
  R0_def "R0 == {p. fst p < snd p & finite(snd p)}"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    19
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    20
  R1_def "R1 == rprod (measure uterm_size) (measure uterm_size)"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    21
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    22
  (* The termination relation for the Unify function *)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    23
  R_def  "R == inv_image  (R0 ** R1)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    24
                          ((%(x,y). vars_of x Un vars_of y) ## (%x.x))"
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    25
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    26
end