- if not 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
+ if s == State.dummy then
+ let dir =
+ match l with
+ | `Is1 -> ctx.is_left
+ | _ -> not ctx.is_left
+ in
+ let res = dir && not ctx.is_root in
+ res && b || (not (b || res))
+ else begin
+ if not 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
+ | _ -> StateSet.empty
+ end