# opencog/opencog

Fetching contributors…
Cannot retrieve contributors at this time
1913 lines (1792 sloc) 107 KB
 Amusing Friend PLN Demo

Amusing Friend PLN Demo

PLN demo involving deductive and abductive reasoning. Self is looking for an amusing and honest friend and infers that Bob would be one based on his actions and the fact that friends tend to be honest.

Background Knowledge

Bob is a human.
I am a human.
I am honest.
I know Bob.
Friends tend to be honest.
People who told the truth about something are honest.
People who told a joke to someone, somewhere, are funny.
Being funny is loosely equivalent to being amusing.
Bob told Jill the truth about the party.
Bob told Jim a joke at the party.
Probability of two humans being acquaintances: .0002
Probability of a person being honest: .8
Probability of being funny: .69
The probability of random things (typically humans) being friends: .0001
The probablity of turning acquaintance into friendship between humans: .01

Atomese

;; Kownledge base for the amusing friend demo.

;;;;;;;;;;;;;
;; Honesty ;;
;;;;;;;;;;;;;

;; Probability of being honest
(Predicate "is-honest" (stv 0.8 0.9))

;; Probability that two things are honest
;;
;; This should be inferred since we don't have the rules to infer that
;; we put it in the kb for now.
(Lambda (stv 0.64 0.9)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(And
(Evaluation
(Predicate "is-honest")
(Variable "\$X"))
(Evaluation
(Predicate "is-honest")
(Variable "\$Y"))))

;; Probability of telling the truth to someone. The probability if
;; very low cause the probability of telling something to someone is
(Predicate "told-the-truth" (stv 0.00001 0.7))

;; We need also the following. It should normally be wrapped in a
;; Lambda, but because instantiation. And ultimately this should be
;; inferred.
(Evaluation (stv 0.00001 0.7)
(List
(Variable "\$X")
(Variable "\$Y")
(Variable "\$Z")))

;; People who told the truth about something are honest
(define people-telling-the-truth-are-honest
(ImplicationScope (stv 0.95 0.9)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Z")
(Type "ConceptNode")))
(Evaluation
(List
(Variable "\$X")
(Variable "\$Y")
(Variable "\$Z")))
(Evaluation
(Predicate "is-honest")
(Variable "\$X"))))

;;;;;;;;;;;;;;
;; Humanity ;;
;;;;;;;;;;;;;;

;; Probability of two human acquaintances
(Lambda (stv 0.0002 0.9)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(And
(Inheritance
(Variable "\$X")
(Concept "human"))
(Inheritance
(Variable "\$Y")
(Concept "human"))
(Evaluation
(Predicate "acquainted")
(List
(Variable "\$X")
(Variable "\$Y")))))

;;;;;;;;;
;; Bob ;;
;;;;;;;;;

;; Bob is a human
(Inheritance (stv 1 1)
(Concept "Bob")
(Concept "human"))

;;;;;;;;;;
;; Self ;;
;;;;;;;;;;

;; I am a human
(Inheritance (stv 1 1)
(Concept "Self")
(Concept "human"))

;; I am honest
(Evaluation (stv 0.9 0.9)
(Predicate "is-honest")
(Concept "Self"))

;; I know Bob
(Evaluation (stv 1 1)
(Predicate "acquainted")
(List
(Concept "Self")
(Concept "Bob")))

;;;;;;;;;;;;;;;;
;; Friendship ;;
;;;;;;;;;;;;;;;;

;; The probability of random things (typically humans) being friends
(Predicate "will-be-friends" (stv 0.0001 0.9))

;; Friendship is symmetric
(ImplicationScope (stv 1 1)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(Evaluation
(Predicate "will-be-friends")
(List
(Variable "\$X")
(Variable "\$Y")))
(Evaluation
(Predicate "will-be-friends")
(List
(Variable "\$Y")
(Variable "\$X"))))

