Class AbstractStringFormulaManager<TFormulaInfo,TType,TEnv,TFuncDecl>
- All Implemented Interfaces:
StringFormulaManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FormulaCreator<TFormulaInfo,TType, TEnv, TFuncDecl> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected -
Method Summary
Modifier and TypeMethodDescriptionall()Note: The size of the used alphabet depends on the underlying SMT solver.allChar()Note: The size of the used alphabet depends on the underlying SMT solver.protected abstract TFormulaInfoprotected abstract TFormulaInfoallImpl()charAt(StringFormula str, NumeralFormula.IntegerFormula index) Get a substring of length 1 from the given String.protected abstract TFormulaInfocharAt(TFormulaInfo str, TFormulaInfo index) closure(RegexFormula regex) protected abstract TFormulaInfoclosure(TFormulaInfo pParam) complement(RegexFormula regex) protected abstract TFormulaInfocomplement(TFormulaInfo pParam) concat(List<StringFormula> parts) protected abstract TFormulaInfoconcatImpl(List<TFormulaInfo> parts) concatRegex(List<RegexFormula> parts) protected abstract TFormulaInfoconcatRegexImpl(List<TFormulaInfo> parts) contains(StringFormula str, StringFormula part) protected abstract TFormulaInfocontains(TFormulaInfo str, TFormulaInfo part) cross(RegexFormula regex) difference(RegexFormula regex1, RegexFormula regex2) protected TFormulaInfodifference(TFormulaInfo pParam1, TFormulaInfo pParam2) equal(StringFormula str1, StringFormula str2) protected abstract TFormulaInfoequal(TFormulaInfo pParam1, TFormulaInfo pParam2) protected final FormulaCreator<TFormulaInfo,TType, TEnv, TFuncDecl> greaterOrEquals(StringFormula str1, StringFormula str2) protected abstract TFormulaInfogreaterOrEquals(TFormulaInfo pParam1, TFormulaInfo pParam2) greaterThan(StringFormula str1, StringFormula str2) protected abstract TFormulaInfogreaterThan(TFormulaInfo pParam1, TFormulaInfo pParam2) in(StringFormula str, RegexFormula regex) protected abstract TFormulaInfoin(TFormulaInfo str, TFormulaInfo regex) indexOf(StringFormula str, StringFormula part, NumeralFormula.IntegerFormula startIndex) Get the first index for a substring in a String, or -1 if the substring is not found.protected abstract TFormulaInfoindexOf(TFormulaInfo str, TFormulaInfo part, TFormulaInfo startIndex) intersection(RegexFormula regex1, RegexFormula regex2) protected abstract TFormulaInfointersection(TFormulaInfo pParam1, TFormulaInfo pParam2) length(StringFormula str) protected abstract TFormulaInfolength(TFormulaInfo pParam) lessOrEquals(StringFormula str1, StringFormula str2) protected abstract TFormulaInfolessOrEquals(TFormulaInfo pParam1, TFormulaInfo pParam2) lessThan(StringFormula str1, StringFormula str2) protected abstract TFormulaInfolessThan(TFormulaInfo pParam1, TFormulaInfo pParam2) Returns aRegexFormularepresenting the given constant.protected abstract TFormulaInfomakeRegexImpl(String value) makeString(String value) Returns aStringFormularepresenting the given constant.protected abstract TFormulaInfomakeStringImpl(String value) makeVariable(String pVar) Creates a variable of type String with exactly the given name.protected abstract TFormulaInfomakeVariableImpl(String pVar) none()protected abstract TFormulaInfononeImpl()optional(RegexFormula regex) prefix(StringFormula prefix, StringFormula str) Check whether the given prefix is a real prefix of str.protected abstract TFormulaInfoprefix(TFormulaInfo prefix, TFormulaInfo str) range(StringFormula start, StringFormula end) protected abstract TFormulaInforange(TFormulaInfo start, TFormulaInfo end) replace(StringFormula fullStr, StringFormula target, StringFormula replacement) Replace the first appearances of target in fullStr with the replacement.protected abstract TFormulaInforeplace(TFormulaInfo fullStr, TFormulaInfo target, TFormulaInfo replacement) replaceAll(StringFormula fullStr, StringFormula target, StringFormula replacement) Replace all appearances of target in fullStr with the replacement.protected abstract TFormulaInforeplaceAll(TFormulaInfo fullStr, TFormulaInfo target, TFormulaInfo replacement) substring(StringFormula str, NumeralFormula.IntegerFormula index, NumeralFormula.IntegerFormula length) Get a substring from the given String.protected abstract TFormulaInfosubstring(TFormulaInfo str, TFormulaInfo index, TFormulaInfo length) suffix(StringFormula suffix, StringFormula str) Check whether the given suffix is a real suffix of str.protected abstract TFormulaInfosuffix(TFormulaInfo suffix, TFormulaInfo str) times(RegexFormula regex, int repetitions) Interpret a String formula as an Integer formula.protected abstract TFormulaInfotoIntegerFormula(TFormulaInfo pParam) protected final TTypetoSolverType(FormulaType<?> formulaType) Interpret an Integer formula as a String formula.protected abstract TFormulaInfotoStringFormula(TFormulaInfo pParam) union(RegexFormula regex1, RegexFormula regex2) protected abstract TFormulaInfounion(TFormulaInfo pParam1, TFormulaInfo pParam2) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.sosy_lab.java_smt.api.StringFormulaManager
concat, concat, range
-
Field Details
-
formulaCreator
-
-
Constructor Details
-
AbstractStringFormulaManager
-
-
Method Details
-
makeString
Description copied from interface:StringFormulaManagerReturns aStringFormularepresenting the given constant.- Specified by:
makeStringin interfaceStringFormulaManager- Parameters:
value- the string value the returnedFormulashould represent- Returns:
- a Formula representing the given value
-
makeStringImpl
-
makeVariable
Description copied from interface:StringFormulaManagerCreates a variable of type String with exactly the given name.This variable (symbol) represents a "String" for which the SMT solver needs to find a model.
Please make sure that the given name is valid in SMT-LIB2. Take a look at
FormulaManager.isValidName(java.lang.String)for further information.This method does not quote or unquote the given name, but uses the plain name "AS IS".
Formula.toString()can return a different String than the given one.- Specified by:
makeVariablein interfaceStringFormulaManager
-
makeVariableImpl
-
equal
- Specified by:
equalin interfaceStringFormulaManager
-
equal
-
greaterThan
- Specified by:
greaterThanin interfaceStringFormulaManager
-
greaterThan
-
greaterOrEquals
- Specified by:
greaterOrEqualsin interfaceStringFormulaManager
-
greaterOrEquals
-
lessThan
- Specified by:
lessThanin interfaceStringFormulaManager
-
lessThan
-
lessOrEquals
- Specified by:
lessOrEqualsin interfaceStringFormulaManager
-
lessOrEquals
-
length
- Specified by:
lengthin interfaceStringFormulaManager
-
length
-
concat
- Specified by:
concatin interfaceStringFormulaManager
-
concatImpl
-
prefix
Description copied from interface:StringFormulaManagerCheck whether the given prefix is a real prefix of str.- Specified by:
prefixin interfaceStringFormulaManager
-
prefix
-
suffix
Description copied from interface:StringFormulaManagerCheck whether the given suffix is a real suffix of str.- Specified by:
suffixin interfaceStringFormulaManager
-
suffix
-
in
- Specified by:
inin interfaceStringFormulaManager- Parameters:
str- formula representing the string to matchregex- formula representing the regular expression- Returns:
- a formula representing the acceptance of the string by the regular expression
-
in
-
contains
- Specified by:
containsin interfaceStringFormulaManager
-
contains
-
indexOf
public NumeralFormula.IntegerFormula indexOf(StringFormula str, StringFormula part, NumeralFormula.IntegerFormula startIndex) Description copied from interface:StringFormulaManagerGet the first index for a substring in a String, or -1 if the substring is not found. startIndex (inlcuded) denotes the start of the search for the index.- Specified by:
indexOfin interfaceStringFormulaManager
-
indexOf
protected abstract TFormulaInfo indexOf(TFormulaInfo str, TFormulaInfo part, TFormulaInfo startIndex) -
charAt
Description copied from interface:StringFormulaManagerGet a substring of length 1 from the given String.The result is underspecified, if the index is out of bounds for the given String.
- Specified by:
charAtin interfaceStringFormulaManager
-
charAt
-
substring
public StringFormula substring(StringFormula str, NumeralFormula.IntegerFormula index, NumeralFormula.IntegerFormula length) Description copied from interface:StringFormulaManagerGet a substring from the given String.The result is underspecified, if the start index is out of bounds for the given String or if the requested length is negative. The length of the result is the minimum of the requested length and the remaining length of the given String.
- Specified by:
substringin interfaceStringFormulaManager
-
substring
protected abstract TFormulaInfo substring(TFormulaInfo str, TFormulaInfo index, TFormulaInfo length) -
replace
public StringFormula replace(StringFormula fullStr, StringFormula target, StringFormula replacement) Description copied from interface:StringFormulaManagerReplace the first appearances of target in fullStr with the replacement.- Specified by:
replacein interfaceStringFormulaManager
-
replace
protected abstract TFormulaInfo replace(TFormulaInfo fullStr, TFormulaInfo target, TFormulaInfo replacement) -
replaceAll
public StringFormula replaceAll(StringFormula fullStr, StringFormula target, StringFormula replacement) Description copied from interface:StringFormulaManagerReplace all appearances of target in fullStr with the replacement.- Specified by:
replaceAllin interfaceStringFormulaManager
-
replaceAll
protected abstract TFormulaInfo replaceAll(TFormulaInfo fullStr, TFormulaInfo target, TFormulaInfo replacement) -
makeRegex
Description copied from interface:StringFormulaManagerReturns aRegexFormularepresenting the given constant.This method does not parse an existing regex from String, but uses the String directly as a constant.
- Specified by:
makeRegexin interfaceStringFormulaManager- Parameters:
value- the regular expression the returnedFormulashould represent
-
makeRegexImpl
-
none
- Specified by:
nonein interfaceStringFormulaManager- Returns:
- formula denoting the empty set of strings
-
noneImpl
-
all
Description copied from interface:StringFormulaManagerNote: The size of the used alphabet depends on the underlying SMT solver.- Specified by:
allin interfaceStringFormulaManager- Returns:
- formula denoting the set of all strings, also known as Regex
".*".
-
allImpl
-
allChar
Description copied from interface:StringFormulaManagerNote: The size of the used alphabet depends on the underlying SMT solver.- Specified by:
allCharin interfaceStringFormulaManager- Returns:
- formula denoting the set of all strings of length 1, also known as DOT operator which
represents one arbitrary char, or as Regex
".".
-
allCharImpl
-
range
- Specified by:
rangein interfaceStringFormulaManager- Returns:
- formula denoting the range regular expression over two sequences of length 1.
-
range
-
concatRegex
- Specified by:
concatRegexin interfaceStringFormulaManager- Returns:
- formula denoting the concatenation
-
concatRegexImpl
-
union
- Specified by:
unionin interfaceStringFormulaManager- Returns:
- formula denoting the union
-
union
-
intersection
- Specified by:
intersectionin interfaceStringFormulaManager- Returns:
- formula denoting the intersection
-
intersection
-
closure
- Specified by:
closurein interfaceStringFormulaManager- Returns:
- formula denoting the Kleene closure (0 or more), also known as STAR operand.
-
closure
-
complement
- Specified by:
complementin interfaceStringFormulaManager- Returns:
- formula denoting the Kleene closure
-
complement
-
difference
- Specified by:
differencein interfaceStringFormulaManager- Returns:
- formula denoting the difference
-
difference
-
cross
- Specified by:
crossin interfaceStringFormulaManager- Returns:
- formula denoting the Kleene cross (1 or more), also known as PLUS operand.
-
optional
- Specified by:
optionalin interfaceStringFormulaManager- Returns:
- formula denoting the optionality, also known as QUESTIONMARK operand.
-
times
- Specified by:
timesin interfaceStringFormulaManager- Returns:
- formula denoting the concatenation n times
-
toIntegerFormula
Description copied from interface:StringFormulaManagerInterpret a String formula as an Integer formula.The number is interpreted in base 10 and has no leading zeros. The method works as expected for positive numbers, including zero. It returns the constant value of
-1for negative numbers or invalid number representations, for example if any char is no digit.- Specified by:
toIntegerFormulain interfaceStringFormulaManager
-
toIntegerFormula
-
toStringFormula
Description copied from interface:StringFormulaManagerInterpret an Integer formula as a String formula.The number is in base 10. The method works as expected for positive numbers, including zero. It returns the empty string
""for negative numbers.- Specified by:
toStringFormulain interfaceStringFormulaManager
-
toStringFormula
-
getFormulaCreator
-
toSolverType
-