X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=helm%2Fsoftware%2Fcomponents%2Fng_paramodulation%2Fpp.ml;h=29f257697a0cd50bc5c887baf5c23a1eef6c50af;hb=bd3680d6b90f6c8bdda4eb4a915a86a0e806de63;hp=9dac9001bd6cdea5686f9d2fc122623b2ed8db75;hpb=497563d35f24bbcbcbd8d669d73284b76a823118;p=helm.git diff --git a/helm/software/components/ng_paramodulation/pp.ml b/helm/software/components/ng_paramodulation/pp.ml index 9dac9001b..29f257697 100644 --- a/helm/software/components/ng_paramodulation/pp.ml +++ b/helm/software/components/ng_paramodulation/pp.ml @@ -36,9 +36,8 @@ let pp_foterm ~formatter:f t = ;; let string_of_rule = function - | Terms.SuperpositionRight -> "SupR" - | Terms.SuperpositionLeft -> "SupL" - | Terms.Demodulation -> "Demod" + | Terms.Superposition -> "Super" + | Terms.Demodulation -> "Demod" ;; let string_of_direction = function @@ -59,7 +58,9 @@ let pp_substitution ~formatter:f subst = let pp_proof bag ~formatter:f p = let rec aux eq = function | Terms.Exact t -> - Format.fprintf f "%d: Exact (%s)@;" eq (B.pp t) + Format.fprintf f "%d: Exact (" eq; + pp_foterm f t; + Format.fprintf f ")@;"; | Terms.Step (rule,eq1,eq2,dir,pos,subst) -> Format.fprintf f "%d: %s(" eq (string_of_rule rule); @@ -78,26 +79,40 @@ let pp_proof bag ~formatter:f p = ;; let string_of_comparison = function - | Terms.Lt -> "<" - | Terms.Gt -> ">" - | Terms.Eq -> "=" - | Terms.Incomparable -> "I" + | Terms.Lt -> "=<=" + | Terms.Gt -> "=>=" + | Terms.Eq -> "===" + | Terms.Incomparable -> "=?=" let pp_unit_clause ~formatter:f c = - let (id, l, vars, _) = c in - Format.fprintf f "Id : %d, " id ; + let (id, l, vars, proof) = c in + Format.fprintf f "Id : %3d, " id ; match l with | Terms.Predicate t -> pp_foterm f t | Terms.Equation (lhs, rhs, ty, comp) -> - Format.fprintf f "{"; + Format.fprintf f "@[{"; pp_foterm f ty; - Format.fprintf f "}: "; + Format.fprintf f "}:@;@["; pp_foterm f lhs; - Format.fprintf f " =(%s) " (string_of_comparison comp); + Format.fprintf f "@;%s@;" (string_of_comparison comp); pp_foterm f rhs; - Format.fprintf f " [%s]" - (String.concat ", " (List.map string_of_int vars)) + Format.fprintf f "@]@;[%s] by %s@]" + (String.concat ", " (List.map string_of_int vars)) + (match proof with + | Terms.Exact _ -> "axiom" + | Terms.Step (rule, id1, id2, _, p, _) -> + Printf.sprintf "%s %d with %d at %s" + (string_of_rule rule) + id1 id2 (String.concat + "," (List.map string_of_int p))) +;; + +let pp_bag ~formatter:f bag = + Format.fprintf f "@["; + Terms.M.iter + (fun _ c -> pp_unit_clause ~formatter:f c;Format.fprintf f "@;") bag; + Format.fprintf f "@]" ;; (* String buffer implementation *) @@ -109,6 +124,10 @@ let on_buffer f t = Buffer.contents buff ;; +let pp_bag = + on_buffer pp_bag +;; + let pp_foterm = on_buffer pp_foterm ;;