- 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)
- exception NegativeAtom of (move*State.t)
- let eval ctx p =
- let l, b, s = p.node in
- if b then raise (NegativeAtom(l,s));
- StateSet.mem s begin
- match l with
- `Left -> ctx.left
- | `Right -> ctx.right
- | `Up1 -> ctx.up1
- | `Up2 -> ctx.up2
- | `Epsilon -> ctx.epsilon
- end