src/HOL/Predicate_Compile_Examples/Examples.thy
author bulwahn
Thu Sep 23 14:50:18 2010 +0200 (2010-09-23)
changeset 39655 8ad7fe9d6f0b
child 41413 64cd30d6b0b8
permissions -rw-r--r--
splitting Predicate_Compile_Examples into Examples and Predicate_Compile_Tests
bulwahn@39655
     1
theory Examples
bulwahn@39655
     2
imports Main Predicate_Compile_Alternative_Defs
bulwahn@39655
     3
begin
bulwahn@39655
     4
bulwahn@39655
     5
section {* Formal Languages *}
bulwahn@39655
     6
bulwahn@39655
     7
subsection {* General Context Free Grammars *}
bulwahn@39655
     8
bulwahn@39655
     9
text {* a contribution by Aditi Barthwal *}
bulwahn@39655
    10
bulwahn@39655
    11
datatype ('nts,'ts) symbol = NTS 'nts
bulwahn@39655
    12
                            | TS 'ts
bulwahn@39655
    13
bulwahn@39655
    14
                            
bulwahn@39655
    15
datatype ('nts,'ts) rule = rule 'nts "('nts,'ts) symbol list"
bulwahn@39655
    16
bulwahn@39655
    17
types ('nts,'ts) grammar = "('nts,'ts) rule set * 'nts"
bulwahn@39655
    18
bulwahn@39655
    19
fun rules :: "('nts,'ts) grammar => ('nts,'ts) rule set"
bulwahn@39655
    20
where
bulwahn@39655
    21
  "rules (r, s) = r"
bulwahn@39655
    22
bulwahn@39655
    23
definition derives 
bulwahn@39655
    24
where
bulwahn@39655
    25
"derives g = { (lsl,rsl). \<exists>s1 s2 lhs rhs. 
bulwahn@39655
    26
                         (s1 @ [NTS lhs] @ s2 = lsl) \<and>
bulwahn@39655
    27
                         (s1 @ rhs @ s2) = rsl \<and>
bulwahn@39655
    28
                         (rule lhs rhs) \<in> fst g }"
bulwahn@39655
    29
bulwahn@39655
    30
abbreviation "example_grammar == 
bulwahn@39655
    31
({ rule ''S'' [NTS ''A'', NTS ''B''],
bulwahn@39655
    32
   rule ''S'' [TS ''a''],
bulwahn@39655
    33
  rule ''A'' [TS ''b'']}, ''S'')"
bulwahn@39655
    34
bulwahn@39655
    35
bulwahn@39655
    36
code_pred [inductify, skip_proof] derives .
bulwahn@39655
    37
bulwahn@39655
    38
thm derives.equation
bulwahn@39655
    39
bulwahn@39655
    40
definition "test = { rhs. derives example_grammar ([NTS ''S''], rhs) }"
bulwahn@39655
    41
bulwahn@39655
    42
code_pred (modes: o \<Rightarrow> bool) [inductify] test .
bulwahn@39655
    43
thm test.equation
bulwahn@39655
    44
bulwahn@39655
    45
values "{rhs. test rhs}"
bulwahn@39655
    46
bulwahn@39655
    47
declare rtrancl.intros(1)[code_pred_def] converse_rtrancl_into_rtrancl[code_pred_def]
bulwahn@39655
    48
bulwahn@39655
    49
code_pred [inductify] rtrancl .
bulwahn@39655
    50
bulwahn@39655
    51
definition "test2 = { rhs. ([NTS ''S''],rhs) \<in> (derives example_grammar)^*  }"
bulwahn@39655
    52
bulwahn@39655
    53
code_pred [inductify, skip_proof] test2 .
bulwahn@39655
    54
bulwahn@39655
    55
values "{rhs. test2 rhs}"
bulwahn@39655
    56
bulwahn@39655
    57
subsection {* Some concrete Context Free Grammars *}
bulwahn@39655
    58
bulwahn@39655
    59
datatype alphabet = a | b
bulwahn@39655
    60
bulwahn@39655
    61
inductive_set S\<^isub>1 and A\<^isub>1 and B\<^isub>1 where
bulwahn@39655
    62
  "[] \<in> S\<^isub>1"
bulwahn@39655
    63
| "w \<in> A\<^isub>1 \<Longrightarrow> b # w \<in> S\<^isub>1"
bulwahn@39655
    64
