|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.inferencesupport.HornClause
Provides attribute and behavior for a horn clause assertion, used during backchaining inference. Horn clauses are the result of OpenCyc's canonicalization of implication assertions and consist of two parts, both of which are logical formulae. The first part is the antecedant and the second part is the consequent. Backchaining inference employs horn clauses when seeking to prove a logical formula. If the formula can be unified with the consequent of a horn clause, then the search for a proof can be transformed into a search for a proof of the logical formulae which constitute the horn clause antecedant. This logical inference step in a proof is named modus ponens.
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.
Constructor Summary | |
HornClause()
Constructs a new (empty) HornClause object. |
|
HornClause(java.util.ArrayList antecedantConjuncts,
QueryLiteral consequent)
Constructs a new HornClause object from the given antecedant conjuncts and consequent. |
|
HornClause(CycList hornClause)
Constructs a new HornClause object from the given CycList representation. |
|
HornClause(Literal rule)
Constructs a new HornClause object from the given implication ConstraintRule. |
|
HornClause(java.lang.String hornClauseString)
Constructs a new HornClause object from the given cyclified string representation. |
Method Summary | |
java.lang.Object |
clone()
Creates and returns a copy of this QueryLiteral suitable for mutation. |
protected java.lang.String |
cyclify()
Returns the cyclified string representation of the HornClause. |
boolean |
equals(java.lang.Object object)
Returns true if the object equals this object. |
protected void |
gatherVariables()
Gathers the variables used in the antecedant conjuncts and in the consequent of the horn clause. |
java.util.ArrayList |
getAntecedantConjuncts()
Returns the antecedant conjuncts for this horn clause. |
QueryLiteral |
getConsequent()
Returns the consequent for this horn clause. |
java.util.ArrayList |
getVariables()
Returns the variables for this horn clause. |
static boolean |
isValidHornExpression(CycList cycList)
Returns true iff the given CycList is a valid representation of a constraint horn clause. |
static boolean |
isValidHornExpression(java.lang.String string)
Returns true iff the given CycList is a valid representation of a constraint horn clause. |
void |
renameVariables(java.util.ArrayList otherVariables,
int verbosity)
Renames variables that occur in the given list of other variables. |
boolean |
substituteVariable(CycVariable variable,
java.lang.Object newObject,
int verbosity)
Substitutes an object for a variable, returning true iff all argument type constraints are satisfied, otherwise false is returned at the point where the argument type conflict is found. |
java.lang.String |
toString()
Returns the string representation of the HornClause. |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HornClause()
public HornClause(java.util.ArrayList antecedantConjuncts, QueryLiteral consequent)
public HornClause(Literal rule)
rule
- the given implication ConstraintRulepublic HornClause(java.lang.String hornClauseString) throws CycApiException
hornClauseString
- the cyclified string representation of the horn clausepublic HornClause(CycList hornClause)
cycList
- the CycList representation of the horn clauseMethod Detail |
public java.util.ArrayList getAntecedantConjuncts()
public QueryLiteral getConsequent()
public java.util.ArrayList getVariables()
protected void gatherVariables()
public void renameVariables(java.util.ArrayList otherVariables, int verbosity) throws java.io.IOException, CycApiException
otherVariables
- the other variables with whom this horn clause will have no
variables in commonverbosity
- a verbosity indicator, 0 = quiet ... 9 = most diagnostic outputpublic boolean substituteVariable(CycVariable variable, java.lang.Object newObject, int verbosity) throws java.io.IOException, CycApiException
oldVariable
- the variable to replacedverbosity
- a verbosity indicator, 0 = quiet ... 9 = most diagnostic outputpublic boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- the object for comparisonpublic java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String cyclify()
public static boolean isValidHornExpression(java.lang.String string) throws java.io.IOException, CycApiException
string
- the representation of a constraint horn clause to be validatedpublic static boolean isValidHornExpression(CycList cycList) throws java.io.IOException, CycApiException
cycList
- the representation of a constraint horn clause to be validated
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |