nars.inference
Class CompositionalRules

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

public final class CompositionalRules
extends java.lang.Object

Compound term composition and decomposition rules, with two premises.

Forward inference only, except the last group (dependent variable introduction) can also be used backward.


Constructor Summary
CompositionalRules()
           
 
Method Summary
(package private) static void abdVarDepOuter(CompoundTerm compound, Term component, boolean compoundTask)
          {(&&, <#x() --> S>, <#x() --> P>>, P>} |- S>
(package private) static void composeCompound(Sentence taskSentence, Judgment belief, int index)
          { M>,

M>} |- {<(S|P) ==> M>, <(S&P) ==> M>, <(S-P) ==> M>, <(P-S) ==> M>}

private static void decomposeCompound(CompoundTerm compound, Term component, Term term1, int index, boolean compoundTask)
          {<(S|P) ==> M>,

M>} |- M>

(package private) static void decomposeStatement(CompoundTerm compound, Term component, boolean compoundTask)
          {(||, S, P), P} |- S {(&&, S, P), P} |- S
private static Conjunction introVarDep(Statement premise1, Statement premise2, int index)
          { S>, P>} |- (&&, <#x() --> S>, <#x() --> P>>
(package private) static void introVarDepInner(CompoundTerm compound, Term component, Term premise)
          Introduce a dependent variable in an inner-layer conjunction
private static void introVarDepOuter(Statement premise1, Statement premise2, int index)
          Introduce a dependent variable in an outer-layer conjunction
private static void processComposed(Statement statement, Term subject, Term predicate, TruthValue truth)
          Finish composing compound term
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositionalRules

public CompositionalRules()
Method Detail

composeCompound

static void composeCompound(Sentence taskSentence,
                            Judgment belief,
                            int index)
{ M>,

M>} |- {<(S|P) ==> M>, <(S&P) ==> M>, <(S-P) ==> M>, <(P-S) ==> M>}

Parameters:
taskSentence - The first premise
belief - The second premise
index - The location of the shared term

processComposed

private static void processComposed(Statement statement,
                                    Term subject,
                                    Term predicate,
                                    TruthValue truth)
Finish composing compound term

Parameters:
statement - Type of the content
subject - Subject of content
predicate - Predicate of content
truth - TruthValue of the content

decomposeCompound

private static void decomposeCompound(CompoundTerm compound,
                                      Term component,
                                      Term term1,
                                      int index,
                                      boolean compoundTask)
{<(S|P) ==> M>,

M>} |- M>

Parameters:
compound - The compound term to be decomposed
component - The part of the compound to be removed
term1 - The other term in the content
index - The location of the shared term: 0 for subject, 1 for predicate
compoundTask - Whether the compound comes from the task

decomposeStatement

static void decomposeStatement(CompoundTerm compound,
                               Term component,
                               boolean compoundTask)
{(||, S, P), P} |- S {(&&, S, P), P} |- S

Parameters:
compound - The compound term to be decomposed
component - The part of the compound to be removed
compoundTask - Whether the compound comes from the task

introVarDep

private static Conjunction introVarDep(Statement premise1,
                                       Statement premise2,
                                       int index)
{ S>, P>} |- (&&, <#x() --> S>, <#x() --> P>>

Parameters:
premise1 - The first premise P>
premise2 - The second premise P>
index - The location of the shared term: 0 for subject, 1 for predicate

introVarDepOuter

private static void introVarDepOuter(Statement premise1,
                                     Statement premise2,
                                     int index)
Introduce a dependent variable in an outer-layer conjunction

Parameters:
premise1 - The first premise S>
premise2 - The second premise P>
index - The location of the shared term: 0 for subject, 1 for predicate

introVarDepInner

static void introVarDepInner(CompoundTerm compound,
                             Term component,
                             Term premise)
Introduce a dependent variable in an inner-layer conjunction

Parameters:
compound - The compound containing the first premise
component - The first premise S>
premise - The second premise P>

abdVarDepOuter

static void abdVarDepOuter(CompoundTerm compound,
                           Term component,
                           boolean compoundTask)
{(&&, <#x() --> S>, <#x() --> P>>, P>} |- S>

Parameters:
compound - The compound term to be decomposed
component - The part of the compound to be removed
compoundTask - Whether the compound comes from the task