src/HOL/UNITY/Lift_prog.thy
author paulson
Tue, 21 Sep 1999 11:11:09 +0200
changeset 7547 a72a551b6d79
parent 7482 7badd511844d
child 7630 d0e4a6f1f05c
permissions -rw-r--r--
new proof of drop_prog_correct for new definition of project_act
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
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
     9
Lift_prog = Guar + Extend +
7186
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
7482
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    13
  lift_map :: "['a, 'b * ('a => 'b)] => ('a => 'b)"
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    14
    "lift_map i == %(s,f). f(i := s)"
7badd511844d working snapshot
paulson
parents: 7399
diff changeset
    15
7186
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    16
  lift_set :: "['a, 'b set] => ('a => 'b) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    17
    "lift_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
  drop_set :: "['a, ('a=>'b) set] => 'b set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    20
    "drop_set i A == (%f. f i) `` A"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    21
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    22
  lift_act :: "['a, ('b*'b) set] => (('a=>'b) * ('a=>'b)) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    23
    "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
    24
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    25
  drop_act :: "['a, (('a=>'b) * ('a=>'b)) set] => ('b*'b) set"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    26
    "drop_act i act == (%(f,f'). (f i, f' i)) `` act"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    27
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    28
  lift_prog :: "['a, 'b program] => ('a => 'b) program"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    29
    "lift_prog i F ==
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    30
       mk_program (lift_set i (Init F),
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    31
		   lift_act i `` Acts F)"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    32
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    33
  drop_prog :: "['a, ('a=>'b) program] => 'b program"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    34
    "drop_prog i F ==
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    35
       mk_program (drop_set i (Init F),
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    36
		   drop_act i `` (Acts F))"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    37
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    38
  (*simplifies the expression of specifications*)
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    39
  constdefs
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    40
    sub :: ['a, 'a=>'b] => 'b
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    41
      "sub i f == f i"
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    42
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    43
860479291bb5 new theory UNITY/Lift_prog
paulson
parents:
diff changeset
    44
end