transpose defrule not work



On 7/15/10, Niitsuma Hirotaka <hirotaka.niitsuma at gmail.com> wrote:

> matchdeclare(xx,true);
> defrule(tranorm,transpose(norm2(xx)),norm2(xx));
> apply1(transpose(norm2(x.y)),tranorm );
>
> -> transpose(norm2(x.y))
> no change

Probably this is a noun/verb confusion.
Try this:

matchdeclare (xx, true);
foo : transpose (norm2 (xx));
/* now foo is a noun expression */
defrule (tranorm, ''foo, norm2 (xx));

Note that '' is two single quotes, not one double quote.

However I'm guessing that norm2 represents a norm function
in which case it is a scalar and you just want transpose to
return it unchanged. If so try this:

declare (norm2, scalar);
transpose (norm2 (whatever));
 => norm2 (whatever)

HTH

Robert Dodier