X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fbinaries%2Fmatitaprover%2Ftptp_cnf.ml;h=06f777ff64a51830cd0e7b26462973960f975e3d;hb=8a3045a162622e8a76ffdb267309faff496ee7ec;hp=8d3cedfd4f9e90ad05f3e976f1099d788e634bc8;hpb=0b0c468aeb828f074a1b6a0195fa05216f29ee37;p=helm.git diff --git a/helm/software/components/binaries/matitaprover/tptp_cnf.ml b/helm/software/components/binaries/matitaprover/tptp_cnf.ml index 8d3cedfd4..06f777ff6 100644 --- a/helm/software/components/binaries/matitaprover/tptp_cnf.ml +++ b/helm/software/components/binaries/matitaprover/tptp_cnf.ml @@ -5,12 +5,17 @@ let trans_atom = function | Ast.NotEq (a,b) -> false, Ast.Function ("==",[Ast.Constant "_"; a; b]) ;; -let trans_formulae = function - | Ast.Disjunction _ -> assert false - | Ast.Atom a -> trans_atom a +let rec trans_formulae (nlit,plit) = function + | Ast.Disjunction (a,b) -> + trans_formulae (trans_formulae (nlit,plit) b) a + | Ast.Atom a -> + let is_positive,lit = trans_atom a in + if is_positive then (nlit,lit::plit) else (lit::nlit,plit) | Ast.NegAtom _ -> assert false ;; +let trans_formulae = trans_formulae ([],[]);; + (* HELPERS *) let resolve ~tptppath s = @@ -50,9 +55,9 @@ let parse ~tptppath filename = | Ast.Comment _ :: tl -> aux p n tl | Ast.AnnotatedFormula (name, (Ast.Axiom | Ast.Hypothesis|Ast.Negated_conjecture), f,_,_) :: tl-> - let is_positive, f = trans_formulae f in - if is_positive then aux (p@[Ast.Constant name,f]) n tl - else aux p (n@[Ast.Constant name,f]) tl + let (nlit,plit) = trans_formulae f in + if plit = [] then aux p (n@[Ast.Constant name,(nlit,plit)]) tl + else aux (p@[Ast.Constant name,(nlit,plit)]) n tl | _ -> prerr_endline "bad syntax"; assert false in aux [] [] statements