|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.inferencesupport.Literal | +--org.opencyc.inferencesupport.ConstraintRule
ConstraintRule object to model the attributes and behavior of a constraint rule.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
UnitTest.testConstraintRule()
Fields inherited from class org.opencyc.inferencesupport.Literal |
formula, nbrFormulaInstances, NO_SUBSUMPTION, SUBSUMED_BY, SUBSUMES, variables |
Constructor Summary | |
ConstraintRule(CycList formula)
Constructs a new ConstraintRule object from a CycList. |
|
ConstraintRule(java.lang.String formulaString)
Constructs a new ConstraintRule object from a CycList String representation. |
Method Summary | |
java.lang.Object |
clone()
Creates and returns a copy of this ConstraintRule. |
static boolean |
evaluateConstraintRule(CycList instantiatedConstraintRule)
Evaluates the instantiated constraint rule locally without asking OpenCyc. |
ConstraintRule |
instantiate(CycVariable cycVariable,
java.lang.Object value)
Returns a new ConstraintRule which is the result of substituting the given Object value for the given CycVariable. |
boolean |
isExtensionalVariableDomainPopulatingConstraintRule()
Returns true if this is an extensional variable domain populating ConstraintRule. |
boolean |
isVariableDomainPopulatingRule()
Returns true if this is a variable domain populating Rule. |
static int |
numericallyEvaluateExpression(java.lang.Object expression)
Returns the numerical value of the expression. |
static java.util.ArrayList |
simplifyConstraintRuleExpression(CycList cycList)
Simplifies a rule expression. |
Methods inherited from class org.opencyc.inferencesupport.Literal |
compareTo, cyclify, determineSubsumption, equals, gatherVariables, getArguments, getArity, getFormula, getPredicate, getVariables, hasEvaluatableNumericalArgs, hashCode, isAllDifferent, isEvaluatable, isGround, isIrreflexive, isSubsumedBy, isUnary, isValidConstraintRuleExpression, substituteVariable, subsumes, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
compareTo |
Constructor Detail |
public ConstraintRule(java.lang.String formulaString) throws CycApiException
formulaString
- the rule's formula String, which must be a well formed OpenCyc
query represented by a CycList.public ConstraintRule(CycList formula)
String ruleAsString = "(#$isa ?x #$Cathedral)"; ConstraintRule rule1 = new ConstraintRule (cycAccess.makeCycList(ruleAsString));
formula
- the rule's formula, which must be a well formed OpenCyc
query represented by a CycList.Method Detail |
public static java.util.ArrayList simplifyConstraintRuleExpression(CycList cycList) throws java.io.IOException
(#$and (
cycList
- the rule expression that is simplifiedUnitTest.testConstraintRule()
public java.lang.Object clone()
clone
in class java.lang.Object
public static boolean evaluateConstraintRule(CycList instantiatedConstraintRule) throws java.io.IOException
instantiatedConstraintRule
- the fully instantiated constraint rule whose predicates
can be evaluated locally without asking OpenCyc.public static int numericallyEvaluateExpression(java.lang.Object expression) throws java.io.IOException
expression
- the expression to be evaluated which can be a Integer value,
or a CycListpublic boolean isVariableDomainPopulatingRule() throws java.io.IOException, CycApiException
public boolean isExtensionalVariableDomainPopulatingConstraintRule() throws java.io.IOException, CycApiException
public ConstraintRule instantiate(CycVariable cycVariable, java.lang.Object value)
cycVariable
- the variable for substitutionvalue
- the value which is substituted for each occurrance of the variable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |