Safe Haskell | None |
---|---|
Language | Haskell2010 |
A module providing program building capabilities for both ground and non-ground programs.
- data Backend s
- data ProgramBuilder s
- newtype Node = Node {}
- data Literal s
- data Atom s
- data ExternalType
- = ExtFree
- | ExtTrue
- | ExtFalse
- | ExtRelease
- data HeuristicType
- assume :: Foldable t => t (AspifLiteral s) -> GroundStatement s
- data GroundStatement s
- addGroundStatements :: Foldable t => Backend s -> t (GroundStatement s) -> Clingo s ()
- acycEdge :: Foldable t => Node -> Node -> t (Literal s) -> GroundStatement s
- atom :: (MonadIO m, MonadThrow m) => Backend s -> m (Atom s)
- atomAspifLiteral :: Atom s -> AspifLiteral s
- negateAspifLiteral :: AspifLiteral s -> AspifLiteral s
- external :: Atom s -> ExternalType -> GroundStatement s
- heuristic :: Foldable t => Atom s -> HeuristicType -> Int -> Natural -> t (AspifLiteral s) -> GroundStatement s
- minimize :: Foldable t => Integer -> t (WeightedLiteral s) -> GroundStatement s
- rule :: Foldable t => Bool -> t (Atom s) -> t (AspifLiteral s) -> GroundStatement s
- weightedRule :: Foldable t => Bool -> t (Atom s) -> Natural -> t (WeightedLiteral s) -> GroundStatement s
- project :: Foldable t => t (Atom s) -> GroundStatement s
- addStatements :: Traversable t => ProgramBuilder s -> t (Statement (Symbol s) (Signature s)) -> Clingo s ()
Documentation
data ProgramBuilder s Source #
data ExternalType Source #
data HeuristicType Source #
assume :: Foldable t => t (AspifLiteral s) -> GroundStatement s Source #
Add an assumption directive.
Ground Programs
data GroundStatement s Source #
A GroundStatement
is a statement built from ground atoms. Because the
atoms are only valid within the context of clingo, they may not leave this
context. They can be added to the current program using the
addGroundStatements
function.
addGroundStatements :: Foldable t => Backend s -> t (GroundStatement s) -> Clingo s () Source #
Add a collection of GroundStatement
to the program via a Backend
handle.
acycEdge :: Foldable t => Node -> Node -> t (Literal s) -> GroundStatement s Source #
Build an edge directive.
atom :: (MonadIO m, MonadThrow m) => Backend s -> m (Atom s) Source #
Obtain a fresh atom to be used in aspif directives.
atomAspifLiteral :: Atom s -> AspifLiteral s Source #
Use an Atom as a positive AspifLiteral
negateAspifLiteral :: AspifLiteral s -> AspifLiteral s Source #
external :: Atom s -> ExternalType -> GroundStatement s Source #
Build an external statement.
:: Foldable t | |
=> Atom s | |
-> HeuristicType | |
-> Int | Bias |
-> Natural | Priority |
-> t (AspifLiteral s) | Condition |
-> GroundStatement s |
Build a heuristic directive.
:: Foldable t | |
=> Integer | Priority |
-> t (WeightedLiteral s) | Literals to minimize |
-> GroundStatement s |
Build a minimize constraint (or weak constraint).
:: Foldable t | |
=> Bool | Is a choice rule? |
-> t (Atom s) | Head |
-> t (AspifLiteral s) | Body |
-> GroundStatement s |
Build a rule.
:: Foldable t | |
=> Bool | Is a choice rule? |
-> t (Atom s) | Head |
-> Natural | Lower Bound |
-> t (WeightedLiteral s) | Body |
-> GroundStatement s |
Build a weighted rule.
Non-Ground Programs
addStatements :: Traversable t => ProgramBuilder s -> t (Statement (Symbol s) (Signature s)) -> Clingo s () Source #
Add a collection of non-ground statements to the solver.