src/HOL/IMP/Transition.thy
author wenzelm
Thu, 15 Nov 2001 18:20:13 +0100
changeset 12207 4dff931b852f
parent 9364 e783491b9a1f
child 12431 07ec657249e5
permissions -rw-r--r--
added Induct/Binary_Trees.thy, Induct/Tree_Forest (converted from former ex/TF.ML ex/TF.thy ex/Term.ML ex/Term.thy);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     1
(*  Title:      HOL/IMP/Transition.thy
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     2
    ID:         $Id$
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     3
    Author:     Tobias Nipkow & Robert Sandner, TUM
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     4
    Copyright   1996 TUM
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     5
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     6
Transition semantics of commands
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     7
*)
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
     8
8029
05446a898852 Basis now Main.
nipkow
parents: 5855
diff changeset
     9
Transition = Natural +
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    10
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    11
consts  evalc1    :: "((com*state)*(com*state))set"
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    12
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    13
syntax
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    14
        "@evalc1" :: "[(com*state),(com*state)] => bool"
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    15
                                ("_ -1-> _" [81,81] 100)
5855
9be441c17f6d the type of @evalcn was wrong
paulson
parents: 4906
diff changeset
    16
        "@evalcn" :: "[(com*state),nat,(com*state)] => bool"
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    17
                                ("_ -_-> _" [81,81] 100)
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    18
        "@evalc*" :: "[(com*state),(com*state)] => bool"
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    19
                                ("_ -*-> _" [81,81] 100)
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    20
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    21
translations
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    22
  "cs0 -1-> cs1"	== "(cs0,cs1) : evalc1"
9364
e783491b9a1f fixed tuple translations;
wenzelm
parents: 9241
diff changeset
    23
  "cs0 -1-> (c1,s1)"	== "(cs0,c1,s1) : evalc1"
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    24
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    25
  "cs0 -n-> cs1" 	== "(cs0,cs1) : evalc1^n"
9364
e783491b9a1f fixed tuple translations;
wenzelm
parents: 9241
diff changeset
    26
  "cs0 -n-> (c1,s1)" 	== "(cs0,c1,s1) : evalc1^n"
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    27
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    28
  "cs0 -*-> cs1" 	== "(cs0,cs1) : evalc1^*"
9364
e783491b9a1f fixed tuple translations;
wenzelm
parents: 9241
diff changeset
    29
  "cs0 -*-> (c1,s1)" 	== "(cs0,c1,s1) : evalc1^*"
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    30
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    31
1789
aade046ec6d5 Quotes now optional around inductive set
paulson
parents: 1701
diff changeset
    32
inductive evalc1
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    33
  intrs
9241
f961c1fdff50 disambiguated := ; added Examples (factorial)
oheimb
parents: 8029
diff changeset
    34
    Assign "(x :== a,s) -1-> (SKIP,s[x ::= a s])"
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    35
4906
0537ee95d004 fixed translations;
wenzelm
parents: 4897
diff changeset
    36
    Semi1   "(SKIP;c,s) -1-> (c,s)"     
1700
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    37
    Semi2   "(c0,s) -1-> (c2,s1) ==> (c0;c1,s) -1-> (c2;c1,s1)"
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    38
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    39
    IfTrue "b s ==> (IF b THEN c1 ELSE c2,s) -1-> (c1,s)"
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    40
    IfFalse "~b s ==> (IF b THEN c1 ELSE c2,s) -1-> (c2,s)"
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    41
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    42
    WhileFalse "~b s ==> (WHILE b DO c,s) -1-> (SKIP,s)"
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    43
    WhileTrue "b s ==> (WHILE b DO c,s) -1-> (c;WHILE b DO c,s)"
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    44
afd3b60660db Natural and Transition semantics.
nipkow
parents:
diff changeset
    45
end