;; I'm disabling that to simplify the inference. Ultimately the only
;; reason we use will-be-friends rather than are-friends is so the
;; first person perspective makes a bit of sense (cause someone is
;; supposed to know who are her friends). With a third person
;; perspective, such as "Find Sylvia's friends", then we can just use
;; "are-friends", cause we're not supposed to know all of Sylvia's
;; friends.
;;
;; ;; Friends will remain friends.
;; ;;
;; ;; This could simply be expressed as
;; ;;
;; ;; (Implication (stv 0.9 0.9)
;; ;;    (Predicate "are-friends")
;; ;;    (Predicate "will-be-friends"))
;; ;;
;; ;; but due to some current limitation in the type system, specifically
;; ;; that a Predicate cannot be declared with a certain type, we need to
;; ;; express that in a more convoluted way.
;; (ImplicationScope (stv 0.9 0.9)
;;    (VariableList
;;       (TypedVariable
;;          (Variable "\$X")
;;          (Type "ConceptNode"))
;;       (TypedVariable
;;          (Variable "\$Y")
;;          (Type "ConceptNode")))
;;    (Evaluation
;;       (Predicate "are-friends")
;;       (List
;;          (Variable "\$X")
;;          (Variable "\$Y")))
;;    (Evaluation
;;       (Predicate "will-be-friends")
;;       (List
;;          (Variable "\$X")
;;          (Variable "\$Y"))))

;; The probablity of turning acquaintance into friendship between
;; humans is 0.1.
(define human-acquainted-tend-to-become-friends
(ImplicationScope (stv 0.1 0.5)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(And
(Inheritance
(Variable "\$X")
(Concept "human"))
(Inheritance
(Variable "\$Y")
(Concept "human"))
(Evaluation
(Predicate "acquainted")
(List
(Variable "\$X")
(Variable "\$Y"))))
(Evaluation
(Predicate "will-be-friends")
(List
(Variable "\$X")
(Variable "\$Y")))))

;; Friends tend to be honest
(define friends-tend-to-be-honest
(ImplicationScope (stv 0.85 0.5)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(Evaluation
(Predicate "will-be-friends")
(List
(Variable "\$X")
(Variable "\$Y")))
(And
(Evaluation
(Predicate "is-honest")
(Variable "\$X"))
(Evaluation
(Predicate "is-honest")
(Variable "\$Y")))))

;;;;;;;;;;;;;;;;;
;; Being Funny ;;
;;;;;;;;;;;;;;;;;

;; Probability of telling a joke to someone. The probability is
;; extremely low because the probability of telling anything to
;; someone is already very low.
(Predicate "told-a-joke-at" (stv 0.000001 0.6))

;; The following should be wrapped in a Lambda and ultimately
;; inferred.
(Evaluation (stv 0.000001 0.6)
(Predicate "told-a-joke-at")
(List
(Variable "\$X")
(Variable "\$Y")
(Variable "\$Z")))

;; Probability of being funny
(Predicate "is-funny" (stv 0.69 0.7))

;; Same remark as for Predicate "told-a-joke-at"
(Evaluation (stv 0.69 0.7)
(Predicate "is-funny")
(Variable "\$X"))

;; People who told a joke to someone, somewhere, are funny
(define people-telling-jokes-are-funny
(ImplicationScope (stv 0.8 0.9)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Z")
(Type "ConceptNode")))
(Evaluation
(Predicate "told-a-joke-at")
(List
(Variable "\$X")
(Variable "\$Y")
(Variable "\$Z")))
(Evaluation
(Predicate "is-funny")
(Variable "\$X"))))

;; Being funny is loosely equivalent to being amusing
;;
;; This could simply be expressed as
;;
;; (Equivalence (stv 0.7 0.9)
;;    (Predicate "is-funny")
;;    (Predicate "is-amusing"))
;;
;; but due to some current limitation in the type system, specifically
;; that a Predicate cannot be declared with a certain type, we need to
;; express that in a more convoluted way.
(define funny-is-loosely-equivalent-to-amusing
(Equivalence (stv 0.7 0.9)
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(Evaluation
(Predicate "is-funny")
(Variable "\$X"))
(Evaluation
(Predicate "is-amusing")
(Variable "\$X"))))

