|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cs.ai.kreator.logic.prolog.PrologProgram
public class PrologProgram
This class models a program in Prolog.
Constructor Summary | |
---|---|
PrologProgram(LanguageFactory language)
Constructs a prolog program without clauses and with empty universe. |
|
PrologProgram(java.util.Set<Clause> clauses,
LanguageFactory language)
Constructs a prolog program with the given clauses and language. |
Method Summary | |
---|---|
void |
addClause(Clause clause)
Adds the given clause to this prolog program. |
java.util.List<AtomExpression> |
closure(java.util.List<AtomExpression> data,
LanguageFactory language)
Computes the closure of the given list of atom expression, e.g. |
java.util.Set<Clause> |
getClauses()
Returns the clauses of this program. |
java.util.Set<Clause> |
getClauses(GeneralizedAtom atom)
Returns the set of (instantiated) clauses where the head unifies with given bayesian atom. |
java.util.Set<Clause> |
getClauses(GeneralizedAtom atom,
java.util.Map<Sort,java.util.Set<Constant>> constants)
Returns the set of (instantiated) clauses where the head unifies with given bayesian atom. |
LanguageFactory |
getLanguage()
|
java.lang.String |
isEntailed(GeneralizedAtom atom)
Checks whether the given atom is entailed by this prolog program. |
java.lang.String |
isEntailed(GeneralizedAtom atom,
java.util.List<AtomExpression> evidences)
Checks whether the given atom is entailed by this prolog program. |
boolean |
mentions(GeneralizedPredicate p)
Checks whether the given predicate is mentioned in this program. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PrologProgram(LanguageFactory language)
language
- a LanguageFactory.public PrologProgram(java.util.Set<Clause> clauses, LanguageFactory language) throws InvalidLanguageExpressionException
clauses
- a set of bayesian clauseslanguage
- a LanguageFactory.
InvalidLanguageExpressionException
- if the given clauses do not conform to the given language.Method Detail |
---|
public void addClause(Clause clause) throws InvalidLanguageExpressionException
clause
- a bayesian clause;
InvalidLanguageExpressionException
- if the given clause does not conform to the given language.public java.util.Set<Clause> getClauses(GeneralizedAtom atom, java.util.Map<Sort,java.util.Set<Constant>> constants)
atom
- a bayesian atom.constants
- a set of bayesian clauses.
public java.util.Set<Clause> getClauses(GeneralizedAtom atom)
atom
- a bayesian atom.
public java.util.Set<Clause> getClauses()
public java.lang.String isEntailed(GeneralizedAtom atom) throws CycleFoundException
atom
- a bayesian atom.
CycleFoundException
public java.lang.String isEntailed(GeneralizedAtom atom, java.util.List<AtomExpression> evidences) throws CycleFoundException
atom
- a bayesian atom.evidences
- a list of evidences treated as additional facts for the program.
CycleFoundException
public java.util.List<AtomExpression> closure(java.util.List<AtomExpression> data, LanguageFactory language)
data
- a list of atom expressions.
public boolean mentions(GeneralizedPredicate p)
l
- a bayesian predicate.
public java.lang.String toString()
toString
in class java.lang.Object
public LanguageFactory getLanguage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |