On Thu, Jan 08, 2004 at 10:33:15AM -0500, Stavros Macrakis wrote:
>
> -------------------------------------------
>
> As for handling negation of relations, it is easy enough to write your
> own function to do this:
>
> makelist(negate_relation[x[1]]: x[2], x,
> [["<",">="],["<=",">"],["=","#"],[">=","<"],[">","<="],["#","="])$
>
> negate_relation(ex):=
> if atom(ex) or not member(op(ex),["<","<=","=",">=",">","#"])
> then error("Can only negate relations, not",ex)
> else funmake(negate_relation[op(ex)],args(ex))$
>
> -------------------------------------------
>
Many thanks! I have caught the idea. As I work with integrals,
the endpoints does not matter. Thus, I agree if "a>b" is transformed
into "b>a", not necessarily into "b>=a". And this is simple:
(C1) prefix(IR)$ IR expr:= funmake(OP(expr),reverse(args(expr)))$
(C2)
(C3) IR(a>b+c);
(D3) c + b > a
(C4) expr:SIN(x)+0.5>0;
(D4) SIN(x) + 0.5 > 0
(C5) IR expr;
(D5) 0 > SIN(x) + 0.5
Looks great,
--
Alexander