author | paulson |
Wed, 15 Jul 1998 10:15:13 +0200 | |
changeset 5143 | b94cd208f073 |
parent 5070 | c42429b3e2f2 |
child 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 |
Update = Fun + |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
10 |
|
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
11 |
consts |
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
12 |
update :: "('a => 'b) => 'a => 'b => ('a => 'b)" |
5070 | 13 |
|
14 |
nonterminals |
|
15 |
updbinds updbind |
|
16 |
||
17 |
syntax |
|
18 |
||
19 |
(* Let expressions *) |
|
20 |
||
21 |
"_updbind" :: ['a, 'a] => updbind ("(2_ :=/ _)") |
|
22 |
"" :: updbind => updbinds ("_") |
|
23 |
"_updbinds" :: [updbind, updbinds] => updbinds ("_,/ _") |
|
24 |
"_Update" :: ['a, updbinds] => 'a ("_/'((_)')" [900,0] 900) |
|
25 |
||
26 |
translations |
|
27 |
"_Update f (_updbinds b bs)" == "_Update (_Update f b) bs" |
|
28 |
"f(x:=y)" == "update f x y" |
|
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
29 |
|
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
30 |
defs |
5070 | 31 |
update_def "f(a:=b) == %x. if x=a then b else f x" |
4896
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
32 |
|
4727272f3db6
New syntax for function update; moved to main HOL directory
paulson
parents:
diff
changeset
|
33 |
end |