
-- Input for page PatternMatching
)clear all

square := operator 'square
rule square(x) == x*x
fact(n | n > 0) == n * fact(n - 1)
fact(0) == 1
f('A) == 1
f(0) == 0 otherwise
binary(true) == 1
binary(false) == 0
sinValues == rules
  sin(%pi) == 0
  sin(%pi/4) == sqrt(2)/2
integrate(log(1 + tan(x)),x,0,%pi/4) == %pi/8*log(2)
powerOf(x,x) == 1
powerOf(x,x**n) == n
powerOf(x,y) == 0 otherwise
powerOf(x,x**n%) == n%
powerOf(x,y) == 0 otherwise
linearExponent?(exp(%a*x+%b | freeOf?(%a,x) and freeOf?(%b,x)),x) == true
linearExponent?(exp(a) | freeOf?(a,x),x) == true
linearExponent?(u,x) == false
linearExponent?(exp(x),x) == true
linearExponent?(exp(a*x) | freeOf?(a,x),x) == true
linearExponent?(exp(x+b) | freeOf?(b,x),x) == true
linearExponent?(exp(a*x+b,x) | freeOf?(a,x) and freeOf?(b,x)) == true
