Project

General

Profile

« Previous | Next » 

Revision 89fd79f0

Added by LĂ©lio Brun over 2 years ago

a working version for automata with 'last' case of enums as default case

View differences:

src/spec_common.ml
115 115
  | [ (h1, spec1); (h2, spec2) ] when h1 = tag_false && h2 = tag_true ->
116 116
    Ternary (Var x, spec2, spec1)
117 117
  | hl ->
118
    And (List.map (fun (t, spec) -> Imply (Equal (Var x, Tag t), spec)) hl)
118
    let n = List.length hl in
119
    And (List.mapi (fun k (t, spec) ->
120
        let c = if k = n - 1 then GEqual (Var x, Tag t) else Equal (Var x, Tag t) in
121
        Imply (c, spec)) hl)
119 122

  
120 123
let mk_assign_tr x v = Equal (Var x, Val v)

Also available in: Unified diff