public class KinTermDef
extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable
ClauseBody
is composed of Literal
s. A Literal is composed of
a Predicate
and then one or more Argument
s enclosed in parentheses.
When the definitions field holds more than one ClauseBody, then there is more than one way to define this kin term.
Modifier and Type | Method and Description |
---|---|
void |
analyzeFeatures(java.util.ArrayList<java.lang.Object> hcvc,
java.util.ArrayList<java.lang.Object> ivc,
int[] params,
boolean[] boolArray)
This method is called during analysis of the Library's Domain Theories.
|
void |
argValsRemover()
Clear the value field of each ClauseBody in this definition.
|
void |
assureExamplesGenerated(java.util.ArrayList<java.lang.Object> egoBag)
This method is called when we need to be sure that this KTD has been
expanded and all its fields computed during generation.
|
java.util.ArrayList<java.lang.String> |
checkLineLengths(java.util.ArrayList<java.lang.String> input,
java.lang.String pad) |
int |
compareTo(java.lang.Object obj)
Provide a method of comparing 2 KTDs for use in TreeMaps and TreeSets.
|
boolean |
complementaryPreds(java.util.ArrayList<java.lang.Object> misMatches,
ClauseBody cb1,
ClauseBody cb2) |
void |
computeEQCSigs() |
KinTermDef |
deepCopy() |
boolean |
findMergePairs(java.util.ArrayList<java.lang.Object> superPrims,
java.util.ArrayList<java.lang.Object> triple) |
void |
generateExamples(Context ctxt,
java.util.ArrayList<java.lang.Object> egoBag,
Oracle orca)
This method is called to generate examples - in the process it identifies and removes
duplicative clauses and re-numbers them.
|
void |
generateExamples(Context hypo,
java.util.ArrayList<java.lang.Object> egoBag,
Oracle orca,
KinTermDef learnedDef)
This method is called to generate examples for Simulated Data Generation.
|
boolean |
hasDelayFlags() |
boolean |
isEquivalent(KinTermDef otherDef,
java.util.ArrayList<java.lang.Object> refutation) |
java.util.ArrayList<java.lang.Object> |
makeFlags() |
void |
makeSigStrings()
Iterate through the clauses in this definition and compute (via
ClauseBody.structStr the structural signature of each
clause. |
boolean |
maleFemaleMerge(java.util.ArrayList<java.lang.Object> misMatches,
ClauseBody cb1,
ClauseBody cb2) |
void |
multiGenAndSkew(int[] lvlsFound,
boolean[] locals) |
boolean |
reciprocal(int[] lvlsFound) |
void |
retrieveSigExact() |
void |
simplifyClauses() |
java.lang.String |
stdFormLitString(Literal lit)
Return a string representation of a literal, standardizing the arguments as follows:
If the predicate is "not" assume a single negated literal as arg0 and process that as the literal.
|
java.lang.String |
toSILKString(java.lang.String bacer,
boolean writeDT) |
java.lang.String |
toSILKString(java.lang.String bacer,
boolean writeDT,
boolean defsRequired)
Return an XML block representing this definition.
|
java.lang.String |
toString() |
java.lang.String |
toString(int limit) |
java.lang.String |
toString(java.lang.String type,
boolean inclPrim,
boolean inclExt) |
java.util.ArrayList<java.lang.String> |
toStringAList(java.lang.String type,
boolean inclPrim,
boolean inclExt) |
java.lang.String |
toThyString() |
java.lang.String |
toXML(java.lang.String bacer) |
public KinTermDef deepCopy()
public int compareTo(java.lang.Object obj) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
java.lang.ClassCastException
public boolean isEquivalent(KinTermDef otherDef, java.util.ArrayList<java.lang.Object> refutation) throws KSParsingErrorException, JavaSystemException, KSInternalErrorException, java.io.FileNotFoundException, KSConstraintInconsistency, KSBadHornClauseException, KSNoChainOfRelations2Alter, java.lang.ClassNotFoundException
KSParsingErrorException
JavaSystemException
KSInternalErrorException
java.io.FileNotFoundException
KSConstraintInconsistency
KSBadHornClauseException
KSNoChainOfRelations2Alter
java.lang.ClassNotFoundException
public void retrieveSigExact()
public void computeEQCSigs() throws KSInternalErrorException
KSInternalErrorException
public void makeSigStrings() throws KSInternalErrorException
ClauseBody.structStr
the structural signature of each
clause.KSInternalErrorException
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int limit)
public java.lang.String toString(java.lang.String type, boolean inclPrim, boolean inclExt)
public java.util.ArrayList<java.lang.String> toStringAList(java.lang.String type, boolean inclPrim, boolean inclExt)
public java.util.ArrayList<java.lang.String> checkLineLengths(java.util.ArrayList<java.lang.String> input, java.lang.String pad)
public java.lang.String toThyString() throws KSInternalErrorException
KSInternalErrorException
public java.lang.String toXML(java.lang.String bacer)
public java.lang.String toSILKString(java.lang.String bacer, boolean writeDT)
public java.lang.String toSILKString(java.lang.String bacer, boolean writeDT, boolean defsRequired)
bacer
- The basic spacer needed at the head of each line (for pretty printing)writeDT
- true = print the associated DomainTheory.defsRequired
- true = empty definitions not allowed (the default)
An EditInProgress does allow empty definitionspublic void analyzeFeatures(java.util.ArrayList<java.lang.Object> hcvc, java.util.ArrayList<java.lang.Object> ivc, int[] params, boolean[] boolArray) throws KSInternalErrorException
hcvc
- a list to which we will add all the Head Clause Variable Constraints.ivc
- a list to which we will add all the Internal Variable Constraints.params
- 3 ints: 0=RecipCnt, 1=MultiGenCnt, 2=TotalLat.boolArray
- 3 booleans: 0=GenSkewing, 1=StepTerms, 2=UDPs.KSInternalErrorException
public java.lang.String stdFormLitString(Literal lit)
lit
- the literal to be represented.public boolean reciprocal(int[] lvlsFound)
public void multiGenAndSkew(int[] lvlsFound, boolean[] locals)
public void generateExamples(Context hypo, java.util.ArrayList<java.lang.Object> egoBag, Oracle orca, KinTermDef learnedDef) throws KSBadHornClauseException, KSInternalErrorException, KSConstraintInconsistency, java.lang.ClassNotFoundException
hypo
- the SourceDT Context for this DomainTheoryegoBag
- contains at least 1 male and 1 female Individual
who can serve as Ego in definitions.orca
- contains the 'correct answer' for testinglearnedDef
- the KTD which has been learned for this kinTerm (or null)KSBadHornClauseException
KSInternalErrorException
KSConstraintInconsistency
java.lang.ClassNotFoundException
public void generateExamples(Context ctxt, java.util.ArrayList<java.lang.Object> egoBag, Oracle orca) throws KSBadHornClauseException, KSInternalErrorException, KSConstraintInconsistency, java.lang.ClassNotFoundException
ctxt
- the (hypothetical) Context for this DomainTheoryegoBag
- contains at least 1 male and 1 female Individual
who can serve as Ego in definitions.orca
- contains the 'correct answer' for testingKSBadHornClauseException
KSInternalErrorException
KSConstraintInconsistency
java.lang.ClassNotFoundException
public void assureExamplesGenerated(java.util.ArrayList<java.lang.Object> egoBag) throws KSBadHornClauseException, KSInternalErrorException, KSConstraintInconsistency, java.lang.ClassNotFoundException
egoBag
- contains at least 1 male and 1 female Individual
who can serve as Ego in definitions.KSBadHornClauseException
KSInternalErrorException
KSConstraintInconsistency
java.lang.ClassNotFoundException
public void argValsRemover()
public java.util.ArrayList<java.lang.Object> makeFlags()
public boolean hasDelayFlags()
public void simplifyClauses() throws KSInternalErrorException, KSConstraintInconsistency, KSBadHornClauseException, java.lang.ClassNotFoundException
KSInternalErrorException
KSConstraintInconsistency
KSBadHornClauseException
java.lang.ClassNotFoundException
public boolean findMergePairs(java.util.ArrayList<java.lang.Object> superPrims, java.util.ArrayList<java.lang.Object> triple) throws KSInternalErrorException
KSInternalErrorException
public boolean complementaryPreds(java.util.ArrayList<java.lang.Object> misMatches, ClauseBody cb1, ClauseBody cb2) throws KSInternalErrorException
KSInternalErrorException
public boolean maleFemaleMerge(java.util.ArrayList<java.lang.Object> misMatches, ClauseBody cb1, ClauseBody cb2) throws KSInternalErrorException
KSInternalErrorException