Package org.smtlib.impl
Class Factory
java.lang.Object
org.smtlib.impl.Factory
- All Implemented Interfaces:
ICommand.IFactory,IExpr.IFactory,ISort.IFactory
Implements a factory for SMT-LIB expressions using the standard concrete syntax.
Instances of these IExpr objects have an IPos element.
The various factories are all implemented together in this one class because they
use each other mutually; combining them lets them be overridden in a consistent fashion.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final SMT.ConfigurationThe configuration this factory's instances (e.g. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassertCommand(IExpr expr) Creates an assert command object, asserting the given expression.Creates an attribute with just a keyword and no attribute value.<T extends IAttributeValue>
IExpr.IAttribute<T> attribute(IExpr.IKeyword k, T value) Creates an attribute with a keyword and a value.attributedExpr(IExpr e, List<IExpr.IAttribute<?>> attributes) Creates an attributed expression (an expression with a positive number of attributes).<T extends IAttributeValue>
IExpr.IAttributedExprattributedExpr(IExpr e, IExpr.IKeyword key, T value) Creates an attributed expression with just one attribute.Creates an IBinaryLiteral from a string of 0 and 1 digits.binding(IExpr.ISymbol symbol, IExpr expr) Creates a binding for a Let expression.Bool()Returns the Bool sort.Creates a check-sat command object.check_sat_assuming(List<IExpr> terms) Creates a check-sat-assuming command object.Creates a comment pseudo-command object, carrying the given raw comment text (seeICommand.Icomment).constructor(IExpr.ISymbol symbol, List<IExpr.ISelector> selectors) Creates a constructor declaration.createErrorDefinition(IExpr.IIdentifier id, String errorMessage, IPos pos) Creates an error-placeholder definition (suppresses cascading errors).createFcnSort(ISort[] args, ISort result) Creates a function sort.createSortAbbreviation(IExpr.IIdentifier identifier, List<ISort.IParameter> params, ISort sortExpr) Creates a new sort abbreviation.createSortExpression(IExpr.IIdentifier sortFamily, List<ISort> exprs) Creates a sort expression, applying a family to a list of sort arguments; the arity of the identifier in the applicable symbol table must match the number of sort arguments.createSortExpression(IExpr.IIdentifier sortFamily, ISort... exprs) Creates a sort expression, applying a family to a list of sort arguments; the arity of the identifier in the applicable symbol table must match the number of sort arguments.createSortFamily(IExpr.IIdentifier identifier, IExpr.INumeral arity, List<IExpr.IAttribute<?>> attributes) Creates a sort family with the given identifier, arity, and attributes (null or empty if none).createSortParameter(IExpr.ISymbol symbol) Creates a parameter for a parameterized sort abbreviation.datatype(List<IExpr.IConstructor> constructors, List<IExpr.ISymbol> symbols) Creates a datatype declaration; symbols is non-null only for parametric (par) forms.Creates an IDecimal object; the argument must be a string of digits with just one decimal point.declaration(IExpr.ISymbol symbol, ISort sort) Creates a parameter declaration.declare_const(IExpr.ISymbol s, ISort r) Creates a declare-const command object.Creates a declare-datatype command object.declare_datatypes(List<IExpr.ISortDeclaration> sds, List<ISort.IDatatype> dts) Creates a declare-datatypes command object.declare_fun(IExpr.ISymbol id, List<ISort> args, ISort r) Creates a declare-fun command object.Creates a declare-sort command object.Creates a declare-sort-parameter command object.define_const(IExpr.ISymbol s, ISort r, IExpr e) Creates a define-const command object.define_fun(IExpr.ISymbol id, List<IExpr.IDeclaration> ps, ISort r, IExpr e) Creates a define-fun command object.define_fun_rec(IExpr.ISymbol id, List<IExpr.IDeclaration> ps, ISort r, IExpr e) Creates a define-fun-rec command object.define_funs_rec(List<IExpr.IFunctionDeclaration> ds, List<IExpr> bs) Creates a define-funs-rec command object.define_sort(IExpr.ISymbol id, List<ISort.IParameter> ps, ISort e) Creates a define-sort command object.echo(IExpr.IStringLiteral arg) Creates an echo command object.Creates an error expression.exists(List<IExpr.IDeclaration> params, IExpr e) Creates an Exists expression.Creates an Exists expression with trigger patterns: each element of patterns is a separate single-term pattern, emitted as:pattern (p).exit()Creates an exit command object.fcn(IExpr.IQualifiedIdentifier id, List<IExpr> args) Creates a function expression (perhaps with an empty argument list).fcn(IExpr.IQualifiedIdentifier id, IExpr... args) Creates a function expression (perhaps with an empty argument list).forall(List<IExpr.IDeclaration> params, IExpr e) Creates a Forall expression.Creates a Forall expression with trigger patterns: each element of patterns is a separate single-term pattern, emitted as:pattern (p).functionDeclaration(IExpr.ISymbol symbol, List<IExpr.IDeclaration> parameters, ISort sort) Creates a function declaration (used in define-funs-rec).Creates a get-assertions command object.Creates a get-assignment command object.Creates a get-info command object.Creates a get-model command object.Creates a get-option command object.Creates a get-proof command object.Creates a get-unsat-assumptions command object.Creates a get-unsat-core command object.Creates a get-value command object.Creates an IHexLiteral object from a string of hex digits (either case).id(IExpr.IIdentifier identifier, ISort qualifier) Creates an 'as' identifier from an identifier and a sort qualifier.id(IExpr.ISymbol symbol, List<IExpr.IIndex> indices) Creates a parameterized identifier from a symbol and a non-empty list of indices (each INumeral or ISymbol).static voidinitFactories(SMT.Configuration config) Initializes the SMT configuration object for the implementation in org.smtlib.impl - all the appropriate factories, etc.Creates an IKeyword object from a canonical string representation.lambda(List<IExpr.IDeclaration> params, IExpr e) Creates a Lambda expression (SMT-LIB 2.7ff, HO-Core theory).let(List<IExpr.IBinding> bindings, IExpr e) Creates a Let expression.match(IExpr expr, List<IExpr.IMatchCase> cases) Creates a match expression.matchCase(IExpr.IPattern pattern, IExpr body) Creates a single match case.numeral(long v) Creates an INumeral object; the argument must be non-negative.Creates an INumeral object; the argument must be a string of digits.pattern(IExpr.ISymbol constructor, List<IExpr.ISymbol> params) Creates a match pattern.patternTerms(List<IExpr> terms) Creates the value of a:patternattribute: the given terms as one (multi-)pattern.Creates a pop command object.Creates a push command object.Creates an IStringLiteral from a string that is SMT-LIB escaped with enclosing quotes.reset()Creates a reset command object.Creates a reset-assertions command object.script()Creates an empty script, with no filename and no commands, ready to have commands added viaICommand.IScript.add(ICommand).script(IExpr.IStringLiteral filename, List<ICommand> commands) Creates a script object containing the given filename or the given set of commands.selector(IExpr.ISymbol symbol, ISort sort) Creates a selector declaration.Creates a set-info command object.Creates a set-logic command object.Creates a set-option command object.sortDeclaration(IExpr.ISymbol symbol, IExpr.INumeral arity) Creates a sort declaration (symbol + arity) for use in declare-datatype(s).Creates an ISymbol object from a canonical String representation of the symbol.Creates an IStringLiteral from a pure character string with no SMT-LIB escapes or enclosing quotes.
-
Field Details
-
smtConfig
The configuration this factory's instances (e.g. StringLiteral) are scoped to; see issue #22.
-
-
Constructor Details
-
Factory
-
-
Method Details
-
initFactories
Initializes the SMT configuration object for the implementation in org.smtlib.impl - all the appropriate factories, etc.- Parameters:
config- the configuration object to initialize
-
createSortFamily
public Sort.Family createSortFamily(IExpr.IIdentifier identifier, IExpr.INumeral arity, List<IExpr.IAttribute<?>> attributes) Description copied from interface:ISort.IFactoryCreates a sort family with the given identifier, arity, and attributes (null or empty if none).- Specified by:
createSortFamilyin interfaceISort.IFactory
-
createSortParameter
Description copied from interface:ISort.IFactoryCreates a parameter for a parameterized sort abbreviation.- Specified by:
createSortParameterin interfaceISort.IFactory
-
createSortExpression
Description copied from interface:ISort.IFactoryCreates a sort expression, applying a family to a list of sort arguments; the arity of the identifier in the applicable symbol table must match the number of sort arguments.- Specified by:
createSortExpressionin interfaceISort.IFactory
-
createSortExpression
Description copied from interface:ISort.IFactoryCreates a sort expression, applying a family to a list of sort arguments; the arity of the identifier in the applicable symbol table must match the number of sort arguments.- Specified by:
createSortExpressionin interfaceISort.IFactory
-
createSortAbbreviation
public Sort.Abbreviation createSortAbbreviation(IExpr.IIdentifier identifier, List<ISort.IParameter> params, ISort sortExpr) Description copied from interface:ISort.IFactoryCreates a new sort abbreviation.- Specified by:
createSortAbbreviationin interfaceISort.IFactory
-
createFcnSort
Description copied from interface:ISort.IFactoryCreates a function sort.- Specified by:
createFcnSortin interfaceISort.IFactory
-
createErrorDefinition
public ISort.IErrorDefinition createErrorDefinition(IExpr.IIdentifier id, String errorMessage, IPos pos) Description copied from interface:ISort.IFactoryCreates an error-placeholder definition (suppresses cascading errors).- Specified by:
createErrorDefinitionin interfaceISort.IFactory
-
Bool
Description copied from interface:ISort.IFactoryReturns the Bool sort.- Specified by:
Boolin interfaceISort.IFactory
-
script
Description copied from interface:ICommand.IFactoryCreates an empty script, with no filename and no commands, ready to have commands added viaICommand.IScript.add(ICommand).- Specified by:
scriptin interfaceICommand.IFactory
-
script
Description copied from interface:ICommand.IFactoryCreates a script object containing the given filename or the given set of commands.- Specified by:
scriptin interfaceICommand.IFactory
-
assertCommand
Description copied from interface:ICommand.IFactoryCreates an assert command object, asserting the given expression.- Specified by:
assertCommandin interfaceICommand.IFactory
-
check_sat
Description copied from interface:ICommand.IFactoryCreates a check-sat command object.- Specified by:
check_satin interfaceICommand.IFactory
-
check_sat_assuming
Description copied from interface:ICommand.IFactoryCreates a check-sat-assuming command object.- Specified by:
check_sat_assumingin interfaceICommand.IFactory
-
declare_const
Description copied from interface:ICommand.IFactoryCreates a declare-const command object.- Specified by:
declare_constin interfaceICommand.IFactory
-
declare_datatype
Description copied from interface:ICommand.IFactoryCreates a declare-datatype command object.- Specified by:
declare_datatypein interfaceICommand.IFactory
-
declare_datatypes
public ICommand.Ideclare_datatypes declare_datatypes(List<IExpr.ISortDeclaration> sds, List<ISort.IDatatype> dts) Description copied from interface:ICommand.IFactoryCreates a declare-datatypes command object.- Specified by:
declare_datatypesin interfaceICommand.IFactory
-
declare_fun
Description copied from interface:ICommand.IFactoryCreates a declare-fun command object.- Specified by:
declare_funin interfaceICommand.IFactory
-
declare_sort
Description copied from interface:ICommand.IFactoryCreates a declare-sort command object.- Specified by:
declare_sortin interfaceICommand.IFactory
-
declare_sort_parameter
Description copied from interface:ICommand.IFactoryCreates a declare-sort-parameter command object.- Specified by:
declare_sort_parameterin interfaceICommand.IFactory
-
define_const
Description copied from interface:ICommand.IFactoryCreates a define-const command object.- Specified by:
define_constin interfaceICommand.IFactory
-
define_fun
public ICommand.Idefine_fun define_fun(IExpr.ISymbol id, List<IExpr.IDeclaration> ps, ISort r, IExpr e) Description copied from interface:ICommand.IFactoryCreates a define-fun command object.- Specified by:
define_funin interfaceICommand.IFactory
-
define_fun_rec
public ICommand.Idefine_fun_rec define_fun_rec(IExpr.ISymbol id, List<IExpr.IDeclaration> ps, ISort r, IExpr e) Description copied from interface:ICommand.IFactoryCreates a define-fun-rec command object.- Specified by:
define_fun_recin interfaceICommand.IFactory
-
define_funs_rec
public ICommand.Idefine_funs_rec define_funs_rec(List<IExpr.IFunctionDeclaration> ds, List<IExpr> bs) Description copied from interface:ICommand.IFactoryCreates a define-funs-rec command object.- Specified by:
define_funs_recin interfaceICommand.IFactory
-
define_sort
Description copied from interface:ICommand.IFactoryCreates a define-sort command object.- Specified by:
define_sortin interfaceICommand.IFactory
-
echo
Description copied from interface:ICommand.IFactoryCreates an echo command object.- Specified by:
echoin interfaceICommand.IFactory
-
comment
Description copied from interface:ICommand.IFactoryCreates a comment pseudo-command object, carrying the given raw comment text (seeICommand.Icomment).- Specified by:
commentin interfaceICommand.IFactory
-
exit
Description copied from interface:ICommand.IFactoryCreates an exit command object.- Specified by:
exitin interfaceICommand.IFactory
-
get_assertions
Description copied from interface:ICommand.IFactoryCreates a get-assertions command object.- Specified by:
get_assertionsin interfaceICommand.IFactory
-
get_assignment
Description copied from interface:ICommand.IFactoryCreates a get-assignment command object.- Specified by:
get_assignmentin interfaceICommand.IFactory
-
get_info
Description copied from interface:ICommand.IFactoryCreates a get-info command object.- Specified by:
get_infoin interfaceICommand.IFactory
-
get_model
Description copied from interface:ICommand.IFactoryCreates a get-model command object.- Specified by:
get_modelin interfaceICommand.IFactory
-
get_option
Description copied from interface:ICommand.IFactoryCreates a get-option command object.- Specified by:
get_optionin interfaceICommand.IFactory
-
get_proof
Description copied from interface:ICommand.IFactoryCreates a get-proof command object.- Specified by:
get_proofin interfaceICommand.IFactory
-
get_unsat_assumptions
Description copied from interface:ICommand.IFactoryCreates a get-unsat-assumptions command object.- Specified by:
get_unsat_assumptionsin interfaceICommand.IFactory
-
get_unsat_core
Description copied from interface:ICommand.IFactoryCreates a get-unsat-core command object.- Specified by:
get_unsat_corein interfaceICommand.IFactory
-
get_value
Description copied from interface:ICommand.IFactoryCreates a get-value command object.- Specified by:
get_valuein interfaceICommand.IFactory
-
push
Description copied from interface:ICommand.IFactoryCreates a push command object.- Specified by:
pushin interfaceICommand.IFactory
-
pop
Description copied from interface:ICommand.IFactoryCreates a pop command object.- Specified by:
popin interfaceICommand.IFactory
-
reset
Description copied from interface:ICommand.IFactoryCreates a reset command object.- Specified by:
resetin interfaceICommand.IFactory
-
reset_assertions
Description copied from interface:ICommand.IFactoryCreates a reset-assertions command object.- Specified by:
reset_assertionsin interfaceICommand.IFactory
-
set_logic
Description copied from interface:ICommand.IFactoryCreates a set-logic command object.- Specified by:
set_logicin interfaceICommand.IFactory
-
set_info
Description copied from interface:ICommand.IFactoryCreates a set-info command object.- Specified by:
set_infoin interfaceICommand.IFactory
-
set_option
Description copied from interface:ICommand.IFactoryCreates a set-option command object.- Specified by:
set_optionin interfaceICommand.IFactory
-
numeral
Description copied from interface:IExpr.IFactoryCreates an INumeral object; the argument must be a string of digits.- Specified by:
numeralin interfaceIExpr.IFactory
-
numeral
Description copied from interface:IExpr.IFactoryCreates an INumeral object; the argument must be non-negative.- Specified by:
numeralin interfaceIExpr.IFactory
-
decimal
Description copied from interface:IExpr.IFactoryCreates an IDecimal object; the argument must be a string of digits with just one decimal point.- Specified by:
decimalin interfaceIExpr.IFactory
-
unquotedString
Description copied from interface:IExpr.IFactoryCreates an IStringLiteral from a pure character string with no SMT-LIB escapes or enclosing quotes.- Specified by:
unquotedStringin interfaceIExpr.IFactory
-
quotedString
Description copied from interface:IExpr.IFactoryCreates an IStringLiteral from a string that is SMT-LIB escaped with enclosing quotes.- Specified by:
quotedStringin interfaceIExpr.IFactory
-
keyword
Description copied from interface:IExpr.IFactoryCreates an IKeyword object from a canonical string representation.- Specified by:
keywordin interfaceIExpr.IFactory
-
binary
Description copied from interface:IExpr.IFactoryCreates an IBinaryLiteral from a string of 0 and 1 digits.- Specified by:
binaryin interfaceIExpr.IFactory
-
hex
Description copied from interface:IExpr.IFactoryCreates an IHexLiteral object from a string of hex digits (either case).- Specified by:
hexin interfaceIExpr.IFactory
-
symbol
Description copied from interface:IExpr.IFactoryCreates an ISymbol object from a canonical String representation of the symbol.- Specified by:
symbolin interfaceIExpr.IFactory
-
attribute
Description copied from interface:IExpr.IFactoryCreates an attribute with just a keyword and no attribute value.- Specified by:
attributein interfaceIExpr.IFactory
-
attribute
Description copied from interface:IExpr.IFactoryCreates an attribute with a keyword and a value.- Specified by:
attributein interfaceIExpr.IFactory
-
attributedExpr
Description copied from interface:IExpr.IFactoryCreates an attributed expression (an expression with a positive number of attributes).- Specified by:
attributedExprin interfaceIExpr.IFactory
-
patternTerms
Description copied from interface:IExpr.IFactoryCreates the value of a:patternattribute: the given terms as one (multi-)pattern.- Specified by:
patternTermsin interfaceIExpr.IFactory
-
attributedExpr
public <T extends IAttributeValue> IExpr.IAttributedExpr attributedExpr(IExpr e, IExpr.IKeyword key, T value) Description copied from interface:IExpr.IFactoryCreates an attributed expression with just one attribute.- Specified by:
attributedExprin interfaceIExpr.IFactory
-
fcn
Description copied from interface:IExpr.IFactoryCreates a function expression (perhaps with an empty argument list).- Specified by:
fcnin interfaceIExpr.IFactory
-
fcn
Description copied from interface:IExpr.IFactoryCreates a function expression (perhaps with an empty argument list).- Specified by:
fcnin interfaceIExpr.IFactory
-
id
Description copied from interface:IExpr.IFactoryCreates a parameterized identifier from a symbol and a non-empty list of indices (each INumeral or ISymbol).- Specified by:
idin interfaceIExpr.IFactory
-
id
Description copied from interface:IExpr.IFactoryCreates an 'as' identifier from an identifier and a sort qualifier.- Specified by:
idin interfaceIExpr.IFactory
-
let
Description copied from interface:IExpr.IFactoryCreates a Let expression.- Specified by:
letin interfaceIExpr.IFactory
-
binding
Description copied from interface:IExpr.IFactoryCreates a binding for a Let expression.- Specified by:
bindingin interfaceIExpr.IFactory
-
declaration
Description copied from interface:IExpr.IFactoryCreates a parameter declaration.- Specified by:
declarationin interfaceIExpr.IFactory
-
forall
Description copied from interface:IExpr.IFactoryCreates a Forall expression.- Specified by:
forallin interfaceIExpr.IFactory
-
forall
Description copied from interface:IExpr.IFactoryCreates a Forall expression with trigger patterns: each element of patterns is a separate single-term pattern, emitted as:pattern (p).- Specified by:
forallin interfaceIExpr.IFactory
-
exists
Description copied from interface:IExpr.IFactoryCreates an Exists expression.- Specified by:
existsin interfaceIExpr.IFactory
-
exists
Description copied from interface:IExpr.IFactoryCreates an Exists expression with trigger patterns: each element of patterns is a separate single-term pattern, emitted as:pattern (p).- Specified by:
existsin interfaceIExpr.IFactory
-
lambda
Description copied from interface:IExpr.IFactoryCreates a Lambda expression (SMT-LIB 2.7ff, HO-Core theory).- Specified by:
lambdain interfaceIExpr.IFactory
-
error
Description copied from interface:IExpr.IFactoryCreates an error expression.- Specified by:
errorin interfaceIExpr.IFactory
-
sortDeclaration
Description copied from interface:IExpr.IFactoryCreates a sort declaration (symbol + arity) for use in declare-datatype(s).- Specified by:
sortDeclarationin interfaceIExpr.IFactory
-
selector
Description copied from interface:IExpr.IFactoryCreates a selector declaration.- Specified by:
selectorin interfaceIExpr.IFactory
-
constructor
Description copied from interface:IExpr.IFactoryCreates a constructor declaration.- Specified by:
constructorin interfaceIExpr.IFactory
-
datatype
Description copied from interface:IExpr.IFactoryCreates a datatype declaration; symbols is non-null only for parametric (par) forms.- Specified by:
datatypein interfaceIExpr.IFactory
-
functionDeclaration
public IExpr.IFunctionDeclaration functionDeclaration(IExpr.ISymbol symbol, List<IExpr.IDeclaration> parameters, ISort sort) Description copied from interface:IExpr.IFactoryCreates a function declaration (used in define-funs-rec).- Specified by:
functionDeclarationin interfaceIExpr.IFactory
-
pattern
Description copied from interface:IExpr.IFactoryCreates a match pattern.- Specified by:
patternin interfaceIExpr.IFactory
-
matchCase
Description copied from interface:IExpr.IFactoryCreates a single match case.- Specified by:
matchCasein interfaceIExpr.IFactory
-
match
Description copied from interface:IExpr.IFactoryCreates a match expression.- Specified by:
matchin interfaceIExpr.IFactory
-