src/HOL/IMP/Procs.thy
author paulson <lp15@cam.ac.uk>
Mon May 23 15:33:24 2016 +0100 (2016-05-23)
changeset 63114 27afe7af7379
parent 58889 5b7a9633cfa8
permissions -rw-r--r--
Lots of new material for multivariate analysis
     1 section "Extensions and Variations of IMP"
     2 
     3 theory Procs imports BExp begin
     4 
     5 subsection "Procedures and Local Variables"
     6 
     7 type_synonym pname = string
     8 
     9 datatype
    10   com = SKIP 
    11       | Assign vname aexp        ("_ ::= _" [1000, 61] 61)
    12       | Seq    com  com          ("_;;/ _"  [60, 61] 60)
    13       | If     bexp com com     ("(IF _/ THEN _/ ELSE _)"  [0, 0, 61] 61)
    14       | While  bexp com         ("(WHILE _/ DO _)"  [0, 61] 61)
    15       | Var    vname com        ("(1{VAR _;/ _})")
    16       | Proc   pname com com    ("(1{PROC _ = _;/ _})")
    17       | CALL   pname
    18 
    19 definition "test_com =
    20 {VAR ''x'';
    21  {PROC ''p'' = ''x'' ::= N 1;
    22   {PROC ''q'' = CALL ''p'';
    23    {VAR ''x'';
    24     ''x'' ::= N 2;;
    25     {PROC ''p'' = ''x'' ::= N 3;
    26      CALL ''q'';; ''y'' ::= V ''x''}}}}}"
    27 
    28 end