nars.inference
Class RuleTables

java.lang.Object
  extended by nars.inference.RuleTables

public final class RuleTables
extends java.lang.Object

Table of inference rules, indexed by the TermLinks for the task and the belief. Used in indirective processing of a task, to dispatch inference cases to the relevant inference rules.


Constructor Summary
RuleTables()
           
 
Method Summary
private static void asymmetricAsymmetric(Sentence sentence, Judgment belief, int figure)
          Syllogistic rules whose both premises are on the same asymmetric relation
private static void asymmetricSymmetric(Sentence asym, Sentence sym, int figure)
          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)
          Inference between a component term (of the current term) and a statement
private static void compoundAndCompound(CompoundTerm taskTerm, CompoundTerm beliefTerm)
          Inference between two compound terms
private static void compoundAndSelf(CompoundTerm compound, Term component, boolean compoundTask)
          Inference between a compound term and a component of it
private static void compoundAndStatement(CompoundTerm compound, short index, Statement statement, short side, Term beliefTerm)
          Inference between a compound term and a statement
private static void conditionalDedIndWithVar(Implication conditional, short index, Statement statement, short side)
          Conditional deduction or induction, with variable unification
private static void detachmentWithVar(Sentence mainSentence, Sentence subSentence, int index)
          The detachment rule, with variable unification
private static int indexToFigure(TermLink link1, TermLink link2)
          Decide the figure of syllogism according to the locations of the common term in the premises
static void reason(TaskLink tLink, TermLink bLink)
          Entry point of the inference engine
private static void syllogisms(TaskLink tLink, TermLink bLink, Term taskTerm, Term beliefTerm)
          Meta-table of syllogistic rules, indexed by the content classes of the taskSentence and the belief
private static void symmetricSymmetric(Judgment belief, Sentence taskSentence, int figure)
          Syllogistic rules whose both premises are on the same symmetric relation
static void transformTask(Task task, TaskLink tLink)
          The TaskLink is of type TRANSFORM, and the conclusion is an equivalent transformation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuleTables

public RuleTables()
Method Detail

reason

public static void reason(TaskLink tLink,
                          TermLink bLink)
Entry point of the inference engine

Parameters:
tLink - The selected TaskLink, which will provide a task
bLink - The selected TermLink, which may provide a belief

syllogisms

private static void syllogisms(TaskLink tLink,
                               TermLink bLink,
                               Term taskTerm,
                               Term beliefTerm)
Meta-table of syllogistic rules, indexed by the content classes of the taskSentence and the belief

Parameters:
tLink - The link to task
bLink - The link to belief
taskTerm - The content of task
beliefTerm - The content of belief

indexToFigure

private static int indexToFigure(TermLink link1,
                                 TermLink link2)
Decide the figure of syllogism according to the locations of the common term in the premises

Parameters:
link1 - The link to the first premise
link2 - The link to the second premise
Returns:
The figure of the syllogism, one of the four: 11, 12, 21, or 22

asymmetricAsymmetric

private static void asymmetricAsymmetric(Sentence sentence,
                                         Judgment belief,
                                         int figure)
Syllogistic rules whose both premises are on the same asymmetric relation

Parameters:
sentence - The taskSentence in the task
belief - The judgment in the belief
figure - The location of the shared term

asymmetricSymmetric

private static void asymmetricSymmetric(Sentence asym,
                                        Sentence sym,
                                        int figure)
Syllogistic rules whose first premise is on an asymmetric relation, and the second on a symmetric relation

Parameters:
asym - The asymmetric premise
sym - The symmetric premise
figure - The location of the shared term

symmetricSymmetric

private static void symmetricSymmetric(Judgment belief,
                                       Sentence taskSentence,
                                       int figure)
Syllogistic rules whose both premises are on the same symmetric relation

Parameters:
belief - The premise that comes from a belief
taskSentence - The premise that comes from a task
figure - The location of the shared term

detachmentWithVar

private static void detachmentWithVar(Sentence mainSentence,
                                      Sentence subSentence,
                                      int index)
The detachment rule, with variable unification

Parameters:
mainSentence - The premise that is an Implication or Equivalence
subSentence - The premise that is the subject or predicate of the first one
index - The location of the second premise in the first

conditionalDedIndWithVar

private static void conditionalDedIndWithVar(Implication conditional,
                                             short index,
                                             Statement statement,
                                             short side)
Conditional deduction or induction, with variable unification

Parameters:
conditional - The premise that is an Implication with a Conjunction as condition
index - The location of the shared term in the condition
statement - The second premise that is a statement
side - The location of the shared term in the statement

compoundAndSelf

private static void compoundAndSelf(CompoundTerm compound,
                                    Term component,
                                    boolean compoundTask)
Inference between a compound term and a component of it

Parameters:
compound - The compound term
component - The component term
compoundTask - Whether the compound comes from the task

compoundAndCompound

private static void compoundAndCompound(CompoundTerm taskTerm,
                                        CompoundTerm beliefTerm)
Inference between two compound terms

Parameters:
taskTerm - The compound from the task
beliefTerm - The compound from the belief

compoundAndStatement

private static void compoundAndStatement(CompoundTerm compound,
                                         short index,
                                         Statement statement,
                                         short side,
                                         Term beliefTerm)
Inference between a compound term and a statement

Parameters:
compound - The compound term
index - The location of the current term in the compound
statement - The statement
side - The location of the current term in the statement
beliefTerm - The content of the belief

componentAndStatement

private static void componentAndStatement(CompoundTerm compound,
                                          short index,
                                          Statement statement,
                                          short side)
Inference between a component term (of the current term) and a statement

Parameters:
compound - The compound term
index - The location of the current term in the compound
statement - The statement
side - The location of the current term in the statement

transformTask

public static void transformTask(Task task,
                                 TaskLink tLink)
The TaskLink is of type TRANSFORM, and the conclusion is an equivalent transformation

Parameters:
task - The task
tLink - The task link