| "w \<in> B\<^isub>1 \<Longrightarrow> a # w \<in> S\<^isub>1"
bulwahn@39655
    65
| "w \<in> S\<^isub>1 \<Longrightarrow> a # w \<in> A\<^isub>1"
bulwahn@39655
    66
| "w \<in> S\<^isub>1 \<Longrightarrow> b # w \<in> S\<^isub>1"
bulwahn@39655
    67
| "\<lbrakk>v \<in> B\<^isub>1; v \<in> B\<^isub>1\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>1"
bulwahn@39655
    68
bulwahn@39655
    69
code_pred [inductify] S\<^isub>1p .
bulwahn@39655
    70
code_pred [random_dseq inductify] S\<^isub>1p .
bulwahn@39655
    71
thm S\<^isub>1p.equation
bulwahn@39655
    72
thm S\<^isub>1p.random_dseq_equation
bulwahn@39655
    73
bulwahn@39655
    74
values [random_dseq 5, 5, 5] 5 "{x. S\<^isub>1p x}"
bulwahn@39655
    75
bulwahn@39655
    76
inductive_set S\<^isub>2 and A\<^isub>2 and B\<^isub>2 where
bulwahn@39655
    77
  "[] \<in> S\<^isub>2"
bulwahn@39655
    78
| "w \<in> A\<^isub>2 \<Longrightarrow> b # w \<in> S\<^isub>2"
bulwahn@39655
    79
| "w \<in> B\<^isub>2 \<Longrightarrow> a # w \<in> S\<^isub>2"
bulwahn@39655
    80
| "w \<in> S\<^isub>2 \<Longrightarrow> a # w \<in> A\<^isub>2"
bulwahn@39655
    81
| "w \<in> S\<^isub>2 \<Longrightarrow> b # w \<in> B\<^isub>2"
bulwahn@39655
    82
| "\<lbrakk>v \<in> B\<^isub>2; v \<in> B\<^isub>2\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>2"
bulwahn@39655
    83
bulwahn@39655
    84
code_pred [random_dseq inductify] S\<^isub>2p .
bulwahn@39655
    85
thm S\<^isub>2p.random_dseq_equation
bulwahn@39655
    86
thm A\<^isub>2p.random_dseq_equation
bulwahn@39655
    87
thm B\<^isub>2p.random_dseq_equation
bulwahn@39655
    88
bulwahn@39655
    89
values [random_dseq 5, 5, 5] 10 "{x. S\<^isub>2p x}"
bulwahn@39655
    90
bulwahn@39655
    91
inductive_set S\<^isub>3 and A\<^isub>3 and B\<^isub>3 where
bulwahn@39655
    92
  "[] \<in> S\<^isub>3"
bulwahn@39655
    93
| "w \<in> A\<^isub>3 \<Longrightarrow> b # w \<in> S\<^isub>3"
bulwahn@39655
    94
| "w \<in> B\<^isub>3 \<Longrightarrow> a # w \<in> S\<^isub>3"
bulwahn@39655
    95
| "w \<in> S\<^isub>3 \<Longrightarrow> a # w \<in> A\<^isub>3"
bulwahn@39655
    96
| "w \<in> S\<^isub>3 \<Longrightarrow> b # w \<in> B\<^isub>3"
bulwahn@39655
    97
| "\<lbrakk>v \<in> B\<^isub>3; w \<in> B\<^isub>3\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>3"
bulwahn@39655
    98
bulwahn@39655
    99
code_pred [inductify, skip_proof] S\<^isub>3p .
bulwahn@39655
   100
thm S\<^isub>3p.equation
bulwahn@39655
   101
bulwahn@39655
   102
values 10 "{x. S\<^isub>3p x}"
bulwahn@39655
   103
bulwahn@39655
   104
inductive_set S\<^isub>4 and A\<^isub>4 and B\<^isub>4 where
bulwahn@39655
   105
  "[] \<in> S\<^isub>4"
bulwahn@39655
   106
| "w \<in> A\<^isub>4 \<Longrightarrow> b # w \<in> S\<^isub>4"
bulwahn@39655
   107
| "w \<in> B\<^isub>4 \<Longrightarrow> a # w \<in> S\<^isub>4"
bulwahn@39655
   108
| "w \<in> S\<^isub>4 \<Longrightarrow> a # w \<in> A\<^isub>4"
bulwahn@39655
   109
