
23 Jan
2009
23 Jan
'09
6:04 p.m.
"Eric Niebler"
A general equation solver will be challenging to write, but should be possible. You'll need to familiarize yourself with Proto grammars and transforms. Here is a toy example to get you started. Hope it helps.
Suppose you want to move a series of additions to the right hand side. For example, transforming "var_ + 1 + 3 = 2" into "var_ = 2 - 3 - 1". Is there a general way to iterate the Solve() transform until all the plusses are consumed? Or do you need multiple calls to Solve(), e.g. "proto::display_expr( Solve()Solve()( var_ + 1 + 3 = 2 ) );" Thanks, Dave Jenkins