From etzioni@chum Thu May 16 08:36:57 1991
Received: from chum.cs.washington.edu by wolf.cs.washington.edu (5.64/7.0jh)
	id AA03566; Thu, 16 May 91 08:36:28 -0700
Received: by chum.cs.washington.edu (5.64/7.0h)
	id AA28469; Thu, 16 May 91 08:52:38 -0700
Date: Thu, 16 May 91 08:52:38 -0700
From: etzioni@chum (Oren Etzioni)
Message-Id: <9105161552.AA28469@chum.cs.washington.edu>
To: lindborg@wolf
Cc: cs473@chum.cs.washington.edu
In-Reply-To: lindborg@wolf's message of Wed, 15 May 91 21:00:19 PDT <9105160400.AA26642@wolf.cs.washington.edu>
Subject: memory wank
Status: R

   To: cs473@chum.cs.washington.edu
   Subject: memory wank
   Date: Wed, 15 May 91 21:00:19 PDT
   From: lindborg@wolf


   Is anyone else ever getting :

   Warning: 8597864 bytes have been tenured; (gc t) is recommended.

   when they run?  I'm only on node 204 and it starts barfing these
   things out at me.  After a while it tells me the operating system
   will no longer allocate memory for me and it crashes.

   anything I can do about this?  What is (gc t) anyway?

   thanx

   Jeff Lindborg

gc stands for garbage collect.  It's suggesting you do taht because
you're using massive amounts of memory.  Trying turning DISCARD on at
the prodigy prompt, and do garbage collect periodically.
oren

From etzioni@chum Thu May 16 10:13:29 1991
Received: from chum.cs.washington.edu by wolf.cs.washington.edu (5.64/7.0jh)
	id AA05248; Thu, 16 May 91 10:12:58 -0700
Received: by chum.cs.washington.edu (5.64/7.0h)
	id AA28563; Thu, 16 May 91 10:29:07 -0700
Date: Thu, 16 May 91 10:29:07 -0700
From: etzioni@chum (Oren Etzioni)
Message-Id: <9105161729.AA28563@chum.cs.washington.edu>
To: cs473@chum
Subject: multiple lisp jobs.
Status: R

Do NOT use multiple lisp jobs (even on different machines!).  This is
unfair to other people using the machines.  If you do, the
consequences will be swift and unpleasant.

enough said,

oren

From c473bv@ms.washington.edu Thu May 16 12:52:30 1991
Received: from chum.cs.washington.edu by wolf.cs.washington.edu (5.64/7.0jh)
	id AA08551; Thu, 16 May 91 12:51:44 -0700
Received: from hilbert.ms.washington.edu by chum.cs.washington.edu (5.64/7.0h)
	id AA28731; Thu, 16 May 91 13:07:52 -0700
Received: by hilbert.ms.washington.edu
	(5.65/UW-NDC Revision: 2.21 ) id AA03374; Thu, 16 May 91 13:06:54 -0700
Date: Thu, 16 May 91 13:06:54 -0700
From: Douglas Tad Orman <c473bv@ms.washington.edu>
Message-Id: <9105162006.AA03374@hilbert.ms.washington.edu>
To: cs473@chum.cs.washington.edu
Subject: Incrementors anybody?
Status: R

To everyone that needs to:
  Count Cash!
  Count Time!
  Count Credits!
  Keep a count of anything!

I have been working my fingers to the bone trying to get a simple
incrementor to work for my CS Course scheduling domain.  Vaughn
helped me to work out the bugs in the code that follows which
demonstrates how to do it.

The example counts from 0 to 5 before inserting a predicate
for noting termination.

The schematic for an incrementor might be:

(incrementor <old> <new-value> <step-value>)

where <new-value> is <old> + <step-value>.  Intuitively you
will probably have unified <old> and <step-value> prior to
the call in the preconditions and only need a <new>.  BUT!!!
Prodigy works backwards.. (the piece of $%%@#@$#!!).  It 
will try to unify the new value first and work backwards. You
must provide a incrementor that will handle generating binding
candidates for all combinations of constants / variables for
old, new, AND the step value!!  The difficulty
then is that if the initial state is 0, the goal is 5, Prodigy
will set new to 5 (to try to unify), bind step and find that 
old no longer works out.. confusing and strange eh?  We will
want Prodigy to SUBGOAL on the counter till it works.

Yes, major confusion now... best enter the following example and
watch it churn.

You may want to note the operator ADD-COMPLETED.  You would think
that this should be an inference rule.. note that it will subgoal
the credit total..  BUT if one makes it an inference rule and it
tries to subgoal to the operator ADD you will get a "NO ALTS 
AVAILABLE" message...  I screamed all night long because of this.

Just experiment with it and see what happens.  Also note where
I put the precondition (credits <credit-count>)... AFTER the
incrementor... weird eh?  Think like Prodigy, work backwards 
unifying and ask yourself why I ordered it there...

NOTE: If you use any of the code here in your projects, please
note where you got it from.

NOTE: The generator code is hard coded for binding credit values
to the stepper if needed... increments of 3, 4, 5.  You may need
to change this if your stepper (dollar figures etc.) are not as 
easy to calculate.


Tad Orman

***********************************************

(load-goal '(completed))

(load-start-state
   '(
     (innercore-required 5)
     (credits 0)
))


(setq *OPERATORS* '(

(ADD
 (params (<credit-count> <new-credit-count>))
  (PRECONDS
   (AND
    (~ (completed))
    (Generate-credits <credit-count> <new-credit-count> 1)
    (credits <credit-count>)))
  (EFFECTS
   (
    (DEL (credits <credit-count>))
    (ADD (credits <new-credit-count>)))))

(ADD-COMPLETED
 (preconds
  (and
   (innercore-required <required>)
   (credits <required>)))
 (effects
  ((add (completed)))))

))