| "\<lbrakk>v \<in> A\<^isub>4; w \<in> A\<^isub>4\<rbrakk> \<Longrightarrow> b # v @ w \<in> A\<^isub>4"
bulwahn@39655
   110
| "w \<in> S\<^isub>4 \<Longrightarrow> b # w \<in> B\<^isub>4"
bulwahn@39655
   111
| "\<lbrakk>v \<in> B\<^isub>4; w \<in> B\<^isub>4\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>4"
bulwahn@39655
   112
bulwahn@39655
   113
code_pred (expected_modes: o => bool, i => bool) S\<^isub>4p .
bulwahn@39655
   114
bulwahn@39655
   115
hide_const a b
bulwahn@39655
   116
bulwahn@39655
   117
section {* Semantics of programming languages *}
bulwahn@39655
   118
bulwahn@39655
   119
subsection {* IMP *}
bulwahn@39655
   120
bulwahn@39655
   121
types
bulwahn@39655
   122
  var = nat
bulwahn@39655
   123
  state = "int list"
bulwahn@39655
   124
bulwahn@39655
   125
datatype com =
bulwahn@39655
   126
  Skip |
bulwahn@39655
   127
  Ass var "state => int" |
bulwahn@39655
   128
  Seq com com |
bulwahn@39655
   129
  IF "state => bool" com com |
bulwahn@39655
   130
  While "state => bool" com
bulwahn@39655
   131
bulwahn@39655
   132
inductive exec :: "com => state => state => bool" where
bulwahn@39655
   133
"exec Skip s s" |
bulwahn@39655
   134
"exec (Ass x e) s (s[x := e(s)])" |
bulwahn@39655
   135
"exec c1 s1 s2 ==> exec c2 s2 s3 ==> exec (Seq c1 c2) s1 s3" |
bulwahn@39655
   136
"b s ==> exec c1 s t ==> exec (IF b c1 c2) s t" |
bulwahn@39655
   137
"~b s ==> exec c2 s t ==> exec (IF b c1 c2) s t" |
bulwahn@39655
   138
"~b s ==> exec (While b c) s s" |
bulwahn@39655
   139
"b s1 ==> exec c s1 s2 ==> exec (While b c) s2 s3 ==> exec (While b c) s1 s3"
bulwahn@39655
   140
bulwahn@39655
   141
code_pred exec .
bulwahn@39655
   142
bulwahn@39655
   143
values "{t. exec
bulwahn@39655
   144
 (While (%s. s!0 > 0) (Seq (Ass 0 (%s. s!0 - 1)) (Ass 1 (%s. s!1 + 1))))
bulwahn@39655
   145
 [3,5] t}"
bulwahn@39655
   146
bulwahn@39655
   147
subsection {* Lambda *}
bulwahn@39655
   148
bulwahn@39655
   149
datatype type =
bulwahn@39655
   150
    Atom nat
bulwahn@39655
   151
  | Fun type type    (infixr "\<Rightarrow>" 200)
bulwahn@39655
   152
bulwahn@39655
   153
datatype dB =
bulwahn@39655
   154
    Var nat
bulwahn@39655
   155
  | App dB dB (infixl "\<degree>" 200)
bulwahn@39655
   156
  | Abs type dB
bulwahn@39655
   157
bulwahn@39655
   158
primrec
bulwahn@39655
   159
  nth_el :: "'a list \<Rightarrow> nat \<Rightarrow> 'a option" ("_\<langle>_\<rangle>" [90, 0] 91)
bulwahn@39655
   160
where
bulwahn@39655
   161
  "[]\<langle>i\<rangle> = None"
bulwahn@39655
   162
| "(x # xs)\<langle>i\<rangle> = (case i of 0 \<Rightarrow> Some x | Suc j \<Rightarrow> xs \<langle>j\<rangle>)"
bulwahn@39655
   163
bulwahn@39655
   164
inductive nth_el' :: "'a list \<Rightarrow> nat \<Rightarrow> 'a \<Rightarrow> bool"
bulwahn@39655
   165
where
bulwahn@39655
   166
  "nth_el' (x # xs) 0 x"
bulwahn@39655
   167
| "nth_el' xs i y \<Longrightarrow> nth_el' (x # xs) (Suc i) y"
bulwahn@39655
   168
bulwahn@39655
   169
