unique-logic: 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. The solver may optionally check for consistency. It does not do so by default since with floating point numbers or symbolic expressions even simple rules may not be consistent.
The modules ordered with respect to abstraction level are:
UniqueLogic.ST.System: Construct and solve sets of functional dependencies. Example:
assignment3 (+) a b cmeaning dependency
a+b -> c.
UniqueLogic.ST.Rule: Combine functional dependencies to rules that can apply in multiple directions. Example:
add a b cmeans relation
a+b = cwhich resolves to dependencies
a+b -> c, c-a -> b, c-b -> a. For an executable example see UniqueLogic.ST.Example.Rule.
UniqueLogic.ST.Expression: Allows to write rules using arithmetic operators. It creates temporary variables automatically. Example:
(a+b)*c =:= dresolves to
a+b = x, x*c = d. For an executable example see UniqueLogic.ST.Example.Expression.
UniqueLogic.ST.System.Label: Provides a custom constructor for variables. When creating a variable you decide whether and how an assignment to this variable shall be logged. There is an example that shows how to solve a logic system using symbolic expressions. The naming and logging allows us to observe shared intermediate results. For an executable example see UniqueLogic.ST.Example.Label.
By using more sophisticated monad transformers, we can check the equations for consistency, report inconsistencies and how they arised. We demonstrate that in UniqueLogic.ST.Example.Verify.
The package is purely Haskell 98.
|Versions||0.2, 0.3, 0.4|
|Dependencies||base (==4.*), explicit-exception (>=0.1.7 && <0.2), transformers (>=0.2 && <0.6), utility-ht (>=0.0.9 && <0.1) [details]|
|Maintainer||Henning Thielemann <firstname.lastname@example.org>|
|Source repo||this: darcs get http://hub.darcs.net/thielema/unique-logic/ --tag 0.4
head: darcs get http://hub.darcs.net/thielema/unique-logic/
|Uploaded||by HenningThielemann at Sat Feb 17 22:48:49 UTC 2018|
|Downloads||943 total (13 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
|Status||Docs available [build log]
Last success reported on 2018-02-17 [all 1 reports]
Hackage Matrix CI
For package maintainers and hackage trustees