public final class StructuralRules extends Object
Constructor | Description |
---|---|
StructuralRules() |
Modifier and Type | Method | Description |
---|---|---|
protected static boolean |
contraposition(Statement statement,
Sentence sentence,
DerivationContext nal) |
{<A ==> B>, A@(--, A)} |- <(--, B) ==> (--, A)>
|
private static void |
createSequenceTaskByRange(Conjunction sourceConjunction,
int inclusiveStartIndex,
int inclusiveEndIndex,
DerivationContext nal) |
Derives a sub-sequence of a sequence based on a (inclusive) index range
|
private static void |
deriveSequenceTask(DerivationContext nal,
Conjunction parentConj,
Term[] total,
TruthValue truth) |
Derives a sequence task, inheriting properties from parentConj
|
(package private) static void |
flattenSequence(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(#,(#,A,B),C), (#,A,B)@(#,(#,A,B), C)} |- (#,A,B,C)
(same for &/)
|
(package private) static void |
groupSequence(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(#,A,B,C,D,E), C@(#,A,B,C,D,E)} |- (#,(#,A,B),C,D,E), (#,A,B,C,(#,D,E))
Group sequence left and right
Works for all conjunctions
|
static void |
seqToImage(Conjunction conj,
int index,
DerivationContext nal) |
|
(package private) static void |
splitConjunctionApart(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(#,A,B,C,D,E), C@(#,A,B,C,D,E)} |- (#,A,B,C), (#,C,D,E)
Works for all conjunctions
|
(package private) static void |
structuralCompose1(CompoundTerm compound,
short index,
Statement statement,
DerivationContext nal) |
{<S --> P>, P@(P|Q)} |- <S --> (P|Q)>
|
(package private) static void |
structuralCompose2(CompoundTerm compound,
short index,
Statement statement,
short side,
DerivationContext nal) |
{<S --> P>, S@(S&T)} |- <(S&T) --> (P&T)>
{<S --> P>, S@(M-S)} |- <(M-P) --> (M-S)> |
(package private) static boolean |
structuralCompound(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(&&, A, B), A@(&&, A, B)} |- A,
or answer (&&, A, B)? using A {(||, A, B), A@(||, A, B)} |- A, or answer (||, A, B)? using A |
(package private) static void |
structuralDecompose1(CompoundTerm compound,
short index,
Statement statement,
DerivationContext nal) |
{<(S|T) --> P>, S@(S|T)} |- <S --> P>
{<S --> (P&T)>, P@(P&T)} |- <S --> P> |
(package private) static void |
structuralDecompose2(Statement statement,
int index,
DerivationContext nal) |
{<(S*T) --> (P*T)>, S@(S*T)} |- <S --> P>
|
private static void |
structuralStatement(Term subject,
Term predicate,
int order,
TruthValue truth,
DerivationContext nal) |
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 |
takeOutFromConjunction(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(&&,A,B,C), B@(&&,A,B,C)} |- (&&,A,C)
Works for all conjunctions
|
static void |
transformNegation(CompoundTerm content,
DerivationContext nal) |
{A, A@(--, A)} |- (--, A)
|
private static void |
transformPredicatePI(short index,
Term subject,
CompoundTerm predicate,
DerivationContext nal) |
Equivalent transformation between products and images when the predicate
is a compound
{<(*, S, M) --> P>, S@(*, S, M)} |- <S --> (/, P, _, M)>
{<S --> (/, P, _, M)>, P@(/, P, _, M)} |- <(*, S, M) --> P> {<S --> (/, P, _, M)>, M@(/, P, _, M)} |- <M --> (/, P, S, _)> |
(package private) static void |
transformProductImage(Inheritance inh,
CompoundTerm oldContent,
short[] indices,
DerivationContext nal) |
Equivalent transformation between products and images
{<(*, S, M) --> P>, S@(*, S, M)} |- <S --> (/, P, _, M)>
{<S --> (/, P, _, M)>, P@(/, P, _, M)} |- <(*, S, M) --> P> {<S --> (/, P, _, M)>, M@(/, P, _, M)} |- <M --> (/, P, S, _)> |
(package private) static void |
transformSetRelation(CompoundTerm compound,
Statement statement,
short side,
DerivationContext nal) |
{<S --> {P}>} |- <S <-> {P}>
|
private static void |
transformSubjectPI(short index,
CompoundTerm subject,
Term predicate,
DerivationContext nal) |
Equivalent transformation between products and images when the subject is
a compound
{<(*, S, M) --> P>, S@(*, S, M)} |- <S --> (/, P, _, M)>
{<S --> (/, P, _, M)>, P@(/, P, _, M)} |- <(*, S, M) --> P> {<S --> (/, P, _, M)>, M@(/, P, _, M)} |- <M --> (/, P, S, _)> |
static void structuralCompose2(CompoundTerm compound, short index, Statement statement, short side, DerivationContext nal)
compound
- The compound termindex
- The location of the indicated term in the compoundstatement
- The premiseside
- The location of the indicated term in the premisenal
- Reference to the memorystatic void structuralDecompose2(Statement statement, int index, DerivationContext nal)
statement
- The premisenal
- Reference to the memoryprivate static boolean switchOrder(CompoundTerm compound, short index)
compound
- The compound termindex
- The location of focus in the compoundstatic void structuralCompose1(CompoundTerm compound, short index, Statement statement, DerivationContext nal)
compound
- The compound termindex
- The location of the indicated term in the compoundstatement
- The premisenal
- Reference to the memorystatic void structuralDecompose1(CompoundTerm compound, short index, Statement statement, DerivationContext nal)
compound
- The compound termindex
- The location of the indicated term in the compoundstatement
- The premisenal
- Reference to the memoryprivate static void structuralStatement(Term subject, Term predicate, int order, TruthValue truth, DerivationContext nal)
subject
- The subject of the new taskpredicate
- The predicate of the new tasktruth
- The truth value of the new tasknal
- Reference to the memorystatic void transformSetRelation(CompoundTerm compound, Statement statement, short side, DerivationContext nal)
compound
- The set compoundstatement
- The premiseside
- The location of the indicated term in the premisenal
- Reference to the memorystatic void transformProductImage(Inheritance inh, CompoundTerm oldContent, short[] indices, DerivationContext nal)
inh
- An Inheritance statementoldContent
- The whole contentindices
- The indices of the TaskLinknal
- Reference to the memoryprivate static void transformSubjectPI(short index, CompoundTerm subject, Term predicate, DerivationContext nal)
subject
- The subject termpredicate
- The predicate termnal
- Reference to the memoryprivate static void transformPredicatePI(short index, Term subject, CompoundTerm predicate, DerivationContext nal)
subject
- The subject termpredicate
- The predicate termnal
- Reference to the memorystatic void flattenSequence(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The premisecomponent
- The recognized component in the premisecompoundTask
- Whether the compound comes from the tasknal
- Reference to the memorystatic void takeOutFromConjunction(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The premisecomponent
- The recognized component in the premisecompoundTask
- Whether the compound comes from the tasknal
- Reference to the memorystatic void splitConjunctionApart(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The premisecomponent
- The recognized component in the premisecompoundTask
- Whether the compound comes from the tasknal
- Reference to the memorystatic void groupSequence(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The premisecomponent
- The recognized component in the premisecompoundTask
- Whether the compound comes from the tasknal
- Reference to the memoryprivate static void createSequenceTaskByRange(Conjunction sourceConjunction, int inclusiveStartIndex, int inclusiveEndIndex, DerivationContext nal)
sourceConjunction
- The conjunction we take out a certain part frominclusiveStartIndex
- The start index (inclusive)inclusiveEndIndex
- The end index (inclusive)nal
- The derivation contextprivate static void deriveSequenceTask(DerivationContext nal, Conjunction parentConj, Term[] total, TruthValue truth)
nal
- The derivation contexttotal
- The sub-terms the conjunction should be created fromtruth
- The truth value of the derivationpublic static void seqToImage(Conjunction conj, int index, DerivationContext nal)
static boolean structuralCompound(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compound
- The premisecomponent
- The recognized component in the premisecompoundTask
- Whether the compound comes from the tasknal
- Reference to the memorypublic static void transformNegation(CompoundTerm content, DerivationContext nal)
content
- The premisenal
- Reference to the memoryprotected static boolean contraposition(Statement statement, Sentence sentence, DerivationContext nal)
statement
- The premisenal
- Reference to the memoryCopyright © 2020 OpenNARS. All rights reserved.