src/ZF/Update.thy
author wenzelm
Sat, 15 Apr 2000 15:00:57 +0200
changeset 8717 20c42415c07d
parent 5157 6e03de8ec2b4
child 13177 ba734cc2887d
permissions -rw-r--r--
plain ASCII;

(*  Title:      ZF/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
*)

Update = func +

consts
  update  :: "[i,i,i] => i"

nonterminals
  updbinds  updbind

syntax

  (* Let expressions *)

  "_updbind"       :: [i, i] => updbind             ("(2_ :=/ _)")
  ""               :: updbind => updbinds             ("_")
  "_updbinds"      :: [updbind, updbinds] => updbinds ("_,/ _")
  "_Update"        :: [i, updbinds] => i            ("_/'((_)')" [900,0] 900)

translations
  "_Update (f, _updbinds(b,bs))"  == "_Update (_Update(f,b), bs)"
  "f(x:=y)"                     == "update(f,x,y)"

defs
  update_def "f(a:=b) == lam x: cons(a, domain(f)). if(x=a, b, f`x)"

end