src/HOL/UNITY/Comp.thy
author wenzelm
Sat, 01 Dec 2001 18:52:32 +0100
changeset 12338 de0f4a63baa5
parent 11190 44e157622cb2
child 13792 d1811693899c
permissions -rw-r--r--
renamed class "term" to "type" (actually "HOL.type");

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

Composition
From Chandy and Sanders, "Reasoning About Program Composition",
Technical Report 2000-003, University of Florida, 2000.

Revised by Sidi Ehmety on January  2001 

Added: a strong form of the <= relation (component_of) and localize 

*)

Comp = Union +

instance
  program :: (type) ord

defs
  component_def   "F <= H == EX G. F Join G = H"
  strict_component_def   "(F < (H::'a program)) == (F <= H & F ~= H)"


constdefs
  component_of :: "'a program=>'a program=> bool"
                                    (infixl "component'_of" 50)
  "F component_of H == EX G. F ok G & F Join G = H"

  strict_component_of :: "'a program\\<Rightarrow>'a program=> bool"
                                    (infixl "strict'_component'_of" 50)
  "F strict_component_of H == F component_of H & F~=H"
  
  preserves :: "('a=>'b) => 'a program set"
    "preserves v == INT z. stable {s. v s = z}"

  localize  :: "('a=>'b) => 'a program => 'a program"
  "localize v F == mk_program(Init F, Acts F,
			      AllowedActs F Int (UN G:preserves v. Acts G))"

  funPair      :: "['a => 'b, 'a => 'c, 'a] => 'b * 'c"
  "funPair f g == %x. (f x, g x)"
end