Beispiel #1
0
 /**
  * {<S ==> M>, <M ==> P>} |- {<S ==> P>,
  *
  * <P ==>S>}
  *
  * @param term1 Subject of the first new task
  * @param term2 Predicate of the first new task
  * @param sentence The first premise
  * @param belief The second premise
  */
 static void dedExe(Term term1, Term term2, Sentence sentence, Judgment belief) {
   if (RDFStatement.invalidStatement(term1, term2)) {
     return;
   }
   TruthValue value1 = sentence.getTruth();
   TruthValue value2 = belief.getTruth();
   TruthValue truth1 = null;
   TruthValue truth2 = null;
   BudgetValue budget1, budget2;
   if (sentence instanceof Question) {
     budget1 = BudgetFunctions.backwardWeak(value2);
     budget2 = BudgetFunctions.backwardWeak(value2);
   } else {
     if (sentence instanceof Goal) {
       truth1 = TruthFunctions.desireWeak(value1, value2);
       truth2 = TruthFunctions.desireWeak(value1, value2);
     } else {
       truth1 = TruthFunctions.deduction(value1, value2);
       truth2 = TruthFunctions.exemplification(value1, value2);
     }
     budget1 = BudgetFunctions.forward(truth1);
     budget2 = BudgetFunctions.forward(truth2);
   }
   TemporalValue order1 = sentence.getContent().getOrder();
   TemporalValue order2 = belief.getContent().getOrder();
   TemporalValue order = TemporalRules.syllogistic(order1, order2);
   RDFStatement content1 =
       RDFStatement.make((RDFStatement) sentence.getContent(), term1, term2, order);
   RDFStatement content2 =
       RDFStatement.make(
           (RDFStatement) sentence.getContent(), term2, term1, TemporalValue.getReverse(order));
   Memory.doublePremiseTask(budget1, content1, truth1);
   Memory.doublePremiseTask(budget2, content2, truth2);
 }