;;;;;;;;;;;;;;;
;; The Party ;;
;;;;;;;;;;;;;;;

;; Bob told Jill the truth about the party
(Evaluation (stv 1 1)
(List
(Concept "Bob")
(Concept "Jill")
(Concept "Party")))

;; Bob told Jim a joke at the party.
(Evaluation (stv 1 1)
(Predicate "told-a-joke-at")
(List
(Concept "Bob")
(Concept "Jim")
(Concept "Party")))

;;;;;;;;;;
;; Hack ;;
;;;;;;;;;;

;; Due to the fact the evaluator does not support fuzzy TV semantic we
;; put the evaluation of a to-be-used instantiated precondition
;; here. Alternatively we could add PLN rules to evaluate.
(define hack (And (stv 1 0.9)
(Evaluation
(Predicate "is-honest")
(Concept "Self")
)
(Evaluation
(Predicate "is-honest")
(Concept "Bob")
)
(Inheritance
(Concept "Self")
(Concept "human")
)
(Inheritance
(Concept "Bob")
(Concept "human")
)
(Evaluation
(Predicate "acquainted")
(Concept "Self")
(Concept "Bob")
)
)
)
)

;; Because implication-instantiation occurs on the sugar syntax, the
;; predicate (which should be wrapped in a Lambda) is not given. Also
;; of course that predicate should still be evaluated. Here we provide
;; the adequate TV value of that predicate on the free scope form.
(PredicateNode "is-honest")
(VariableNode "\$X")
)
(PredicateNode "is-honest")
(VariableNode "\$Y")
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)

Steps leading up to the conclusion: Bob will be an amusing and honest friend.

Step 1

Infer that Bob is honest.

Apply the implication-full-instantiation-rule on the implication in the knowledge base that people telling the truth are honest.

People who told the truth about something are honest.
Bob told Jill the truth about the party.
|-
Bob is honest.

PLN Rule Atomese
implication-full-instantiation-rule:

V
P
Q
T
|-
Q[V->T]

where V is a variable or a list of variables, P is a condition, Q
is the implicand, T is an atom (or a list of atoms) to substitute
and Q[V->T] is Q where V has been substituted by T.

Antecedents:

;; People who told the truth about something are honest
(ImplicationScope (stv 0.95 0.9)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Z")
(Type "ConceptNode")))
(Evaluation
(List
(Variable "\$X")
(Variable "\$Y")
(Variable "\$Z")))
(Evaluation
(Predicate "is-honest")
(Variable "\$X"))))

;; Bob told Jill the truth about the party
(Evaluation (stv 1 1)
(List
(Concept "Bob")
(Concept "Jill")
(Concept "Party")))

Conclusion (1):

(cog-execute! implication-full-instantiation-rule)
;; Bob is honest
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(ConceptNode "Bob")

Step 2

Atomspace representation transformation

Distribute the scope of the implication that friends tend to be honest in the KB, applying implication-scope-to-implication-rule.

PLN Rule Atomese
implication-scope-to-implication-rule:

V
P
Q
|-
V
P
V
Q

where V is a variable or a list of variables, P and Q are the implicant
and implicand bodies.

Antecedent:

;; Friends tend to be honest
(define friends-tend-to-be-honest
(ImplicationScope (stv 0.85 0.5)
(VariableList
(TypedVariable
(Variable "\$X")
(Type "ConceptNode"))
(TypedVariable
(Variable "\$Y")
(Type "ConceptNode")))
(Evaluation
(Predicate "will-be-friends")
(List
(Variable "\$X")
(Variable "\$Y")))
(And
(Evaluation
(Predicate "is-honest")
(Variable "\$X"))
(Evaluation
(Predicate "is-honest")
(Variable "\$Y")))))

Conclusion (2):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)
)

Step 3

Atomspace representation transformation

Infer the TV of the implicant of conclusion (2) using predicate-lambda-introduction-rule.

