All Downloads are FREE. Search and download functionalities are using the official Maven repository.

APT.all-test.water-jug.water-jug.fill.soar Maven / Gradle / Ivy

# If the task is water-jug and there is a jug that is not full, 
# then propose filling that jug.

sp {water-jug*propose*fill
   (state  ^name water-jug
              ^jug )
   ( ^empty > 0)
-->
   ( ^operator  + =)
   ( ^name fill
        ^fill-jug )}

# If the task is water-jug and the fill operator is selected for a given jug, 
# then set that jug?s contents to be its volume.

sp {water-jug*apply*fill
   (state  ^name water-jug
              ^operator 
              ^jug )
   ( ^name fill
        ^fill-jug )
   ( ^volume 
        ^contents )
-->
   ( ^contents 
                   -)}