Am Dienstag, den 17.11.2009, 18:46 -0600 schrieb Barton Willis:
> It should be possible to wrap a function inside a function that calls
> well-formed-p on the input and the output. Maybe there is some general
> scheme (a macro?) for doing this?
I have to think about it, but other developer may know more about
implementing such a scheme.
My fist implementation is not complete. I have stopped to implement the
last conditional. This is the more complete version. With this version
we get some more bad formed expressions from the testsuite.
(defun well-formed-p (form flag)
(let ((expr (specrepcheck form)))
(cond ((atom expr))
((and (listp (car expr))
(member (caar expr) '(mdefine lambda))))
((and flag
(listp (car expr))
(member 'simp (car expr)))
(do ((l (cdr expr) (cdr l)))
((null l) t)
(when (not (well-formed-p (car l) t))
(return nil))))
((and (not flag)
(listp (car expr)))
(cond ((member 'simp (car expr))
(do ((l (cdr expr) (cdr l)))
((null l) t)
(when (not (well-formed-p (car l) t))
(return nil))))
(t
(do ((l (cdr expr) (cdr l)))
((null l) t)
(when (not (well-formed-p (car l) nil))
(return nil)))))))))
As a first work I have removed bad simplified expressions generated by
the functions of the files gamma.lisp and expintegral.lisp (my errors).
Dieter Kaiser