PLN Rule Atomese

predicate-lambda-introduction-rule:

Predicate <TV>
|-
Lambda <TV>
<variables>
Evaluation
Predicate <TV>
List
<variables>

Wrap a Lambda around an evaluation of predicate and assign to the
lambda the TV of the predicate.

Antecedent:

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)

Conclusion (3):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$Y")
(VariableNode "\$X")
)
)
)

Step 4

Atomspace representation transformation

Infer the TV of the implicand of conclusion (2) using predicate-lambda-introduction-rule.

PLN Rule Atomese

predicate-lambda-introduction-rule:

Predicate <TV>
|-
Lambda <TV>
<variables>
Evaluation
Predicate <TV>
List
<variables>

Wrap a Lambda around an evaluation of predicate and assign to the
lambda the TV of the predicate.

Conclusion (4):
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)

Step 5

Infer that honest people are more likely to become friends.

Apply the inversion rule over conclusion (2).

People who become friends are more likely to be honest.
|-
People who are honest are more likely to become friends.

PLN Rule Atomese
InversionRule:

A
B
|-
B
A

Antecedent:

;; people who are friends are more likely to be honest
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)
)

Conclusion (5):

;; People who are honest are more likely to be friends
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)

Step 6

Atomspace representation transformation

Distribute the scope of the implication that human acquaintances tend to become friends in the kb, applying implication-scope-to-implication-rule.

(This transformation already occurred as a result of step 2.)

PLN Rule Atomese
implication-scope-to-implication-rule:

V
P
Q
|-
V
P
V
Q

where V is a variable or a list of variables, P and Q are the implicant
and implicand bodies.
Conclusion (6):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)

Step 7

Infer that honest human acquaintances tend to become friends (more so than just human acquaintances).

Apply rule implication-implicant-conjunction-rule on (5) and (6).

(5) Honest people are more likely to become friends
(6) Human acquaintances tend to become friends
|-
(7) Honest human acquaintances tend to become friends.

PLN Rule Atomese
implication-implicant-conjunction-rule:

A
C
B
C
|-
A
B
C
Conclusion (7):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)

Step 8

Atomspace representation transformation

Factorize lambda in implicant of (7). Apply rule and-lambda-factorization-double-implication-rule to the implicant of (7).

PLN Rule Atomese
and-lambda-factorization-double-implication-rule:

V
A1
...
V
An
|-
V
A1
...
An
Conclusion (8):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)
)
)

Step 9

Atomspace representation transformation

Deduce with all lambda factorized that honest human acquaintance tend to become friend.

Apply deduction-implication-rule on (7) and (8).

PLN Rule Atomese
deduction-implication-rule:

A
B
B
C
|-
A
C
Conclusion (9):

(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$X")
)
(PredicateNode "is-honest" (stv 0.80000001 0.89999998))
(VariableNode "\$Y")
)
(VariableNode "\$X")
(ConceptNode "human")
)
(VariableNode "\$Y")
(ConceptNode "human")
)
(PredicateNode "acquainted")
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
)
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(VariableNode "\$X")
(VariableNode "\$Y")
)
)
)
)

Step 10

Infer that Bob may become a friend.

Apply the implication-full-instantiation-rule on (9).

Humans who are honest and acquainted tend to become friends.
Bob is human. I am human.
Bob is honest. I am honest.
Bob and I are acquainted.
|-
Bob and I will become friends.

PLN Rule Atomese
implication-full-instantiation-rule:

V
P
Q
T
|-
Q[V->T]

where V is a variable or a list of variables, P is a condition, Q
is the implicand, T is an atom (or a list of atoms) to substitute
and Q[V->T] is Q where V has been substituted by T.
Conclusion (10):

;; Bob and I will become friends.
(PredicateNode "will-be-friends" (stv 9.9999997e-05 0.89999998))
(ConceptNode "Self")
(ConceptNode "Bob")
)
)

Step 11

Infer that Bob is funny.

Apply the implication-full-instantiation-rule on the implication stating that people telling jokes are funny in the kb.

People who tell jokes are funny.
Bob told Jim a joke at the party.
|-
Bob is funny.

PLN Rule Atomese
implication-full-instantiation-rule:

V
P
Q
T
|-
Q[V->T]

where V is a variable or a list of variables, P is a condition, Q
is the implicand, T is an atom (or a list of atoms) to substitute
and Q[V->T] is Q where V has been substituted by T.
Antecedents:

;; people who tell jokes are funny
(VariableList
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(VariableNode "\$Y")
(TypeNode "ConceptNode")
)
(VariableNode "\$Z")
(TypeNode "ConceptNode")
)
)
(PredicateNode "told-a-joke-at" (stv 1e-06 0.60000002))
(VariableNode "\$X")
(VariableNode "\$Y")
(VariableNode "\$Z")
)
)
(PredicateNode "is-funny" (stv 0.69 0.69999999))
(VariableNode "\$X")
)
)

;; Bob told jim a joke at the party.
(PredicateNode "told-a-joke-at" (stv 1e-06 0.60000002))
(ConceptNode "Bob")
(ConceptNode "Jim")
(ConceptNode "Party")
)

Conclusion (11):

;; Bob is funny.
(PredicateNode "is-funny" (stv 0.69 0.69999999))
(ConceptNode "Bob")
)

Step 12

Atomspace representation transformation

Distribute the scope of the amusing funny equivalence from the KB.

Apply equivalence-scope-distribution-rule.

PLN Rule Atomese
equivalence-scope-distribution-rule:

V
P
Q
|-
V
P
V
Q

where V is a variable or a list of variables, P and Q are the
implicant and implicand bodies.
Conclusion (12):

(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(PredicateNode "is-funny" (stv 0.69 0.69999999))
(VariableNode "\$X")
)
)
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(PredicateNode "is-amusing")
(VariableNode "\$X")
)
)
)

Step 13

Infer that if X is funny, then X is amusing.

Apply the equivalence-to-implication-rule on (12).

Being funny is similar to being amusing.
|-
If X is funny, then X is amusing.

PLN Rule Atomese

equivalence-to-implication-rule:

Equivalence
A
B
|-
Implication
A
B
Implication
B
A

Conclusion (13):

;; If X is funny, then X is amusing.
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(PredicateNode "is-funny" (stv 0.69 0.69999999))
(VariableNode "\$X")
)
)
(VariableNode "\$X")
(TypeNode "ConceptNode")
)
(PredicateNode "is-amusing")
(VariableNode "\$X")
)
))

Step 14

Infer that Bob is amusing.

Apply implication-full-instantiation on the result of (13).

(13) If X is funny, then X is amusing.
(11) Bob is funny.
|-
(14) Bob is amusing.

PLN Rule Atomese

implication-full-instantiation-rule:

V
P
Q
T
|-
Q[V->T]

where V is a variable or a list of variables, P is a condition, Q
is the implicand, T is an atom (or a list of atoms) to substitute
and Q[V->T] is Q where V has been substituted by T.

Conclusion (14):

;;Bob is amusing
(PredicateNode "is-amusing")
(ConceptNode "Bob")
)

Step 15

Infer that Bob will be an amusing and honest friend.

Apply the and-introduction-rule over the results of (10), (11) and (14)

(10) Bob and I will become friends.
(1) Bob is honest.
(14) Bob is amusing
|-
(15) Bob will be an amusing and honest friend.

PLN Rule Atomese

and-introduction-rule:

A<TV1>
B<TV2>
|-
A
B

Conclusion (15):

;; Bob will be an amusing and honest friend.
(And (stv 0.13281251 0.25109974)
(Evaluation
(Predicate "will-be-friends")
(List
(Concept "Self")
(Concept "Bob")))
(Evaluation
(Predicate "is-amusing")
(Concept "Bob"))
(Evaluation
(Predicate "is-honest")
(Concept "Bob")))

You can’t perform that action at this time.