INCLUDE "debug.ml"
INCLUDE "utils.ml"
+
+
type jump_kind = [ `TAG of Tag.t | `CONTAINS of string | `NOTHING ]
-let cpt_trans = ref 0
-let miss_trans = ref 0
-let cpt_eval = ref 0
-let miss_eval = ref 0
(* Todo : move elsewhere *)
external vb : bool -> int = "%identity"
s == s' && b==b' && m==m' && Formula.equal f f'
end)
- let print ppf f = let (st,mark,form,_) = node f in
+ let print ppf f = let (st,mark,form,b) = node f in
Format.fprintf ppf "%i %s" st (if mark then "⇒" else "→");
Formula.print ppf form;
- Format.pp_print_flush ppf ()
+ Format.fprintf ppf "%s%!" (if b then " (b)" else "")
+
+
module Infix = struct
let ( ?< ) x = x
- let ( >< ) state (l,mark) = state,(l,mark,true)
- let ( ><@ ) state (l,mark) = state,(l,mark,false)
+ let ( >< ) state (l,mark) = state,(l,mark,false)
+ let ( ><@ ) state (l,mark) = state,(l,mark,true)
let ( >=> ) (state,(label,mark,bur)) form = (state,label,(make (state,mark,form,bur)))
end
Hashtbl.fold
(fun p l acc ->
if p == q then List.fold_left
-
- (fun acc (ts,t) ->
- let _,_,_,aux = Transition.node t in
- if aux then acc else
- TagSet.cup ts acc) acc l
+ (fun acc (ts,t) ->
+ let _,_,_,aux = Transition.node t in
+ if aux then acc else
+ TagSet.cup ts acc) acc l
else acc) a.trans TagSet.empty
let next_sibling_ctx x _ = Tree.next_sibling x
let r_ignore _ x = x
- let set_get_tag r t = r := (fun _ -> t)
module type ResultSet =
sig
(mk_fun (Tree.text_next) "Tree.text_next")
(mk_fun (fun _ -> Tree.node_sibling_ctx) "[TaggedSibling]Tree.node_sibling_ctx")(* !! no tagged_sibling in Tree.ml *)
(mk_fun (fun _ -> Tree.node_sibling_ctx) "[SelectSibling]Tree.node_sibling_ctx")(* !! no select_sibling in Tree.ml *)
- (mk_fun (Tree.tagged_foll_below) "Tree.tagged_foll_below")
+ (mk_fun (Tree.tagged_foll_ctx) "Tree.tagged_foll_ctx")
(mk_fun (fun _ -> Tree.node_sibling_ctx) "[SelectFoll]Tree.node_sibling_ctx")(* !! no select_foll *)
(mk_fun (Tree.node_sibling_ctx) "Tree.node_sibling_ctx")
match k with
| `TAG (tag) ->
(*Tree.tagged_lowest t tag, fun tree -> Tree.tagged_next tree tag*)
- (Tree.tagged_desc tag t, fun tree -> Tree.tagged_foll_below tag tree t)
+ (Tree.tagged_desc tag t, fun tree -> Tree.tagged_foll_ctx tag tree t)
| `CONTAINS(_) -> (Tree.text_below t,fun tree -> Tree.text_next tree t)
| _ -> assert false
in