src/HOL/Induct/Com.ML
author nipkow
Fri, 05 Jan 2001 18:48:18 +0100
changeset 10797 028d22926a41
parent 10759 994877ee68cb
child 12486 0ed8bdd883e0
permissions -rw-r--r--
^^ -> ``` Univalent -> single_valued
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3120
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Induct/Com
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     2
    ID:         $Id$
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     4
    Copyright   1997  University of Cambridge
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     5
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     6
Example of Mutual Induction via Iteratived Inductive Definitions: Commands
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     7
*)
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     8
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
     9
AddIs exec.intrs;
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    10
6141
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    11
val exec_elim_cases = 
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    12
    map exec.mk_cases
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    13
       ["(SKIP,s) -[eval]-> t",
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    14
	"(x:=a,s) -[eval]-> t", 
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    15
	"(c1;;c2, s) -[eval]-> t",
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    16
	"(IF e THEN c1 ELSE c2, s) -[eval]-> t"];
3120
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    17
6141
a6922171b396 removal of the (thm list) argument of mk_cases
paulson
parents: 5223
diff changeset
    18
val exec_WHILE_case = exec.mk_cases "(WHILE b DO c,s) -[eval]-> t";
3120
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    19
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    20
AddSEs exec_elim_cases;
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    21
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    22
(*This theorem justifies using "exec" in the inductive definition of "eval"*)
5143
b94cd208f073 Removal of leading "\!\!..." from most Goal commands
paulson
parents: 5069
diff changeset
    23
Goalw exec.defs "A<=B ==> exec(A) <= exec(B)";
3120
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    24
by (rtac lfp_mono 1);
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    25
by (REPEAT (ares_tac basic_monos 1));
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    26
qed "exec_mono";
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    27
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    28
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    29
Unify.trace_bound := 30;
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    30
Unify.search_bound := 60;
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    31
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    32
(*Command execution is functional (deterministic) provided evaluation is*)
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10759
diff changeset
    33
Goal "single_valued ev ==> single_valued(exec ev)";
028d22926a41 ^^ -> ```
nipkow
parents: 10759
diff changeset
    34
by (simp_tac (simpset() addsimps [single_valued_def]) 1);
3120
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    35
by (REPEAT (rtac allI 1));
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    36
by (rtac impI 1);
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    37
by (etac exec.induct 1);
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    38
by (Blast_tac 3);
c58423c20740 New directory to contain examples of (co)inductive definitions
paulson
parents:
diff changeset
    39
by (Blast_tac 1);
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10759
diff changeset
    40
by (rewrite_goals_tac [single_valued_def]);
4089
96fba19bcbe2 isatool fixclasimp;
wenzelm
parents: 3919
diff changeset
    41
by (REPEAT (blast_tac (claset() addEs [exec_WHILE_case]) 1));
10797
028d22926a41 ^^ -> ```
nipkow
parents: 10759
diff changeset
    42
qed "single_valued_exec";
3147
49f2614732ea New theorems about "assign"
paulson
parents: 3142
diff changeset
    43
10759
994877ee68cb *** empty log message ***
nipkow
parents: 6300
diff changeset
    44
Addsimps [fun_upd_same, fun_upd_other];