nars.inference
Class StructuralRules

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

public final class StructuralRules
extends java.lang.Object

Single-premise inference rules involving compound terms. Input are one sentence (the premise) and one TermLink (indicating a component)


Constructor Summary
StructuralRules()
           
 
Method Summary
(package private) static void contraposition(Statement statement)
          { B>, A@(--, A)} |- <(--, B) ==> (--, A)>
(package private) static void structuralCompose1(CompoundTerm compound, short index, Statement statement)
          { P>, P@(P&Q)} |- (P&Q)>
(package private) static void structuralCompose2(CompoundTerm compound, short index, Statement statement, short side)
          { P>, S@(S&T)} |- <(S&T) --> (P&T)> { P>, S@(M-S)} |- <(M-P) --> (M-S)>
(package private) static void structuralCompound(CompoundTerm compound, Term component, boolean compoundTask)
          {(&&, A, B), A@(&&, A, B)} |- A {(||, A, B), A@(||, A, B)} |- A
(package private) static void structuralDecompose1(CompoundTerm compound, short index, Statement statement)
          {<(S&T) --> P>, S@(S&T)} |- P>
(package private) static void structuralDecompose2(Statement statement)
          {<(S&T) --> (P&T)>, S@(S&T)} |- P>
private static void structuralStatement(Term subject, Term predicate, TruthValue truth)
          Common final operations of the above two methods
private static boolean switchOrder(CompoundTerm compound, short index)
          List the cases where the direction of inheritance is revised in conclusion
(package private) static void transformNegation(Term content)
          {A, A@(--, A)} |- (--, A)
(package private) static void transformProductImage(Inheritance inh, CompoundTerm oldContent, short[] indices, Task task)
          Equivalent transformation between products and images {<(*, S, M) --> P>, S@(*, S, M)} |- (/, P, _, M)> { (/, P, _, M)>, P@(/, P, _, M)} |- <(*, S, M) --> P> { (/, P, _, M)>, M@(/, P, _, M)} |- (/, P, S, _)>
(package private) static void transformSetRelation(CompoundTerm compound, Statement statement, short side)
          { {P}>} |- {P}>
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructuralRules

public StructuralRules()
Method Detail

structuralCompose2

static void structuralCompose2(CompoundTerm compound,
                               short index,
                               Statement statement,
                               short side)
{ P>, S@(S&T)} |- <(S&T) --> (P&T)> { P>, S@(M-S)} |- <(M-P) --> (M-S)>

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

structuralDecompose2

static void structuralDecompose2(Statement statement)
{<(S&T) --> (P&T)>, S@(S&T)} |- P>

Parameters:
statement - The premise

switchOrder

private static boolean switchOrder(CompoundTerm compound,
                                   short index)
List the cases where the direction of inheritance is revised in conclusion

Parameters:
compound - The compound term
index - The location of focus in the compound
Returns:
Whether the direction of inheritance should be revised

structuralCompose1

static void structuralCompose1(CompoundTerm compound,
                               short index,
                               Statement statement)
{ P>, P@(P&Q)} |- (P&Q)>

Parameters:
compound - The compound term
index - The location of the indicated term in the compound
statement - The premise

structuralDecompose1

static void structuralDecompose1(CompoundTerm compound,
                                 short index,
                                 Statement statement)
{<(S&T) --> P>, S@(S&T)} |- P>

Parameters:
compound - The compound term
index - The location of the indicated term in the compound
statement - The premise

structuralStatement

private static void structuralStatement(Term subject,
                                        Term predicate,
                                        TruthValue truth)
Common final operations of the above two methods

Parameters:
subject - The subject of the new task
predicate - The predicate of the new task
truth - The truth value of the new task

transformSetRelation

static void transformSetRelation(CompoundTerm compound,
                                 Statement statement,
                                 short side)
{ {P}>} |- {P}>

Parameters:
compound - The set compound
statement - The premise
side - The location of the indicated term in the premise

transformProductImage

static void transformProductImage(Inheritance inh,
                                  CompoundTerm oldContent,
                                  short[] indices,
                                  Task task)
Equivalent transformation between products and images {<(*, S, M) --> P>, S@(*, S, M)} |- (/, P, _, M)> { (/, P, _, M)>, P@(/, P, _, M)} |- <(*, S, M) --> P> { (/, P, _, M)>, M@(/, P, _, M)} |- (/, P, S, _)>

Parameters:
inh - An Inheritance statement
oldContent - The whole content
indices - The indices of the TaskLink
task - The task

structuralCompound

static void structuralCompound(CompoundTerm compound,
                               Term component,
                               boolean compoundTask)
{(&&, A, B), A@(&&, A, B)} |- A {(||, A, B), A@(||, A, B)} |- A

Parameters:
compound - The premise
component - The recognized component in the premise
compoundTask - Whether the compound comes from the task

transformNegation

static void transformNegation(Term content)
{A, A@(--, A)} |- (--, A)

Parameters:
content - The premise

contraposition

static void contraposition(Statement statement)
{ B>, A@(--, A)} |- <(--, B) ==> (--, A)>

Parameters:
statement - The premise