@@ -343,8 +343,6 @@ impl FOLTerm {
343343 }
344344
345345 // The order of the pulled up quantifiers is important for Skolemnization.
346- // TODO: If there are multiple equisatisfiable versions, picking Exist first is preferable.
347- // It will result in Skolem Functions with less arguments.
348346 fn pull_quants ( self ) -> FOLTerm {
349347 let mut quants = Vec :: new ( ) ;
350348 let mut result = self . separate_binders ( & mut quants) ;
@@ -534,8 +532,8 @@ pub struct TPTPProblem {
534532 pub conjectures : Vec < FOLTerm > ,
535533}
536534
537- // Parse into structure consisting of two lists: one with assumptions, one with goals (still FoF)
538- // FIXME: we don't have any sanity checks for include stuff with conflicting names
535+ // Parse a TPTP problem into NNF Terms,
536+ // while separating the axioms from the conjectures
539537pub fn parse_file ( file : PathBuf ) -> TPTPProblem {
540538 log:: info!( "Opening {file:?}" ) ;
541539 let mut f = File :: open ( & file) . expect ( "Unable to open file" ) ;
@@ -633,10 +631,9 @@ pub fn parse_file(file: PathBuf) -> TPTPProblem {
633631}
634632
635633// Transform the TPTPProblem into the problem in CNF for our saturation prover:
636- // - we conjunct the assumption formulas
637- // - we conjunct those with the disjunction of the negated goals
638- // - we transform it into CNF
639- // - we show False
634+ // - conjunct the assumption formulas
635+ // - conjunct those with the disjunction of the negated goals
636+ // - transform it into CNF
640637pub fn transform_problem ( problem : TPTPProblem ) -> SkolemTerm {
641638 let mut acc;
642639 if !problem. conjectures . is_empty ( ) {
@@ -685,8 +682,8 @@ impl TermBankConversionState<'_> {
685682 }
686683 }
687684
688- // TODO: if the problem contains two identically named functions with different arities
689- // the hashmap doesn't work correctly , but there is an assertion which does track this .
685+ // If the problem contains two identically named functions with different arities,
686+ // this conversion doesn't work, but there is an assertion at TermBank which would bomb .
690687 fn get_func_id ( & mut self , name : Name , arity : usize , sort : Sort ) -> FunctionIdentifier {
691688 if let Some ( func) = self . func_map . get ( & name) {
692689 * func
@@ -867,7 +864,7 @@ impl From<fof::BinaryNonassoc<'_>> for FOLTerm {
867864}
868865
869866// The BNF makes sure that there are atleast two elems in the initial vec
870- // the formula vectors `f_or`|`f_and`
867+ // of the formula vectors `f_or`|`f_and`
871868fn convert_op_into_binary ( fs : & [ fof:: UnitFormula < ' _ > ] , op : & Op ) -> FOLTerm {
872869 let mut acc = FOLTerm :: from ( fs[ 0 ] . clone ( ) ) ;
873870 let op_fn = match op {
@@ -914,16 +911,18 @@ impl From<fof::Term<'_>> for Term {
914911 }
915912}
916913
917- //%----System terms have system specific interpretations
918- //%----<fof_system_atomic_formula>s are used for evaluable predicates that are
919- //%----available in particular tools. The predicate names are not controlled by
920- //%----the TPTP syntax, so use with due care. Same for <fof_system_term>s.
921- // FIXME: unclear if we want to support System Terms and what would be the correct interpretation
922914impl From < fof:: FunctionTerm < ' _ > > for Term {
923915 fn from ( t : fof:: FunctionTerm ) -> Self {
924916 match t {
925917 fof:: FunctionTerm :: Plain ( p) => Self :: from ( p) ,
926- fof:: FunctionTerm :: Defined ( d) => Self :: from ( d) ,
918+ // > Defined terms have TPTP specific interpretations
919+ // > <distinct_object>s are different from (but may be equal to) other tokens,
920+ // > e.g., "cat" is different from 'cat' and cat. Distinct objects are always interpreted as
921+ // > themselves, so if they are different they are unequal, e.g., "Apple" != "Microsoft" is implicit.
922+ fof:: FunctionTerm :: Defined ( _) => unimplemented ! ( ) ,
923+ // > System terms have system specific interpretations.
924+ // > <fof_system_atomic_formula>s are used for evaluable
925+ // > predicates that are available in particular tools
927926 fof:: FunctionTerm :: System ( _) => unimplemented ! ( ) ,
928927 }
929928 }
@@ -941,40 +940,9 @@ impl From<fof::PlainTerm<'_>> for Term {
941940 }
942941}
943942
944- //%----Defined terms have TPTP specific interpretations
945- impl From < fof:: DefinedTerm < ' _ > > for Term {
946- fn from ( t : fof:: DefinedTerm ) -> Self {
947- match t {
948- fof:: DefinedTerm :: Defined ( d) => Self :: from ( d) ,
949- fof:: DefinedTerm :: Atomic ( _) => todo ! ( ) ,
950- }
951- }
952- }
953-
954- //%----Defined terms have TPTP specific interpretations"
955- //%----<distinct_object>s are different from (but may be equal to) other tokens,
956- //%----e.g., "cat" is different from 'cat' and cat. Distinct objects are always interpreted as
957- //%----themselves, so if they are different they are unequal, e.g., "Apple" != "Microsoft" is implicit.
958- impl From < tptp:: common:: DefinedTerm < ' _ > > for Term {
959- fn from ( _: tptp:: common:: DefinedTerm ) -> Self {
960- unimplemented ! ( "There is no support for distinct objects" )
961- // TODO: this is most definitely not enough to support it
962- //match t {
963- // tptp::common::DefinedTerm::Number(n) => {
964- // Self::Function(Name::Parsed(n.to_string()), Vec::new())
965- // }
966- // // These are double-quoted tokens.
967- // tptp::common::DefinedTerm::Distinct(n) => {
968- // Self::Function(Name::Parsed(n.to_string()), Vec::new())
969- // }
970- //}
971- }
972- }
973-
974943impl From < fof:: QuantifiedFormula < ' _ > > for FOLTerm {
975944 fn from ( f : fof:: QuantifiedFormula ) -> Self {
976945 match f. quantifier {
977- // FIXME: the reference implementation reversed the order, but I dont understand why
978946 fof:: Quantifier :: Forall => {
979947 let vars = f
980948 . bound
@@ -1037,7 +1005,8 @@ impl From<fof::AtomicFormula<'_>> for FOLTerm {
10371005 match f {
10381006 fof:: AtomicFormula :: Plain ( p) => Self :: from ( p) ,
10391007 fof:: AtomicFormula :: Defined ( d) => Self :: from ( d) ,
1040- fof:: AtomicFormula :: System ( _) => todo ! ( ) ,
1008+ // see: `fof::FunctionTerm::System(_)`
1009+ fof:: AtomicFormula :: System ( _) => unimplemented ! ( ) ,
10411010 }
10421011 }
10431012}
0 commit comments