Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- 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 #
SCNumeral Numeral | |
SCDecimal Decimal | |
SCHexadecimal Hexadecimal | |
SCBinary Binary | |
SCString StringLiteral |
Instances
Eq SpecConstant Source # | |
Defined in Language.SMT2.Syntax (==) :: SpecConstant -> SpecConstant -> Bool (/=) :: SpecConstant -> SpecConstant -> Bool | |
Show SpecConstant Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> SpecConstant -> ShowS show :: SpecConstant -> String showList :: [SpecConstant] -> ShowS |
Instances
Eq SExpr Source # | |
Show SExpr Source # | |
SpecificSuccessRes SExpr Source # | |
Defined in Language.SMT2.Parser specificSuccessRes :: GenParser st SExpr Source # |
Identifiers (Sec 3.3)
data Identifier Source #
Instances
Eq Identifier Source # | |
Defined in Language.SMT2.Syntax (==) :: Identifier -> Identifier -> Bool (/=) :: Identifier -> Identifier -> Bool | |
Show Identifier Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> Identifier -> ShowS show :: Identifier -> String showList :: [Identifier] -> ShowS |
Attributes (Sec. 3.4)
data AttributeValue Source #
Instances
Eq AttributeValue Source # | |
Defined in Language.SMT2.Syntax (==) :: AttributeValue -> AttributeValue -> Bool (/=) :: AttributeValue -> AttributeValue -> Bool | |
Show AttributeValue Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> AttributeValue -> ShowS show :: AttributeValue -> String showList :: [AttributeValue] -> ShowS | |
SpecificSuccessRes AttributeValue Source # | |
Defined in Language.SMT2.Parser specificSuccessRes :: GenParser st AttributeValue Source # |
Sorts (Sec 3.5)
SortSymbol Identifier | |
SortParameter Identifier (NonEmpty Sort) |
Terms and Formulas (Sec 3.6)
data QualIdentifier Source #
Instances
Eq QualIdentifier Source # | |
Defined in Language.SMT2.Syntax (==) :: QualIdentifier -> QualIdentifier -> Bool (/=) :: QualIdentifier -> QualIdentifier -> Bool | |
Show QualIdentifier Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> QualIdentifier -> ShowS show :: QualIdentifier -> String showList :: [QualIdentifier] -> ShowS |
data VarBinding Source #
Instances
Eq VarBinding Source # | |
Defined in Language.SMT2.Syntax (==) :: VarBinding -> VarBinding -> Bool (/=) :: VarBinding -> VarBinding -> Bool | |
Show VarBinding Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> VarBinding -> ShowS show :: VarBinding -> String showList :: [VarBinding] -> ShowS |
data MatchPattern Source #
MPVariable Symbol | |
MPConstructor Symbol (NonEmpty Symbol) |
Instances
Eq MatchPattern Source # | |
Defined in Language.SMT2.Syntax (==) :: MatchPattern -> MatchPattern -> Bool (/=) :: MatchPattern -> MatchPattern -> Bool | |
Show MatchPattern Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> MatchPattern -> ShowS show :: MatchPattern -> String showList :: [MatchPattern] -> ShowS |
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 specificSuccessRes :: GenParser st [Term] Source # | |
SpecificSuccessRes (NonEmpty ValuationPair) Source # | |
Defined in Language.SMT2.Parser specificSuccessRes :: GenParser st (NonEmpty ValuationPair) Source # |
Theory declarations (Sec 3.7)
data SortSymbolDecl Source #
Instances
Eq SortSymbolDecl Source # | |
Defined in Language.SMT2.Syntax (==) :: SortSymbolDecl -> SortSymbolDecl -> Bool (/=) :: SortSymbolDecl -> SortSymbolDecl -> Bool | |
Show SortSymbolDecl Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> SortSymbolDecl -> ShowS show :: SortSymbolDecl -> String showList :: [SortSymbolDecl] -> ShowS |
data MetaSpecConstant Source #
Instances
Eq MetaSpecConstant Source # | |
Defined in Language.SMT2.Syntax (==) :: MetaSpecConstant -> MetaSpecConstant -> Bool (/=) :: MetaSpecConstant -> MetaSpecConstant -> Bool | |
Show MetaSpecConstant Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> MetaSpecConstant -> ShowS show :: MetaSpecConstant -> String showList :: [MetaSpecConstant] -> ShowS |
data FunSymbolDecl Source #
FunConstant SpecConstant Sort [Attribute] | |
FunMeta MetaSpecConstant Sort [Attribute] | |
FunIdentifier Identifier (NonEmpty Sort) [Attribute] | potentially overloaded |
Instances
Eq FunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax (==) :: FunSymbolDecl -> FunSymbolDecl -> Bool (/=) :: FunSymbolDecl -> FunSymbolDecl -> Bool | |
Show FunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> FunSymbolDecl -> ShowS show :: FunSymbolDecl -> String showList :: [FunSymbolDecl] -> ShowS |
data ParFunSymbolDecl Source #
NonPar FunSymbolDecl | non-parametric |
Par (NonEmpty Symbol) Identifier (NonEmpty Sort) [Attribute] | parametric |
Instances
Eq ParFunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax (==) :: ParFunSymbolDecl -> ParFunSymbolDecl -> Bool (/=) :: ParFunSymbolDecl -> ParFunSymbolDecl -> Bool | |
Show ParFunSymbolDecl Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ParFunSymbolDecl -> ShowS show :: ParFunSymbolDecl -> String showList :: [ParFunSymbolDecl] -> ShowS |
data TheoryAttribute Source #
Instances
Eq TheoryAttribute Source # | |
Defined in Language.SMT2.Syntax (==) :: TheoryAttribute -> TheoryAttribute -> Bool (/=) :: TheoryAttribute -> TheoryAttribute -> Bool | |
Show TheoryAttribute Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> TheoryAttribute -> ShowS show :: TheoryAttribute -> String showList :: [TheoryAttribute] -> ShowS |
data TheoryDecl Source #
TheoryDecl Symbol (NonEmpty TheoryAttribute) |
Instances
Eq TheoryDecl Source # | |
Defined in Language.SMT2.Syntax (==) :: TheoryDecl -> TheoryDecl -> Bool (/=) :: TheoryDecl -> TheoryDecl -> Bool | |
Show TheoryDecl Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> TheoryDecl -> ShowS show :: TheoryDecl -> String showList :: [TheoryDecl] -> ShowS |
Logic Declarations (Sec 3.8)
data LogicAttribute Source #
LATheories (NonEmpty Symbol) | |
LALanguage StringLiteral | |
LAExtensions StringLiteral | |
LAValues StringLiteral | |
LANotes StringLiteral | |
LAAttr Attribute |
Instances
Eq LogicAttribute Source # | |
Defined in Language.SMT2.Syntax (==) :: LogicAttribute -> LogicAttribute -> Bool (/=) :: LogicAttribute -> LogicAttribute -> Bool | |
Show LogicAttribute Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> LogicAttribute -> ShowS show :: LogicAttribute -> String showList :: [LogicAttribute] -> ShowS |
Logic Symbol (NonEmpty LogicAttribute) |
Scripts (Sec 3.9)
data SelectorDec Source #
Instances
Eq SelectorDec Source # | |
Defined in Language.SMT2.Syntax (==) :: SelectorDec -> SelectorDec -> Bool (/=) :: SelectorDec -> SelectorDec -> Bool | |
Show SelectorDec Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> SelectorDec -> ShowS show :: SelectorDec -> String showList :: [SelectorDec] -> ShowS |
data ConstructorDec Source #
Instances
Eq ConstructorDec Source # | |
Defined in Language.SMT2.Syntax (==) :: ConstructorDec -> ConstructorDec -> Bool (/=) :: ConstructorDec -> ConstructorDec -> Bool | |
Show ConstructorDec Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ConstructorDec -> ShowS show :: ConstructorDec -> String showList :: [ConstructorDec] -> ShowS |
data DatatypeDec Source #
DDNonparametric (NonEmpty ConstructorDec) | |
DDParametric (NonEmpty Symbol) (NonEmpty ConstructorDec) |
Instances
Eq DatatypeDec Source # | |
Defined in Language.SMT2.Syntax (==) :: DatatypeDec -> DatatypeDec -> Bool (/=) :: DatatypeDec -> DatatypeDec -> Bool | |
Show DatatypeDec Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> DatatypeDec -> ShowS show :: DatatypeDec -> String showList :: [DatatypeDec] -> ShowS |
data FunctionDec Source #
Instances
Eq FunctionDec Source # | |
Defined in Language.SMT2.Syntax (==) :: FunctionDec -> FunctionDec -> Bool (/=) :: FunctionDec -> FunctionDec -> Bool | |
Show FunctionDec Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> FunctionDec -> ShowS show :: FunctionDec -> String showList :: [FunctionDec] -> ShowS |
data FunctionDef Source #
Instances
Eq FunctionDef Source # | |
Defined in Language.SMT2.Syntax (==) :: FunctionDef -> FunctionDef -> Bool (/=) :: FunctionDef -> FunctionDef -> Bool | |
Show FunctionDef Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> FunctionDef -> ShowS show :: FunctionDef -> String showList :: [FunctionDef] -> ShowS |
data PropLiteral Source #
Instances
Eq PropLiteral Source # | |
Defined in Language.SMT2.Syntax (==) :: PropLiteral -> PropLiteral -> Bool (/=) :: PropLiteral -> PropLiteral -> Bool | |
Show PropLiteral Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> PropLiteral -> ShowS show :: PropLiteral -> String showList :: [PropLiteral] -> ShowS |
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 specificSuccessRes :: GenParser st [TValuationPair] Source # |
data ScriptOption Source #
Instances
Eq ScriptOption Source # | |
Defined in Language.SMT2.Syntax (==) :: ScriptOption -> ScriptOption -> Bool (/=) :: ScriptOption -> ScriptOption -> Bool | |
Show ScriptOption Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ScriptOption -> ShowS show :: ScriptOption -> String showList :: [ScriptOption] -> ShowS |
Responses (Sec 3.9.1)
data ResErrorBehavior Source #
Instances
Eq ResErrorBehavior Source # | |
Defined in Language.SMT2.Syntax (==) :: ResErrorBehavior -> ResErrorBehavior -> Bool (/=) :: ResErrorBehavior -> ResErrorBehavior -> Bool | |
Show ResErrorBehavior Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ResErrorBehavior -> ShowS show :: ResErrorBehavior -> String showList :: [ResErrorBehavior] -> ShowS |
data ResReasonUnknown Source #
Instances
Eq ResReasonUnknown Source # | |
Defined in Language.SMT2.Syntax (==) :: ResReasonUnknown -> ResReasonUnknown -> Bool (/=) :: ResReasonUnknown -> ResReasonUnknown -> Bool | |
Show ResReasonUnknown Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ResReasonUnknown -> ShowS show :: ResReasonUnknown -> String showList :: [ResReasonUnknown] -> ShowS |
RMDefineFun FunctionDef | |
RMDefineFunRec FunctionDef | |
RMDefineFunsRec (NonEmpty FunctionDec) (NonEmpty Term) | same number |
Instances
SpecificSuccessRes ResModel Source # | |
Defined in Language.SMT2.Parser specificSuccessRes :: GenParser st ResModel Source # |
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 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 (==) :: ResCheckSat -> ResCheckSat -> Bool (/=) :: ResCheckSat -> ResCheckSat -> Bool | |
Show ResCheckSat Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> ResCheckSat -> ShowS show :: ResCheckSat -> String showList :: [ResCheckSat] -> ShowS | |
SpecificSuccessRes ResCheckSat Source # | |
Defined in Language.SMT2.Parser 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 #
Instances
Eq res => Eq (GeneralRes res) Source # | |
Defined in Language.SMT2.Syntax (==) :: GeneralRes res -> GeneralRes res -> Bool (/=) :: GeneralRes res -> GeneralRes res -> Bool | |
Show res => Show (GeneralRes res) Source # | |
Defined in Language.SMT2.Syntax showsPrec :: Int -> GeneralRes res -> ShowS show :: GeneralRes res -> String showList :: [GeneralRes res] -> ShowS |
class SpecificSuccessRes s where Source #
specificSuccessRes :: GenParser st s Source #