From: SourceForge.net <no...@so...> - 2006-04-10 05:30:29
|
Bugs item #1052382, was opened at 2004-10-22 12:33 Message generated for change (Settings changed) made by robert_dodier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1052382&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. >Category: Lisp Core - Assume Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stavros Macrakis (macrakis) Assigned to: Nobody/Anonymous (nobody) Summary: assume hard to use programmatically Initial Comment: assume(r>0 and r<1) works fine. However, if I have a function withassume(pred,expr) := ( assume(pred), expand(expr) ); you get withassume(r>0 and r<1, abs(r)) => ERROR: can't eval predicate r>0 Quoting doesn't help: withassume('(r>0 and r<1), abs(r)) => error withassume('('(r>0) and '(r<1)), abs(r)) => error withassume(('"and")(r>0) and '(r<1)), abs(r)) => error withassume('("and")(r>0) and '(r<1)), abs(r)) => error There is a workaround, however: withassume(pred,expr) := ( apply('assume,[pred]), expand(expr) ); You still have to quote the argument, but it works now: withassume('(r>0 and r<1), abs(r)) => r Alternatively, you can use the noun form of AND: withassume('("and")(r>0,r<1),abs(r)) => r Yuck in both cases. ------------------------------ Discussion The underlying problem is that "is", "assume", "forget", etc. quote their arguments then depend on their own little idiosyncratic evaluator.... Also that noun-form logical connectives (and, or, if) aren't really supported. Maxima version: 5.9.0.9beta2 Maxima build date: 10:50 7/27/2004 host type: i686-pc-mingw32 lisp-implementation-type: Kyoto Common Lisp lisp-implementation-version: GCL 2.6.3 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=1052382&group_id=4933 |