| org.mandarax.kernel.LogicFactory org.mandarax.reference.DefaultLogicFactory
DefaultLogicFactory | public class DefaultLogicFactory extends LogicFactory (Code) | | Factory object for creating logical entities objects.
The classes with the postfix Impl should never be instanciated
directly. Instead use instances of this class. To use alternative
implementations, subclass this class. To install an instance of this
class to be the default factory use the following code:
(new DefaultLogicFactory()).install() . If this is done, a
reference to the factory can be obtained using
LogicFactory.getDefaultFactory() .
As from 1.9, queries are supported.
author: Jens Dietrich version: 3.4 <7 March 05> since: 1.1 |
Method Summary | |
public ComplexTerm | createComplexTerm(Function anFunction, Term[] terms) Create a new complex term. | public ConstantTerm | createConstantTerm(Object obj) Create a new constant term. | public ConstantTerm | createConstantTerm(Object obj, Class type) Create a new constant term.
a new constant term Parameters: obj - the wrapped object Parameters: type - the type of the object throws an IllegalArgumentException if object and type are inconsistent,i.e. | public Prerequisite | createCut() Create a cut prerequisite. | public Fact | createFact(Predicate aPredicate, Term[] terms) Create a new fact. | public Prerequisite | createPrerequisite(Predicate aPredicate, Term[] terms, boolean negatedAF) Create a new prerequisite. | public Query | createQuery(Fact fact, String name) Create a new query. | public Query | createQuery(Fact[] facts, String name) Create a new query. | public Rule | createRule(java.util.List body, Fact head) Create a new rule. | public Rule | createRule(java.util.List body, Fact head, boolean or) Create a new rule. | public Rule | createRule(Fact head) Create a new rule with an empty body. | public TestCase | createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, boolean expectedResult) Create a new test case. | public TestCase | createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults) Create a new test case. | public TestCase | createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Map[] expectedReplacements) Create a new test case. | public TestCase | createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults, boolean expectedResult, Map[] expectedReplacements) Create a new test case.
Note that the parameters are somehow redundant, expectedResult only makes sense if the query is ground while
expectedReplacements only makes sense if the query contains variables. | public VariableTerm | createVariableTerm(String aName, Class aType) Create a new variable term. | public Class | getComplexTermImplementationClass() Return the implementation class for complex terms. | public Class | getConstantTermImplementationClass() Return the implementation class for constant terms. | public Class | getFactImplementationClass() Return the implementation class for facts. | public Class | getPrerequisiteImplementationClass() Return the implementation class for prerequisites. | public Class | getQueryImplementationClass() Return the implementation class for queries. | public Class | getRuleImplementationClass() Return the implementation class for rules. | public Class | getVariableTermImplementationClass() Return the implementation class for variable terms. |
DefaultLogicFactory | public DefaultLogicFactory()(Code) | | Constructor.
|
createComplexTerm | public ComplexTerm createComplexTerm(Function anFunction, Term[] terms)(Code) | | Create a new complex term.
the created complex term Parameters: anFunction - a function Parameters: terms - an array of terms |
createConstantTerm | public ConstantTerm createConstantTerm(Object obj)(Code) | | Create a new constant term.
the created constant term Parameters: obj - the object that is to be wrapped by the constant term |
createConstantTerm | public ConstantTerm createConstantTerm(Object obj, Class type)(Code) | | Create a new constant term.
a new constant term Parameters: obj - the wrapped object Parameters: type - the type of the object throws an IllegalArgumentException if object and type are inconsistent,i.e. if type object is not an instance of type |
createFact | public Fact createFact(Predicate aPredicate, Term[] terms)(Code) | | Create a new fact.
the created fact Parameters: aPredicate - the predicate Parameters: terms - the terms |
createPrerequisite | public Prerequisite createPrerequisite(Predicate aPredicate, Term[] terms, boolean negatedAF)(Code) | | Create a new prerequisite.
a new prerequisite Parameters: aPredicate - a predicate Parameters: terms - an array of terms Parameters: negatedAF - whether the prerequisite is negated (as failure) |
createQuery | public Query createQuery(Fact fact, String name)(Code) | | Create a new query.
a new query Parameters: fact - aFact Parameters: name - the name of the query |
createQuery | public Query createQuery(Fact[] facts, String name)(Code) | | Create a new query.
a new query Parameters: facts - an array of facts Parameters: name - the name of the query |
createRule | public Rule createRule(java.util.List body, Fact head)(Code) | | Create a new rule.
the created rule Parameters: body - a list of facts that will become the body of the rule Parameters: head - a fact that will become the head of the rule |
createRule | public Rule createRule(java.util.List body, Fact head, boolean or)(Code) | | Create a new rule.
a new rule Parameters: body - a list facts becoming the body of the rules Parameters: head - the head of the rule Parameters: or - indicates whether the prerequisites are connected by OR |
createRule | public Rule createRule(Fact head)(Code) | | Create a new rule with an empty body.
the created rule Parameters: head - the fact that will become the head of the rule |
createTestCase | public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, boolean expectedResult)(Code) | | Create a new test case.
a new test case Parameters: aQuery - a ground query Parameters: assumptions - some assumptions Parameters: policyToAddAssumptionsToKB - one of the integers in TestCase (TestCase.ON_TOP, TestCase.AT_BOTTOM) Parameters: expectedResult - true or false See Also: org.mandarax.kernel.validation.TestCase |
createTestCase | public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults)(Code) | | Create a new test case.
a new test case Parameters: aQuery - a ground query Parameters: assumptions - some assumptions Parameters: policyToAddAssumptionsToKB - one of the integers in TestCase (TestCase.ON_TOP, TestCase.AT_BOTTOM) Parameters: expectedNumberOfResults - the expected number of results |
createTestCase | public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Map[] expectedReplacements)(Code) | | Create a new test case.
a new test case Parameters: aQuery - a ground query Parameters: assumptions - some assumptions Parameters: policyToAddAssumptionsToKB - one of the integers in TestCase (TestCase.ON_TOP, TestCase.AT_BOTTOM) Parameters: expectedReplacements - an array of expected replacements, each map contains VariableTerm -> Object associations |
createTestCase | public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults, boolean expectedResult, Map[] expectedReplacements)(Code) | | Create a new test case.
Note that the parameters are somehow redundant, expectedResult only makes sense if the query is ground while
expectedReplacements only makes sense if the query contains variables. This is a general purpose
creator that can be used in modules such as ZKB.
a new test case Parameters: aQuery - a ground query Parameters: assumptions - some assumptions Parameters: policyToAddAssumptionsToKB - one of the integers in TestCase (TestCase.ON_TOP, TestCase.AT_BOTTOM) Parameters: expectedNumberOfResults - the expected number of results Parameters: expectedResult - true or false Parameters: expectedReplacements - an array of expected replacements, each map contains VariableTerm -> Object associations |
createVariableTerm | public VariableTerm createVariableTerm(String aName, Class aType)(Code) | | Create a new variable term.
the created variable term Parameters: aName - the name of the variable Parameters: aType - the type of the variable |
getComplexTermImplementationClass | public Class getComplexTermImplementationClass()(Code) | | Return the implementation class for complex terms.
a class |
getConstantTermImplementationClass | public Class getConstantTermImplementationClass()(Code) | | Return the implementation class for constant terms.
a class |
getFactImplementationClass | public Class getFactImplementationClass()(Code) | | Return the implementation class for facts.
a class |
getPrerequisiteImplementationClass | public Class getPrerequisiteImplementationClass()(Code) | | Return the implementation class for prerequisites.
a class |
getQueryImplementationClass | public Class getQueryImplementationClass()(Code) | | Return the implementation class for queries.
a class |
getRuleImplementationClass | public Class getRuleImplementationClass()(Code) | | Return the implementation class for rules.
a class |
getVariableTermImplementationClass | public Class getVariableTermImplementationClass()(Code) | | Return the implementation class for variable terms.
a class |
Methods inherited from org.mandarax.kernel.LogicFactory | abstract public ComplexTerm createComplexTerm(Function aFunction, Term[] terms)(Code)(Java Doc) abstract public ConstantTerm createConstantTerm(Object obj)(Code)(Java Doc) abstract public ConstantTerm createConstantTerm(Object obj, Class type)(Code)(Java Doc) abstract public Prerequisite createCut()(Code)(Java Doc) abstract public Fact createFact(Predicate aPredicate, Term[] terms)(Code)(Java Doc) abstract public Prerequisite createPrerequisite(Predicate aPredicate, Term[] terms, boolean negatedAF)(Code)(Java Doc) abstract public Query createQuery(Fact fact, String name)(Code)(Java Doc) abstract public Query createQuery(Fact[] facts, String name)(Code)(Java Doc) abstract public Rule createRule(java.util.List body, Fact head)(Code)(Java Doc) abstract public Rule createRule(java.util.List body, Fact head, boolean or)(Code)(Java Doc) public Rule createRule(Fact head)(Code)(Java Doc) abstract public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, boolean expectedResult)(Code)(Java Doc) abstract public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults)(Code)(Java Doc) abstract public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, Map[] expectedReplacements)(Code)(Java Doc) abstract public TestCase createTestCase(Query aQuery, ClauseSet[] assumptions, int policyToAddAssumptionsToKB, int expectedNumberOfResults, boolean expectedResult, Map[] expectedReplacements)(Code)(Java Doc) abstract public VariableTerm createVariableTerm(String aName, Class aType)(Code)(Java Doc) abstract public Class getComplexTermImplementationClass()(Code)(Java Doc) abstract public Class getConstantTermImplementationClass()(Code)(Java Doc) public static LogicFactory getDefaultFactory()(Code)(Java Doc) abstract public Class getFactImplementationClass()(Code)(Java Doc) abstract public Class getPrerequisiteImplementationClass()(Code)(Java Doc) abstract public Class getQueryImplementationClass()(Code)(Java Doc) abstract public Class getRuleImplementationClass()(Code)(Java Doc) abstract public Class getVariableTermImplementationClass()(Code)(Java Doc) public void install()(Code)(Java Doc)
|
|
|