From: Monica Besnier
Subject: alpha beta algorithm
Date: 
Message-ID: <3520@mtecv2.mty.itesm.mx>
Does somebody have an idea of how to program the Alpha beta algorithm in 
lisp without using setq and let? This is the algorithm I have, but I need
it without defining variables with the setq or using the let instruction:

(Defun alpha-beta (status level maxlevel alpha beta minmax)
 (tag sortie
   (cond ((eq level maxlevel) (list (eval-status status) status))
         (t (let ((nstatus (get-status status))
                  (best-status nil)
                  (Newminmax (if (eq minmax 'min) 'max 'min)))
         (mapc
          (lambda (edit) 
            (let ((val-edit (alpha-beta edit (1 + level) maxlevel
                                alpha beta newminmax)))
             (cond ((eq minmax 'min)
                    (when (> beta (car val-edit))
                          (setq beta (car val-edit))
                          (setq best-status edit)
                          (if (>= alpha beta)
                              (exit sortie (list beta edit)))))
                     (t (when (< alpha (car val-edit))
                              (setq alpha (car val-edit))
                              (setq best-status edit)
                              (if (>= alpha beta)
                                  (exit sortie (list alpha edit)))
           nstatus)
         (if (eq minmax 'min)
              (list beta best-status)
             (list alpha best-status)))))))

(defun get-status (status) (print 'status_sucesors) (read))

(defun eval-status (status) (print 'evaluate_status) (read))

well, that's it. If by any chance you have a different one, I would apreciate
it very much if you send it to me.

Thank you very much
Monica Besnier
········@TECMTYVM.MTY.ITESM.MX
········@MTECV2.MTY.ITESM.MX
 
From: John Gateley
Subject: Re: alpha beta algorithm
Date: 
Message-ID: <GATELEY.91Jul7194107@gefion.rice.edu>
In article <····@mtecv2.mty.itesm.mx> ········@mtecv2.mty.itesm.mx (Monica Besnier) writes:

   Does somebody have an idea of how to program the Alpha beta algorithm in 
   lisp without using setq and let? This is the algorithm I have, but I need
   it without defining variables with the setq or using the let instruction:

   [Algorithm deleted]

Yes, first use a store passing style a la denotational semantics to
get rid of your setq's. Second, translate it into combinatory logic
and you will have eliminated all bound variables. :^) :^) :^)

John
·······@rice.edu
--
"I've thought the thoughts of little children and the thoughts of men
 I've thought the thoughts of stupid people who have never been
 so much in love as they should be and got confused too easily
 to fall in love again." The Residents and Renaldo and the Loaf