Safe Haskell | None |
---|---|
Language | Haskell2010 |
Clingo.AST
- parseProgram :: Text -> Maybe (ClingoWarning -> Text -> IO ()) -> Natural -> Clingo s [Statement (Symbol s) (Signature s)]
- fromPureAST :: (Monad (m s), MonadSymbol m) => [Statement PureSymbol PureSignature] -> m s [Statement (Symbol s) (Signature s)]
- toPureAST :: [Statement (Symbol s) (Signature s)] -> [Statement PureSymbol PureSignature]
- data Location = Location {}
- data Sign
- data Signature s
- data Symbol s
- data UnaryOperation a = UnaryOperation UnaryOperator (Term a)
- data UnaryOperator
- data BinaryOperation a = BinaryOperation BinaryOperator (Term a) (Term a)
- data BinaryOperator
- data Interval a = Interval (Term a) (Term a)
- data Function a = Function Text [Term a]
- data Pool a = Pool [Term a]
- data Term a
- = TermSymbol Location a
- | TermVariable Location Text
- | TermUOp Location (UnaryOperation a)
- | TermBOp Location (BinaryOperation a)
- | TermInterval Location (Interval a)
- | TermFunction Location (Function a)
- | TermExtFunction Location (Function a)
- | TermPool Location (Pool a)
- data CspProductTerm a = CspProductTerm Location (Term a) (Maybe (Term a))
- data CspSumTerm a = CspSumTerm Location [CspProductTerm a]
- data CspGuard a = CspGuard ComparisonOperator (CspSumTerm a)
- data ComparisonOperator
- data CspLiteral a = CspLiteral (CspSumTerm a) [CspGuard a]
- data Identifier = Identifier Location Text
- data Comparison a = Comparison ComparisonOperator (Term a) (Term a)
- data Literal a
- = LiteralBool Location Sign Bool
- | LiteralTerm Location Sign (Term a)
- | LiteralComp Location Sign (Comparison a)
- | LiteralCSPL Location Sign (CspLiteral a)
- data AggregateGuard a = AggregateGuard ComparisonOperator (Term a)
- data ConditionalLiteral a = ConditionalLiteral (Literal a) [Literal a]
- data Aggregate a = Aggregate [ConditionalLiteral a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a))
- data BodyAggregateElement a = BodyAggregateElement [Term a] [Literal a]
- data BodyAggregate a = BodyAggregate AggregateFunction [BodyAggregateElement a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a))
- data AggregateFunction
- data HeadAggregateElement a = HeadAggregateElement [Term a] (ConditionalLiteral a)
- data HeadAggregate a = HeadAggregate AggregateFunction [HeadAggregateElement a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a))
- data Disjunction a = Disjunction [ConditionalLiteral a]
- data DisjointElement a = DisjointElement Location [Term a] (CspSumTerm a) [Literal a]
- data Disjoint a = Disjoint [DisjointElement a]
- data TheoryTermArray a = TheoryTermArray [TheoryTerm a]
- data TheoryFunction a = TheoryFunction Text [TheoryTerm a]
- data TheoryUnparsedTermElement a = TheoryUnparsedTermElement [Text] (TheoryTerm a)
- data TheoryUnparsedTerm a = TheoryUnparsedTerm [TheoryUnparsedTermElement a]
- data TheoryTerm a
- data TheoryAtomElement a = TheoryAtomElement [TheoryTerm a] [Literal a]
- data TheoryGuard a = TheoryGuard Text (TheoryTerm a)
- data TheoryAtom a = TheoryAtom (Term a) [TheoryAtomElement a] (TheoryGuard a)
- data HeadLiteral a
- data BodyLiteral a
- data TheoryOperatorDefinition = TheoryOperatorDefinition Location Text Natural TheoryOperatorType
- data TheoryOperatorType
- data TheoryTermDefinition = TheoryTermDefinition Location Text [TheoryOperatorDefinition]
- data TheoryGuardDefinition = TheoryGuardDefinition Text [Text]
- data TheoryAtomDefinition = TheoryAtomDefinition Location TheoryAtomDefinitionType Text Int Text TheoryGuardDefinition
- data TheoryAtomDefinitionType
- data TheoryDefinition = TheoryDefinition Text [TheoryTermDefinition] [TheoryAtomDefinition]
- data Rule a = Rule (HeadLiteral a) [BodyLiteral a]
- data Definition a = Definition Text (Term a) Bool
- data ShowSignature b = ShowSignature b Bool
- data ShowTerm a = ShowTerm (Term a) [BodyLiteral a] Bool
- data Minimize a = Minimize (Term a) (Term a) [Term a] [BodyLiteral a]
- data Script = Script ScriptType Text
- data ScriptType
- data Program = Program Text [Identifier]
- data External a = External (Term a) [BodyLiteral a]
- data Edge a = Edge (Term a) (Term a) [BodyLiteral a]
- data Heuristic a = Heuristic (Term a) [BodyLiteral a] (Term a) (Term a) (Term a)
- data Project a = Project (Term a) [BodyLiteral a]
- data Statement a b
- = StmtRule Location (Rule a)
- | StmtDefinition Location (Definition a)
- | StmtShowSignature Location (ShowSignature b)
- | StmtShowTerm Location (ShowTerm a)
- | StmtMinimize Location (Minimize a)
- | StmtScript Location Script
- | StmtProgram Location Program
- | StmtExternal Location (External a)
- | StmtEdge Location (Edge a)
- | StmtHeuristic Location (Heuristic a)
- | StmtProject Location (Project a)
- | StmtSignature Location b
- | StmtTheoryDefinition Location TheoryDefinition
Documentation
Arguments
:: Text | Program |
-> Maybe (ClingoWarning -> Text -> IO ()) | Logger Callback |
-> Natural | Logger Call Limit |
-> Clingo s [Statement (Symbol s) (Signature s)] |
Parse a logic program into a list of statements.
fromPureAST :: (Monad (m s), MonadSymbol m) => [Statement PureSymbol PureSignature] -> m s [Statement (Symbol s) (Signature s)] Source #
An AST can be constructed in a pure environment using PureSymbol
and
PureSignature
and then registered with the solver when required. Creation
calls for the same symbol in multiple places will be repeated, i.e. no symbol
table is being created internally by this function!
toPureAST :: [Statement (Symbol s) (Signature s)] -> [Statement PureSymbol PureSignature] Source #
Constructors
Location | |
Fields
|
Constructors
NoSign | |
NegationSign | |
DoubleNegationSign |
data UnaryOperation a Source #
Constructors
UnaryOperation UnaryOperator (Term a) |
Instances
Functor UnaryOperation Source # | |
Foldable UnaryOperation Source # | |
Traversable UnaryOperation Source # | |
Eq a => Eq (UnaryOperation a) Source # | |
Ord a => Ord (UnaryOperation a) Source # | |
Show a => Show (UnaryOperation a) Source # | |
Pretty a => Pretty (UnaryOperation a) Source # | |
data BinaryOperation a Source #
Constructors
BinaryOperation BinaryOperator (Term a) (Term a) |
Instances
Functor BinaryOperation Source # | |
Foldable BinaryOperation Source # | |
Traversable BinaryOperation Source # | |
Eq a => Eq (BinaryOperation a) Source # | |
Ord a => Ord (BinaryOperation a) Source # | |
Show a => Show (BinaryOperation a) Source # | |
Pretty a => Pretty (BinaryOperation a) Source # | |
data BinaryOperator Source #
Instances
Constructors
data CspProductTerm a Source #
Constructors
CspProductTerm Location (Term a) (Maybe (Term a)) |
Instances
Functor CspProductTerm Source # | |
Foldable CspProductTerm Source # | |
Traversable CspProductTerm Source # | |
Eq a => Eq (CspProductTerm a) Source # | |
Ord a => Ord (CspProductTerm a) Source # | |
Show a => Show (CspProductTerm a) Source # | |
data CspSumTerm a Source #
Constructors
CspSumTerm Location [CspProductTerm a] |
Instances
Functor CspSumTerm Source # | |
Foldable CspSumTerm Source # | |
Traversable CspSumTerm Source # | |
Eq a => Eq (CspSumTerm a) Source # | |
Ord a => Ord (CspSumTerm a) Source # | |
Show a => Show (CspSumTerm a) Source # | |
Constructors
CspGuard ComparisonOperator (CspSumTerm a) |
data ComparisonOperator Source #
Constructors
GreaterThan | |
LessThan | |
LessEqual | |
GreaterEqual | |
NotEqual | |
Equal |
data CspLiteral a Source #
Constructors
CspLiteral (CspSumTerm a) [CspGuard a] |
Instances
Functor CspLiteral Source # | |
Foldable CspLiteral Source # | |
Traversable CspLiteral Source # | |
Eq a => Eq (CspLiteral a) Source # | |
Ord a => Ord (CspLiteral a) Source # | |
Show a => Show (CspLiteral a) Source # | |
data Comparison a Source #
Constructors
Comparison ComparisonOperator (Term a) (Term a) |
Instances
Functor Comparison Source # | |
Foldable Comparison Source # | |
Traversable Comparison Source # | |
Eq a => Eq (Comparison a) Source # | |
Ord a => Ord (Comparison a) Source # | |
Show a => Show (Comparison a) Source # | |
Pretty a => Pretty (Comparison a) Source # | |
Constructors
LiteralBool Location Sign Bool | |
LiteralTerm Location Sign (Term a) | |
LiteralComp Location Sign (Comparison a) | |
LiteralCSPL Location Sign (CspLiteral a) |
data AggregateGuard a Source #
Constructors
AggregateGuard ComparisonOperator (Term a) |
Instances
Functor AggregateGuard Source # | |
Foldable AggregateGuard Source # | |
Traversable AggregateGuard Source # | |
Eq a => Eq (AggregateGuard a) Source # | |
Ord a => Ord (AggregateGuard a) Source # | |
Show a => Show (AggregateGuard a) Source # | |
Pretty a => Pretty (AggregateGuard a) Source # | Instance describing left-guards. |
data ConditionalLiteral a Source #
Constructors
ConditionalLiteral (Literal a) [Literal a] |
Instances
Functor ConditionalLiteral Source # | |
Foldable ConditionalLiteral Source # | |
Traversable ConditionalLiteral Source # | |
Eq a => Eq (ConditionalLiteral a) Source # | |
Ord a => Ord (ConditionalLiteral a) Source # | |
Show a => Show (ConditionalLiteral a) Source # | |
Pretty a => Pretty (ConditionalLiteral a) Source # | |
Constructors
Aggregate [ConditionalLiteral a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a)) |
data BodyAggregateElement a Source #
Constructors
BodyAggregateElement [Term a] [Literal a] |
Instances
Functor BodyAggregateElement Source # | |
Foldable BodyAggregateElement Source # | |
Traversable BodyAggregateElement Source # | |
Eq a => Eq (BodyAggregateElement a) Source # | |
Ord a => Ord (BodyAggregateElement a) Source # | |
Show a => Show (BodyAggregateElement a) Source # | |
Pretty a => Pretty (BodyAggregateElement a) Source # | |
data BodyAggregate a Source #
Constructors
BodyAggregate AggregateFunction [BodyAggregateElement a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a)) |
Instances
Functor BodyAggregate Source # | |
Foldable BodyAggregate Source # | |
Traversable BodyAggregate Source # | |
Eq a => Eq (BodyAggregate a) Source # | |
Ord a => Ord (BodyAggregate a) Source # | |
Show a => Show (BodyAggregate a) Source # | |
Pretty a => Pretty (BodyAggregate a) Source # | |
data AggregateFunction Source #
data HeadAggregateElement a Source #
Constructors
HeadAggregateElement [Term a] (ConditionalLiteral a) |
Instances
Functor HeadAggregateElement Source # | |
Foldable HeadAggregateElement Source # | |
Traversable HeadAggregateElement Source # | |
Eq a => Eq (HeadAggregateElement a) Source # | |
Ord a => Ord (HeadAggregateElement a) Source # | |
Show a => Show (HeadAggregateElement a) Source # | |
Pretty a => Pretty (HeadAggregateElement a) Source # | |
data HeadAggregate a Source #
Constructors
HeadAggregate AggregateFunction [HeadAggregateElement a] (Maybe (AggregateGuard a)) (Maybe (AggregateGuard a)) |
Instances
Functor HeadAggregate Source # | |
Foldable HeadAggregate Source # | |
Traversable HeadAggregate Source # | |
Eq a => Eq (HeadAggregate a) Source # | |
Ord a => Ord (HeadAggregate a) Source # | |
Show a => Show (HeadAggregate a) Source # | |
Pretty a => Pretty (HeadAggregate a) Source # | |
data Disjunction a Source #
Constructors
Disjunction [ConditionalLiteral a] |
Instances
Functor Disjunction Source # | |
Foldable Disjunction Source # | |
Traversable Disjunction Source # | |
Eq a => Eq (Disjunction a) Source # | |
Ord a => Ord (Disjunction a) Source # | |
Show a => Show (Disjunction a) Source # | |
Pretty a => Pretty (Disjunction a) Source # | |
data DisjointElement a Source #
Constructors
DisjointElement Location [Term a] (CspSumTerm a) [Literal a] |
Instances
Functor DisjointElement Source # | |
Foldable DisjointElement Source # | |
Traversable DisjointElement Source # | |
Eq a => Eq (DisjointElement a) Source # | |
Ord a => Ord (DisjointElement a) Source # | |
Show a => Show (DisjointElement a) Source # | |
Constructors
Disjoint [DisjointElement a] |
data TheoryTermArray a Source #
Constructors
TheoryTermArray [TheoryTerm a] |
Instances
Functor TheoryTermArray Source # | |
Foldable TheoryTermArray Source # | |
Traversable TheoryTermArray Source # | |
Eq a => Eq (TheoryTermArray a) Source # | |
Ord a => Ord (TheoryTermArray a) Source # | |
Show a => Show (TheoryTermArray a) Source # | |
data TheoryFunction a Source #
Constructors
TheoryFunction Text [TheoryTerm a] |
Instances
Functor TheoryFunction Source # | |
Foldable TheoryFunction Source # | |
Traversable TheoryFunction Source # | |
Eq a => Eq (TheoryFunction a) Source # | |
Ord a => Ord (TheoryFunction a) Source # | |
Show a => Show (TheoryFunction a) Source # | |
data TheoryUnparsedTermElement a Source #
Constructors
TheoryUnparsedTermElement [Text] (TheoryTerm a) |
Instances
data TheoryUnparsedTerm a Source #
Constructors
TheoryUnparsedTerm [TheoryUnparsedTermElement a] |
Instances
Functor TheoryUnparsedTerm Source # | |
Foldable TheoryUnparsedTerm Source # | |
Traversable TheoryUnparsedTerm Source # | |
Eq a => Eq (TheoryUnparsedTerm a) Source # | |
Ord a => Ord (TheoryUnparsedTerm a) Source # | |
Show a => Show (TheoryUnparsedTerm a) Source # | |
data TheoryTerm a Source #
Constructors
Instances
Functor TheoryTerm Source # | |
Foldable TheoryTerm Source # | |
Traversable TheoryTerm Source # | |
Eq a => Eq (TheoryTerm a) Source # | |
Ord a => Ord (TheoryTerm a) Source # | |
Show a => Show (TheoryTerm a) Source # | |
data TheoryAtomElement a Source #
Constructors
TheoryAtomElement [TheoryTerm a] [Literal a] |
Instances
Functor TheoryAtomElement Source # | |
Foldable TheoryAtomElement Source # | |
Traversable TheoryAtomElement Source # | |
Eq a => Eq (TheoryAtomElement a) Source # | |
Ord a => Ord (TheoryAtomElement a) Source # | |
Show a => Show (TheoryAtomElement a) Source # | |
data TheoryGuard a Source #
Constructors
TheoryGuard Text (TheoryTerm a) |
Instances
Functor TheoryGuard Source # | |
Foldable TheoryGuard Source # | |
Traversable TheoryGuard Source # | |
Eq a => Eq (TheoryGuard a) Source # | |
Ord a => Ord (TheoryGuard a) Source # | |
Show a => Show (TheoryGuard a) Source # | |
data TheoryAtom a Source #
Constructors
TheoryAtom (Term a) [TheoryAtomElement a] (TheoryGuard a) |
Instances
Functor TheoryAtom Source # | |
Foldable TheoryAtom Source # | |
Traversable TheoryAtom Source # | |
Eq a => Eq (TheoryAtom a) Source # | |
Ord a => Ord (TheoryAtom a) Source # | |
Show a => Show (TheoryAtom a) Source # | |
data HeadLiteral a Source #
Constructors
HeadLiteral Location (Literal a) | |
HeadDisjunction Location (Disjunction a) | |
HeadLitAggregate Location (Aggregate a) | |
HeadHeadAggregate Location (HeadAggregate a) | |
HeadTheoryAtom Location (TheoryAtom a) |
Instances
Functor HeadLiteral Source # | |
Foldable HeadLiteral Source # | |
Traversable HeadLiteral Source # | |
Eq a => Eq (HeadLiteral a) Source # | |
Ord a => Ord (HeadLiteral a) Source # | |
Show a => Show (HeadLiteral a) Source # | |
Pretty a => Pretty (HeadLiteral a) Source # | |
data BodyLiteral a Source #
Constructors
Instances
Functor BodyLiteral Source # | |
Foldable BodyLiteral Source # | |
Traversable BodyLiteral Source # | |
Eq a => Eq (BodyLiteral a) Source # | |
Ord a => Ord (BodyLiteral a) Source # | |
Show a => Show (BodyLiteral a) Source # | |
Pretty a => Pretty (BodyLiteral a) Source # | |
data TheoryOperatorDefinition Source #
Constructors
TheoryOperatorDefinition Location Text Natural TheoryOperatorType |
data TheoryOperatorType Source #
Instances
data TheoryTermDefinition Source #
Constructors
TheoryTermDefinition Location Text [TheoryOperatorDefinition] |
data TheoryGuardDefinition Source #
Constructors
TheoryGuardDefinition Text [Text] |
data TheoryAtomDefinition Source #
data TheoryDefinition Source #
Constructors
TheoryDefinition Text [TheoryTermDefinition] [TheoryAtomDefinition] |
Instances
Constructors
Rule (HeadLiteral a) [BodyLiteral a] |
data Definition a Source #
Constructors
Definition Text (Term a) Bool |
Instances
Functor Definition Source # | |
Foldable Definition Source # | |
Traversable Definition Source # | |
Eq a => Eq (Definition a) Source # | |
Ord a => Ord (Definition a) Source # | |
Show a => Show (Definition a) Source # | |
data ShowSignature b Source #
Constructors
ShowSignature b Bool |
Instances
Functor ShowSignature Source # | |
Foldable ShowSignature Source # | |
Traversable ShowSignature Source # | |
Eq b => Eq (ShowSignature b) Source # | |
Ord b => Ord (ShowSignature b) Source # | |
Show b => Show (ShowSignature b) Source # | |
Constructors
ShowTerm (Term a) [BodyLiteral a] Bool |
Constructors
Minimize (Term a) (Term a) [Term a] [BodyLiteral a] |
Constructors
Script ScriptType Text |
data ScriptType Source #
Instances
Constructors
Program Text [Identifier] |
Constructors
External (Term a) [BodyLiteral a] |
Constructors
Edge (Term a) (Term a) [BodyLiteral a] |
Constructors
Project (Term a) [BodyLiteral a] |
Constructors
Instances
Bifunctor Statement Source # | |
Bitraversable Statement Source # | |
Bifoldable Statement Source # | |
Functor (Statement a) Source # | |
Foldable (Statement a) Source # | |
Traversable (Statement a) Source # | |
(Eq b, Eq a) => Eq (Statement a b) Source # | |
(Ord b, Ord a) => Ord (Statement a b) Source # | |
(Show b, Show a) => Show (Statement a b) Source # | |
(Pretty a, Pretty b) => Pretty (Statement a b) Source # | |