| Copyright | (c) Masahiro Sakai 2014 |
|---|---|
| License | BSD-style |
| Maintainer | masahiro.sakai@gmail.com |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
ToySolver.Arith.VirtualSubstitution
Contents
Description
Naive implementation of virtual substitution
Reference:
- V. Weispfenning. The complexity of linear problems in fields. Journal of Symbolic Computation, 5(1-2): 3-27, Feb.-Apr. 1988.
- Hirokazu Anai, Shinji Hara. Parametric Robust Control by Quantifier Elimination. J.JSSAC, Vol. 10, No. 1, pp. 41-51, 2003.
- type QFFormula = BoolExpr (Atom Rational)
- evalQFFormula :: Model Rational -> QFFormula -> Bool
- project :: Var -> QFFormula -> (QFFormula, Model Rational -> Model Rational)
- projectN :: VarSet -> QFFormula -> (QFFormula, Model Rational -> Model Rational)
- projectCases :: Var -> QFFormula -> [(QFFormula, Model Rational -> Model Rational)]
- projectCasesN :: VarSet -> QFFormula -> [(QFFormula, Model Rational -> Model Rational)]
- solve :: VarSet -> [Atom Rational] -> Maybe (Model Rational)
- solveQFFormula :: VarSet -> QFFormula -> Maybe (Model Rational)
Documentation
evalQFFormula :: Model Rational -> QFFormula -> Bool Source
returns whether evalQFFormula M φM ⊧_LRA φ or not.
Projection
project :: Var -> QFFormula -> (QFFormula, Model Rational -> Model Rational) Source
returns project x φ(ψ, lift) such that:
⊢_LRA ∀y1, …, yn. (∃x. φ) ↔ ψwhere{y1, …, yn} = FV(φ) \ {x}, and- if
M ⊧_LRA ψthenlift M ⊧ φ.
projectN :: VarSet -> QFFormula -> (QFFormula, Model Rational -> Model Rational) Source
returns projectN {x1,…,xm} φ(ψ, lift) such that:
⊢_LRA ∀y1, …, yn. (∃x1, …, xm. φ) ↔ ψwhere{y1, …, yn} = FV(φ) \ {x1,…,xm}, and- if
M ⊧_LRA ψthenlift M ⊧_LRA φ.
projectCases :: Var -> QFFormula -> [(QFFormula, Model Rational -> Model Rational)] Source
returns projectCases x φ[(ψ_1, lift_1), …, (ψ_m, lift_m)] such that:
⊢_LRA ∀y1, …, yn. (∃x. φ) ↔ (ψ_1 ∨ … ∨ φ_m)where{y1, …, yn} = FV(φ) \ {x}, and- if
M ⊧_LRA ψ_ithenlift_i M ⊧_LRA φ.
projectCasesN :: VarSet -> QFFormula -> [(QFFormula, Model Rational -> Model Rational)] Source
returns projectCasesN {x1,…,xm} φ[(ψ_1, lift_1), …, (ψ_n, lift_n)] such that:
⊢_LRA ∀y1, …, yp. (∃x. φ) ↔ (ψ_1 ∨ … ∨ φ_n)where{y1, …, yp} = FV(φ) \ {x1,…,xm}, and- if
M ⊧_LRA ψ_ithenlift_i M ⊧_LRA φ.
Constraint solving
solve :: VarSet -> [Atom Rational] -> Maybe (Model Rational) Source
returns solve {x1,…,xn} φJust M such that M ⊧_LRA φ when
such M exists, returns Nothing otherwise.
FV(φ) must be a subset of {x1,…,xn}.
solveQFFormula :: VarSet -> QFFormula -> Maybe (Model Rational) Source
returns solveQFFormula {x1,…,xn} φJust M such that M ⊧_LRA φ when
such M exists, returns Nothing otherwise.
FV(φ) must be a subset of {x1,…,xn}.