author | paulson |
Wed, 05 Aug 1998 10:57:25 +0200 | |
changeset 5253 | 82a5ca6290aa |
parent 5195 | 277831ae7eac |
permissions | -rw-r--r-- |
4898 | 1 |
(* Title: HOL/Update.thy |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
2 |
ID: $Id$ |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
4 |
Copyright 1998 University of Cambridge |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
5 |
|
4898 | 6 |
Function updates: like theory Map, but for ordinary functions |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
7 |
*) |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
8 |
|
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
9 |
open Update; |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
10 |
|
5195 | 11 |
Goalw [fun_upd_def] "(f(x:=y) = f) = (f x = y)"; |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
12 |
by Safe_tac; |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
13 |
by (etac subst 1); |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
14 |
by (rtac ext 2); |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
15 |
by Auto_tac; |
5195 | 16 |
qed "fun_upd_idem_iff"; |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
17 |
|
5070 | 18 |
(* f x = y ==> f(x:=y) = f *) |
5195 | 19 |
bind_thm("fun_upd_idem", fun_upd_idem_iff RS iffD2); |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
20 |
|
5154 | 21 |
(* f(x := f x) = f *) |
5195 | 22 |
AddIffs [refl RS fun_upd_idem]; |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
23 |
|
5133 | 24 |
Goal "(f(x:=y))z = (if z=x then y else f z)"; |
5195 | 25 |
by (simp_tac (simpset() addsimps [fun_upd_def]) 1); |
26 |
qed "fun_upd_apply"; |
|
27 |
Addsimps [fun_upd_apply]; |