+module Move : (Formula.PREDICATE with type data = pred_ and type ctx = ctx_ ) =
+struct
+
+ module Node =
+ struct
+ type t = move * bool * State.t
+ let equal n1 n2 = n1 = n2
+ let hash n = Hashtbl.hash n
+ end
+
+ type ctx = ctx_
+ let make_ctx a b c d e =
+ { left = a; right = b; up1 = c; up2 = d; epsilon = e }
+
+ include Hcons.Make(Node)
+
+ let print ppf a =
+ let _ = flush_str_formatter() in
+ let fmt = str_formatter in
+
+ let m, b, s = a.node in
+ let dir,num =
+ match m with
+ | `Left -> Pretty.down_arrow, Pretty.subscript 1
+ | `Right -> Pretty.down_arrow, Pretty.subscript 2
+ | `Epsilon -> Pretty.epsilon, ""
+ | `Up1 -> Pretty.up_arrow, Pretty.subscript 1
+ | `Up2 -> Pretty.up_arrow, Pretty.subscript 2
+ in
+ fprintf fmt "%s%s" dir num;
+ State.print fmt s;
+ let str = flush_str_formatter() in
+ if b then fprintf ppf "%s" str
+ else Pretty.pp_overline ppf str
+
+ let neg p =
+ let l, b, s = p.node in
+ make (l, not b, s)
+
+ let eval ctx p =
+ let l, b, s = p.node in
+ let nctx = if b then ctx.positive else ctx.negative in
+ StateSet.mem s begin
+ match l with
+ `Left -> nctx.left
+ | `Right -> nctx.right
+ | `Up1 -> nctx.up1
+ | `Up2 -> nctx.up2
+ | `Epsilon -> nctx.epsilon
+ end
+end
+
+module SFormula = Formula.Make(Move)