author | clasohm |
Thu, 22 Feb 1996 12:20:34 +0100 | |
changeset 1516 | 96286c4e32de |
parent 1481 | 03f096efa26d |
permissions | -rw-r--r-- |
1465 | 1 |
(* Title: HOL/IMP/Properties.ML |
924
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
2 |
ID: $Id$ |
1465 | 3 |
Author: Tobias Nipkow, TUM |
924
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
4 |
Copyright 1994 TUM |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
5 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
6 |
IMP is deterministic. |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
7 |
*) |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
8 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
9 |
(* evaluation of aexp is deterministic *) |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
10 |
goal Com.thy "!m n. <a,s> -a-> m & <a,s> -a-> n --> m=n"; |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
11 |
by(res_inst_tac[("aexp","a")]Com.aexp.induct 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
12 |
by(REPEAT(fast_tac (HOL_cs addSIs evala.intrs addSEs evala_elim_cases) 1)); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
13 |
bind_thm("aexp_detD", conjI RS (result() RS spec RS spec RS mp)); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
14 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
15 |
(* evaluation of bexp is deterministic *) |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
16 |
goal Com.thy "!v w. <b,s> -b-> v & <b,s> -b-> w --> v=w"; |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
17 |
by(res_inst_tac[("bexp","b")]Com.bexp.induct 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
18 |
by(REPEAT(fast_tac (HOL_cs addSIs evalb.intrs addSEs evalb_elim_cases |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
19 |
addDs [aexp_detD]) 1)); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
20 |
bind_thm("bexp_detD", conjI RS (result() RS spec RS spec RS mp)); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
21 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
22 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
23 |
val evalc_elim_cases = map (evalc.mk_cases com.simps) |
1481 | 24 |
["<Skip,s> -c-> t", "<x:=a,s> -c-> t", "<c1;c2, s> -c-> t", |
25 |
"<IF b THEN c1 ELSE c2, s> -c-> t", "<WHILE b DO c,s> -c-> t"]; |
|
924
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
26 |
|
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
27 |
(* evaluation of com is deterministic *) |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
28 |
goal Com.thy "!!c. <c,s> -c-> t ==> !u. <c,s> -c-> u --> u=t"; |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
29 |
(* start with rule induction *) |
1465 | 30 |
by (etac (evalc.mutual_induct RS spec RS spec RS spec RSN (2,rev_mp)) 1); |
924
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
31 |
by(fast_tac (set_cs addSEs evalc_elim_cases) 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
32 |
by(fast_tac (set_cs addSEs evalc_elim_cases addDs [aexp_detD]) 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
33 |
by(fast_tac (set_cs addSEs evalc_elim_cases) 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
34 |
by(fast_tac (set_cs addSEs evalc_elim_cases addDs [bexp_detD]) 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
35 |
by(fast_tac (set_cs addSEs evalc_elim_cases addDs [bexp_detD]) 1); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
36 |
by(EVERY1[strip_tac, eresolve_tac evalc_elim_cases, |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
37 |
atac, dtac bexp_detD, atac, etac False_neq_True]); |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
38 |
by(EVERY1[strip_tac, eresolve_tac evalc_elim_cases, |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
39 |
dtac bexp_detD, atac, etac (sym RS False_neq_True), |
806721cfbf46
new version of HOL/IMP with curried function application
clasohm
parents:
diff
changeset
|
40 |
fast_tac HOL_cs]); |
1340 | 41 |
qed "com_det"; |