src/HOL/Hoare_Parallel/RG_Syntax.thy
changeset 35113 1a0c129bb2e0
parent 35107 bdca9f765ee4
child 35145 f132a4fd8679
     1.1 --- a/src/HOL/Hoare_Parallel/RG_Syntax.thy	Thu Feb 11 22:06:37 2010 +0100
     1.2 +++ b/src/HOL/Hoare_Parallel/RG_Syntax.thy	Thu Feb 11 22:19:58 2010 +0100
     1.3 @@ -20,11 +20,11 @@
     1.4  
     1.5  translations
     1.6    "\<acute>x := a" \<rightharpoonup> "CONST Basic \<guillemotleft>\<acute>(_update_name x (\<lambda>_. a))\<guillemotright>"
     1.7 -  "IF b THEN c1 ELSE c2 FI" \<rightharpoonup> "Cond .{b}. c1 c2"
     1.8 +  "IF b THEN c1 ELSE c2 FI" \<rightharpoonup> "CONST Cond .{b}. c1 c2"
     1.9    "IF b THEN c FI" \<rightleftharpoons> "IF b THEN c ELSE SKIP FI"
    1.10 -  "WHILE b DO c OD" \<rightharpoonup> "While .{b}. c"
    1.11 -  "AWAIT b THEN c END" \<rightleftharpoons> "Await .{b}. c"
    1.12 -  "\<langle>c\<rangle>" \<rightleftharpoons> "AWAIT True THEN c END"
    1.13 +  "WHILE b DO c OD" \<rightharpoonup> "CONST While .{b}. c"
    1.14 +  "AWAIT b THEN c END" \<rightleftharpoons> "CONST Await .{b}. c"
    1.15 +  "\<langle>c\<rangle>" \<rightleftharpoons> "AWAIT CONST True THEN c END"
    1.16    "WAIT b END" \<rightleftharpoons> "AWAIT b THEN SKIP END"
    1.17  
    1.18  nonterminals
    1.19 @@ -59,10 +59,10 @@
    1.20  print_translation {*
    1.21    let
    1.22      fun quote_tr' f (t :: ts) =
    1.23 -          Term.list_comb (f $ Syntax.quote_tr' "_antiquote" t, ts)
    1.24 +          Term.list_comb (f $ Syntax.quote_tr' @{syntax_const "_antiquote"} t, ts)
    1.25        | quote_tr' _ _ = raise Match;
    1.26  
    1.27 -    val assert_tr' = quote_tr' (Syntax.const "_Assert");
    1.28 +    val assert_tr' = quote_tr' (Syntax.const @{syntax_const "_Assert"});
    1.29  
    1.30      fun bexp_tr' name ((Const (@{const_syntax Collect}, _) $ t) :: ts) =
    1.31            quote_tr' (Syntax.const name) (t :: ts)
    1.32 @@ -74,7 +74,7 @@
    1.33        | NONE => raise Match);
    1.34  
    1.35      fun update_name_tr' (Free x) = Free (upd_tr' x)
    1.36 -      | update_name_tr' ((c as Const ("_free", _)) $ Free x) =
    1.37 +      | update_name_tr' ((c as Const (@{syntax_const "_free"}, _)) $ Free x) =
    1.38            c $ Free (upd_tr' x)
    1.39        | update_name_tr' (Const x) = Const (upd_tr' x)
    1.40        | update_name_tr' _ = raise Match;
    1.41 @@ -86,14 +86,14 @@
    1.42        | K_tr' _ = raise Match;
    1.43  
    1.44      fun assign_tr' (Abs (x, _, f $ k $ Bound 0) :: ts) =
    1.45 -          quote_tr' (Syntax.const "_Assign" $ update_name_tr' f)
    1.46 +          quote_tr' (Syntax.const @{syntax_const "_Assign"} $ update_name_tr' f)
    1.47              (Abs (x, dummyT, K_tr' k) :: ts)
    1.48        | assign_tr' _ = raise Match;
    1.49    in
    1.50     [(@{const_syntax Collect}, assert_tr'),
    1.51      (@{const_syntax Basic}, assign_tr'),
    1.52 -    (@{const_syntax Cond}, bexp_tr' "_Cond"),
    1.53 -    (@{const_syntax While}, bexp_tr' "_While_inv")]
    1.54 +    (@{const_syntax Cond}, bexp_tr' @{syntax_const "_Cond"}),
    1.55 +    (@{const_syntax While}, bexp_tr' @{syntax_const "_While"})]
    1.56    end
    1.57  *}
    1.58