From: Barton W. <wi...@un...> - 2023-09-30 17:12:20
|
I think you need to test for syntactic equality, not semantic equality. And you might need to head the setting of prederror too. The user documentation for “equal” has some details. Tests for semantic equality (%i5) block([prederror : false], is(equal((x+1)^2, x^2+2*x+1))); (%o5) true (%i1) block([prederror : true], is(equal(op(f(x,y)), 'del))); Unable to evaluate predicate equal(f,del) (%i2) block([prederror : false], is(equal(op(f(x,y)), 'del))); (%o2) unknown Test for syntactic equality (%i3) block([prederror : true], is(op(f(x,y))= 'del)); (%o3) false (%i4) block([prederror : false], is(op(f(x,y))= 'del)); (%o4) false Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows From: Eduardo Ochs<mailto:edu...@gm...> Sent: Saturday, September 30, 2023 7:42 AM To: <max...@li...><mailto:max...@li...> Subject: [Maxima-discuss] is(equal(op(f(x,y)), 'del)) -> unknown Non-NU Email Hi list, if I run these expressions in the REPL is(equal(op(del(w)), 'del)); is(equal(op(f(x,y)), 'del)); if is(equal(op(del(w)), 'del)) then "yes" else "no"; if is(equal(op(f(x,y)), 'del)) then "yes" else "no"; I get this: (%i1) is(equal(op(del(w)), 'del)); (%o1) true (%i2) is(equal(op(f(x,y)), 'del)); (%o2) unknown (%i3) if is(equal(op(del(w)), 'del)) then "yes" else "no"; (%o3) yes (%i4) if is(equal(op(f(x,y)), 'del)) then "yes" else "no"; (%o4) if unknown then yes else no (%i5) The is(equal(op(o),'del)) returns "true", "false", or "unknown". How do I replace it by something that converts the "unknown"s to "false"s? Thanks in advance! Eduardo Ochs http://anggtwu.net/eev-maxima.html<https://urldefense.com/v3/__http:/anggtwu.net/eev-maxima.html__;!!PvXuogZ4sRB2p-tU!GNaxwGVTipE82T-sI-zLuEl2633SKjs92BGP_Vw42MrMWqrXI91q9muM2zJpiIVrnnxBUAIFbohKpv2hRoI$> |