| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Language.SMT2.Syntax
Description
- Module : Language.SMT2.Syntax
- Description : SMT language parser
- Maintainer : ubikium@gmail.com
- Stability : experimental
Synopsis
- type Numeral = Text
- type Decimal = Text
- type Hexadecimal = Text
- type Binary = Text
- type StringLiteral = Text
- type ReservedWord = Text
- type Symbol = Text
- type Keyword = Text
- data SpecConstant
- data SExpr
- type SList = [SExpr]
- data Index
- data Identifier
- data AttributeValue
- data Attribute
- data Sort
- = SortSymbol Identifier
- | SortParameter Identifier (NonEmpty Sort)
- data QualIdentifier
- data VarBinding = VarBinding Symbol Term
- data SortedVar = SortedVar Symbol Sort
- data MatchPattern
- = MPVariable Symbol
- | MPConstructor Symbol (NonEmpty Symbol)
- data MatchCase = MatchCase MatchPattern Term
- data Term
- = TermSpecConstant SpecConstant
- | TermQualIdentifier QualIdentifier
- | TermApplication QualIdentifier (NonEmpty Term)
- | TermLet (NonEmpty VarBinding) Term
- | TermForall (NonEmpty SortedVar) Term
- | TermExists (NonEmpty SortedVar) Term
- | TermMatch Term (NonEmpty MatchCase)
- | TermAnnotation Term (NonEmpty Attribute)
- data SortSymbolDecl = SortSymbolDecl Identifier Numeral [Attribute]
- data MetaSpecConstant
- data FunSymbolDecl
- = FunConstant SpecConstant Sort [Attribute]
- | FunMeta MetaSpecConstant Sort [Attribute]
- | FunIdentifier Identifier (NonEmpty Sort) [Attribute]
- data ParFunSymbolDecl
- = NonPar FunSymbolDecl
- | Par (NonEmpty Symbol) Identifier (NonEmpty Sort) [Attribute]
- data TheoryAttribute
- data TheoryDecl = TheoryDecl Symbol (NonEmpty TheoryAttribute)
- data LogicAttribute
- data Logic = Logic Symbol (NonEmpty LogicAttribute)
- data SortDec = SortDec Symbol Numeral
- data SelectorDec = SelectorDec Symbol Sort
- data ConstructorDec = ConstructorDec Symbol [SelectorDec]
- data DatatypeDec
- = DDNonparametric (NonEmpty ConstructorDec)
- | DDParametric (NonEmpty Symbol) (NonEmpty ConstructorDec)
- data FunctionDec = FunctionDec Symbol [SortedVar] Sort
- data FunctionDef = FunctionDef Symbol [SortedVar] Sort Term
- data PropLiteral
- data Command
- = Assert Term
- | CheckSat
- | CheckSatAssuming [PropLiteral]
- | DeclareConst Symbol Sort
- | DeclareDatatype Symbol DatatypeDec
- | DeclareDatatypes (NonEmpty SortDec) (NonEmpty DatatypeDec)
- | DeclareFun Symbol [Sort] Sort
- | DeclareSort Symbol Numeral
- | DefineFun FunctionDef
- | DefineFunRec FunctionDef
- | DefineFunsRec (NonEmpty FunctionDec) (NonEmpty Term)
- | DefineSort Symbol [Symbol] Sort
- | Echo StringLiteral
- | Exit
- | GetAssertions
- | GetAssignment
- | GetInfo InfoFlag
- | GetModel
- | GetOption Keyword
- | GetProof
- | GetUnsatAssumptions
- | GetUnsatCore
- | GetValue (NonEmpty Term)
- | Pop Numeral
- | Push Numeral
- | Reset
- | ResetAssertions
- | SetInfo Attribute
- | SetLogic Symbol
- | SetOption ScriptOption
- type Script = [Command]
- data BValue
- data ScriptOption
- = DiagnosticOutputChannel StringLiteral
- | GlobalDeclarations BValue
- | InteractiveMode BValue
- | PrintSuccess BValue
- | ProduceAssertions BValue
- | ProduceAssignments BValue
- | ProduceModels BValue
- | ProduceProofs BValue
- | ProduceUnsatAssumptions BValue
- | ProduceUnsatCores BValue
- | RandomSeed Numeral
- | RegularOutputChannel StringLiteral
- | ReproducibleResourceLimit Numeral
- | Verbosity Numeral
- | OptionAttr Attribute
- data InfoFlag
- data ResErrorBehavior
- data ResReasonUnknown
- data ResModel
- = RMDefineFun FunctionDef
- | RMDefineFunRec FunctionDef
- | RMDefineFunsRec (NonEmpty FunctionDec) (NonEmpty Term)
- data ResInfo
- type ValuationPair = (Term, Term)
- type TValuationPair = (Symbol, BValue)
- data ResCheckSat
- type CheckSatRes = GeneralRes ResCheckSat
- type EchoRes = GeneralRes StringLiteral
- type GetAssertionsRes = GeneralRes [Term]
- type GetAssignmentRes = GeneralRes [TValuationPair]
- type GetInfoRes = GeneralRes (NonEmpty ResInfo)
- type GetModelRes = GeneralRes ResModel
- type GetOptionRes = GeneralRes AttributeValue
- type GetProofRes = GeneralRes SExpr
- type GetUnsatAssumpRes = GeneralRes [Symbol]
- type GetUnsatCoreRes = GeneralRes [Symbol]
- type GetValueRes = GeneralRes (NonEmpty ValuationPair)
- data GeneralRes res
- class SpecificSuccessRes s where
- specificSuccessRes :: GenParser st s
Lexicons (Sec. 3.1)
type Hexadecimal = Text Source #
type StringLiteral = Text Source #
type ReservedWord = Text Source #
S-expressions (Sec. 3.2)
data SpecConstant Source #
Constructors
| SCNumeral Numeral | |
| SCDecimal Decimal | |
| SCHexadecimal Hexadecimal | |
| SCBinary Binary | |
| SCString StringLiteral |
Instances
| Eq SpecConstant Source # | |
Defined in Language.SMT2.Syntax | |
| Show SpecConstant Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> SpecConstant -> ShowS show :: SpecConstant -> String showList :: [SpecConstant] -> ShowS | |
Constructors
| SEConstant SpecConstant | |
| SEReservedWord ReservedWord | |
| SESymbol Symbol | |
| SEKeyword Keyword | |
| SEList SList |
Instances
| Eq SExpr Source # | |
| Show SExpr Source # | |
| SpecificSuccessRes SExpr Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st SExpr Source # | |
Identifiers (Sec 3.3)
data Identifier Source #
Instances
| Eq Identifier Source # | |
Defined in Language.SMT2.Syntax | |
| Show Identifier Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> Identifier -> ShowS show :: Identifier -> String showList :: [Identifier] -> ShowS | |
Attributes (Sec. 3.4)
data AttributeValue Source #
Constructors
| AttrValSpecConstant SpecConstant | |
| AttrValSymbol Symbol | |
| AttrValSList SList |
Instances
| Eq AttributeValue Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: AttributeValue -> AttributeValue -> Bool (/=) :: AttributeValue -> AttributeValue -> Bool | |
| Show AttributeValue Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> AttributeValue -> ShowS show :: AttributeValue -> String showList :: [AttributeValue] -> ShowS | |
| SpecificSuccessRes AttributeValue Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st AttributeValue Source # | |
Constructors
| AttrKey Keyword | |
| AttrKeyValue Keyword AttributeValue |
Instances
Sorts (Sec 3.5)
Constructors
| SortSymbol Identifier | |
| SortParameter Identifier (NonEmpty Sort) |
Terms and Formulas (Sec 3.6)
data QualIdentifier Source #
Constructors
| Unqualified Identifier | |
| Qualified Identifier Sort |
Instances
| Eq QualIdentifier Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: QualIdentifier -> QualIdentifier -> Bool (/=) :: QualIdentifier -> QualIdentifier -> Bool | |
| Show QualIdentifier Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> QualIdentifier -> ShowS show :: QualIdentifier -> String showList :: [QualIdentifier] -> ShowS | |
data VarBinding Source #
Constructors
| VarBinding Symbol Term |
Instances
| Eq VarBinding Source # | |
Defined in Language.SMT2.Syntax | |
| Show VarBinding Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> VarBinding -> ShowS show :: VarBinding -> String showList :: [VarBinding] -> ShowS | |
Instances
data MatchPattern Source #
Constructors
| MPVariable Symbol | |
| MPConstructor Symbol (NonEmpty Symbol) |
Instances
| Eq MatchPattern Source # | |
Defined in Language.SMT2.Syntax | |
| Show MatchPattern Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> MatchPattern -> ShowS show :: MatchPattern -> String showList :: [MatchPattern] -> ShowS | |
Constructors
| MatchCase MatchPattern Term |
Instances
Constructors
| TermSpecConstant SpecConstant | |
| TermQualIdentifier QualIdentifier | |
| TermApplication QualIdentifier (NonEmpty Term) | |
| TermLet (NonEmpty VarBinding) Term | |
| TermForall (NonEmpty SortedVar) Term | |
| TermExists (NonEmpty SortedVar) Term | |
| TermMatch Term (NonEmpty MatchCase) | |
| TermAnnotation Term (NonEmpty Attribute) |
Instances
| Eq Term Source # | |
| Show Term Source # | |
| SpecificSuccessRes [Term] Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st [Term] Source # | |
| SpecificSuccessRes (NonEmpty ValuationPair) Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st (NonEmpty ValuationPair) Source # | |
Theory declarations (Sec 3.7)
data SortSymbolDecl Source #
Constructors
| SortSymbolDecl Identifier Numeral [Attribute] |
Instances
| Eq SortSymbolDecl Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: SortSymbolDecl -> SortSymbolDecl -> Bool (/=) :: SortSymbolDecl -> SortSymbolDecl -> Bool | |
| Show SortSymbolDecl Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> SortSymbolDecl -> ShowS show :: SortSymbolDecl -> String showList :: [SortSymbolDecl] -> ShowS | |
data MetaSpecConstant Source #
Constructors
| MSC_NUMERAL | |
| MSC_DECIMAL | |
| MSC_STRING |
Instances
| Eq MetaSpecConstant Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: MetaSpecConstant -> MetaSpecConstant -> Bool (/=) :: MetaSpecConstant -> MetaSpecConstant -> Bool | |
| Show MetaSpecConstant Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> MetaSpecConstant -> ShowS show :: MetaSpecConstant -> String showList :: [MetaSpecConstant] -> ShowS | |
data FunSymbolDecl Source #
Constructors
| FunConstant SpecConstant Sort [Attribute] | |
| FunMeta MetaSpecConstant Sort [Attribute] | |
| FunIdentifier Identifier (NonEmpty Sort) [Attribute] | potentially overloaded |
Instances
| Eq FunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax | |
| Show FunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> FunSymbolDecl -> ShowS show :: FunSymbolDecl -> String showList :: [FunSymbolDecl] -> ShowS | |
data ParFunSymbolDecl Source #
Constructors
| NonPar FunSymbolDecl | non-parametric |
| Par (NonEmpty Symbol) Identifier (NonEmpty Sort) [Attribute] | parametric |
Instances
| Eq ParFunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: ParFunSymbolDecl -> ParFunSymbolDecl -> Bool (/=) :: ParFunSymbolDecl -> ParFunSymbolDecl -> Bool | |
| Show ParFunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ParFunSymbolDecl -> ShowS show :: ParFunSymbolDecl -> String showList :: [ParFunSymbolDecl] -> ShowS | |
data TheoryAttribute Source #
Constructors
Instances
| Eq TheoryAttribute Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: TheoryAttribute -> TheoryAttribute -> Bool (/=) :: TheoryAttribute -> TheoryAttribute -> Bool | |
| Show TheoryAttribute Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> TheoryAttribute -> ShowS show :: TheoryAttribute -> String showList :: [TheoryAttribute] -> ShowS | |
data TheoryDecl Source #
Constructors
| TheoryDecl Symbol (NonEmpty TheoryAttribute) |
Instances
| Eq TheoryDecl Source # | |
Defined in Language.SMT2.Syntax | |
| Show TheoryDecl Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> TheoryDecl -> ShowS show :: TheoryDecl -> String showList :: [TheoryDecl] -> ShowS | |
Logic Declarations (Sec 3.8)
data LogicAttribute Source #
Constructors
| LATheories (NonEmpty Symbol) | |
| LALanguage StringLiteral | |
| LAExtensions StringLiteral | |
| LAValues StringLiteral | |
| LANotes StringLiteral | |
| LAAttr Attribute |
Instances
| Eq LogicAttribute Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: LogicAttribute -> LogicAttribute -> Bool (/=) :: LogicAttribute -> LogicAttribute -> Bool | |
| Show LogicAttribute Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> LogicAttribute -> ShowS show :: LogicAttribute -> String showList :: [LogicAttribute] -> ShowS | |
Constructors
| Logic Symbol (NonEmpty LogicAttribute) |
Scripts (Sec 3.9)
data SelectorDec Source #
Constructors
| SelectorDec Symbol Sort |
Instances
| Eq SelectorDec Source # | |
Defined in Language.SMT2.Syntax | |
| Show SelectorDec Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> SelectorDec -> ShowS show :: SelectorDec -> String showList :: [SelectorDec] -> ShowS | |
data ConstructorDec Source #
Constructors
| ConstructorDec Symbol [SelectorDec] |
Instances
| Eq ConstructorDec Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: ConstructorDec -> ConstructorDec -> Bool (/=) :: ConstructorDec -> ConstructorDec -> Bool | |
| Show ConstructorDec Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ConstructorDec -> ShowS show :: ConstructorDec -> String showList :: [ConstructorDec] -> ShowS | |
data DatatypeDec Source #
Constructors
| DDNonparametric (NonEmpty ConstructorDec) | |
| DDParametric (NonEmpty Symbol) (NonEmpty ConstructorDec) |
Instances
| Eq DatatypeDec Source # | |
Defined in Language.SMT2.Syntax | |
| Show DatatypeDec Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> DatatypeDec -> ShowS show :: DatatypeDec -> String showList :: [DatatypeDec] -> ShowS | |
data FunctionDec Source #
Constructors
| FunctionDec Symbol [SortedVar] Sort |
Instances
| Eq FunctionDec Source # | |
Defined in Language.SMT2.Syntax | |
| Show FunctionDec Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> FunctionDec -> ShowS show :: FunctionDec -> String showList :: [FunctionDec] -> ShowS | |
data FunctionDef Source #
Constructors
| FunctionDef Symbol [SortedVar] Sort Term |
Instances
| Eq FunctionDef Source # | |
Defined in Language.SMT2.Syntax | |
| Show FunctionDef Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> FunctionDef -> ShowS show :: FunctionDef -> String showList :: [FunctionDef] -> ShowS | |
data PropLiteral Source #
Constructors
| PLPositive Symbol | |
| PLNegative Symbol |
Instances
| Eq PropLiteral Source # | |
Defined in Language.SMT2.Syntax | |
| Show PropLiteral Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> PropLiteral -> ShowS show :: PropLiteral -> String showList :: [PropLiteral] -> ShowS | |
Constructors
| Assert Term | |
| CheckSat | |
| CheckSatAssuming [PropLiteral] | |
| DeclareConst Symbol Sort | |
| DeclareDatatype Symbol DatatypeDec | |
| DeclareDatatypes (NonEmpty SortDec) (NonEmpty DatatypeDec) | same number |
| DeclareFun Symbol [Sort] Sort | |
| DeclareSort Symbol Numeral | |
| DefineFun FunctionDef | |
| DefineFunRec FunctionDef | |
| DefineFunsRec (NonEmpty FunctionDec) (NonEmpty Term) | same number |
| DefineSort Symbol [Symbol] Sort | |
| Echo StringLiteral | |
| Exit | |
| GetAssertions | |
| GetAssignment | |
| GetInfo InfoFlag | |
| GetModel | |
| GetOption Keyword | |
| GetProof | |
| GetUnsatAssumptions | |
| GetUnsatCore | |
| GetValue (NonEmpty Term) | |
| Pop Numeral | |
| Push Numeral | |
| Reset | |
| ResetAssertions | |
| SetInfo Attribute | |
| SetLogic Symbol | |
| SetOption ScriptOption |
Instances
| Eq BValue Source # | |
| Show BValue Source # | |
| SpecificSuccessRes [TValuationPair] Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st [TValuationPair] Source # | |
data ScriptOption Source #
Constructors
Instances
| Eq ScriptOption Source # | |
Defined in Language.SMT2.Syntax | |
| Show ScriptOption Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ScriptOption -> ShowS show :: ScriptOption -> String showList :: [ScriptOption] -> ShowS | |
Responses (Sec 3.9.1)
data ResErrorBehavior Source #
Constructors
| ImmediateExit | |
| ContinuedExecution |
Instances
| Eq ResErrorBehavior Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: ResErrorBehavior -> ResErrorBehavior -> Bool (/=) :: ResErrorBehavior -> ResErrorBehavior -> Bool | |
| Show ResErrorBehavior Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ResErrorBehavior -> ShowS show :: ResErrorBehavior -> String showList :: [ResErrorBehavior] -> ShowS | |
data ResReasonUnknown Source #
Constructors
| Memout | |
| Incomplete | |
| ResReasonSExpr SExpr |
Instances
| Eq ResReasonUnknown Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: ResReasonUnknown -> ResReasonUnknown -> Bool (/=) :: ResReasonUnknown -> ResReasonUnknown -> Bool | |
| Show ResReasonUnknown Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ResReasonUnknown -> ShowS show :: ResReasonUnknown -> String showList :: [ResReasonUnknown] -> ShowS | |
Constructors
| RMDefineFun FunctionDef | |
| RMDefineFunRec FunctionDef | |
| RMDefineFunsRec (NonEmpty FunctionDec) (NonEmpty Term) | same number |
Instances
| SpecificSuccessRes ResModel Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st ResModel Source # | |
Constructors
| IRErrorBehaviour ResErrorBehavior | |
| IRName StringLiteral | |
| IRAuthours StringLiteral | |
| IRVersion StringLiteral | |
| IRReasonUnknown ResReasonUnknown | |
| IRAttr Attribute |
Instances
| Eq ResInfo Source # | |
| Show ResInfo Source # | |
| SpecificSuccessRes (NonEmpty ResInfo) Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st (NonEmpty ResInfo) Source # | |
type ValuationPair = (Term, Term) Source #
type TValuationPair = (Symbol, BValue) Source #
data ResCheckSat Source #
Instances
| Eq ResCheckSat Source # | |
Defined in Language.SMT2.Syntax | |
| Show ResCheckSat Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> ResCheckSat -> ShowS show :: ResCheckSat -> String showList :: [ResCheckSat] -> ShowS | |
| SpecificSuccessRes ResCheckSat Source # | |
Defined in Language.SMT2.Parser Methods specificSuccessRes :: GenParser st ResCheckSat Source # | |
instances
type CheckSatRes = GeneralRes ResCheckSat Source #
type EchoRes = GeneralRes StringLiteral Source #
type GetAssertionsRes = GeneralRes [Term] Source #
type GetAssignmentRes = GeneralRes [TValuationPair] Source #
type GetInfoRes = GeneralRes (NonEmpty ResInfo) Source #
type GetModelRes = GeneralRes ResModel Source #
type GetOptionRes = GeneralRes AttributeValue Source #
type GetProofRes = GeneralRes SExpr Source #
type GetUnsatAssumpRes = GeneralRes [Symbol] Source #
type GetUnsatCoreRes = GeneralRes [Symbol] Source #
type GetValueRes = GeneralRes (NonEmpty ValuationPair) Source #
data GeneralRes res Source #
Constructors
| ResSuccess | |
| ResSpecific res | |
| ResUnsupported | |
| ResError StringLiteral |
Instances
| Eq res => Eq (GeneralRes res) Source # | |
Defined in Language.SMT2.Syntax Methods (==) :: GeneralRes res -> GeneralRes res -> Bool (/=) :: GeneralRes res -> GeneralRes res -> Bool | |
| Show res => Show (GeneralRes res) Source # | |
Defined in Language.SMT2.Syntax Methods showsPrec :: Int -> GeneralRes res -> ShowS show :: GeneralRes res -> String showList :: [GeneralRes res] -> ShowS | |
class SpecificSuccessRes s where Source #
Methods
specificSuccessRes :: GenParser st s Source #