Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Var = Int
- type Val = Int
- type CSPMonad r = ReaderT (CSP r) IO
- data CSP r = MkCSP {
- cspDomains :: Domains
- cspVariables :: Variables
- cspConstraints :: Constraints
- cspRandomCap :: Int
- cspTermination :: Int -> Assignment -> CSPMonad r (Maybe r)
- type Domains = IntMap IntSet
- type Variables = IntSet
- type Constraints = [(Variables, Assignment -> Bool)]
- type Assignment = IntMap Val
- data Solution
- fromSolution :: Solution -> Assignment
Documentation
Represents a contraint satisfaction problem
MkCSP | |
|
type Domains = IntMap IntSet Source #
Represents the domains for different variables. The variables are indexed by integers
type Constraints = [(Variables, Assignment -> Bool)] Source #
Represents the constraints for the timetabling problem. The first element of the tuple represents the variables this constraint affects, the second is the constraint itself
type Assignment = IntMap Val Source #
Represents an assignment of variables
This is returned by the IFS. Complete
indicates the assignment is
complete, and Incomplete
indicates the assignment is not complete
fromSolution :: Solution -> Assignment Source #
fromSolution
solution
extracts an Assignment
value from a Solution
value