X-Git-Url: http://git.nguyen.vg/gitweb/?p=tatoo.git;a=blobdiff_plain;f=src%2Fformula.ml;h=14fd76f6c8201dcfed18381b9cfcf3604c16358e;hp=4c58e3cc531dc501f811cd93357837711996ed08;hb=e2dcfc3066d33b814d4e9724563cc5b3e696060d;hpb=54b9cdaa6686eb28a0cad0ac3f1648f115d3fac5 diff --git a/src/formula.ml b/src/formula.ml index 4c58e3c..14fd76f 100644 --- a/src/formula.ml +++ b/src/formula.ml @@ -21,8 +21,7 @@ type 'formula expr = | True | Or of 'formula * 'formula | And of 'formula * 'formula - | Move of (move * bool * State.t) - | Label of QNameSet.t + | Move of move * bool * State.t type 'hcons node = { pos : 'hcons expr; @@ -43,7 +42,6 @@ module rec Node : Hcons.S | Or(xf1, xf2), Or(yf1, yf2) | And(xf1, xf2), And(yf1,yf2) -> (xf1 == yf1) && (xf2 == yf2) | Move(d1, p1, s1), Move(d2 ,p2 ,s2) -> d1 == d2 && p1 == p2 && s1 == s2 - | Label s1, Label s2 -> s1 == s2 | _ -> false let hash f = @@ -56,7 +54,6 @@ module rec Node : Hcons.S HASHINT3(PRIME3, Uid.to_int f1.Node.id, Uid.to_int f2.Node.id) | Move(d, p, s) -> HASHINT4(PRIME5, hash_const_variant d,vb p,s) - | Label s -> HASHINT2(PRIME7, Uid.to_int s.QNameSet.id) end type t = Node.t @@ -64,14 +61,12 @@ let hash x = x.Node.hash let uid x = x.Node.id let equal = Node.equal let expr f = f.Node.node.pos -(*let st f = f.Node.node.st*) -(*let size f = f.Node.node.size*) + let compare f1 f2 = compare f1.Node.id f2.Node.id let prio f = match expr f with | True | False -> 10 | Move _ -> 8 - | Label _ -> 7 | And _ -> 6 | Or _ -> 1 @@ -88,7 +83,6 @@ let rec print ?(parent=false) ppf f = (print ppf f1); fprintf ppf " %s " Pretty.vee; (print ppf f2); - | Label s -> fprintf ppf "%a" QNameSet.print s | Move(dir, b, s) -> let _ = flush_str_formatter() in let fmt = str_formatter in @@ -155,12 +149,3 @@ let and_ f1 f2 = let of_bool = function true -> true_ | false -> false_ - -module Infix = struct - let ( +| ) f1 f2 = or_ f1 f2 - - let ( *& ) f1 f2 = and_ f1 f2 - - let ( *+ ) d s = atom_ d true s - let ( *- ) d s = atom_ d false s -end