|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.constraintsolver.ArgumentTypeConstrainer
Provides argument type consistency checking for candidate backchaining rules, and also provides additional constraint rules derived from argument type constraints on the restricting constraint rules using the input constraint rules as a starting point. No additional rules are derived for domain populating rules because their purpose is not to restrict permitted variable bindings, but to populate the domains with values.
Argument type constraints are retrieved for candidate rules during backchaining. For variables mentioned in both the antecedant and consequent portions of the candidate backchain rule, the argument type constraints on these variables can rule out candidates for backchaining if associated collections are proven disjoint. The ArgumentTypeConstrainer provides the additional constraint rules as a preparation step before beginning the forward checking search for permitted bindings.
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.
Field Summary | |
protected ConstraintProblem |
constraintProblem
Reference to the parent ConstraintProblem object. |
protected int |
verbosity
Sets verbosity of the constraint solver output. |
Constructor Summary | |
ArgumentTypeConstrainer(ConstraintProblem constraintProblem)
Constructs a new ArgumentTypeConstrainer object given the parent ConstraintProblem object. |
Method Summary | |
protected java.util.ArrayList |
gatherPredicateVariableArgConstaints(CycList expression)
Returns the argument type constraint rules for the variables within the given expression. |
boolean |
isUnaryRuleConsistent(ConstraintRule unaryRule,
CycVariable cycVariable)
Returns true iff the given unary constraint rule is consistent with the previously accepted unary constraints on the given variable. |
java.util.ArrayList |
retrieveArgGenls(CycConstant predicate,
int argPosition,
CycVariable cycVariable)
Retrieves the #$argGenl constraint rules for the given predicate at the given argument position, indexed base 1. |
java.util.ArrayList |
retrieveArgNIsas(CycConstant predicate,
int argPosition,
CycVariable cycVariable)
Retrieves the #$argNIsa constraint rules for the given predicate at the given argument position, indexed base 1. |
java.util.ArrayList |
retrieveArgumentTypeConstraintRules(ConstraintRule rule)
Retrieves the argument type constraint rules for the given rule. |
java.util.ArrayList |
retrieveArgumentTypeConstraintRules(CycConstant predicate,
int argPosition,
CycVariable cycVariable)
Retrieves the argument type constraint rules for the given predicate at the given argument position, indexed base 1. |
void |
setVerbosity(int verbosity)
Sets verbosity of the constraint solver output. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int verbosity
protected ConstraintProblem constraintProblem
Constructor Detail |
public ArgumentTypeConstrainer(ConstraintProblem constraintProblem)
constraintProblem
- the parent constraint problemMethod Detail |
public java.util.ArrayList retrieveArgumentTypeConstraintRules(ConstraintRule rule) throws java.io.IOException, CycApiException
predicate
- the CycConstant which is the predicate of a simple ruleargPosition
- the argument position, indexed base 1, for which the argument
type constraint rules are soughtcycVariable
- the variable used to construct the returned rulesprotected java.util.ArrayList gatherPredicateVariableArgConstaints(CycList expression) throws java.io.IOException, CycApiException
expression
- the expression which possibly contains variablespublic java.util.ArrayList retrieveArgumentTypeConstraintRules(CycConstant predicate, int argPosition, CycVariable cycVariable) throws java.io.IOException, CycApiException
predicate
- the CycConstant which is the predicate of a simple ruleargPosition
- the argument position, indexed base 1, for which the argument
type constraint rules are soughtcycVariable
- the variable used to construct the returned rulespublic java.util.ArrayList retrieveArgNIsas(CycConstant predicate, int argPosition, CycVariable cycVariable) throws java.io.IOException, CycApiException
predicate
- the CycConstant which is the predicate of a simple ruleargPosition
- the argument position, indexed base 1, for which the argument
type constraint rules are soughtcycVariable
- the variable used to construct the returned rulespublic java.util.ArrayList retrieveArgGenls(CycConstant predicate, int argPosition, CycVariable cycVariable) throws java.io.IOException, java.net.UnknownHostException, CycApiException
predicate
- the CycConstant which is the predicate of a simple ruleargPosition
- the argument position, indexed base 1, for which the argument
type constraint rules are soughtcycVariable
- the variable used to construct the returned rulespublic boolean isUnaryRuleConsistent(ConstraintRule unaryRule, CycVariable cycVariable) throws java.io.IOException, CycApiException
(#$isa variable collection)
(#$genls variable collection)
unaryRule
- the unary constraint rule whose consistency is in questioncycVariable
- the variable to which the unary constraint is checked for consistencypublic void setVerbosity(int verbosity)
verbosity
- 0 --> quiet ... 9 -> maximum diagnostic input
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |