]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_paramodulation/pp.ml
right inference step completed
[helm.git] / helm / software / components / ng_paramodulation / pp.ml
index e7353cee8b765af2e7910d3e87101e71d7dd691b..a125101bcf212563b6b6a08f7b8c0cb50a6884e9 100644 (file)
@@ -80,10 +80,10 @@ 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, proof) = c in
@@ -96,19 +96,27 @@ let pp_unit_clause ~formatter:f c =
          pp_foterm f ty;
          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] by %s"
             (String.concat ", " (List.map string_of_int vars))
             (match proof with
             | Terms.Exact _ -> "axiom"
-            | Terms.Step (Terms.SuperpositionRight, id1, id2, _, p, _) -> 
-                 Printf.sprintf "supR %d with %d at %s" id1 id2 (String.concat
-                 "," (List.map string_of_int p))
-            | _ -> assert false)
+            | 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 "@[<v>";
+  Terms.M.iter 
+  (fun _ c -> pp_unit_clause ~formatter:f c;Format.fprintf f "@;") bag;
+  Format.fprintf f "@]"
+;;
+
 (* String buffer implementation *)
 let on_buffer f t = 
   let buff = Buffer.create 100 in
@@ -118,6 +126,10 @@ let on_buffer f t =
   Buffer.contents buff
 ;;
 
+let pp_bag =
+  on_buffer pp_bag
+;;
+
 let pp_foterm =
  on_buffer pp_foterm
 ;;