inductive typing :: "type list \<Rightarrow> dB \<Rightarrow> type \<Rightarrow> bool"  ("_ \<turnstile> _ : _" [50, 50, 50] 50)
bulwahn@39655
   170
  where
bulwahn@39655
   171
    Var [intro!]: "nth_el' env x T \<Longrightarrow> env \<turnstile> Var x : T"
bulwahn@39655
   172
  | Abs [intro!]: "T # env \<turnstile> t : U \<Longrightarrow> env \<turnstile> Abs T t : (T \<Rightarrow> U)"
bulwahn@39655
   173
  | App [intro!]: "env \<turnstile> s : T \<Rightarrow> U \<Longrightarrow> env \<turnstile> t : T \<Longrightarrow> env \<turnstile> (s \<degree> t) : U"
bulwahn@39655
   174
bulwahn@39655
   175
primrec
bulwahn@39655
   176
  lift :: "[dB, nat] => dB"
bulwahn@39655
   177
where
bulwahn@39655
   178
    "lift (Var i) k = (if i < k then Var i else Var (i + 1))"
bulwahn@39655
   179
  | "lift (s \<degree> t) k = lift s k \<degree> lift t k"
bulwahn@39655
   180
  | "lift (Abs T s) k = Abs T (lift s (k + 1))"
bulwahn@39655
   181
bulwahn@39655
   182
primrec
bulwahn@39655
   183
  subst :: "[dB, dB, nat] => dB"  ("_[_'/_]" [300, 0, 0] 300)
bulwahn@39655
   184
where
bulwahn@39655
   185
    subst_Var: "(Var i)[s/k] =
bulwahn@39655
   186
      (if k < i then Var (i - 1) else if i = k then s else Var i)"
bulwahn@39655
   187
  | subst_App: "(t \<degree> u)[s/k] = t[s/k] \<degree> u[s/k]"
bulwahn@39655
   188
  | subst_Abs: "(Abs T t)[s/k] = Abs T (t[lift s 0 / k+1])"
bulwahn@39655
   189
bulwahn@39655
   190
inductive beta :: "[dB, dB] => bool"  (infixl "\<rightarrow>\<^sub>\<beta>" 50)
bulwahn@39655
   191
  where
bulwahn@39655
   192
    beta [simp, intro!]: "Abs T s \<degree> t \<rightarrow>\<^sub>\<beta> s[t/0]"
bulwahn@39655
   193
  | appL [simp, intro!]: "s \<rightarrow>\<^sub>\<beta> t ==> s \<degree> u \<rightarrow>\<^sub>\<beta> t \<degree> u"
bulwahn@39655
   194
  | appR [simp, intro!]: "s \<rightarrow>\<^sub>\<beta> t ==> u \<degree> s \<rightarrow>\<^sub>\<beta> u \<degree> t"
bulwahn@39655
   195
  | abs [simp, intro!]: "s \<rightarrow>\<^sub>\<beta> t ==> Abs T s \<rightarrow>\<^sub>\<beta> Abs T t"
bulwahn@39655
   196
bulwahn@39655
   197
code_pred (expected_modes: i => i => o => bool, i => i => i => bool) typing .
bulwahn@39655
   198
thm typing.equation
bulwahn@39655
   199
bulwahn@39655
   200
