Skip to content
Snippets Groups Projects
Commit e0d1cbdf authored by patham9's avatar patham9
Browse files

do not add questions to derivation chain, they do not propagate truth value...

do not add questions to derivation chain, they do not propagate truth value and it will lead to isses if a question is used as the task. todo: also analyze why second question does not work on issue30.
parent 5bf719a0
No related branches found
No related tags found
No related merge requests found
...@@ -317,7 +317,7 @@ public class Memory { ...@@ -317,7 +317,7 @@ public class Memory {
} }
Stamp stamp = task.getSentence().getStamp(); Stamp stamp = task.getSentence().getStamp();
ArrayList<Term> chain = stamp.getChain(); ArrayList<Term> chain = stamp.getChain();
if (currentBelief != null) { if (currentBelief != null && currentBelief.isJudgment()) {
if(chain.contains(currentBelief.getContent())) { if(chain.contains(currentBelief.getContent())) {
chain.remove(currentBelief.getContent()); chain.remove(currentBelief.getContent());
} }
...@@ -325,14 +325,14 @@ public class Memory { ...@@ -325,14 +325,14 @@ public class Memory {
} }
//workaround for single premise task issue: //workaround for single premise task issue:
if(currentBelief == null && single && currentTask != null) { if(currentBelief == null && single && currentTask != null && currentTask.getSentence().isJudgment()) {
if(chain.contains(currentTask.getContent())) { if(chain.contains(currentTask.getContent())) {
chain.remove(currentTask.getContent()); chain.remove(currentTask.getContent());
} }
stamp.addToChain(currentTask.getContent()); stamp.addToChain(currentTask.getContent());
} }
//end workaround //end workaround
if (currentTask != null && !single) { if (currentTask != null && !single && currentTask.getSentence().isJudgment()) {
if(chain.contains(currentTask.getContent())) { if(chain.contains(currentTask.getContent())) {
chain.remove(currentTask.getContent()); chain.remove(currentTask.getContent());
} }
...@@ -340,7 +340,7 @@ public class Memory { ...@@ -340,7 +340,7 @@ public class Memory {
} }
if (!revised) { //its a inference rule, we have to do the derivation chain check to hamper cycles if (!revised) { //its a inference rule, we have to do the derivation chain check to hamper cycles
for (Term chain1 : chain) { for (Term chain1 : chain) {
if (task.getContent() == chain1) { if (task.getSentence().isJudgment() && task.getContent().equals(chain1)) {
recorder.append("!!! Cyclic Reasoning detected: " + task + "\n"); recorder.append("!!! Cyclic Reasoning detected: " + task + "\n");
return; return;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment