public abstract class DT_Abstract1
extends java.lang.Object
implements java.io.Serializable
Because so many methods are defined at the Domain Theory level, the code files are broken into 4 classes:
DomainTheory
Learned_DT
Modifier and Type | Class and Description |
---|---|
class |
DT_Abstract1.ScoreObj |
Modifier and Type | Field and Description |
---|---|
static boolean |
addrTerms
This global variable records whether the Domain Theory currently in focus concerns
Terms of Address (true) or Terms of Reference (false).
|
static DomainTheory |
current |
java.util.TreeMap<java.lang.String,java.util.ArrayList<Issue>> |
issuesForUser
issuesForUser holds the current set of suggestions for this DT.
|
static java.util.TreeMap |
primitiveCodes |
static java.lang.String[] |
primPredNames |
static java.util.TreeMap |
standardMacroTree |
Constructor and Description |
---|
DT_Abstract1() |
Modifier and Type | Method and Description |
---|---|
void |
addTerm(KinTermDef ktd)
Add a kin term to this domain theory, assuring that no duplicate definitions are
added, but allowing overwrite of temporary auxiliaries.
|
void |
addTerm(KinTermDef ktd,
java.lang.String[] macros)
Add a kin term to this domain theory, assuring that no duplicate definitions are
added, but allowing overwrite of Standard Macro predicates and temporary auxiliaries.
|
static int |
countLeaves(java.util.TreeMap tree)
This method is designed to work on TreeMaps with sub-trees that are
TreeMaps or ArrayLists.
|
boolean |
equivalentLists(java.util.ArrayList<java.lang.Object> list1,
java.util.ArrayList<java.lang.Object> list2) |
void |
fillInNames(Individual ego)
For all the persons in a context, fill in their kinTerm names (relative to Ego)
per this domain theory.
|
abstract boolean |
fit(ClauseBody cb,
Dyad dad) |
boolean |
found(int seqNmbr,
java.util.ArrayList<java.lang.Object> cbList) |
boolean |
foundInSigStr(java.lang.String sigString,
java.lang.String pcStr) |
static java.util.ArrayList<java.lang.Object> |
harvestLeaves(java.util.TreeMap tree) |
boolean |
isEmpty() |
static boolean |
isPrimOrMacro(java.lang.String predName) |
boolean |
isSupersetOf(java.util.ArrayList<java.lang.Object> list1,
java.util.ArrayList<java.lang.Object> list2) |
static java.util.TreeMap |
loadPrimitiveCodes() |
Dyad |
makeExampleDyad(ClauseBody cb,
Context workingCtxt,
java.util.ArrayList<java.lang.Object> egoBag) |
void |
makeExampleGEDCOMFile(java.lang.String fileName,
java.lang.String sex,
Context hypo,
java.lang.String options)
Create a GEDCOM file containing hypothetical people who illustrate each definition of each kinTerm
in this Domain Theory.
|
java.util.ArrayList<java.lang.Object> |
maleAndFemaleCreatedHeThem()
Create one female and one male Ego for the current Context.
|
static java.util.TreeMap |
mergeNestedTrees(java.util.TreeMap tree1,
java.util.TreeMap tree2) |
static java.util.TreeMap |
mergeTrees(java.util.TreeMap tree1,
java.util.TreeMap tree2) |
boolean |
nonTerm(java.lang.String term) |
boolean |
notFound(int seqNmbr,
java.util.ArrayList<java.lang.Object> cbList) |
boolean |
printableBaseTerm(KinTermDef ktd) |
boolean |
printableTerm(KinTermDef ktd) |
java.lang.String |
toSILKString(java.lang.String bacer) |
java.lang.String |
toString() |
void |
toThyFile(java.io.PrintWriter file)
Write a .thy file with all the data from this DomainTheory.
|
public static boolean addrTerms
public static DomainTheory current
public static final java.util.TreeMap standardMacroTree
public static java.lang.String[] primPredNames
public static final java.util.TreeMap primitiveCodes
public java.util.TreeMap<java.lang.String,java.util.ArrayList<Issue>> issuesForUser
public static java.util.TreeMap loadPrimitiveCodes()
public static boolean isPrimOrMacro(java.lang.String predName)
public static java.util.TreeMap mergeTrees(java.util.TreeMap tree1, java.util.TreeMap tree2)
public static java.util.TreeMap mergeNestedTrees(java.util.TreeMap tree1, java.util.TreeMap tree2)
public boolean isEmpty()
public void addTerm(KinTermDef ktd, java.lang.String[] macros) throws KSParsingErrorException
ktd
- the KinTermDef to be addedmacros
- an array of the names of the Standard MacrosKSParsingErrorException
public void addTerm(KinTermDef ktd) throws KSParsingErrorException
ktd
- the KinTermDef to be addedKSParsingErrorException
public void toThyFile(java.io.PrintWriter file) throws KSInternalErrorException
file
- the output fileKSInternalErrorException
public java.lang.String toSILKString(java.lang.String bacer)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean printableTerm(KinTermDef ktd)
public boolean nonTerm(java.lang.String term)
public boolean printableBaseTerm(KinTermDef ktd)
public java.util.ArrayList<java.lang.Object> maleAndFemaleCreatedHeThem()
public void fillInNames(Individual ego) throws KSBadHornClauseException, KSInternalErrorException, KSConstraintInconsistency, KSNoChainOfRelations2Alter, java.lang.ClassNotFoundException
ego
- the person we start from, and basis for all kin termsKSBadHornClauseException
KSInternalErrorException
KSConstraintInconsistency
KSNoChainOfRelations2Alter
java.lang.ClassNotFoundException
public void makeExampleGEDCOMFile(java.lang.String fileName, java.lang.String sex, Context hypo, java.lang.String options) throws KSBadHornClauseException, JavaSystemException, KSInternalErrorException, KSConstraintInconsistency, KSNoChainOfRelations2Alter, java.lang.ClassNotFoundException
fileName
- the filename to create in GEDCOM format.sex
- the gender of Ego in the hypothetical populationhypo
- the hypothetical context.options
- If it contains 'theory' then a file will be written with a full expansion of this
domain theory and some diagnostic information. If it contains 'census' then a printable
listing of all Individuals and Families will be written to a file.KSBadHornClauseException
- if a clause is encountered for which it cannot create an exampleJavaSystemException
- if Java throws a run-time exceptionKSInternalErrorException
- if an internal processing activity occursKSConstraintInconsistency
- if the constraints on a person (imposed by the literals in a clause)
are inconsistent. For example: male(X) and female(X).KSNoChainOfRelations2Alter
- if a clause is encountered with no "path" from Ego to Alter via its literals.
For example: 'foo(Alter,Ego) :- parent(P,Ego), child(Alter,Q).' is wrong.
But 'foo(Alter,Ego) :- parent(P,Ego), sibling(P,Q), child(Alter,Q).' is OK.java.lang.ClassNotFoundException
public static java.util.ArrayList<java.lang.Object> harvestLeaves(java.util.TreeMap tree)
public static int countLeaves(java.util.TreeMap tree)
tree
- a TreeMap to be countedpublic Dyad makeExampleDyad(ClauseBody cb, Context workingCtxt, java.util.ArrayList<java.lang.Object> egoBag) throws KSBadHornClauseException, KSInternalErrorException, KSConstraintInconsistency, java.lang.ClassNotFoundException
KSBadHornClauseException
KSInternalErrorException
KSConstraintInconsistency
java.lang.ClassNotFoundException
public boolean notFound(int seqNmbr, java.util.ArrayList<java.lang.Object> cbList)
public boolean found(int seqNmbr, java.util.ArrayList<java.lang.Object> cbList)
public boolean foundInSigStr(java.lang.String sigString, java.lang.String pcStr)
public boolean equivalentLists(java.util.ArrayList<java.lang.Object> list1, java.util.ArrayList<java.lang.Object> list2)
public boolean isSupersetOf(java.util.ArrayList<java.lang.Object> list1, java.util.ArrayList<java.lang.Object> list2)
public abstract boolean fit(ClauseBody cb, Dyad dad) throws KSBadHornClauseException, KSNoChainOfRelations2Alter, KSInternalErrorException, KSConstraintInconsistency, java.lang.ClassNotFoundException
KSBadHornClauseException
KSNoChainOfRelations2Alter
KSInternalErrorException
KSConstraintInconsistency
java.lang.ClassNotFoundException