Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- Module : Language.SMT2.Parser
- Description : SMT language parser
- Maintainer : yokis1997@pku.edu.cn
- Stability : experimental
Synopsis
- parseString :: Parser a -> Text -> Either ParseError a
- parseStringEof :: Parser a -> Text -> Either ParseError a
- parseFileMsg :: Parser a -> Text -> Either Text a
- parseCommentFreeFileMsg :: Parser a -> Text -> Either Text a
- stripSpaces :: GenParser st a -> GenParser st a
- removeComment :: Text -> Text
- numeral :: GenParser st Numeral
- decimal :: GenParser st Decimal
- hexadecimal :: GenParser st Hexadecimal
- binary :: GenParser st Binary
- stringLiteral :: GenParser st StringLiteral
- reservedWord :: GenParser st ReservedWord
- symbol :: GenParser st Symbol
- keyword :: GenParser st Keyword
- slist :: GenParser st SList
- specConstant :: GenParser st SpecConstant
- sexpr :: GenParser st SExpr
- index :: GenParser st Index
- identifier :: GenParser st Identifier
- attributeValue :: GenParser st AttributeValue
- attribute :: GenParser st Attribute
- sort :: GenParser st Sort
- qualIdentifier :: GenParser st QualIdentifier
- varBinding :: GenParser st VarBinding
- sortedVar :: GenParser st SortedVar
- matchPattern :: GenParser st MatchPattern
- matchCase :: GenParser st MatchCase
- term :: GenParser st Term
- sortSymbolDecl :: GenParser st SortSymbolDecl
- metaSpecConstant :: GenParser st MetaSpecConstant
- funSymbolDecl :: GenParser st FunSymbolDecl
- parFunSymbolDecl :: GenParser st ParFunSymbolDecl
- theoryAttribute :: GenParser st TheoryAttribute
- theoryDecl :: GenParser st TheoryDecl
- logicAttribute :: GenParser st LogicAttribute
- logic :: GenParser st Logic
- sortDec :: GenParser st SortDec
- selectorDec :: GenParser st SelectorDec
- constructorDec :: GenParser st ConstructorDec
- datatypeDec :: GenParser st DatatypeDec
- functionDec :: GenParser st FunctionDec
- functionDef :: GenParser st FunctionDef
- propLiteral :: GenParser st PropLiteral
- command :: GenParser st Command
- script :: GenParser st Script
- bValue :: GenParser st BValue
- scriptOption :: GenParser st ScriptOption
- infoFlag :: GenParser st InfoFlag
- resErrorBehaviour :: GenParser st ResErrorBehavior
- resReasonUnknown :: GenParser st ResReasonUnknown
- resModel :: GenParser st ResModel
- resInfo :: GenParser st ResInfo
- valuationPair :: GenParser st ValuationPair
- tValuationPair :: GenParser st TValuationPair
- resCheckSat :: GenParser st ResCheckSat
- checkSatRes :: GenParser st CheckSatRes
- echoRes :: GenParser st EchoRes
- getAssertionsRes :: GenParser st GetAssertionsRes
- getAssignmentRes :: GenParser st GetAssignmentRes
- getInfoRes :: GenParser st GetInfoRes
- getModelRes :: GenParser st GetModelRes
- getOptionRes :: GenParser st GetOptionRes
- getProofRes :: GenParser st GetProofRes
- getUnsatAssumpRes :: GenParser st GetUnsatAssumpRes
- getUnsatCoreRes :: GenParser st GetUnsatCoreRes
- getValueRes :: GenParser st GetValueRes
Utils
commonly used combinators
parseString :: Parser a -> Text -> Either ParseError a Source #
parseStringEof :: Parser a -> Text -> Either ParseError a Source #
parseFileMsg :: Parser a -> Text -> Either Text a Source #
parse from a file string, may have leading & trailing spaces and comments
parseCommentFreeFileMsg :: Parser a -> Text -> Either Text a Source #
parse from a comment-free file string
stripSpaces :: GenParser st a -> GenParser st a Source #
strip away the leading and trailing spaces
removeComment :: Text -> Text Source #
remove comments
Lexicons (Sec. 3.1)
Parsers for lexicons.
For a numeral, a decimal, or a string literal, the parsed result is the same.
For a hexadecimal or a binary, the result is stripped with marks (#x
and #b
).
hexadecimal :: GenParser st Hexadecimal Source #
stringLiteral :: GenParser st StringLiteral Source #
reservedWord :: GenParser st ReservedWord Source #
accept all reserved words, the exact content should be checked later in the parsing procedure
symbol :: GenParser st Symbol Source #
enclosing a simple symbol in vertical bars does not produce a
new symbol, e.g. abc
and |abc|
are the same symbol
this is guaranteed by removing the bars
S-expressions (Sec. 3.2)
specConstant :: GenParser st SpecConstant Source #
a constant must be followed by a space to delimit the end
Identifiers (Sec 3.3)
identifier :: GenParser st Identifier Source #
Attributes (Sec. 3.4)
attributeValue :: GenParser st AttributeValue Source #
Sorts (Sec 3.5)
Terms and Formulas (Sec 3.6)
qualIdentifier :: GenParser st QualIdentifier Source #
varBinding :: GenParser st VarBinding Source #
matchPattern :: GenParser st MatchPattern Source #
Theory declarations (Sec 3.7)
sortSymbolDecl :: GenParser st SortSymbolDecl Source #
metaSpecConstant :: GenParser st MetaSpecConstant Source #
funSymbolDecl :: GenParser st FunSymbolDecl Source #
parFunSymbolDecl :: GenParser st ParFunSymbolDecl Source #
theoryAttribute :: GenParser st TheoryAttribute Source #
theoryDecl :: GenParser st TheoryDecl Source #
Logic Declarations (Sec 3.8)
logicAttribute :: GenParser st LogicAttribute Source #
Scripts (Sec 3.9)
selectorDec :: GenParser st SelectorDec Source #
constructorDec :: GenParser st ConstructorDec Source #
datatypeDec :: GenParser st DatatypeDec Source #
functionDec :: GenParser st FunctionDec Source #
functionDef :: GenParser st FunctionDef Source #
propLiteral :: GenParser st PropLiteral Source #
scriptOption :: GenParser st ScriptOption Source #
Responses (Sec 3.9.1)
values
resErrorBehaviour :: GenParser st ResErrorBehavior Source #
resReasonUnknown :: GenParser st ResReasonUnknown Source #
valuationPair :: GenParser st ValuationPair Source #
tValuationPair :: GenParser st TValuationPair Source #
resCheckSat :: GenParser st ResCheckSat Source #
instances
checkSatRes :: GenParser st CheckSatRes Source #
getAssertionsRes :: GenParser st GetAssertionsRes Source #
getAssignmentRes :: GenParser st GetAssignmentRes Source #
getInfoRes :: GenParser st GetInfoRes Source #
getModelRes :: GenParser st GetModelRes Source #
getOptionRes :: GenParser st GetOptionRes Source #
getProofRes :: GenParser st GetProofRes Source #
getUnsatAssumpRes :: GenParser st GetUnsatAssumpRes Source #
getUnsatCoreRes :: GenParser st GetUnsatCoreRes Source #
getValueRes :: GenParser st GetValueRes Source #
Orphan instances
SpecificSuccessRes ResCheckSat Source # | |
specificSuccessRes :: GenParser st ResCheckSat Source # | |
SpecificSuccessRes ResModel Source # | |
specificSuccessRes :: GenParser st ResModel Source # | |
SpecificSuccessRes AttributeValue Source # | |
specificSuccessRes :: GenParser st AttributeValue Source # | |
SpecificSuccessRes SExpr Source # | |
specificSuccessRes :: GenParser st SExpr Source # | |
SpecificSuccessRes StringLiteral Source # | |
specificSuccessRes :: GenParser st StringLiteral Source # | |
SpecificSuccessRes [TValuationPair] Source # | |
specificSuccessRes :: GenParser st [TValuationPair] Source # | |
SpecificSuccessRes [Term] Source # | |
specificSuccessRes :: GenParser st [Term] Source # | |
SpecificSuccessRes [Symbol] Source # | |
specificSuccessRes :: GenParser st [Symbol] Source # | |
SpecificSuccessRes (NonEmpty ValuationPair) Source # | |
specificSuccessRes :: GenParser st (NonEmpty ValuationPair) Source # | |
SpecificSuccessRes (NonEmpty ResInfo) Source # | |
specificSuccessRes :: GenParser st (NonEmpty ResInfo) Source # |