Actually, my pattern matcher in Maxima DOES some "solving"... in particular the example I gave..
matchdeclare(a,true); defrule(r1,f(a+1), g(a)); r1(f(4)) returns g(3) but it only solves simple linear forms. I think the lisp code for my matcher is fairly clear. matcom.lisp is the match "compiler" and matrun.lisp is its "runtime" support. RJF On Saturday, November 29, 2014 9:58:10 PM UTC-8, Richard Fateman wrote: > > > > On Saturday, November 29, 2014 8:29:56 AM UTC-8, Aaron Meurer wrote: >> >> >> <big snip> >> > > >> . >> >> Another question is, how can you teach the pattern matcher that a >> function maps to an identity, like cos(a)*x can match x with a = 0, or >> x**a*y can match y with a = 0? >> > > You can do this (trivially) but no one does because it is too expensive. > Simpler case > x is a pattern variable. > pattern is f(x+1) > expression is f(4) > method. f matches. Now to match x+1 to 4, you call your solve program, > and find out that x=3. > So "all" you need is solve. > > Your example requires solving cos(a)=1 for a. Unfortunately there are an > infinite number of solutions, not just a=0. > <snip> > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/36c7ae5f-3475-4c5e-b399-6a84c2703919%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
