Changes have been pushed for the repository "fawkes.git".
(Fawkes Robotics Software Framework)

Clone:  g...@git.fawkesrobotics.org:fawkes.git
Gitweb: http://git.fawkesrobotics.org/fawkes.git
Trac:   http://trac.fawkesrobotics.org

The branch, mgomaa/clips-executive-nonunique-action-ids-fix has been created
        at  d9562d37e679258050b528f92c387695e96ad64f (commit)

http://git.fawkesrobotics.org/fawkes.git/mgomaa/clips-executive-nonunique-action-ids-fix

- *Log* ---------------------------------------------------------------
commit d9562d37e679258050b528f92c387695e96ad64f
Author:     Mostafa Gomaa <go...@kbsg.rwth-aachen.de>
AuthorDate: Mon Apr 16 23:33:08 2018 +0200
Commit:     Mostafa Gomaa <go...@kbsg.rwth-aachen.de>
CommitDate: Mon Apr 16 23:33:08 2018 +0200

    clips-exec: always check for goal before grounding or applying effects
    
    In the context of specifying action ids uniquely ONLY within a given
    goal and plan.
    
    Add the missing checks for the existence of the goal specified in the
    plan-action during grounding and other similar rules that process
    plan-actions or preconditions.
    
    The missing check caused an unified behavior if the goal-id was missing
    in the plan-action. Some of the rules where still allowed to
    fire while others needed the goal-id.
    
    (Example, preconditions were still allowed to ground, effects
    were allowed to apply. Whereas, atomic-precondition were not allowed to
    ground)

http://git.fawkesrobotics.org/fawkes.git/commit/d9562d3
http://trac.fawkesrobotics.org/changeset/d9562d3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -


- *Summary* -----------------------------------------------------------


- *Diffs* -------------------------------------------------------------

- *commit* d9562d37e679258050b528f92c387695e96ad64f - - - - - - - - - -
Author:  Mostafa Gomaa <go...@kbsg.rwth-aachen.de>
Date:    Mon Apr 16 23:33:08 2018 +0200
Subject: clips-exec: always check for goal before grounding or applying effects

 src/plugins/clips-executive/clips/domain.clp |   28 ++++++++++++++++++++++++-
 1 files changed, 26 insertions(+), 2 deletions(-)

_Diff for modified files_:
diff --git a/src/plugins/clips-executive/clips/domain.clp 
b/src/plugins/clips-executive/clips/domain.clp
index 6a5cc7c..0f023d6 100644
--- a/src/plugins/clips-executive/clips/domain.clp
+++ b/src/plugins/clips-executive/clips/domain.clp
@@ -210,6 +210,8 @@
   "Ground a non-atomic precondition. Grounding here merely means that we
    duplicate the precondition and tie it to one specific action-id."
   (not (domain-wm-update))
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   (plan-action (action-name ?op) (goal-id ?g) (plan-id ?p) (id ?action-id)
     (status FORMULATED|PENDING|WAITING))
   ?precond <- (domain-precondition
@@ -228,6 +230,8 @@
   "Ground a non-atomic precondition. Grounding here merely means that we
    duplicate the precondition and tie it to one specific effect-id."
   (not (domain-wm-update))
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   (plan-action (action-name ?op) (id ?action-id) (goal-id ?g) (plan-id ?p)
     (status EXECUTION-SUCCEEDED))
   (domain-effect (name ?effect-name) (part-of ?op))
@@ -246,11 +250,13 @@
   "Ground a non-atomic precondition that is part of another precondition. Copy
    the action ID from the parent precondition."
   (not (domain-wm-update))
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-precondition
                 (name ?precond-name)
                 (part-of ?parent)
                 (grounded FALSE))
-  (domain-precondition (name ?parent) (goal-id ?g&~nil) (plan-id ?p&~nil)
+  (domain-precondition (name ?parent) (goal-id ?g) (plan-id ?p)
     (grounded-with ?action-id&~0))
   (not (domain-precondition
         (name ?precond-name)
@@ -266,6 +272,8 @@
 (defrule domain-ground-atomic-precondition
   "Ground an atomic precondition of an operator."
   (not (domain-wm-update))
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   (plan-action
     (status FORMULATED|PENDING|WAITING)
     (action-name ?op)
@@ -274,7 +282,7 @@
     (param-values $?action-values& :
       (= (length$ ?action-values) (length$ ?action-param-names)))
   )
-  (domain-precondition (name ?parent) (goal-id ?g&~nil) (plan-id ?p&~nil)
+  (domain-precondition (name ?parent) (goal-id ?g) (plan-id ?p)
     (grounded-with ?action-id&~0) (grounded TRUE))
   ?precond <- (domain-atomic-precondition
                 (part-of ?parent)
@@ -326,6 +334,8 @@
 )
 
 (defrule domain-check-if-atomic-precondition-is-satisfied
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-atomic-precondition
                 (goal-id ?g) (plan-id ?p)
                 (is-satisfied FALSE)
@@ -341,6 +351,8 @@
   "A negative precondition is satisfied iff its (only) child is not satisfied.
    Note that we need a second rule that retracts the fact if the child is
    asserted."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-precondition
                 (type negation)
                 (grounded TRUE)
@@ -367,6 +379,8 @@
 (defrule domain-retract-negative-precondition-if-child-is-satisfied
   "If a negative precondition's child is satisfied, the precondition is not
    satisfied anymore."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-precondition
                 (type negation)
                 (name ?pn)
@@ -392,6 +406,8 @@
 
 (defrule domain-check-if-conjunctive-precondition-is-satisfied
   "All the precondition's children must be satisfied."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-precondition
                 (name ?pn)
                 (type conjunction)
@@ -415,6 +431,8 @@
 (defrule domain-retract-conjunctive-precondition-if-child-is-not-satisfied
   "Make sure that a conjunctive precondition is not satisfied if any of its
    children is satisfied."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?precond <- (domain-precondition
                 (name ?pn)
                 (type conjunction)
@@ -462,6 +480,8 @@
 ; TODO: ?action-name should be ?op
 (defrule domain-effects-check-for-sensed
   "Apply effects of an action after it succeeded."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?pa <- (plan-action  (id ?id) (goal-id ?g) (plan-id ?p) (action-name ?op)
                       (status EXECUTION-SUCCEEDED)
                                                                                
        (param-names $?action-param-names)
@@ -501,6 +521,8 @@
 ; Atomically assert all effects of an action after it has been executed.
 (defrule domain-effects-apply
   "Apply effects of an action after it succeeded."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?pa <- (plan-action  (id ?id) (goal-id ?g) (plan-id ?p) (action-name ?op)
                       (status SENSED-EFFECTS-HOLD)
                                                                                
        (param-names $?action-param-names)
@@ -585,6 +607,8 @@
 
 (defrule domain-check-if-action-is-executable
   "If the precondition of an action is satisfied, the action is executable."
+  (goal (id ?g))
+  (plan (id ?p) (goal-id ?g))
   ?action <- (plan-action (id ?action-id) (goal-id ?g) (plan-id ?p)
                           (executable FALSE))
   (domain-precondition (plan-id ?p) (goal-id ?g) (grounded-with ?action-id)




-- 
Fawkes Robotics Framework                 http://www.fawkesrobotics.org
_______________________________________________
fawkes-commits mailing list
fawkes-commits@lists.kbsg.rwth-aachen.de
https://lists.kbsg.rwth-aachen.de/listinfo/fawkes-commits

Reply via email to