Copyright | (c) Masahiro Sakai 2012 |
---|---|
License | BSD-style |
Maintainer | masahiro.sakai@gmail.com |
Stability | provisional |
Portability | non-portable (TypeSynonymInstances, FlexibleInstances, ScopedTypeVariables) |
Safe Haskell | None |
Language | Haskell2010 |
A simple model finder.
References:
- Koen Claessen and Niklas Sörensson. New Techniques that Improve MACE-style Finite Model Finding. CADE-19. 2003. http://www.cs.miami.edu/~geoff/Conferences/CADE/Archive/CADE-19/WS4/04.pdf
- type Var = String
- type FSym = String
- type PSym = String
- data GenLit a
- data Term
- data Atom = PApp PSym [Term]
- type Lit = GenLit Atom
- type Clause = [Lit]
- type Formula = GenFormula Atom
- data GenFormula a
- = T
- | F
- | Atom a
- | And (GenFormula a) (GenFormula a)
- | Or (GenFormula a) (GenFormula a)
- | Not (GenFormula a)
- | Imply (GenFormula a) (GenFormula a)
- | Equiv (GenFormula a) (GenFormula a)
- | Forall Var (GenFormula a)
- | Exists Var (GenFormula a)
- toSkolemNF :: forall m. Monad m => (String -> Int -> m FSym) -> Formula -> m [Clause]
- data Model = Model {}
- type Entity = Int
- showModel :: Model -> [String]
- showEntity :: Entity -> String
- findModel :: Int -> [Clause] -> IO (Maybe Model)
Formula types
Generalized literal type parameterized by atom type
type Formula = GenFormula Atom Source
data GenFormula a Source
T | |
F | |
Atom a | |
And (GenFormula a) (GenFormula a) | |
Or (GenFormula a) (GenFormula a) | |
Not (GenFormula a) | |
Imply (GenFormula a) (GenFormula a) | |
Equiv (GenFormula a) (GenFormula a) | |
Forall Var (GenFormula a) | |
Exists Var (GenFormula a) |
Eq a => Eq (GenFormula a) | |
Ord a => Ord (GenFormula a) | |
Show a => Show (GenFormula a) |
toSkolemNF :: forall m. Monad m => (String -> Int -> m FSym) -> Formula -> m [Clause] Source
normalize a formula into a skolem normal form.
TODO:
- Tseitin encoding
Model types
showEntity :: Entity -> String Source
print entity