src/HOL/IMP/Hoare.thy
author paulson
Thu Jun 06 14:39:44 1996 +0200 (1996-06-06)
changeset 1789 aade046ec6d5
parent 1696 e84bff5c519b
child 2810 c4e16b36bc57
permissions -rw-r--r--
Quotes now optional around inductive set
     1 (*  Title:      HOL/IMP/Hoare.thy
     2     ID:         $Id$
     3     Author:     Tobias Nipkow
     4     Copyright   1995 TUM
     5 
     6 Inductive definition of Hoare logic
     7 *)
     8 
     9 Hoare = Denotation +
    10 
    11 types assn = state => bool
    12 
    13 constdefs hoare_valid :: [assn,com,assn] => bool ("|= {(1_)}/ (_)/ {(1_)}" 50)
    14           "|= {P}c{Q} == !s t. (s,t) : C(c) --> P s --> Q t"
    15 
    16 consts hoare :: "(assn * com * assn) set"
    17 syntax "@hoare" :: [bool,com,bool] => bool ("|- ({(1_)}/ (_)/ {(1_)})" 50)
    18 translations "|- {P}c{Q}" == "(P,c,Q) : hoare"
    19 
    20 inductive hoare
    21 intrs
    22   skip "|- {P}SKIP{P}"
    23   ass  "|- {%s.P(s[a s/x])} x:=a {P}"
    24   semi "[| |- {P}c{Q}; |- {Q}d{R} |] ==> |- {P} c;d {R}"
    25   If "[| |- {%s. P s & b s}c{Q}; |- {%s. P s & ~b s}d{Q} |] ==>
    26       |- {P} IF b THEN c ELSE d {Q}"
    27   While "|- {%s. P s & b s} c {P} ==>
    28          |- {P} WHILE b DO c {%s. P s & ~b s}"
    29   conseq "[| !s. P' s --> P s; |- {P}c{Q}; !s. Q s --> Q' s |] ==>
    30           |- {P'}c{Q'}"
    31 
    32 constdefs swp :: com => assn => assn
    33           "swp c Q == (%s. !t. (s,t) : C(c) --> Q t)"
    34 
    35 end