src/HOL/UNITY/Lift_prog.thy
author paulson
Fri, 20 Aug 1999 11:54:32 +0200
changeset 7301 6d43d525facc
parent 7186 860479291bb5
child 7399 cf780c2bcccf
permissions -rw-r--r--
new theories RealBin, RealInt, RealPow
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/Lift_prog.thy
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     2
    ID:         $Id$
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     4
    Copyright   1999  University of Cambridge
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     5
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     6
lift_prog, etc: replication of components
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     7
*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     8
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
     9
Lift_prog = Union + Comp +
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    10
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    11
constdefs
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    12
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    13
  lift_set :: "['a, 'b set] => ('a => 'b) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    14
    "lift_set i A == {f. f i : A}"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    15
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    16
  drop_set :: "['a, ('a=>'b) set] => 'b set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    17
    "drop_set i A == (%f. f i) `` A"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    18
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    19
  lift_act :: "['a, ('b*'b) set] => (('a=>'b) * ('a=>'b)) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    20
    "lift_act i act == {(f,f'). f(i:= f' i) = f' & (f i, f' i) : act}"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    21
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    22
  drop_act :: "['a, (('a=>'b) * ('a=>'b)) set] => ('b*'b) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    23
    "drop_act i act == (%(f,f'). (f i, f' i)) `` act"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    24
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    25
  lift_prog :: "['a, 'b program] => ('a => 'b) program"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    26
    "lift_prog i F ==
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    27
       mk_program (lift_set i (Init F),
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    28
		   lift_act i `` Acts F)"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    29
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    30
  drop_prog :: "['a, ('a=>'b) program] => 'b program"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    31
    "drop_prog i F ==
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    32
       mk_program (drop_set i (Init F),
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    33
		   drop_act i `` (Acts F))"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    34
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    35
  (*simplifies the expression of specifications*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    36
  constdefs
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    37
    sub :: ['a, 'a=>'b] => 'b
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    38
      "sub i f == f i"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    39
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    40
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    41
end