public class RuleTables extends Object
Modifier and Type | Class | Description |
---|---|---|
(package private) static class |
RuleTables.EnumFigureSide |
Constructor | Description |
---|---|
RuleTables() |
Modifier and Type | Method | Description |
---|---|---|
private static void |
applyRuleTable(TaskLink tLink,
TermLink bLink,
DerivationContext nal,
Task task,
Sentence taskSentence,
Term taskTerm,
Term beliefTerm,
Sentence belief) |
|
private static void |
asymmetricAsymmetric(Sentence taskSentence,
Sentence belief,
int figure,
DerivationContext nal) |
Syllogistic rules whose both premises are on the same asymmetric relation
|
private static void |
asymmetricSymmetric(Sentence asym,
Sentence sym,
int figure,
DerivationContext nal) |
Syllogistic rules whose first premise is on an asymmetric relation, and
the second on a symmetric relation
|
private static void |
componentAndStatement(CompoundTerm compound,
short index,
Statement statement,
short side,
DerivationContext nal) |
Inference between a component term (of the current term) and a statement
|
private static void |
compoundAndCompound(CompoundTerm taskTerm,
CompoundTerm beliefTerm,
int tindex,
int bindex,
DerivationContext nal) |
Inference between two compound terms
|
private static void |
compoundAndSelf(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
Inference between a compound term and a component of it
|
private static void |
compoundAndStatement(CompoundTerm compound,
short index,
Statement statement,
short side,
Term beliefTerm,
DerivationContext nal) |
Inference between a compound term and a statement
|
private static void |
conditionalDedIndWithVar(Sentence conditionalSentence,
Implication conditional,
short index,
Statement statement,
short side,
DerivationContext nal) |
Conditional deduction or induction, with variable unification
|
private static void |
detachmentWithVar(Sentence originalMainSentence,
Sentence subSentence,
int index,
boolean checkTermAgain,
DerivationContext nal) |
|
private static void |
detachmentWithVar(Sentence originalMainSentence,
Sentence subSentence,
int index,
DerivationContext nal) |
The detachment rule, with variable unification
|
private static void |
goalFromQuestion(Task task,
Term taskTerm,
DerivationContext nal) |
|
static void |
goalFromWantBelief(Task task,
short tIndex,
short bIndex,
Term taskTerm,
DerivationContext nal,
Term beliefTerm) |
|
private static int |
indexToFigure(TLink link1,
TLink link2) |
Decide the figure of syllogism according to the locations of the common
term in the premises
|
static void |
reason(TaskLink tLink,
TermLink bLink,
DerivationContext nal) |
Entry point of the inference engine
|
private static Statement.EnumStatementSide |
retSideFromFigure(int figure,
RuleTables.EnumFigureSide sideOfFigure) |
converts the side of a figure to a zero based index - which determines the side of the Statement
a figure is a encoding for the sides
|
private static void |
syllogisms(TaskLink tLink,
TermLink bLink,
Term taskTerm,
Term beliefTerm,
DerivationContext nal) |
Meta-table of syllogistic rules, indexed by the content classes of the
taskSentence and the belief
|
private static void |
symmetricSymmetric(Sentence belief,
Sentence taskSentence,
int figure,
DerivationContext nal) |
Syllogistic rules whose both premises are on the same symmetric relation
|
static void |
transformTask(TaskLink tLink,
DerivationContext nal) |
The TaskLink is of type TRANSFORM, and the conclusion is an equivalent
transformation
|
public static void reason(TaskLink tLink, TermLink bLink, DerivationContext nal)
tLink
- The selected TaskLink, which will provide a taskbLink
- The selected TermLink, which may provide a beliefprivate static void applyRuleTable(TaskLink tLink, TermLink bLink, DerivationContext nal, Task task, Sentence taskSentence, Term taskTerm, Term beliefTerm, Sentence belief)
public static void goalFromWantBelief(Task task, short tIndex, short bIndex, Term taskTerm, DerivationContext nal, Term beliefTerm)
private static void goalFromQuestion(Task task, Term taskTerm, DerivationContext nal)
private static void syllogisms(TaskLink tLink, TermLink bLink, Term taskTerm, Term beliefTerm, DerivationContext nal)
tLink
- The link to taskbLink
- The link to belieftaskTerm
- The content of taskbeliefTerm
- The content of beliefnal
- Reference to the memoryprivate static final int indexToFigure(TLink link1, TLink link2)
link1
- The link to the first premiselink2
- The link to the second premiseprivate static void asymmetricAsymmetric(Sentence taskSentence, Sentence belief, int figure, DerivationContext nal)
taskSentence
- The taskSentence in the taskbelief
- The judgment in the belieffigure
- The location of the shared termnal
- Reference to the memoryprivate static void asymmetricSymmetric(Sentence asym, Sentence sym, int figure, DerivationContext nal)
asym
- The asymmetric premisesym
- The symmetric premisefigure
- The location of the shared termnal
- Reference to the memoryprivate static Statement.EnumStatementSide retSideFromFigure(int figure, RuleTables.EnumFigureSide sideOfFigure)
figure
- figure encoding as 11 or 12 or 21 or 22sideOfFigure
- sideprivate static void symmetricSymmetric(Sentence belief, Sentence taskSentence, int figure, DerivationContext nal)
belief
- The premise that comes from a belieftaskSentence
- The premise that comes from a taskfigure
- The location of the shared termnal
- Reference to the memoryprivate static void detachmentWithVar(Sentence originalMainSentence, Sentence subSentence, int index, DerivationContext nal)
originalMainSentence
- The premise that is an Implication or
EquivalencesubSentence
- The premise that is the subject or predicate of the
first oneindex
- The location of the second premise in the firstnal
- Reference to the memoryprivate static void detachmentWithVar(Sentence originalMainSentence, Sentence subSentence, int index, boolean checkTermAgain, DerivationContext nal)
private static void conditionalDedIndWithVar(Sentence conditionalSentence, Implication conditional, short index, Statement statement, short side, DerivationContext nal)
conditional
- The premise that is an Implication with a Conjunction
as conditionindex
- The location of the shared term in the conditionstatement
- The second premise that is a statementside
- The location of the shared term in the statementnal
- Reference to the memoryprivate static void compoundAndSelf(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The compound termcomponent
- The component termcompoundTask
- Whether the compound comes from the tasknal
- Reference to the memoryprivate static void compoundAndCompound(CompoundTerm taskTerm, CompoundTerm beliefTerm, int tindex, int bindex, DerivationContext nal)
taskTerm
- The compound from the taskbeliefTerm
- The compound from the beliefnal
- Reference to the memoryprivate static void compoundAndStatement(CompoundTerm compound, short index, Statement statement, short side, Term beliefTerm, DerivationContext nal)
compound
- The compound termindex
- The location of the current term in the compoundstatement
- The statementside
- The location of the current term in the statementbeliefTerm
- The content of the beliefnal
- Reference to the memoryprivate static void componentAndStatement(CompoundTerm compound, short index, Statement statement, short side, DerivationContext nal)
compound
- The compound termindex
- The location of the current term in the compoundstatement
- The statementside
- The location of the current term in the statementnal
- Reference to the memorypublic static void transformTask(TaskLink tLink, DerivationContext nal)
tLink
- The task linknal
- Reference to the memoryCopyright © 2020 OpenNARS. All rights reserved.