Boost logo

Boost Users :

Subject: Re: [Boost-users] [Proto] implementing an computer algebra system with proto
From: Dave Jenkins (david_at_[hidden])
Date: 2009-01-30 11:38:55


"Kim Kuen Tang" <kuentang_at_[hidden]> wrote in message
news:497F760C.1030408_at_vodafone.de...
> The next step will be to extend the grammar with the feature of
> transforming such expression "1+2+var_+3=4" into
> this "var_=4-1-2-3".

Hi Kim Tang,

I think the attached program solves that problem.

The problem I've been working on is to use the distributive law to simplify
expressions at compile time.
For example, I'd like to transform "var_ * 2 + var_ * 3 = 4" to "var_ * (2 +
3) = 4".
Then, you could transform it to "var_ = 4 / (2 + 3)", all at compile time.
Wouldn't that be cool? I think it's possible using Proto, but I haven't
worked out the details yet.
Any suggestions are welcome.

Regards,
Dave Jenkins




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net