Hello,
Here is a patch for PART+ in src/matrun.lisp. My guess is that
there should be some more discussion before this patch is applied.
The purpose of this patch is to get tellsimpafter rules for
addition to function as expected when operands satisfy the
same predicate.
After loading the patched matrun.lisp, I find run_testsuite()
reports no unexpected errors, which is not surprising since
this patch only affects tellsimp and tellsimpafter rules for "+".
demo('ineq), which does define rules for "+", seems to run
the same with the patch as without it.
The base 60 hacks which I've cooked up (see my next email message)
work as expected with this patch.
Doubtless more careful testing is called for.
For what it's worth,
Robert Dodier
--- matrun.lisp 25 Nov 2004 02:36:03 -0000 1.5
+++ matrun.lisp 6 Mar 2005 21:41:48 -0000
@@ -157,19 +157,21 @@
(cond (flag (merror "Two or more pattern variables
`true'"))
(t (setq flag t p (reverse p) preds (reverse
preds))
(go a))))
- (t (mset (car p) 0)))
+ (t (mset (car p) 0))) ; UM, IS THIS STILL NEEDED ??
(setq saved 0)
(mapc
#'(lambda (z)
- (cond ((null (setq val (catch 'match (mcall (car preds) z))))
nil)
+ (cond ((null (car preds)) nil)
+ ((null (setq val (catch 'match (mcall (car preds) z))))
nil)
(t (setq saved (add2* saved val))
+ (let ((var (cadr (cadadr (cadddr (car preds))))))
+ (setq p (zl-delete var p 1))
+ (setq preds (cdr preds)))
(setq e (zl-delete z e 1)))))
e)
(cond ((and (equal saved 0)
(null (setq val (catch 'match (mcall (car preds)
0)))))
(matcherr)))
- (mset (car p) saved)
- (setq preds (cdr preds) p (cdr p))
(go a)))
(defmfun part* (e p preds)
__________________________________
Celebrate Yahoo!'s 10th Birthday!
Yahoo! Netrospective: 100 Moments of the Web
http://birthday.yahoo.com/netrospective/