Package org.sosy_lab.java_smt.basicimpl
Class AbstractArrayFormulaManager<TFormulaInfo,TType,TEnv,TFuncDecl>
- java.lang.Object
-
- org.sosy_lab.java_smt.basicimpl.AbstractArrayFormulaManager<TFormulaInfo,TType,TEnv,TFuncDecl>
-
- All Implemented Interfaces:
ArrayFormulaManager
public abstract class AbstractArrayFormulaManager<TFormulaInfo,TType,TEnv,TFuncDecl> extends Object implements ArrayFormulaManager
-
-
Field Summary
Fields Modifier and Type Field Description protected FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl>
formulaCreator
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractArrayFormulaManager(FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl> pFormulaCreator)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description <TI extends Formula,TE extends Formula>
BooleanFormulaequivalence(ArrayFormula<TI,TE> pArray1, ArrayFormula<TI,TE> pArray2)
Make aBooleanFormula
that represents the equality of twoArrayFormula
.protected abstract TFormulaInfo
equivalence(TFormulaInfo pArray1, TFormulaInfo pArray2)
protected TFormulaInfo
extractInfo(Formula pBits)
<TE extends Formula>
FormulaType<TE>getElementType(ArrayFormula<?,TE> pArray)
protected FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl>
getFormulaCreator()
<TI extends Formula>
FormulaType<TI>getIndexType(ArrayFormula<TI,?> pArray)
protected abstract <TI extends Formula,TE extends Formula>
TFormulaInfointernalMakeArray(String pName, FormulaType<TI> pIndexType, FormulaType<TE> pElementType)
protected abstract <TI extends Formula,TE extends Formula>
TFormulaInfointernalMakeArray(FormulaType<TI> pIndexType, FormulaType<TE> pElementType, TFormulaInfo defaultElement)
<TI extends Formula,TE extends Formula,FTI extends FormulaType<TI>,FTE extends FormulaType<TE>>
ArrayFormula<TI,TE>makeArray(FTI pIndexType, FTE pElementType, TE defaultElement)
Create a new array constant with values initialized to defaultElement.<TI extends Formula,TE extends Formula,FTI extends FormulaType<TI>,FTE extends FormulaType<TE>>
ArrayFormula<TI,TE>makeArray(String pName, FTI pIndexType, FTE pElementType)
Declare a new array with exactly the given name.<TI extends Formula,TE extends Formula>
TEselect(ArrayFormula<TI,TE> pArray, TI pIndex)
Read a value that is stored in the array at the specified position.protected abstract TFormulaInfo
select(TFormulaInfo pArray, TFormulaInfo pIndex)
<TI extends Formula,TE extends Formula>
ArrayFormula<TI,TE>store(ArrayFormula<TI,TE> pArray, TI pIndex, TE pValue)
Store a value into a cell of the specified array.protected abstract TFormulaInfo
store(TFormulaInfo pArray, TFormulaInfo pIndex, TFormulaInfo pValue)
protected TType
toSolverType(FormulaType<?> formulaType)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.sosy_lab.java_smt.api.ArrayFormulaManager
makeArray, makeArray
-
-
-
-
Field Detail
-
formulaCreator
protected final FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl> formulaCreator
-
-
Constructor Detail
-
AbstractArrayFormulaManager
protected AbstractArrayFormulaManager(FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl> pFormulaCreator)
-
-
Method Detail
-
select
public <TI extends Formula,TE extends Formula> TE select(ArrayFormula<TI,TE> pArray, TI pIndex)
Description copied from interface:ArrayFormulaManager
Read a value that is stored in the array at the specified position.- Specified by:
select
in interfaceArrayFormulaManager
- Parameters:
pArray
- The array from which to readpIndex
- The position from which to read- Returns:
- A formula that represents the result of the "read"
-
select
protected abstract TFormulaInfo select(TFormulaInfo pArray, TFormulaInfo pIndex)
-
store
public <TI extends Formula,TE extends Formula> ArrayFormula<TI,TE> store(ArrayFormula<TI,TE> pArray, TI pIndex, TE pValue)
Description copied from interface:ArrayFormulaManager
Store a value into a cell of the specified array.- Specified by:
store
in interfaceArrayFormulaManager
- Parameters:
pArray
- The array to which to writepIndex
- The position to which to writepValue
- The value that should be written- Returns:
- A formula that represents the "write"
-
store
protected abstract TFormulaInfo store(TFormulaInfo pArray, TFormulaInfo pIndex, TFormulaInfo pValue)
-
makeArray
public <TI extends Formula,TE extends Formula,FTI extends FormulaType<TI>,FTE extends FormulaType<TE>> ArrayFormula<TI,TE> makeArray(String pName, FTI pIndexType, FTE pElementType)
Description copied from interface:ArrayFormulaManager
Declare a new array with exactly the given name.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:
makeArray
in interfaceArrayFormulaManager
pIndexType
- The type of the array indexpElementType
- The type of the array elements
-
makeArray
public <TI extends Formula,TE extends Formula,FTI extends FormulaType<TI>,FTE extends FormulaType<TE>> ArrayFormula<TI,TE> makeArray(FTI pIndexType, FTE pElementType, TE defaultElement)
Description copied from interface:ArrayFormulaManager
Create a new array constant with values initialized to defaultElement.- Specified by:
makeArray
in interfaceArrayFormulaManager
defaultElement
- The default value of all entries in the array.
-
internalMakeArray
protected abstract <TI extends Formula,TE extends Formula> TFormulaInfo internalMakeArray(String pName, FormulaType<TI> pIndexType, FormulaType<TE> pElementType)
-
internalMakeArray
protected abstract <TI extends Formula,TE extends Formula> TFormulaInfo internalMakeArray(FormulaType<TI> pIndexType, FormulaType<TE> pElementType, TFormulaInfo defaultElement)
-
getIndexType
public <TI extends Formula> FormulaType<TI> getIndexType(ArrayFormula<TI,?> pArray)
- Specified by:
getIndexType
in interfaceArrayFormulaManager
-
getElementType
public <TE extends Formula> FormulaType<TE> getElementType(ArrayFormula<?,TE> pArray)
- Specified by:
getElementType
in interfaceArrayFormulaManager
-
equivalence
public <TI extends Formula,TE extends Formula> BooleanFormula equivalence(ArrayFormula<TI,TE> pArray1, ArrayFormula<TI,TE> pArray2)
Description copied from interface:ArrayFormulaManager
Make aBooleanFormula
that represents the equality of twoArrayFormula
.- Specified by:
equivalence
in interfaceArrayFormulaManager
-
equivalence
protected abstract TFormulaInfo equivalence(TFormulaInfo pArray1, TFormulaInfo pArray2)
-
getFormulaCreator
protected final FormulaCreator<TFormulaInfo,TType,TEnv,TFuncDecl> getFormulaCreator()
-
extractInfo
protected final TFormulaInfo extractInfo(Formula pBits)
-
toSolverType
protected final TType toSolverType(FormulaType<?> formulaType)
-
-