code_pred (modes: i => i => bool,  i => o => bool as reduce') beta .
bulwahn@39655
   201
thm beta.equation
bulwahn@39655
   202
bulwahn@39655
   203
values "{x. App (Abs (Atom 0) (Var 0)) (Var 1) \<rightarrow>\<^sub>\<beta> x}"
bulwahn@39655
   204
bulwahn@39655
   205
definition "reduce t = Predicate.the (reduce' t)"
bulwahn@39655
   206
bulwahn@39655
   207
value "reduce (App (Abs (Atom 0) (Var 0)) (Var 1))"
bulwahn@39655
   208
bulwahn@39655
   209
code_pred [dseq] typing .
bulwahn@39655
   210
code_pred [random_dseq] typing .
bulwahn@39655
   211
bulwahn@39655
   212
values [random_dseq 1,1,5] 10 "{(\<Gamma>, t, T). \<Gamma> \<turnstile> t : T}"
bulwahn@39655
   213
bulwahn@39655
   214
subsection {* A minimal example of yet another semantics *}
bulwahn@39655
   215
bulwahn@39655
   216
text {* thanks to Elke Salecker *}
bulwahn@39655
   217
bulwahn@39655
   218
types
bulwahn@39655
   219
  vname = nat
bulwahn@39655
   220
  vvalue = int
bulwahn@39655
   221
  var_assign = "vname \<Rightarrow> vvalue"  --"variable assignment"
bulwahn@39655
   222
bulwahn@39655
   223
datatype ir_expr = 
bulwahn@39655
   224
  IrConst vvalue
bulwahn@39655
   225
| ObjAddr vname
bulwahn@39655
   226
| Add ir_expr ir_expr
bulwahn@39655
   227
bulwahn@39655
   228
datatype val =
bulwahn@39655
   229
  IntVal  vvalue
bulwahn@39655
   230
bulwahn@39655
   231
record  configuration =
bulwahn@39655
   232
  Env :: var_assign
bulwahn@39655
   233
bulwahn@39655
   234
inductive eval_var ::
bulwahn@39655
   235
  "ir_expr \<Rightarrow> configuration \<Rightarrow> val \<Rightarrow> bool"
bulwahn@39655
   236
where
bulwahn@39655
   237
  irconst: "eval_var (IrConst i) conf (IntVal i)"
bulwahn@39655
   238
| objaddr: "\<lbrakk> Env conf n = i \<rbrakk> \<Longrightarrow> eval_var (ObjAddr n) conf (IntVal i)"
bulwahn@39655
   239
| plus: "\<lbrakk> eval_var l conf (IntVal vl); eval_var r conf (IntVal vr) \<rbrakk> \<Longrightarrow> eval_var (Add l r) conf (IntVal (vl+vr))"
bulwahn@39655
   240
bulwahn@39655
   241
bulwahn@39655
   242
code_pred eval_var .
bulwahn@39655
   243
thm eval_var.equation
bulwahn@39655
   244
bulwahn@39655
   245
values "{val. eval_var (Add (IrConst 1) (IrConst 2)) (| Env = (\<lambda>x. 0)|) val}"
bulwahn@39655
   246
bulwahn@39655
   247
subsection {* Another semantics *}
bulwahn@39655
   248
bulwahn@39655
   249
types
bulwahn@39655
   250
  name = nat --"For simplicity in examples"
bulwahn@39655
   251
  state' = "name \<Rightarrow> nat"
bulwahn@39655
   252
bulwahn@39655
   253
datatype aexp = N nat | V name | Plus aexp aexp
bulwahn@39655
   254
bulwahn@39655
   255
fun aval :: "aexp \<Rightarrow> state' \<Rightarrow> nat" where
bulwahn@39655
   256
"aval (N n) _ = n" |
bulwahn@39655
   257
"aval (V x) st = st x" |
bulwahn@39655
   258
"aval (Plus e\<^isub>1 e\<^isub>2) st = aval e\<^isub>1 st + aval e\<^isub>2 st"
bulwahn@39655
   259
bulwahn@39655
   260
datatype bexp = B bool | Not bexp | And bexp bexp | Less aexp aexp
bulwahn@39655
   261
bulwahn@39655
   262
primrec bval :: "bexp \<Rightarrow> state' \<Rightarrow> bool" where
bulwahn@39655
   263
"bval (B b) _ = b" |
bulwahn@39655
   264
"bval (Not b) st = (\<not> bval b st)" |
bulwahn@39655
   265
"bval (And b1 b2) st = (bval b1 st \<and> bval b2 st)" |
bulwahn@39655
   266
"bval (Less a\<^isub>1 a\<^isub>2) st = (aval a\<^isub>1 st < aval a\<^isub>2 st)"
bulwahn@39655
   267
bulwahn@39655
   268
datatype
bulwahn@39655
   269
  com' = SKIP 
bulwahn@39655
   270
      | Assign name aexp         ("_ ::= _" [1000, 61] 61)
bulwahn@39655
   271
      | Semi   com'  com'          ("_; _"  [60, 61] 60)
bulwahn@39655
   272
      | If     bexp com' com'     ("IF _ THEN _ ELSE _"  [0, 0, 61] 61)
bulwahn@39655
   273
      | While  bexp com'         ("WHILE _ DO _"  [0, 61] 61)
bulwahn@39655
   274
bulwahn@39655
   275
inductive
bulwahn@39655
   276
  big_step :: "com' * state' \<Rightarrow> state' \<Rightarrow> bool" (infix "\<Rightarrow>" 55)
bulwahn@39655
   277
where
bulwahn@39655
   278
  Skip:    "(SKIP,s) \<Rightarrow> s"
bulwahn@39655
   279
| Assign:  "(x ::= a,s) \<Rightarrow> s(x := aval a s)"
bulwahn@39655
   280
bulwahn@39655
   281
| Semi:    "(c\<^isub>1,s\<^isub>1) \<Rightarrow> s\<^isub>2  \<Longrightarrow>  (c\<^isub>2,s\<^isub>2) \<Rightarrow> s\<^isub>3  \<Longrightarrow> (c\<^isub>1;c\<^isub>2, s\<^isub>1) \<Rightarrow> s\<^isub>3"
bulwahn@39655
   282
bulwahn@39655
   283
| IfTrue:  "bval b s  \<Longrightarrow>  (c\<^isub>1,s) \<Rightarrow> t  \<Longrightarrow>  (IF b THEN c\<^isub>1 ELSE c\<^isub>2, s) \<Rightarrow> t"
bulwahn@39655
   284
| IfFalse: "\<not>bval b s  \<Longrightarrow>  (c\<^isub>2,s) \<Rightarrow> t  \<Longrightarrow>  (IF b THEN c\<^isub>1 ELSE c\<^isub>2, s) \<Rightarrow> t"
bulwahn@39655
   285
bulwahn@39655
   286
| WhileFalse: "\<not>bval b s \<Longrightarrow> (WHILE b DO c,s) \<Rightarrow> s"
bulwahn@39655
   287
| WhileTrue:  "bval b s\<^isub>1  \<Longrightarrow>  (c,s\<^isub>1) \<Rightarrow> s\<^isub>2  \<Longrightarrow>  (WHILE b DO c, s\<^isub>2) \<Rightarrow> s\<^isub>3
bulwahn@39655
   288
               \<Longrightarrow> (WHILE b DO c, s\<^isub>1) \<Rightarrow> s\<^isub>3"
bulwahn@39655
   289
bulwahn@39655
   290
code_pred big_step .
bulwahn@39655
   291
bulwahn@39655
   292
thm big_step.equation
bulwahn@39655
   293
bulwahn@39655
   294
subsection {* CCS *}
bulwahn@39655
   295
bulwahn@39655
   296
text{* This example formalizes finite CCS processes without communication or
bulwahn@39655
   297
recursion. For simplicity, labels are natural numbers. *}
bulwahn@39655
   298
bulwahn@39655
   299
datatype proc = nil | pre nat proc | or proc proc | par proc proc
bulwahn@39655
   300
bulwahn@39655
   301
inductive step :: "proc \<Rightarrow> nat \<Rightarrow> proc \<Rightarrow> bool" where
bulwahn@39655
   302
"step (pre n p) n p" |
bulwahn@39655
   303
"step p1 a q \<Longrightarrow> step (or p1 p2) a q" |
bulwahn@39655
   304
"step p2 a q \<Longrightarrow> step (or p1 p2) a q" |
bulwahn@39655
   305
"step p1 a q \<Longrightarrow> step (par p1 p2) a (par q p2)" |
bulwahn@39655
   306
"step p2 a q \<Longrightarrow> step (par p1 p2) a (par p1 q)"
bulwahn@39655
   307
bulwahn@39655
   308
code_pred step .
bulwahn@39655
   309
bulwahn@39655
   310
inductive steps where
bulwahn@39655
   311
"steps p [] p" |
bulwahn@39655
   312
"step p a q \<Longrightarrow> steps q as r \<Longrightarrow> steps p (a#as) r"
bulwahn@39655
   313
bulwahn@39655
   314
code_pred steps .
bulwahn@39655
   315
bulwahn@39655
   316
values 3 
bulwahn@39655
   317
 "{as . steps (par (or (pre 0 nil) (pre 1 nil)) (pre 2 nil)) as (par nil nil)}"
bulwahn@39655
   318
bulwahn@39655
   319
values 5
bulwahn@39655
   320
 "{as . steps (par (or (pre 0 nil) (pre 1 nil)) (pre 2 nil)) as (par nil nil)}"
bulwahn@39655
   321
bulwahn@39655
   322
values 3 "{(a,q). step (par nil nil) a q}"
bulwahn@39655
   323
bulwahn@39655
   324
bulwahn@39655
   325
end
bulwahn@39655
   326