On 30/03/13 12:01, Ralf Hemmecke wrote:
Unless you specify what solver you intend to write, it's probably an
unsolvable task to write a general solver that works for all types of
algebras.

Ralf

Agreed, but I was thinking more about doing it on a per-domain basis and building up gradually.

So we start with a very simple algebra that we want to create a equation solver for, for example we might want to create an algebra domain based on this category:

MyAlgebra() : Category with
  myOp1 : ($,$) -> $
  myOp2 : ($) -> $

Then create an expression holder that is specific to that algebra:

MyAlgebraExpression() : Exports == Implementation where
  Implementation == add
  Rep := Union(_
         literalTerm : MyAlgebra, _
         variableTerm : Symbol, _
         myOp1Term : Record(left: $, right: $), _
         myOp2Term : $_
         )
  bind : (Symbol,MyAlgebra,$) -> $
  canonicalForm : $ -> $
  decomposeMyOp1 : $ -> ($,$)
  decomposeMyOp2 : $ -> ($)

Then create an equation solver that is also specific to that algebra:

MyAlgebraEquation() : Exports == Implementation where
  Implementation == add
  Rep := Record(left: MyAlgebraExpression, right: MyAlgebraExpression)
  solveFor : (Symbol,$) -> MyAlgebraExpression

This would require 3 domains for every algebra that we wanted to be able to solve but why not have some separate common rule interpreter code. So MyAlgebraEquation domain would consist mostly of a set of substitution rules for that particular algebra?

Martin




_______________________________________________
Axiom-mail mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/axiom-mail

Reply via email to