(defun binding-list (var val-list)
  (cond ((null val-list) nil)
        ((null (car val-list)) (binding-list var (cdr val-list)))
        (t (append (list (list (list var (car val-list))))
                   (binding-list var (cdr val-list))))))


(defun Generate-credits (old new cred)
  (cond ((and (is-variable old) (is-variable new) (is-variable cred))
	  'no-match-attempted)
	((and (is-variable old) (is-variable new))
	 (append
	  (binding-list old        (generate-old-new-credits cred))
	  (binding-list new  (rest (generate-old-new-credits cred)))))

	((and (is-variable old) (is-variable cred))
	 (append
	  (binding-list cred '(3 4 5))
	  (binding-list old  (generate-old-credits new '(3 4 5)))))

	((and (is-variable new) (is-variable cred))
	 (append
	  (binding-list cred '(3 4 5))
	  (binding-list new  (generate-new-credits old '(3 4 5)))))

	((is-variable old)
	 (binding-list old  (list (- new cred))))

	((is-variable new)
	 (binding-list new  (list (+ old cred))))

	((is-variable cred)
	 (binding-list cred (list (- new old))))

	(t (= new (+ old cred)))))

;;
;; GENERATE-OLD-NEW-CREDITS:  Used by Generate-Credits when ONLY
;;   credits is known and possible bindings for OLD and NEW
;;   must be generated.  Generates numbers from 0 to *MAX-CREDITS*
;;   stepping by CRED.
;;
;; For *MAX-CREDITS* = 20:
;;   (generate-old-new-credits 3)  returns: (3 6 9 12 15 18 21)
;;   (generate-old-new-credits 4)  returns: (4 8 12 16 20)
;;   (generate-old-new-credits 5)  returns: (5 10 15 20)

(defun generate-old-new-credits (cred &optional (n 0))
  (cond
    ((>= n *MAX-CREDITS*) nil)
    ((cons (+ cred n) (generate-old-new-credits cred (+ n cred))))))

;;
;; GENERATE-NEW-CREDITS:  Used by Generate-Credits when we have
;;   ONLY OLD bound and we must generate possible bindings
;;   for NEW.  Generates numbers by adding each CRED candidate
;;   to OLD.
;;
;; For cred = '(3 4 5):
;;   (generate-new-credits 9 '(3 4 5))  returns: (12 13 14)
;;   (generate-new-credits 0 '(3 4 5))  returns: (3 4 5)
;;

(defun generate-new-credits (old cred)
  (cond
    ((null cred) nil)
    (t (cons (+ (first cred) old) (generate-new-credits old (rest cred))))))

;;
;; GENERATE-OLD-CREDITS:  Used by Generate-Credits when we have
;;   ONLY NEW bound and we must generate possible bindings
;;   for OLD.  Generates numbers by subtracting each CRED candidate
;;   from NEW.
;;
;; For cred = '(3 4 5):
;;   (generate-old-credits 9 '(3 4 5))  returns: (6 5 4)
;;   (generate-old-credits 5 '(3 4 5))  returns: (2 1 0)
;;   (generate-old-credits 4 '(3 4 5))  returns: (1 0)
;;

(defun generate-old-credits (new cred)
  (cond
    ((null cred) nil)
    ((OR (plusp (- new (first cred))) (zerop (- new (first cred))))
     (cons (- new (first cred)) (generate-old-credits new (rest cred))))
    (t nil)))




From c473ay@ms.washington.edu Thu May 16 12:53:48 1991
Received: from june.cs.washington.edu by wolf.cs.washington.edu (5.64/7.0jh)
	id AA08612; Thu, 16 May 91 12:53:17 -0700
Received: from entropy.ms.washington.edu by june.cs.washington.edu (5.64a/7.0jh)
	id AA00318; Thu, 16 May 91 13:09:27 -0700
Received: by entropy.ms.washington.edu
	(5.65/UW-NDC Revision: 2.21 ) id AA28459; Thu, 16 May 91 13:09:41 -0700
Date: Thu, 16 May 91 13:09:41 -0700
From: Douglas Ferry <c473ay@ms.washington.edu>
Message-Id: <9105162009.AA28459@entropy.ms.washington.edu>
To: cs473@june.cs.washington.edu
Subject: a prodigy question (surprise!)
Status: R

in my domain it is necessary to have an operator
MOVE-LEFT whose effects (subject to some preconditions)
are basically:
(effects (
  (add (at (- <x> 1) <y>))
  (del (at <x> <y>))))

it seems straightforward enough, since there should only be
one instance of an "at" predicate in the state at any given time

also, in the preconditions it's necessary to know what <x> and <y>
are. will they be bound with the effects i've given?

in another operator the "at" predicate does not appear in the effects
list (since it doesn't change) but it is still very necessary to know
the value of <x> and <y> in the current state.
would it make sense to use (at <x> <y>) as the first precondition
of any such operator? this bothers me because it's a non-static
generator.

if anyone has suggestions i'll be glad to accept them
thanx
-doug

