X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Fpp.ml;h=ddf5726c49d0f6b479958a4e48ca9f969440f30d;hb=39a2078b0e835d39895a5b6c0862d668ece544f3;hp=e9628220d501e6d30ef9c69d82d5aec3fd43ffb3;hpb=f7bfbdc706a75256c0e9b15ecc242175f562eb71;p=helm.git diff --git a/helm/software/components/ng_paramodulation/pp.ml b/helm/software/components/ng_paramodulation/pp.ml index e9628220d..ddf5726c4 100644 --- a/helm/software/components/ng_paramodulation/pp.ml +++ b/helm/software/components/ng_paramodulation/pp.ml @@ -68,8 +68,8 @@ let pp_proof bag ~formatter:f p = eq (string_of_rule rule); Format.fprintf f "|%d with %d dir %s))" eq1 eq2 (string_of_direction dir); - let (_, _, _, proof1),_ = Terms.M.find eq1 bag in - let (_, _, _, proof2),_ = Terms.M.find eq2 bag in + let (_, _, _, proof1),_,_ = Terms.get_from_bag eq1 bag in + let (_, _, _, proof2),_,_ = Terms.get_from_bag eq2 bag in Format.fprintf f "@["; aux eq1 proof1; aux eq2 proof2; @@ -85,6 +85,7 @@ let string_of_comparison = function | Terms.Gt -> "=>=" | Terms.Eq -> "===" | Terms.Incomparable -> "=?=" + | Terms.Invertible -> "=<->=" let pp_unit_clause ~formatter:f c = let (id, l, vars, proof) = c in @@ -120,17 +121,20 @@ let pp_unit_clause ~formatter:f c = Format.fprintf f "@]" ;; -let pp_bag ~formatter:f bag = +let pp_bag ~formatter:f (_,bag) = Format.fprintf f "@["; Terms.M.iter - (fun _ (c,_) -> pp_unit_clause ~formatter:f c;Format.fprintf f "@;") bag; + (fun _ (c,d,_) -> pp_unit_clause ~formatter:f c; + if d then Format.fprintf f " (discarded)@;" + else Format.fprintf f "@;") bag; Format.fprintf f "@]" ;; (* String buffer implementation *) -let on_buffer f t = +let on_buffer ?(margin=80) f t = let buff = Buffer.create 100 in let formatter = Format.formatter_of_buffer buff in + Format.pp_set_margin formatter margin; f ~formatter:formatter t; Format.fprintf formatter "@?"; Buffer.contents buff @@ -152,8 +156,8 @@ let pp_proof bag = on_buffer (pp_proof bag) ;; -let pp_unit_clause = - on_buffer pp_unit_clause +let pp_unit_clause ?margin x= + on_buffer ?margin pp_unit_clause x ;; end