applyrule - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Operations : Substitution : applyrule

applyrule

applying rules

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

applyrule(rule, expr)

applyrule([rule1, rule2, ...], expr)

Parameters

expr

-

expression the rules are applied to

rule

-

rule

Description

• 

With applyrule a rule or a list of rules can be applied to a given expression. applyrule computes the fix point, it applies the rules until no rule can be applied any more. It is more powerful than the command subs, but does not do mathematical transformations as algsubs does.

• 

Rules are given as equations or in the syntax of the pattern matcher with parameters. See patmatch.

Examples

applyrulea+b=x,fa+b+c

fx+c

(1)

applyrulex=y,x2

y2

(2)

applyrulex2=y,fx2,ⅇsinx+2x2

fy,ⅇsinx+2y

(3)

applyrulefa::integerx=afx,f2x+gxfpx

2fx+gxfpx

(4)

applyrulea::even=even,a::prime=prime,1,2,4,3,5,6,4,8,15,21

1,even,even,prime,prime,even,even,even,15,21

(5)

applyrulesin2x=2sinxcosx,sinx+sin2xcosx

sinx+2sinxcosxcosx

(6)

See Also

algsubs

compiletable

define

patmatch

subs

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam