From: Robert D. <rob...@gm...> - 2014-06-29 19:24:54
|
On 2014-06-29, Dimiter Prodanov <dim...@gm...> wrote: > (matchdeclare (u, atom, fn, symbolp), > defrule (ddint21, 'integrate(delta(u)*fn(u), u, minf, inf), fn(0)) > ); > >>> ddint21('integrate(delta(u)*fn(u), u, minf, inf)); > output false > should be > fn(0) That's a bug in the function which is generated for that rule. I've appended the generated code below -- you can see that TR-GENSYM7 is referenced but without being assigned a value before. I suspect that the (KAAR TR-GENSYM7) should be (KAAR TR-GENSYM3). (An alternative suspicion is that the immediately preceding (SETQ TR-GENSYM3 ...) should be (SETQ TR-GENSYM7 ...).) I'll look at fixing the bug although it might be tricky to figure it out. A work-around is to phrase the rule in a different way which doesn't trigger the bug; here's an example. There are probably other formulations that also work. (%i1) display2d : false $ (%i2) matchdeclare (aa, all, xx, symbolp) $ (%i3) simp : false $ (%i4) defrule (r1, 'integrate(delta(xx)*aa, xx, minf, inf), subst (xx = 0, aa)) $ (%i5) simp : true $ (%i6) r1 ('integrate (delta(u)*f(u)*g(t - u), u, minf, inf)); (%o6) f(0)*g(t) best Robert Dodier PS. I'm working with Clisp. :lisp #'$ddint21 #<FUNCTION LAMBDA (TR-GENSYM1) (DECLARE (SPECIAL TR-GENSYM1)) (CATCH 'MATCH (PROG ($FN $U TR-GENSYM2 TR-GENSYM3 TR-GENSYM4 TR-GENSYM5 TR-GENSYM6 TR-GENSYM7 TR-GENSYM8 TR-GENSYM9 TR-GENSYM10 TR-GENSYM11 TR-GENSYM12 TR-GENSYM13) (DECLARE (SPECIAL $FN $U TR-GENSYM2 TR-GENSYM3 TR-GENSYM4 TR-GENSYM5 TR-GENSYM6 TR-GENSYM7 TR-GENSYM8 TR-GENSYM9 TR-GENSYM10 TR-GENSYM11 TR-GENSYM12 TR-GENSYM13)) (COND ((NOT (EQUAL (KAAR TR-GENSYM1) '%INTEGRATE)) (MATCHERR))) (SETQ TR-GENSYM2 (KDR TR-GENSYM1)) (SETQ TR-GENSYM3 (KAR TR-GENSYM2)) (SETQ TR-GENSYM4 (FINDFUN TR-GENSYM3 (MEVAL '$DELTA) 'MTIMES)) (SETQ TR-GENSYM5 (KDR TR-GENSYM4)) (SETQ TR-GENSYM6 (KAR TR-GENSYM5)) (COND ((DEFINITELY-SO '(($ATOM) TR-GENSYM6)) (MSETQ $U TR-GENSYM6)) ((MATCHERR))) (COND ((NTHKDR TR-GENSYM5 1) (MATCHERR))) (SETQ TR-GENSYM3 (MEVAL '((MQUOTIENT) TR-GENSYM3 (($DELTA SIMP) $U)))) (MSETQ $FN (KAAR TR-GENSYM7)) (SETQ TR-GENSYM8 (FINDFUN TR-GENSYM3 $FN 'MTIMES)) (SETQ TR-GENSYM9 (KDR TR-GENSYM8)) (SETQ TR-GENSYM10 (KAR TR-GENSYM9)) (COND ((NOT (ALIKE1 TR-GENSYM10 (MEVAL '$U))) (MATCHERR))) (COND ((NTHKDR TR-GENSYM9 1) (MATCHERR))) (SETQ TR-GENSYM3 (MEVAL '((MQUOTIENT) TR-GENSYM3 (($FN SIMP) $U)))) (COND ((NOT (EQUAL TR-GENSYM3 1)) (MATCHERR))) (SETQ TR-GENSYM11 (KAR (KDR TR-GENSYM2))) (COND ((NOT (ALIKE1 TR-GENSYM11 (MEVAL '$U))) (MATCHERR))) (SETQ TR-GENSYM12 (KAR (KDR (KDR TR-GENSYM2)))) (COND ((NOT (ALIKE1 TR-GENSYM12 (MEVAL '$MINF))) (MATCHERR))) (SETQ TR-GENSYM13 (KAR (KDR (KDR (KDR TR-GENSYM2))))) (COND ((NOT (ALIKE1 TR-GENSYM13 (MEVAL '$INF))) (MATCHERR))) (COND ((NTHKDR TR-GENSYM2 4) (MATCHERR))) (RETURN (VALUES (MEVAL '(($FN SIMP) 0)) T))))> |