public final class CompositionalRules extends Object
New compound terms are introduced only in forward inference, while decompositional rules are also used in backward inference
Constructor | Description |
---|---|
CompositionalRules() |
Modifier and Type | Method | Description |
---|---|---|
static void |
addVariableCandidates(Set<Term> candidates,
Term side,
boolean subject) |
Add the variable candidates that appear as subjects and predicates
|
(package private) static void |
composeCompound(Statement taskContent,
Statement beliefContent,
int index,
DerivationContext nal) |
{<S ==> M>, <P ==> 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,
int order,
DerivationContext nal) |
{<(S|P) ==> M>, <P ==> M>} |- <S ==> M>
|
(package private) static void |
decomposeStatement(CompoundTerm compound,
Term component,
boolean compoundTask,
int index,
DerivationContext nal) |
{(||, S, P), P} |- S {(&&, S, P), P} |- S
|
static void |
eliminateVariableOfConditionAbductive(int figure,
Sentence sentence,
Sentence belief,
DerivationContext nal) |
|
private static void |
eliminateVariableOfConditionAbductiveInner1(Sentence sentence,
Sentence belief,
DerivationContext nal,
CompoundTerm s1,
Map<Term,Term> res3,
Term s12) |
|
private static void |
eliminateVariableOfConditionAbductiveTryCrossUnification(Sentence sentence,
Sentence belief,
DerivationContext nal,
Term s1,
Term p2,
Map<Term,Term> res3,
Map<Term,Term> res4) |
|
private static void |
eliminateVariableOfConditionAbductiveTryUnification1(Sentence sentence,
Sentence belief,
DerivationContext nal,
Term p1,
CompoundTerm p2,
Map<Term,Term> res3,
Map<Term,Term> res4) |
|
static Set<org.apache.commons.lang3.tuple.Pair<Term,Float>> |
introduceVariables(DerivationContext nal,
Term implicationEquivalenceOrJunction,
boolean subject) |
Introduction of variables that appear either within subjects or within predicates and more than once
|
(package private) static boolean |
introVarInner(Statement premise1,
Statement premise2,
CompoundTerm oldCompound,
DerivationContext nal) |
{<M --> S>, <C ==> <M --> P>>} |- <(&&, <#x --> S>, C) ==> <#x --> P>>
{<M --> S>, (&&, C, <M --> P>)} |- (&&, C, <<#x --> S> ==> <#x --> P>>) |
static void |
introVarOuter(Statement taskContent,
Statement beliefContent,
int index,
DerivationContext nal) |
Introduce a dependent variable in an outer-layer conjunction
{<S --> P1>, <S --> P2>} |- (&&, <#x --> P1>, <#x --> P2>) |
(package private) static void |
IntroVarSameSubjectOrPredicate(Sentence originalMainSentence,
Sentence subSentence,
Term component,
Term content,
int index,
DerivationContext nal) |
|
static <T> Set<Set<T>> |
powerSet(Set<T> originalSet) |
The power set, from João Silva, https://stackoverflow.com/questions/1670862/obtaining-a-powerset-of-a-set-in-java
|
private static void |
processComposed(Statement statement,
Term subject,
Term predicate,
int order,
TruthValue truth,
DerivationContext nal) |
Finish composing implication term
|
static void composeCompound(Statement taskContent, Statement beliefContent, int index, DerivationContext nal)
taskContent
- The first premisebeliefContent
- The second premiseindex
- The location of the shared termnal
- Reference to the memoryprivate static void processComposed(Statement statement, Term subject, Term predicate, int order, TruthValue truth, DerivationContext nal)
statement
- Type of the contentIndsubject
- Subject of contentIndpredicate
- Predicate of contentIndtruth
- TruthValue of the contentIndnal
- Reference to the memoryprivate static void decomposeCompound(CompoundTerm compound, Term component, Term term1, int index, boolean compoundTask, int order, DerivationContext nal)
term1
- The other term in the contentIndindex
- The location of the shared term: 0 for subject, 1 for predicatecompoundTask
- Whether the implication comes from the tasknal
- Reference to the memorystatic void decomposeStatement(CompoundTerm compound, Term component, boolean compoundTask, int index, DerivationContext nal)
compoundTask
- Whether the implication comes from the tasknal
- Reference to the memorypublic static void introVarOuter(Statement taskContent, Statement beliefContent, int index, DerivationContext nal)
taskContent
- The first premise <M --> S>beliefContent
- The second premise <M --> P>index
- The location of the shared term: 0 for subject, 1 for
predicatenal
- Reference to the memorystatic boolean introVarInner(Statement premise1, Statement premise2, CompoundTerm oldCompound, DerivationContext nal)
oldCompound
- The whole contentInd of the first premise, Implication
or Conjunctionnal
- Reference to the memorypublic static void eliminateVariableOfConditionAbductive(int figure, Sentence sentence, Sentence belief, DerivationContext nal)
private static void eliminateVariableOfConditionAbductiveTryCrossUnification(Sentence sentence, Sentence belief, DerivationContext nal, Term s1, Term p2, Map<Term,Term> res3, Map<Term,Term> res4)
private static void eliminateVariableOfConditionAbductiveTryUnification1(Sentence sentence, Sentence belief, DerivationContext nal, Term p1, CompoundTerm p2, Map<Term,Term> res3, Map<Term,Term> res4)
private static void eliminateVariableOfConditionAbductiveInner1(Sentence sentence, Sentence belief, DerivationContext nal, CompoundTerm s1, Map<Term,Term> res3, Term s12)
static void IntroVarSameSubjectOrPredicate(Sentence originalMainSentence, Sentence subSentence, Term component, Term content, int index, DerivationContext nal)
public static <T> Set<Set<T>> powerSet(Set<T> originalSet)
T
- originalSet
- public static Set<org.apache.commons.lang3.tuple.Pair<Term,Float>> introduceVariables(DerivationContext nal, Term implicationEquivalenceOrJunction, boolean subject)
nal
- The derivation contextimplicationEquivalenceOrJunction
- subject
- Copyright © 2020 OpenNARS. All rights reserved.