| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Numeric.Limp.Canon.Convert
Description
Convert from Numeric.Limp.Program representation to simpler, so-called canonical representation.
Documentation
constraint :: (Rep c, Ord z, Ord r) => Constraint z r c -> Constraint z r c Source
Convert a Frontend Constraint into a Canon Constraint.
Should satisfy that
forall a c. P.check a c == check a (constraint c)
program :: (Rep c, Ord z, Ord r) => Program z r c -> Program z r c Source
Convert a Frontend Program into a Canon Program.
If we had a solve function that worked on either, it would ideally satisfy
forall p. P.solve p == solve (program p)
However, due to potential non-determinism in solving functions, it could be possible to get a different, but still optimal, solution:
forall p. let aP = P.solve p
p' = program p
a = solve p'
in P.eval aP (P._objective p) == eval a (_objective p')
&& check a (P._constraints p) && check ...