Friday, October 15, 2010

Doing things smarter

Ok, so we have a basic thing going. Soon enough gestures for multiplication, division, and factoring will be in.

Right now they're being done on a case-by-case basis though. That's not too good. It's really bad actually. Instead we should be doing all of this with a solver.

A solver is something that recursively applies algebra rules until it reaches a desired form. Here's a link to javascript->prolog (http://ioctl.org/logic/prolog1). That's basically all we need.

This is really a math problem, which declarative programming can be rather good at. So what should queries look like?

Part of the difficulty is just identifying what needs to be solved. The user makes some gestures involving different symbols. For simple additivity this is taking a symbol, a for instance, and trying to get it on the other side of the the '=' operator.

So, a recursive solver would just start going through possible operations on a that may lead to this. A Prolog-like approach would be especially good, with cuts and all that jazz. But aah, that link doesn't have cuts. hMmmm. But, what's this? OMG http://yieldprolog.sourceforge.net/
That looks quite promising. As does this project. Awesome!

No comments:

Post a Comment