h$      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLM N O P Q R S T U V W X Y Z[\]^_` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~        !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij k l m n o p q r s t u!v!w!x!y!z!{!|"}"~""""""""""""#####$$%%%&&&&&&&&&&&&''(((()****************************++++++,,,,,,,,,,,,,,,,,,,,,,,,--------..//////////////0001111 2 2 2 2 2333333333344444455 5!5"5#56portable experimental/Sebastian Fischer (sebf@informatik.uni-kiel.de) Safe-Inferred 8Conjunctive normalforms are lists of lists of literals. CLiterals are variables that occur either positively or negatively. 3Boolean formulas are represented as values of type Boolean. %and disjunction of boolean formulas. #and finally we provide conjunction Not constructs negated formulas, No represents false, Yes represents true, Variables are labeled with an Int, =This function returns the name of the variable in a literal. !This function negates a literal. =This predicate checks whether the given literal is positive. BWe convert boolean formulas to conjunctive normal form by pushing 9 negations down to variables and repeatedly applying the  distributive laws.  $%&'()      $%&'()portable experimental/Sebastian Fischer (sebf@informatik.uni-kiel.de) Safe-Inferred A  SatSolver( can be used to solve boolean formulas. -A new SAT solver without stored constraints. 9This predicate tells whether all constraints are solved. CWe can lookup the binding of a variable according to the currently ? stored constraints. If the variable is unbound, the result is  Nothing. +We can assert boolean formulas to update a  SatSolver. The D assertion may fail if the resulting constraints are unsatisfiable. ?This function guesses a value for the given variable, if it is B currently unbound. As this is a non-deterministic operation, the 2 resulting solvers are returned in an instance of  MonadPlus. !BWe select a variable from the shortest clause hoping to produce a  unit clause. "@This function guesses values for variables such that the stored D constraints are satisfied. The result may be non-deterministic and ' is, hence, returned in an instance of  MonadPlus. #8This predicate tells whether the stored constraints are E solvable. Use with care! This might be an inefficient operation. It 9 tries to find a solution using backtracking and returns True if  and only if that fails. *+, !"#-./0123456  !"#    !"#*+, !"#-./0123456None$7$$$7None#%&'()89:*+,;-./0123456789:<;<==>?@>%&'()*+,-./0123456789:;<=>?@&'(-.>?@=;*<+,7132465)89:/0%#%&'()89:*+,;-./0123456789:<;<==>?@> Safe-InferredABCDABCDABCDABCD Safe-InferredEAThe class of formulas that can be negated. There are some types @ that can be negated but do not support the other Boolean Logic  operators, such as the Literal class. F9Negate a formula in a naive fashion, the operators below  prevent double negation. G,Test whether a formula is negated or normal H*Is this formula negated at the top level? I-Negate the formula, avoiding double negation EFGcalled for normal formulas called for negated formulas HIJKLEFGHIJKLEFGHIJKLEFGHIJKL  Safe-InferredMBA class to represent formulas in CNF, which is the conjunction of D a set of disjuncted literals each which may or may not be negated. MNOPMNOPMNOPMNOP  Safe-InferredV?Very similar to unify, not quite sure if there is a difference QRSTUVWXY QRSTUVWXY QRSTUVWXYQRSTUVWXYNoneZ?A class used to do proper parenthesization of formulas. If we E nest a higher precedence formula inside a lower one parentheses can  be omitted. Because | has lower precedence than &, the formula  a | (b & c) appears as a | b & c, while (a | b) & c appears @ unchanged. (Name Precedence chosen because Fixity was taken.) @The second field of Fixity is the FixityDirection, which can be 8 left, right, or non. A left associative operator like / is : grouped left to right, so parenthese can be omitted from (a  b)   c but not from a  (b  c) . It is a syntax error to omit 9 parentheses when formatting a non-associative operator. DThe Haskell FixityDirection type is concerned with how to interpret A a formula formatted in a certain way, but here we are concerned B with how to format a formula given its interpretation. As such, D one case the Haskell type does not capture is whether the operator ? follows the associative law, so we can omit parentheses in an  expression such as a & b & c. \@The intent of this class is to be similar to Show, but only one 1 way, with no corresponding Read class. It doesn't really belong E here in logic-classes. To put something in a pretty printing class E implies that there is only one way to pretty print it, which is not B an assumption made by Text.PrettyPrint. But in practice this is  often good enough. ^9This is used as the initial value for the parent fixity. _6This is used as the fixity for things that never need 1 parenthesization, such as function application. Z[\]^_?  Z[\]^_ \]Z[ ^_Z[\]^_? None`<Represents the boolean logic binary operations, used in the  Combination type above. aOR bAND c Implication d Equivalence ee0 is a helper type used in the signatures of the  foldPropositional and foldFirstOrder methods so can represent B all the ways that formulas can be combined using boolean logic - & negation, logical And, and so forth. h<A type class for logical formulas. Minimal implementation:    (.|.)   i Disjunction/OR j;Derived formula combinators. These could (and should!) be 5 overridden with expressions native to the instance.  | Conjunction/AND k!Formula combinators: Equivalence l Implication mReverse implication: n Exclusive or oNor pNand q&A helper function for building folds:   $ foldPropositional combine atomic    is a no-op. u! can'1t be a function when -XUnicodeSyntax is enabled. `abcdefghijklmnopqrstuvwxy@`abcdefghijklmnopqrstuvwxyhijklmnopegfq`dcbarstuvwxy `dcbaegfhijklmnopqrstuvwxy@ None{8Return a variable based on v but different from any set > element. The result may be v itself if v is not a member of  the set. |:Modify a variable by adding a prefix. This unfortunately  assumes that v is  string-like but at least one algorithm in # Harrison currently requires this. }Pretty print a variable ~+Return an infinite list of variations on v z{|}~z{|}~z{|}~z{|}~ None@This class shows how to convert between atomic Skolem functions A and Ints. We include a variable type as a parameter because we @ create skolem functions to replace an existentially quantified > variable, and it can be helpful to retain a reference to the  variable. <Built a Skolem function from the given variable and number. 9 The number is generally obtained from the skolem monad. None,Build a term which is a variable reference. 7Build a term by applying terms to an atomic function. f ? (atomic function) is one of the type parameters, this package 2 is mostly indifferent to its internal structure. =A fold for the term data type, which understands terms built < from a variable and a term built from the application of a $ primitive function to other terms. NoneAA6NoneBBNone>Some types in the Logic class heirarchy need to have True and  False elements. C CNone BA type class for propositional logic. If the type we are writing @ an instance for is a zero-order (aka propositional) logic type E there will generally by a type or a type parameter corresponding to B atom. For first order or predicate logic types, it is generally C easiest to just use the formula type itself as the atom type, and D raise errors in the implementation if a non-atomic formula somehow E appears where an atomic formula is expected (i.e. as an argument to 8 atomic or to the third argument of foldPropositional.) >The Ord superclass is required so we can put formulas in sets D during the normal form computations. Negatable and Combinable are - also considered basic operations that we can't build this package D without. It is less obvious whether Constants is always required, A but the implementation of functions like simplify would be more  elaborate if we didn'"t have it, so we will require it. ,Build an atomic formula from the atom type. ? | A fold function that distributes different sorts of formula A to its parameter functions, one to handle binary operators, one B for negations, and one for atomic formulas. See examples of its 3 use to implement the polymorphic functions below. 2Show a formula in a format that can be evaluated .Show a formula in a visually pleasing format. @Convert any instance of a propositional logic expression to any 4 other using the supplied atom conversion function. $Simplify and recursively apply nnf. DEliminate => and  = and move negations inwards:   Formula Rewrites to  P => Q ~P | Q  P  = Q (P & Q) | (~P & ~Q)  ~"X P "X ~P  ~"X P "X ~P  ~(P & Q) (~P | ~Q)  ~(P | Q) (~P & ~Q)  ~~P P E>Do a bottom-up recursion to simplify a propositional formula. F4Do one step of simplify for propositional formulas: < Perform the following transformations everywhere, plus any  commuted versions for & , |, and  =.   ~False -> True  ~True -> False  True & P -> P  False & P -> False  True | P -> True  False | P -> P  True => P -> P  False => P -> True  P => True -> P  P => False -> True  True  = P -> P  False  = P -> ~P I'Pm not sure of the clauseNormalForm functions above are wrong or just different. G=Harrison page 59. Look for complementary pairs in a clause.  Use this to implement foldAtoms Deprecated - use foldAtoms. HThe fixity of the parent formula. If the operator being formatted here 6 has a lower precedence it needs to be parenthesized. DHIEFJGKLMNOqqDHIEFJGKLMNONone Safe-Inferred=A class that characterizes how many arguments a predicate or D function takes. Depending on the context, a result of Nothing may C mean that the arity is undetermined or unknown. However, even if C this returns Nothing, the same number of arguments must be passed / to all uses of a given predicate or function. Noneapply'8 with an arity check - clients should always call this. 9Return the variables that occur in an instance of Apply. NoneThe  and  InfixPred types, like the BinOp type in  78-, could be additional parameters to the type < class, but it would add additional complexity with unclear  benefits. The & type class. Minimal implementation:  Hfor_all, exists, foldFirstOrder, foldTerm, (.=.), pApp0-pApp7, fApp, var. The < functional dependencies are necessary here so we can write  functions that don'0t fix all of the type parameters. For example, ? without them the univquant_free_vars function gives the error No 0 instance for (FirstOrderFormula Formula atom V) because the  function doesn't mention the Term type. 1Universal quantification - for all x (formula x) BExistential quantification - there exists x such that (formula x) &A fold function similar to the one in PropositionalFormula ? but extended to cover both the existing formula types and the  ones introduced here. /foldFirstOrder (.~.) quant binOp infixPred pApp ; is a no op. The argument order is taken from Logic-TPTP. <Versions of pApp specialized for different argument counts. ?for_all with a list of variables, for backwards compatibility. >exists with a list of variables, for backwards compatibility. @Names for for_all and exists inspired by the conventions of the  TPTP project. " can'1t be a function when -XUnicodeSyntax is enabled. $Helper function for building folds. CLegacy version of quant from when we supported lists of quantified D variables. It also has the virtue of eliding quantifications with ) empty variable lists (by calling for_all' and exists'.) CTry to convert a first order logic formula to propositional. This A will return Nothing if there are any quantifiers, or if it runs , into an atom that it is unable to convert. EDisplay a formula in a format that can be read into the interpreter. >Examine the formula to find the list of outermost universally B quantified variables, and call a function with that list and the , formula after the quantifiers are removed. Deprecated - use mapAtoms Deprecated - use foldAtoms %P$$ PNone A way to represent any predicate'!s name. Frequently the equality A predicate has no standalone representation in the p type, it is @ just a constructor in the atom type, or even the formula type. jIts not safe to make Atom a superclass of AtomEq, because the Atom methods will fail on AtomEq instances. applyEq'8 with an arity check - clients should always call this. <Versions of pApp specialized for different argument counts.  :Return the variables that occur in an instance of AtomEq. 'Q     R%     %     "Q     RNoneFLiterals are the building blocks of the clause and implicative normal J |forms. They support negation and must include True and False elements. AJust like Logic.FirstOrder.convertFOF except it rejects anything 9 with a construct unsupported in a normal logic formula, ? i.e. quantifiers and formula combinators other than negation. SSNone$!Combine function for result type The substitution function 3The default valuation function for atoms not in ps The variables to vary  T!"#$U%V&'()*+,-./012W345  !"#$%&'()*+,-./012345 -.12/!%03#"$,(' &)*+45$ T!"#$U%V&'()*+,-./012W345None6GThe range of a formula is {True, False} when it has no free variables. 6789:XYZ[\]^_6789:6:987 6:987XYZ[\]^_None!`;<=>?abcdefghijklmnopqrstuvw@xyz;<=>?@<=;@?> `;<=>?abcdefghijklmnopqrstuvw@xyzNoneABCDEFGHIJKLMNOPQR{ABCDEFGHIJKLMNOPQRDEABCFGHIJKLMNOPQRABCDEFGHIJKLMNOPQR{NoneSTUVWXYZ[|}~ STUVWXYZ[ S[ZYXWVUT S[ZYXWVUT|}~None \]^\]^\]^\]^None_`abc_`abc_`abc_`abcNonedefghidefghidefghidefghi Nonejklmnopqrst jklmnopqrst jtsrqponmlkj tsrqponmlk!Nonex-Return all variables occurring in a formula. y3Return the variables that occur free in a formula. 1Return the variables in a propositional formula. uvwxyz{uvwxyz{uwvxy{z uvwxyz{"None|The Skolem monad }The Skolem monad transformer Harrison'8s code generated skolem functions by adding a prefix to C the variable name they are based on. Here we have a more general C and type safe solution: we require that variables be instances of B class Skolem which creates Skolem functions based on an integer. C This state value exists in the SkolemT monad during skolemization > and tracks the next available number and the current list of # universally quantified variables. "The next available Skolem number. 6The variables which are universally quantified in the < current scope, in the order they were encountered. During = Skolemization these are the parameters passed to the Skolem  function. 7Just looks for double negatives and negated constants. >Helper function to rename variables when we want to enclose a D formula containing a free occurrence of that variable a quantifier  that quantifies it. ?Recursivly apply pullQuants anywhere a quantifier might not be  leftmost. AConvert to Prenex normal form, with all quantifiers at the left. ,The state associated with the Skolem monad. 'Run a computation in the Skolem monad. ?Run a computation in a stacked invocation of the Skolem monad. BSkolemize the formula by removing the existential quantifiers and B replacing the variables they quantify with skolem functions (and @ constants, which are functions of zero variables.) The Skolem E functions are new functions (obtained from the SkolemT monad) which < are applied to the list of variables which are universally < quantified in the context where the existential quantifier  appeared. >I need to consult the Harrison book for the reasons why we don't 1 |just Skolemize the result of prenexNormalForm. ?Remove the leading universal quantifiers. After a call to pnf C this will be all the universal quantifiers, and the skolemization ? will have already turned all the existential quantifiers into  skolem functions. @Skolemize and then specialize. Because we know all quantifiers B are gone we can convert to any instance of PropositionalFormula. @We get Skolem Normal Form by skolemizing and then converting to H Prenex Normal Form, and finally eliminating the remaining quantifiers. |}~|}~~}||}~#NoneCNF: (a | b | c) & (d | e | f)  $NoneZConvert to Skolem Normal Form and then distribute the disjunctions over the conjunctions:   Formula Rewrites to  P | (Q & R) (P | Q) & (P | R)  (Q & R) | P (Q | P) & (R | P) %None  &NoneBA type to represent a formula in Implicative Normal Form. Such a  formula has the form a & b & c .=>. d | e | f, where a thru f are D literals. One more restriction that is not implied by the type is A that no literal can appear in both the pos set and the neg set. 1Combination of Normal monad and LiteralMap monad @A version of MakeINF that takes lists instead of sets, used for - implementing a more attractive show method. @Take the clause normal form, and turn it into implicative form, @ where each clauses becomes an (LHS, RHS) pair with the negated > literals on the LHS and the non-negated literals on the RHS:    (a | ~b | c | ~d) becomes (b & d) => (a | c)  (~b | ~d) | (a | c)  ~~(~b | ~d) | (a | c)  ~(b & d) | (a | c)   C If there are skolem functions on the RHS, split the formula using  this identity:    (a | b | c) => (d & e & f)    becomes    a | b | c => d  a | b | c => e  a | b | c => f   gFind a# will extract any elements of type b from  a'-s structure in accordance with the MonadPlus 4 instance, e.g. Maybe Foo will return the first Foo  found while [Foo]% will return the list of Foos found.    'NoneConvert a [[formula]]) to CNF, which means building a map from  formula to Literal. (None>Is there any variable assignment that makes the formula true?  satisfiable :: forall formula atom term v f m. (Monad m, FirstOrderFormula formula atom v, Formula atom term v, Term term v f, Ord formula, Literal formula atom v, Ord atom) => 2 formula -> SkolemT v term m Bool 1Is the formula always false? (Not satisfiable.) -Is the negation of the formula inconsistant? BA formula is invalid if it is neither a theorem nor inconsistent. )None*None5 +None Convert the question to a set of support. BTry to unify the second argument using the equality in the first. $Unification: unifies two sentences. 3Recursion limit. We continue recursing until this 7 becomes zero. If it is negative it may recurse until  it overflows the stack. ,None Both are satisfiable (The negated conjecture is unsatisfiable  The conjecture is unsatisfiable (A monad for running the knowledge base. 5Remove a particular sentence from the knowledge base *Return the contents of the knowledgebase. ?Return a flag indicating whether sentence was disproved, along  with a disproof. CReturn a flag indicating whether sentence was proved, along with a  proof. :Try to prove a sentence, return the result and the proof. D askKB should be in KnowledgeBase module. However, since resolution ? is here functions are here, it is also placed in this module. CSee whether the sentence is true, false or invalid. Return proofs  for truth and falsity. CValidate a sentence and insert it into the knowledgebase. Returns D the INF sentences derived from the new sentence, or Nothing if the > new sentence is inconsistant with the current knowledgebase. Delete an entry from the KB. @Return a text description of the contents of the knowledgebase. &-None?The Harrison book uses String for atomic function, but we need @ something a little more type safe because of our Skolem class. This is probably dangerous. None>HUnit Test type with an added phantom type parameter. To run 1 such a test you use the convert function below:   ) :load Data.Logic.Tests.Harrison.Meson  :m +Data.Logic.Tests.HUnit  :m +Test.HUnit  runTestTT (convert tests)     .None          /None0None?Try f with higher and higher values of n until it succeeds, or + optional maximum depth limit is exceeded.  !" !"1None2None#$%&'() *+ ,-./0 123 4           #$%&'() *+ ,-./0 123 4 3None,The range of a term is an element of a set. Function application.  Constants are encoded as  nullary functions. The result  is another term. A variable, either free or # bound by an enclosing quantifier. :A temporary type used in the fold method to represent the A combination of a predicate and its arguments. This reduces the I number of arguments to foldFirstOrder and makes it easier to manage the : mapping of the different instances to the class methods. GThe range of a formula is {True, False} when it has no free variables. #56789:;<=>?@ABCDEFGHIJKLM  56789:;<=>?@ABCDEFJIHGKLM4NoneBThe new Formula type is just a wrapper around the Native instance A (which eventually should be renamed the Internal instance.) No  derived Eq or Ord instances. 9Convert between the public and internal representations. N(Here are the magic Ord and Eq instances OPQNRSTUVWXYZOPQNRSTUVWXYZ5None[?Using PredName for the predicate type is not quite appropriate D here, but we need to implement this instance so we can use it as a  superclass of AtomEq below.  !"#\]^_`a[bcdefghi !"#!#"  !#"\]^_`a[bcdefghij9:;<=><=?<=@ABCABCABDABEABFABGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~               `yh      !"#$%&'(     )*+,-./0123J456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[d\]^_`[abcdefghijklmnopqPXWr[stuvwxy    n o p q P  X W!<!H!I!z!{!|!}""~"""F"""""""""#P#Q##T#$$%%%&&&&&&&&&&&&''(((()*********I*****p*q*********P****++++++,,,,,,,,,,,,,,,,,,,,,,,,--------S.d.//////////////000111122222333S333333Y344444455"5555 X     6 FD!P"#$%O&'()*+,!-.%/0123456W789:;<=>?@ABCDEFGHIJKLMNOP/0213546QRSTUV 0 W X 5 4 6!Y!J!Z!"["\"]"^"_"`"["a"b"c"d"e#&#j#O#f#%%g%h%%i%j%k%l%m%n%o&p&q'r's't*u*v*u*w*x*y*z*{*|*}*~**************++++++++++++++++++++++}+++,,,,,,,,,,,,,,-------------................A............M.P00002222222222222222223303/33333333353343633333333334404/44444544464445555 5/5 5 5 5 55555Q5logic-classes-1.4.7Data.Logic.Tests.HUnitData.Logic.FailingData.Logic.Classes.Pretty Data.BooleanData.Boolean.SatSolverData.Logic.Harrison.LibData.Logic.Classes.FormulaData.Logic.Classes.Negate#Data.Logic.Classes.ClauseNormalFormData.Logic.Classes.AtomData.Logic.Classes.CombineData.Logic.Classes.VariableData.Logic.Classes.SkolemData.Logic.Classes.TermData.Logic.Harrison.UnifData.Logic.Classes.Constants Data.Logic.Classes.Propositional*Data.Logic.Harrison.Formulas.PropositionalData.Logic.Classes.ArityData.Logic.Classes.ApplyData.Logic.Classes.FirstOrderData.Logic.Classes.EqualsData.Logic.Classes.LiteralData.Logic.Harrison.PropData.Logic.Types.Propositional Data.Logic.Harrison.PropExamplesData.Logic.Harrison.DefCNF0Data.Logic.Types.Harrison.Formulas.PropositionalData.Logic.Types.Harrison.Prop'Data.Logic.Harrison.Formulas.FirstOrderData.Logic.Harrison.Equal-Data.Logic.Types.Harrison.Formulas.FirstOrderData.Logic.Harrison.FOLData.Logic.Harrison.SkolemData.Logic.Harrison.NormalData.Logic.Normal.ClauseData.Logic.Instances.PropLogicData.Logic.Normal.ImplicativeData.Logic.Instances.SatSolverData.Logic.SatisfiableData.Logic.Harrison.PrologData.Logic.Instances.ChiouData.Logic.ResolutionData.Logic.KnowledgeBaseData.Logic.Types.Harrison.FOLData.Logic.Harrison.DPData.Logic.Harrison.HerbrandData.Logic.Harrison.TableauxData.Logic.Harrison.MesonData.Logic.Harrison.ResolutionData.Logic.Types.FirstOrder!Data.Logic.Types.FirstOrderPublicData.Logic.Types.Harrison.EqualData.Logic.Types.Common Data.Logic Propositional HUnit-1.2.5.1Test.HUnit.Base assertEqualapplicative-extras-0.1.8Control.Applicative.ErrorSuccessFailureFailingtemplate-haskellLanguage.Haskell.TH.SyntaxFixityInfixLInfixRInfixNFixityDirectionClauseCNFLiteralNegPosBoolean:||::&&:NotNoYesVar literalVar invLiteralisPositiveLiteral booleanToCNF SatSolver newSatSolverisSolved lookupVar assertTrue assertTrue' branchOnVarselectBranchVarsolve isSolvablefailing∅testssetAnysetAllcanexistsallpairsdistrib'tryfind settryfind mapfilter setmapfilteroptimizemaximizeminimize optimize' maximize' minimize'imageallsets allsubsetsallnonemptysubsetsapply tryApplyDdefined|=>|->fpfFormulaatomic foldAtomsmapAtoms Negatable negatePrivate foldNegationnegated.~.¬negativepositiveClauseNormalFormulaclausesmakeCNF satisfiableAtom substitute allVariables freeVariablesunifymatch foldTermsisRenamegetSubst HasFixityfixityPrettypretty topFixity botFixityBinOp:|::&::=>::<=>: Combination:~: Combinable.|..&..<=>..=>..<=..<~>..~|..~&.combinebinop∧∨⇒⇔==><=> prettyBinOpVariablevariantprefixprettyVariablevariants showVariableSkolemtoSkolemisSkolemTermvtfAppfoldTermzipTermsFunction convertTermshowTerm prettyTermfvttsubstfuncs fullUnify unifyAndApply ConstantsasBoolfromBooltruefalseifElse⊨⊭ prettyBoolPropositionalFormulafoldPropositionalshowPropositionalprettyPropositionalfixityPropositional convertPropnegationNormalFormclauseNormalForm'clauseNormalFormclauseNormalFormAlt'clauseNormalFormAltdisjunctiveNormalFormdisjunctiveNormalForm'foldAtomsPropositional overatomsmapAtomsPropositional antecedent consequenton_atoms over_atoms atom_unionArityarityApply foldApplyapply' Predicate zipApplysapply0apply1apply2apply3apply4apply5apply6apply7 showApply prettyApplyvarApply substApplyQuantExistsForallFirstOrderFormulafor_allfoldFirstOrder zipFirstOrderpApppApp0pApp1pApp2pApp3pApp4pApp5pApp6pApp7for_all'exists'!?∀∃quantquant' convertFOFtoPropositionalshowFirstOrderprettyFirstOrderfixityFirstOrderwithUnivQuantsmapAtomsFirstOrderonatomsfoldAtomsFirstOrder PredicateNameEqualsNamedAtomEq foldAtomEqequalsapplyEq'applyEq zipAtomsEqshowFirstOrderFormulaEq.=..!=.≡≢ fromAtomEq showAtomEq prettyAtomEq varAtomEq substAtomEq funcsAtomEq foldLiteral zipLiteralsfromFirstOrder fromLiteral prettyLitfoldAtomsLiteral TruthTable TruthTableRowevalatomsonAllValuations truthTable tautology unsatisfiablepSubstdual psimplifynegatennfnenf list_conj list_disjmkLitsallSatValuationsdnf0distribrawdnfpurednftrivialsimpdnfdnfdnf'simpcnfcnfcnf'FTCombineNPramseyprimeNumAtommaaimkpropmaincnfdefstep max_varindex mk_defcnfdefcnf1subcnforcnfandcnfdefcnfsdefcnf2andcnf3defcnf3IffImpOrAndProppname predicatesfunction_congruencepredicate_congruenceequivalence_axioms equalitize functions'varfv generalizesubstSkolemTsimplify lsimplifypnf functions runSkolem runSkolemTskolem askolemize specialize skolemizeskolemNormalFormsimpdnf'simpcnf'cnfTraceflattenplSat0plSatImplicativeFormINFnegpos LiteralMapTNormalT runNormalT runNormalmakeINF' prettyINF prettyProofimplicativeNormalFormtoCNF toLiteral inconsistanttheoreminvalid renamerule NormalTermNormalVariableNormalFunctionNormalSentenceNFEqual NFPredicateNFNotConjunctiveNormalForm QuantifierExistsChForAll ConnectiveEquivImplyCTermSentenceEqual toSentence fromSentence Unification SetOfSupportprovegetSetOfSupportgetSubstAtomEqisRenameOfAtomEq ProofResultInvalidProved DisprovedProverTWithIdwiItemwiIdent runProverT' runProver'Proof proofResultproofunloadKBgetKBinconsistantKB theoremKBaskKBvalidKBtellKBloadKBshowKBFNameFOLRTermTypeFn TestFormulaEq TestFormulaTestTest0 TestLabelTestListTestCase Assertionconvertdpllpholdsherbfuns groundterms groundtuplesherbloopsubst' gilmore_loopgilmoredp_mfndp_loop davisputnam dp_refinedp_refine_loop davisputnam'unify_literals unifyAtomsEqdeepencontrapositivesmexpand puremesonmeson resolution1 matchAtomsEq resolution2 presolution resolution3PTermFunApp unFormula BijectionpublicinternPredName:=:FOLEQEQUALS simpleClause conjunction disjunctionasLongAsPossible everywhere atChildrenbindings addClause addUnbound updateSolver insertBindingsimplifyClauses propagatebranchOnUnboundguessshorter$fMonadFailingitlist end_itlistitlist2test01applyD tryApplyLchoose $fPretty[] $fPrettyBinOp isTrivial $fVariable[] $fPrettyBool psimplify1 nnfCombine nnfNotCombinesimppurecnfpurecnf'$fSafeCopyBinOp$fSafeCopyCombination$fSafeCopyQuant arityError$fPrettyPredicateName fixityLiteralnnf'nenf'$fHasFixityFormula$fPrettyFormula!$fPropositionalFormulaFormulaatom$fLiteralFormulaatom$fFormulaFormulaatom$fConstantsFormula$fCombinableFormula$fNegatableFormulahalfsum halfcarryhacarrysumfaconjoin ripplecarrymk_index mk_index2test02 ripplecarry0 ripplecarry1muxoffset carryselect mk_adder_test rippleshift multiplier bitlengthbit congruent_totest03$fHasFixityAtom $fPrettyAtom $fNumAtomAtom $fShowFormula$fShowFormula0$fHasFixityProp $fHasFixity[] $fPrettyProp $fShowProp$fFirstOrderFormulaFormulaa[]$fFormulaFormulaafv' on_formula SkolemState skolemCount univQuantpullqprenexnewSkolemState simplify1 simplifyBinop lsimplify1 pullQuantsskolem2purednf'pairsclauses0$fHasFixityPropForm$fPrettyPropForm$fConstantsPropForm$fPropositionalFormulaPropForma$fFormulaPropForma$fCombinablePropForm$fNegatablePropFormgFindrunLiteralMapM$fClauseNormalFormula[]Literal$fNegatableLiteral $fOrdLiteralAtomicFunctionAtomicSkolemFunctiontoTermfromTerm$fTermNormalTermvf$fHasFixityNormalSentence0$fFirstOrderFormulaNormalSentenceNormalSentencev%$fFormulaNormalSentenceNormalSentence$fPrettyNormalSentence$fNegatableNormalSentence$fConstantsNormalSentence $fTermCTermvf$$fFirstOrderFormulaSentenceSentencev$fHasFixitySentence$fPrettySentence$fAtomEqSentencepCTerm$fApplySentencepCTerm$fSkolemAtomicFunctionv$fIsStringAtomicFunction&$fPropositionalFormulaSentenceSentence$fFormulaSentenceSentence$fCombinableSentence$fConstantsSentence$fNegatableSentence demodulateprove' getResult getSubstsgetSubstSentencesgetSubstSentencegetSubstsTerms getSubstsTerm isRenameOfisRenameOfSentencesisRenameOfSentenceisRenameOfTermisRenameOfTerms resolutionunify' unify2AtomsEq unifyTerm unifyTerms findUnify replaceTerm substTerm substTerms updateSubstProverT' ProverStaterecursionLimit knowledgeBase sentenceCount KnowledgeBase SentenceCountwithIdzeroKB runProverTreportKB $fShowProof$fSafeCopyProofResult $fConstants[]$fHasFixityFOL$fTermTermType[]Function$fSkolemFunction[]$fFunctionFunction[]$fPrettyFunction $fArity[] $fPrettyFOL $fPredicate[]$fConstantsFOL$fApplyFOL[]TermType$fPrettyTermType$fShowTermType$fIsStringFunctionTrailMixDeducedGuessedone_literal_ruleaffirmative_negative_rule resolve_onresolution_blowupresolution_ruledpdpsatdptaut posneg_countdpllsatdplltaut unassignedunit_subpropagateunit_propagate backtrackdplidplisatdplitautbackjumpdplbdplbsatdplbtautunify_complements unify_refute prawitz_loopprawitzmgu unifiablerename resolventsresolve_clausesresloop1pure_resolution1 term_matchmatch_literalssubsumes_clausereplace incorporateresloop2pure_resolution2presolve_clausespreslooppure_presolutionpure_resolution3$fHasFixityPredicate$fPrettyPredicate$fAtomPredicatePTermv$fLiteralFormulaPredicate$$fFirstOrderFormulaFormulaPredicatev$fAtomEqPredicatepPTerm $fTermPTermvf&$fPropositionalFormulaFormulaPredicate$fFormulaFormulaPredicate$fConstantsPredicate$fSafeCopyPTerm$fSafeCopyFormula Predicate_v1Apply_v1 Constant_v1 NotEqual_v1Equal_v1$fSafeCopyPredicate$fMigratePredicate$fSafeCopyPredicate_v1 $fOrdFormula $fEqFormula!$fBijectionCombinationCombination$fBijectionFormulaFormula$fApplyFOLEQPredNameTermType$fAtomFOLEQTermType[]$fAtomEqFOLEQPredNameTermType$fLiteralFormulaFOLEQ $fPrettyFOLEQ"$fPropositionalFormulaFormulaFOLEQ$fPrettyPredName$fPredicatePredName$fConstantsFOLEQ$fConstantsPredName$fIsStringPredName$fHasFixityFOLEQ$fArityPredName