src/HOL/Update.ML
author nipkow
Tue, 23 Jun 1998 18:06:50 +0200
changeset 5070 c42429b3e2f2
parent 5069 3ea049f7979d
child 5133 42a7fe39a63a
permissions -rw-r--r--
Replaced [ := ] syntax by ( := ). Also allows ( := , := , ...) now.

(*  Title:      HOL/Update.thy
    ID:         $Id$
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
    Copyright   1998  University of Cambridge

Function updates: like theory Map, but for ordinary functions
*)

open Update;

Goalw [update_def] "(f(x:=y) = f) = (f x = y)";
by Safe_tac;
by (etac subst 1);
by (rtac ext 2);
by Auto_tac;
qed "update_idem_iff";

(* f x = y ==> f(x:=y) = f *)
bind_thm("update_idem", update_idem_iff RS iffD2);

AddIffs [refl RS update_idem];

Goal "(f(x:=y))z = (if x=z then y else f z)";
by (simp_tac (simpset() addsimps [update_def]) 1);
qed "update_apply";
Addsimps [update_apply];