@hackage unique-logic0.2

Solve simple simultaneous equations

Solve a number of equations simultaneously. This is not Computer Algebra, better think of a kind of type inference algorithm or logic programming with only one allowed solution.

Only one solution is computed. Simultaneous equations with multiple solutions are not allowed. However, variables may remain undefined. We do not even check for consistency, since with floating point numbers even simple rules may not be consistent.

The modules ordered with respect to abstraction level:

  • UniqueLogic.ST.System: Construct and solve sets of functional dependencies. Example: assignment3 (+) a b c meaning dependency a+b -> c.

  • UniqueLogic.ST.Rule: Combine functional dependencies to rules that can apply in multiple directions. Example: add a b c means relation a+b = c which resolves to dependencies a+b -> c, c-a -> b, c-b -> a.

  • UniqueLogic.ST.Expression: Allow to write rules using arithmetic operators. It creates temporary variables automatically. Example: (a+b)*c =:= d resolves to a+b = x, x*c = d.