TFL/examples/Subst/UTerm.ML
author wenzelm
Tue, 10 Dec 1996 13:03:44 +0100
changeset 2367 eba760ebe315
parent 2113 21266526ac42
permissions -rw-r--r--
fixed pris of binder syntax;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2113
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Subst/UTerm.ML
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     2
    ID:         $Id$
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     3
    Author:     Martin Coen, Cambridge University Computer Laboratory
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     4
    Copyright   1993  University of Cambridge
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     5
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     6
Simple term structure for unifiation.
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     7
Binary trees with leaves that are constants or variables.
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     8
*)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
     9
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    10
open UTerm;
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
(**** vars_of lemmas  ****)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    14
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    15
goal UTerm.thy "(v : vars_of(Var(w))) = (w=v)";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    16
by (Simp_tac 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    17
by (fast_tac HOL_cs 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    18
qed "vars_var_iff";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    19
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    20
goal UTerm.thy  "(x : vars_of(t)) = (Var(x) <: t | Var(x) = t)";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    21
by (uterm.induct_tac "t" 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    22
by (ALLGOALS Simp_tac);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    23
by (fast_tac HOL_cs 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    24
qed "vars_iff_occseq";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    25
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    26
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    27
(* Not used, but perhaps useful in other proofs *)
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    28
goal UTerm.thy "M<:N --> vars_of(M) <= vars_of(N)";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    29
by (uterm.induct_tac "N" 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    30
by (ALLGOALS Asm_simp_tac);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    31
by (fast_tac set_cs 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    32
val occs_vars_subset = result();
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    33
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    34
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    35
goal UTerm.thy 
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    36
     "vars_of M Un vars_of N <= vars_of(Comb M P) Un vars_of(Comb N Q)";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    37
by (Simp_tac  1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    38
by (fast_tac set_cs 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    39
val monotone_vars_of = result();
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    40
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    41
goal UTerm.thy "finite(vars_of M)";
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    42
by (uterm.induct_tac"M" 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    43
by (ALLGOALS Simp_tac);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    44
by (forward_tac [finite_UnI] 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    45
by (assume_tac 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    46
by (Asm_simp_tac 1);
21266526ac42 Subst as modified by Konrad Slind
paulson
parents:
diff changeset
    47
val finite_vars_of = result();