Sponsored links: Algebra eBooks
 

Related

symbolp

Run Example
(%i1)termp (e) := symbolp(e) or (numberp(e) and e >
 0)  or ((op(e) = "+" or op(e) = "*") and every (ptermp, args(e)));
(%o1) termp(e) := symbolp(e) or (numberp(e) and (e > 0))
               or (((op(e) = "+") or (op(e) = "*")) and every(ptermp, args(e)))
(%i2) matchdeclare (pterm, ptermp);
(%o2)                                done
(%i3) matchdeclare (otherterm, all);
(%o3)                                done
(%i4) defrule (r1, pterm + otherterm = 0, ratsimp (pterm/(-otherterm)) = 1);
                                                      pterm
(%o4)      r1 : pterm + otherterm = 0 -> (ratsimp(- ---------) = 1)
                                                    otherterm
(%i5) disprule(all);
                                                      pterm
(%t5)      r1 : pterm + otherterm = 0 -> (ratsimp(- ---------) = 1)
                                                    otherterm

(%o5)                                [%t5]
(%i6) apply1 ('(a*x - b - c + d = 0), r1);
(%o6)                         a x + d - c - b = 0
(%i7) apply1 (a*x - (b + g) - 2*c + d*e*f = 0, r1);
(%o7)                    a x - g + d e f - 2 c - b = 0
(%i8) 
Run Example
sublist_indices ('[a, b, b, c, 1, 2, b, 3, b],                                 lambda ([x], x='b));
(%o1)                            [2, 3, 7, 9]
(%i2)  sublist_indices ('[a, b, b, c, 1, 2, b, 3, b], symbolp);
(%o2)                         [1, 2, 3, 4, 7, 9]
(%i3)  sublist_indices ([1 >
 0, 1 <
 0, 2 <
 1, 2 >
 1, 2 >
 0],                                 identity);
(%o3)                              [1, 4, 5]
(%i4)  assume (x <
 -1);
(%o4)                              [x < - 1]
(%i5)  map (maybe, [x >
 0, x <
 0, x <
 -2]);
(%o5)                       [false, true, unknown]
(%i6)  sublist_indices ([x >
 0, x <
 0, x <
 -2], identity);
(%o6)                                 [2]
(%i7) 
Run Example
termp (e) := symbolp(e) or (numberp(e) and e >
 0)  or ((op(e) = "+" or op(e) = "*") and every (ptermp, args(e)));
(%o1) termp(e) := symbolp(e) or (numberp(e) and (e > 0))
               or (((op(e) = "+") or (op(e) = "*")) and every(ptermp, args(e)))
(%i2) matchdeclare (pterm, ptermp);
(%o2)                                done
(%i3) matchdeclare (otherterm, all);
(%o3)                                done
(%i4) defrule (r1, pterm + otherterm = 0, ratsimp (pterm/(-otherterm)) = 1);
                                                      pterm
(%o4)      r1 : pterm + otherterm = 0 -> (ratsimp(- ---------) = 1)
                                                    otherterm
(%i5) 

Related Help

Help for Symbolp