nars.inference
Class TruthFunctions

java.lang.Object
  extended by nars.inference.UtilityFunctions
      extended by nars.inference.TruthFunctions

public final class TruthFunctions
extends UtilityFunctions

All truth-value (and desire-value) functions used in inference rules


Constructor Summary
TruthFunctions()
           
 
Method Summary
(package private) static TruthValue abduction(TruthValue v1, TruthValue v2)
          { M>,

M>} |- P>

(package private) static TruthValue analogy(TruthValue v1, TruthValue v2)
          { M>, P>} |- P>
(package private) static TruthValue comparison(TruthValue v1, TruthValue v2)
          { S>, P>} |- P>
(package private) static TruthValue contraposition(TruthValue v1)
          { B>} |- <(--, B) ==> (--, A)>
(package private) static TruthValue conversion(TruthValue v1)
          { B>} |- A>
(package private) static TruthValue deduction(TruthValue v1, TruthValue v2)
          { M>, P>} |- P>
(package private) static TruthValue desireDed(TruthValue v1, TruthValue v2)
          A function specially designed for desire value [To be refined]
(package private) static TruthValue desireInd(TruthValue v1, TruthValue v2)
          A function specially designed for desire value [To be refined]
(package private) static TruthValue desireStrong(TruthValue v1, TruthValue v2)
          A function specially designed for desire value [To be refined]
(package private) static TruthValue desireWeak(TruthValue v1, TruthValue v2)
          A function specially designed for desire value [To be refined]
(package private) static TruthValue difference(TruthValue v1, TruthValue v2)
          { S>, P>} |- (S-P)>
(package private) static TruthValue exemplification(TruthValue v1, TruthValue v2)
          { S>,

M>} |- P>

(package private) static TruthValue existAnalogy(TruthValue v1, TruthValue v2)
          {(&&, <#x() ==> M>, <#x() ==> P>), S ==> M} |- P>
(package private) static TruthValue implied(TruthValue v1)
          { B>, B} |- A
(package private) static TruthValue implying(TruthValue v1)
          { B>, A} |- B
(package private) static TruthValue induction(TruthValue v1, TruthValue v2)
          { S>, P>} |- P>
(package private) static TruthValue intersection(TruthValue v1, TruthValue v2)
          { S>, P>} |- (S&P)>
(package private) static TruthValue negation(TruthValue v1)
          {A} |- (--A)
(package private) static TruthValue negImply(TruthValue v1)
          { (--, B)>, A} |- B
(package private) static TruthValue reduceConjunction(TruthValue v1, TruthValue v2)
          {(--, (&&, A, B)), B} |- (--, A)
(package private) static TruthValue reduceConjunctionNeg(TruthValue v1, TruthValue v2)
          {(--, (&&, A, (--, B))), (--, B)} |- (--, A)
(package private) static TruthValue reduceDisjunction(TruthValue v1, TruthValue v2)
          {(||, A, B), (--, B)} |- A
(package private) static TruthValue resemblance(TruthValue v1, TruthValue v2)
          { M>, P>} |- P>
(package private) static TruthValue revision(TruthValue v1, TruthValue v2)
          { P>, P>} |- P>
(package private) static TruthValue temporalRevision(TruthValue v1, TruthValue v2, long t1, long t2, long t)
          Revision weighted by time difference
(package private) static TruthValue union(TruthValue v1, TruthValue v2)
          { S>, P>} |- (S|P)>
 
Methods inherited from class nars.inference.UtilityFunctions
and, aveAri, aveGeo, or, w2c
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TruthFunctions

public TruthFunctions()
Method Detail

conversion

static TruthValue conversion(TruthValue v1)
{ B>} |- A>

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

negation

static TruthValue negation(TruthValue v1)
{A} |- (--A)

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

contraposition

static TruthValue contraposition(TruthValue v1)
{ B>} |- <(--, B) ==> (--, A)>

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

implying

static TruthValue implying(TruthValue v1)
{ B>, A} |- B

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

implied

static TruthValue implied(TruthValue v1)
{ B>, B} |- A

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

negImply

static TruthValue negImply(TruthValue v1)
{ (--, B)>, A} |- B

Parameters:
v1 - Truth value of the premise
Returns:
Truth value of the conclusion

revision

static TruthValue revision(TruthValue v1,
                           TruthValue v2)
{ P>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

temporalRevision

static TruthValue temporalRevision(TruthValue v1,
                                   TruthValue v2,
                                   long t1,
                                   long t2,
                                   long t)
Revision weighted by time difference

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
t1 - Creation time of the first truth value
t2 - Creation time of the second truth value
t - Target time of the resulting truth value
Returns:
Truth value of the conclusion

deduction

static TruthValue deduction(TruthValue v1,
                            TruthValue v2)
{ M>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

analogy

static TruthValue analogy(TruthValue v1,
                          TruthValue v2)
{ M>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

resemblance

static TruthValue resemblance(TruthValue v1,
                              TruthValue v2)
{ M>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

abduction

static TruthValue abduction(TruthValue v1,
                            TruthValue v2)
{ M>,

M>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

induction

static TruthValue induction(TruthValue v1,
                            TruthValue v2)
{ S>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

exemplification

static TruthValue exemplification(TruthValue v1,
                                  TruthValue v2)
{ S>,

M>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

comparison

static TruthValue comparison(TruthValue v1,
                             TruthValue v2)
{ S>, P>} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

desireStrong

static TruthValue desireStrong(TruthValue v1,
                               TruthValue v2)
A function specially designed for desire value [To be refined]

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

desireWeak

static TruthValue desireWeak(TruthValue v1,
                             TruthValue v2)
A function specially designed for desire value [To be refined]

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

desireDed

static TruthValue desireDed(TruthValue v1,
                            TruthValue v2)
A function specially designed for desire value [To be refined]

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

desireInd

static TruthValue desireInd(TruthValue v1,
                            TruthValue v2)
A function specially designed for desire value [To be refined]

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

union

static TruthValue union(TruthValue v1,
                        TruthValue v2)
{ S>, P>} |- (S|P)>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

intersection

static TruthValue intersection(TruthValue v1,
                               TruthValue v2)
{ S>, P>} |- (S&P)>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

difference

static TruthValue difference(TruthValue v1,
                             TruthValue v2)
{ S>, P>} |- (S-P)>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

reduceDisjunction

static TruthValue reduceDisjunction(TruthValue v1,
                                    TruthValue v2)
{(||, A, B), (--, B)} |- A

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

reduceConjunction

static TruthValue reduceConjunction(TruthValue v1,
                                    TruthValue v2)
{(--, (&&, A, B)), B} |- (--, A)

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

reduceConjunctionNeg

static TruthValue reduceConjunctionNeg(TruthValue v1,
                                       TruthValue v2)
{(--, (&&, A, (--, B))), (--, B)} |- (--, A)

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion

existAnalogy

static TruthValue existAnalogy(TruthValue v1,
                               TruthValue v2)
{(&&, <#x() ==> M>, <#x() ==> P>), S ==> M} |- P>

Parameters:
v1 - Truth value of the first premise
v2 - Truth value of the second premise
Returns:
Truth value of the conclusion