assume_pos SciMax Toolbox assumescalar

SciMax Toolbox >> assume_pos_pred

assume_pos_pred

Option variable

assume_pos_pred

Description

Default value: false

When assume_pos_pred is assigned the name of a function or a lambda expression of one argument x, that function is called to determine whether x is considered a parameter for the purpose of assume_pos. assume_pos_pred is ignored when assume_pos is false.

The assume_pos_pred function is called by sign and asksign with an argument x which is either an atom, a subscripted variable, or a function call expression. If the assume_pos_pred function returns true, x is considered a parameter for the purpose of assume_pos.

By default, a parameter is x such that symbolp (x) or subvarp (x).

See also and .

Examples:

(%i1) assume_pos: true$
(%i2) assume_pos_pred: symbolp$
(%i3) sign (a);
(%o3)                          pos
(%i4) sign (a[1]);
(%o4)                          pnz
(%i5) assume_pos_pred: lambda ([x], display (x), true)$
(%i6) asksign (a);
                              x = a
(%o6)                          pos
(%i7) asksign (a[1]);
                             x = a
                                  1
(%o7)                          pos
(%i8) asksign (foo (a));
                           x = foo(a)
(%o8)                          pos
(%i9) asksign (foo (a) + bar (b));
                           x = foo(a)
                           x = bar(b)
(%o9)                          pos
(%i10) asksign (log (a));
                              x = a
Is  a - 1  positive, negative, or zero?
p;
(%o10)                         pos
(%i11) asksign (a - b);
                              x = a
                              x = b
                              x = a
                              x = b
Is  b - a  positive, negative, or zero?
p;
(%o11)                         neg
assume_pos SciMax Toolbox assumescalar