|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.constraintsolver.Rule
Rule object to model the attributes and behavior of a constraint rule.
Copyright 2001 OpenCyc.org, 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.testRule()
Field Summary | |
protected CycList |
rule
The constraint rule formula as an OpenCyc query. |
protected java.util.ArrayList |
variables
The collection of CycVariables used in the rule. |
Constructor Summary | |
Rule(CycList rule)
Constructs a new Rule object from a CycList. |
Method Summary | |
java.lang.String |
cyclify()
Returns a cyclified string representation of the rule's formula. |
boolean |
equals(java.lang.Object object)
Returns true if the object equals this object. |
int |
getArity()
Gets the rule's arity, which is the number of variables in this Rule. |
java.lang.Object |
getPredicate()
Returns the predicate of this Rule object. |
CycList |
getRule()
Gets the rule's formula. |
java.util.ArrayList |
getVariables()
Gets the rule's variables. |
boolean |
isVariableDomainPopulatingRule()
Returns true if this is a variable domain populating Rule. |
static java.util.ArrayList |
simplifyRuleExpression(CycList cycList)
Simplifies a rule expression. |
java.lang.String |
toString()
Returns a string representation of the Rule. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected CycList rule
protected java.util.ArrayList variables
Constructor Detail |
public Rule(CycList rule)
String ruleAsString = "(#$isa ?x #$Cathedral)"; Rule rule1 = new Rule (new CycList(ruleAsString));
rule
- the rule's formula, which must be a well formed OpenCyc
query represented by a CycList.Method Detail |
public static java.util.ArrayList simplifyRuleExpression(CycList cycList)
(#$and (
UnitTest.testRule()
public CycList getRule()
public java.util.ArrayList getVariables()
public int getArity()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public java.lang.Object getPredicate()
public boolean isVariableDomainPopulatingRule()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String cyclify()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |