Transitive learning

From OpenCog
Jump to: navigation, search
boolean_while(true action_if(is_last_agent_action
  (owner kick_left) Dance1 Dance2)

- toggle between dances based on user signals

and_seq(
   goto_obj(#1)
   grab(#1)
   goto_obj(#2)
   drop)

schema predicatization produces:

"get the ball and bring it to fred"

ImplicationLink
   AND
       Evaluation
           ownerAsks
           List
               Evaluation _Patient (get,$1)
               Evaluation _Beneficiary (get,$2)
               Evaluation _type (get,IMPERATIVE)
       SequentialAndLink
               ExecutionLink goto_obj $1
           ExecutionLink grab #1
           ExecutionLink goto_obj #2
           ExecutionLink drop
   GoalNode: PleaseOwner


"take the ball from Bob and give it to Fred"

inference may be used to estimate the probability of pleasing the owner based on a certain series of actions

Implication
   AND
       context1
       procedure1
   goal
Inheritance context1 context2

or

Similarity context context2

Find procedure2 so that

Implication
   AND
       context2
       procedure2
   goal

Backward chaining of the form

Implication
   AND
       context2
       $1
       // Evaluation isExecutable $1
   goal


case 1):

dog knows how to take ball from Bob (bite him, then grab ball after he drops it)

case 2):

dog does not know how to take ball from Bob

then, may guess ... (inference)

or, could make partial solution, predicate-schematize it, and let MOSES fill in the blanks, i.e. feed moses

       SequentialAndLink
               ExecutionLink goto_obj $1
           INSERT SOMETHING LEARNED BY MOSES
           ExecutionLink grab #1
           ExecutionLink goto_obj #2
           ExecutionLink drop


Implication
  AND
       in_house
       P
  MaintainAppropriateFullness
Implication
   AND
         in_park
       P1
   MaintainAppropriateFullness
Implication
   AND
       in_store
       $1
   MaintainAppropriateFullness
Similarity in_house in_park <.7>
Similarity in_park in_store <.3>
Implication
  AND
       in_house
       P
  MaintainAppropriateHydration
Similarity MaintainAppropriateFullness MaintainAppropriateHydration <.7>


-- put ball, stick under a tree :

and_seq(
  goto_obj(ball_id)
  grab(ball_id)
  goto_obj(tree_id)
  drop
  goto_obj(stick_id)
  grab(stick_id)
  goto_obj(tree_id)
  drop)

Of course there is a room for reusing fetch_generalized...

-- bark until owner says "stop barking" :

boolean_while(
  not(has_said(owner "stop barking"))
  bark
)

-- fnorb (just to check contextual trick)

action_boolean_if(
  is_near(ball stick)
  and_seq(bark bark bark)
  and_seq(wag wag wag)
)