- if trs == dummy_trl then
- let trs = Ata.get_trans auto tag states in
- (Cache.N2.add
- cache2
- (tag.QName.id :> int)
- (states.StateSet.id :> int) trs; trs)
- else trs
-
-
-
- let simplify_atom atom pos q { NodeStatus.node = status; _ } =
- if (pos && StateSet.mem q status.sat)
- || ((not pos) && StateSet.mem q status.unsat) then Ata.Formula.true_
- else if (pos && StateSet.mem q status.unsat)
- || ((not pos) && StateSet.mem q status.sat) then Ata.Formula.false_
- else atom
-
-
- let eval_form phi fcs nss ps ss summary =
- let open Ata in
- let rec loop phi =
- begin match Formula.expr phi with
- Boolean.True | Boolean.False -> phi
- | Boolean.Atom (a, b) ->
- begin
- let open NodeSummary in
- match a.Atom.node with
- | Move (m, q) ->
- let states = match m with
- `First_child -> fcs
- | `Next_sibling -> nss
- | `Parent | `Previous_sibling -> ps
- | `Stay -> ss
- in simplify_atom phi b q states
- | Is_first_child -> Formula.of_bool (b == is_left summary)
- | Is_next_sibling -> Formula.of_bool (b == is_right summary)
- | Is k -> Formula.of_bool (b == (k == kind summary))
- | Has_first_child -> Formula.of_bool (b == has_left summary)
- | Has_next_sibling -> Formula.of_bool (b == has_right summary)
- end
- | Boolean.And(phi1, phi2) -> Formula.and_ (loop phi1) (loop phi2)
- | Boolean.Or (phi1, phi2) -> Formula.or_ (loop phi1) (loop phi2)
- end
- in
- loop phi