aima.logic.fol.kb
Class FOLKnowledgeBase

java.lang.Object
  extended by aima.logic.fol.kb.FOLKnowledgeBase

public class FOLKnowledgeBase
extends java.lang.Object


Constructor Summary
FOLKnowledgeBase(FOLDomain domain)
           
FOLKnowledgeBase(FOLDomain domain, InferenceProcedure inferenceProcedure)
           
FOLKnowledgeBase(FOLDomain domain, InferenceProcedure inferenceProcedure, Unifier unifier)
           
 
Method Summary
 InferenceResult ask(Sentence aQuery)
           
 InferenceResult ask(java.lang.String aQuerySentence)
           
 void clear()
           
 java.util.Set<Variable> collectAllVariables(Sentence aSentence)
           
 java.util.Set<Clause> convertToClauses(Sentence aSentence)
           
 CNF convertToCNF(Sentence aSentence)
           
 Literal createAnswerLiteral(Sentence forQuery)
           
 java.util.Set<java.util.Map<Variable,Term>> fetch(java.util.List<Literal> literals)
           
 java.util.Set<java.util.Map<Variable,Term>> fetch(Literal l)
           
 java.util.Set<Clause> getAllClauses()
           
 java.util.List<Clause> getAllDefiniteClauseImplications()
           
 java.util.List<Clause> getAllDefiniteClauses()
           
 InferenceProcedure getInferenceProcedure()
           
 int getNumberFacts()
           
 int getNumberRules()
           
 java.util.List<Sentence> getOriginalSentences()
           
protected  FOLParser getParser()
           
 boolean isRenaming(Literal l)
           
 boolean isRenaming(Literal l, java.util.List<Literal> possibleMatches)
           
 void setInferenceProcedure(InferenceProcedure inferenceProcedure)
           
 Chain standardizeApart(Chain aChain)
           
 Clause standardizeApart(Clause aClause)
           
 Sentence standardizeApart(Sentence aSentence)
           
 Literal subst(java.util.Map<Variable,Term> theta, Literal l)
           
 Sentence subst(java.util.Map<Variable,Term> theta, Sentence aSentence)
           
 Term subst(java.util.Map<Variable,Term> theta, Term aTerm)
           
 void tell(java.util.List<? extends Sentence> sentences)
           
 void tell(Sentence aSentence)
           
 Sentence tell(java.lang.String aSentence)
           
 java.lang.String toString()
           
 java.util.Map<Variable,Term> unify(FOLNode x, FOLNode y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FOLKnowledgeBase

public FOLKnowledgeBase(FOLDomain domain)

FOLKnowledgeBase

public FOLKnowledgeBase(FOLDomain domain,
                        InferenceProcedure inferenceProcedure)

FOLKnowledgeBase

public FOLKnowledgeBase(FOLDomain domain,
                        InferenceProcedure inferenceProcedure,
                        Unifier unifier)
Method Detail

clear

public void clear()

getInferenceProcedure

public InferenceProcedure getInferenceProcedure()

setInferenceProcedure

public void setInferenceProcedure(InferenceProcedure inferenceProcedure)

tell

public Sentence tell(java.lang.String aSentence)

tell

public void tell(java.util.List<? extends Sentence> sentences)

tell

public void tell(Sentence aSentence)

ask

public InferenceResult ask(java.lang.String aQuerySentence)
Parameters:
aQuerySentence -
Returns:
an InferenceResult.

ask

public InferenceResult ask(Sentence aQuery)

getNumberFacts

public int getNumberFacts()

getNumberRules

public int getNumberRules()

getOriginalSentences

public java.util.List<Sentence> getOriginalSentences()

getAllDefiniteClauses

public java.util.List<Clause> getAllDefiniteClauses()

getAllDefiniteClauseImplications

public java.util.List<Clause> getAllDefiniteClauseImplications()

getAllClauses

public java.util.Set<Clause> getAllClauses()

fetch

public java.util.Set<java.util.Map<Variable,Term>> fetch(Literal l)

fetch

public java.util.Set<java.util.Map<Variable,Term>> fetch(java.util.List<Literal> literals)

unify

public java.util.Map<Variable,Term> unify(FOLNode x,
                                          FOLNode y)

subst

public Sentence subst(java.util.Map<Variable,Term> theta,
                      Sentence aSentence)

subst

public Literal subst(java.util.Map<Variable,Term> theta,
                     Literal l)

subst

public Term subst(java.util.Map<Variable,Term> theta,
                  Term aTerm)

standardizeApart

public Sentence standardizeApart(Sentence aSentence)

standardizeApart

public Clause standardizeApart(Clause aClause)

standardizeApart

public Chain standardizeApart(Chain aChain)

collectAllVariables

public java.util.Set<Variable> collectAllVariables(Sentence aSentence)

convertToCNF

public CNF convertToCNF(Sentence aSentence)

convertToClauses

public java.util.Set<Clause> convertToClauses(Sentence aSentence)

createAnswerLiteral

public Literal createAnswerLiteral(Sentence forQuery)

isRenaming

public boolean isRenaming(Literal l)

isRenaming

public boolean isRenaming(Literal l,
                          java.util.List<Literal> possibleMatches)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getParser

protected FOLParser getParser()