nars.inference
Class MatchingRules

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

public final class MatchingRules
extends java.lang.Object

Directly process a task by a oldBelief, with only two Terms in both. In matching, the new task is compared with all existing direct Tasks in that Concept, to carry out:

temporalRevision: between judgments on non-overlapping evidence; temporalRevision: between judgments; satisfy: between a Judgment and a Question/Goal; merge: between items of the same type and stamp; conversion: between different inheritance relations.


Constructor Summary
MatchingRules()
           
 
Method Summary
private static boolean betterSolution(Judgment newSol, Judgment oldSol, Sentence problem)
          Compare the quality of two solutions
private static void conversion()
          {

S>} |- P> Produce an Inheritance/Implication from a reversed Inheritance/Implication

private static void convertRelation()
          { P>} |- P> { P>} |- P> Switch between Inheritance/Implication and Similarity/Equivalence
private static void inferToAsym(Judgment asym, Judgment sym, TemporalValue order)
          { P>,

S>} |- P> Produce an Inheritance/Implication from a Similarity/Equivalence and a reversed Inheritance/Implication

private static void inferToSym(Judgment judgment1, Judgment judgment2)
          { P>,

S} |- p> Produce Similarity/Equivalence from a pair of reversed Inheritance/Implication

static void match(Task task, Judgment belief)
          The task and belief have the same content
static void matchAsymSym(Sentence asym, Sentence sym, int figure)
          Inheritance/Implication matches Similarity/Equivalence
static void matchReverse()
          The task and belief match reversely
static boolean revision(Task task, Judgment oldBelief, boolean feedbackToLinks)
          Belief revision
static void trySolution(Sentence problem, Judgment belief, Task task)
          Check if a Judgment provide a better answer to a Question
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatchingRules

public MatchingRules()
Method Detail

match

public static void match(Task task,
                         Judgment belief)
The task and belief have the same content

called in RuleTables.reason

Parameters:
task - The task
belief - The belief

revision

public static boolean revision(Task task,
                               Judgment oldBelief,
                               boolean feedbackToLinks)
Belief revision

called from Concept.reviseTable and match

Parameters:
task - The task containing new belief
oldBelief - The previous belief with the same content
feedbackToLinks - Whether to send feedback to the links
Returns:
Whether temporalRevision happened

trySolution

public static void trySolution(Sentence problem,
                               Judgment belief,
                               Task task)
Check if a Judgment provide a better answer to a Question

Parameters:
problem - The Goal or Question to be answered
belief - The proposed answer
task - The task to be processed

betterSolution

private static boolean betterSolution(Judgment newSol,
                                      Judgment oldSol,
                                      Sentence problem)
Compare the quality of two solutions

Parameters:
newSol - A new solution
oldSol - A old solution
problem - The problem
Returns:
Whether the new one is better

matchReverse

public static void matchReverse()
The task and belief match reversely


matchAsymSym

public static void matchAsymSym(Sentence asym,
                                Sentence sym,
                                int figure)
Inheritance/Implication matches Similarity/Equivalence

Parameters:
asym - A Inheritance/Implication sentence
sym - A Similarity/Equivalence sentence
figure - location of the shared term

inferToSym

private static void inferToSym(Judgment judgment1,
                               Judgment judgment2)
{ P>,

S} |- p> Produce Similarity/Equivalence from a pair of reversed Inheritance/Implication

Parameters:
judgment1 - The first premise
judgment2 - The second premise

inferToAsym

private static void inferToAsym(Judgment asym,
                                Judgment sym,
                                TemporalValue order)
{ P>,

S>} |- P> Produce an Inheritance/Implication from a Similarity/Equivalence and a reversed Inheritance/Implication

Parameters:
asym - The asymmetric premise
sym - The symmetric premise

conversion

private static void conversion()
{

S>} |- P> Produce an Inheritance/Implication from a reversed Inheritance/Implication


convertRelation

private static void convertRelation()
{ P>} |- P> { P>} |- P> Switch between Inheritance/Implication and Similarity/Equivalence