25
25
import org .sosy_lab .java_smt .api .FormulaType .FloatingPointType ;
26
26
import org .sosy_lab .java_smt .api .visitors .FormulaVisitor ;
27
27
import org .sosy_lab .java_smt .basicimpl .FormulaCreator ;
28
- import org .sosy_lab .java_smt .native_api .stp .VC ;
29
- import org .sosy_lab .java_smt .native_api .stp .stpJapi ;
30
28
31
29
//extends FormulaCreator<TFormulaInfo, TType, TEnv, TFuncDecl> {
32
30
public class StpFormulaCreator extends FormulaCreator <Long , Long , Long , Long > {
@@ -41,7 +39,7 @@ public class StpFormulaCreator extends FormulaCreator<Long, Long, Long, Long> {
41
39
// }
42
40
//
43
41
// protected StpFormulaCreator(Long pEnv) {
44
- // super(pEnv, stpJapi .vc_boolType(vc), null, null);
42
+ // super(pEnv, StpJavaApi .vc_boolType(vc), null, null);
45
43
//
46
44
// }
47
45
@@ -52,14 +50,14 @@ public class StpFormulaCreator extends FormulaCreator<Long, Long, Long, Long> {
52
50
private final VC vc ;
53
51
54
52
protected StpFormulaCreator (VC vc ) {
55
- super (StpVC .getVCptr (vc ), StpType . getTypePtr ( stpJapi .vc_boolType (vc )), null , null );
53
+ super (StpVC .getVCptr (vc ), Type . getCPtr ( StpJavaApi .vc_boolType (vc )), null , null );
56
54
this .vc = vc ;
57
55
}
58
56
59
57
60
58
@ Override
61
59
public Long getBitvectorType (int pBitwidth ) {
62
- return StpType . getTypePtr ( stpJapi .vc_bvType (vc , pBitwidth ));
60
+ return Type . getCPtr ( StpJavaApi .vc_bvType (vc , pBitwidth ));
63
61
}
64
62
65
63
@ Override
@@ -69,50 +67,42 @@ public Long getFloatingPointType(FloatingPointType pType) {
69
67
70
68
@ Override
71
69
public Long getArrayType (Long pIndexType , Long pElementType ) {
72
- return StpType . getTypePtr (
73
- stpJapi .vc_arrayType (vc , StpType . getType (pIndexType ), StpType . getType (pElementType )));
70
+ return Type . getCPtr (
71
+ StpJavaApi .vc_arrayType (vc , new Type (pIndexType , true ), new Type (pElementType , true )));
74
72
}
75
73
76
74
@ Override
77
75
public Long makeVariable (Long pType , String pVarName ) {
78
76
String alphaNum_ = "^[a-zA-Z0-9_]*$" ;
79
77
assert (pVarName
80
78
.matches (alphaNum_ )) : "A valid Variable Name can only contain Alphanumeric and underscore" ;
81
- return StpExpr . getExprPtr ( stpJapi .vc_varExpr (vc , pVarName , StpType . getType (pType )));
79
+ return Expr . getCPtr ( StpJavaApi .vc_varExpr (vc , pVarName , new Type (pType , true )));
82
80
}
83
81
84
82
@ Override
85
83
public FormulaType <?> getFormulaType (Long pFormula ) {
86
- // TODO Auto-generated method stub
84
+ System .out .println ("I came here." );
85
+ // long type = msat_term_get_type(pFormula);
86
+ // return getFormulaTypeFromTermType(type);
87
87
return null ;
88
88
}
89
- //
90
- //
91
- // private FormulaType<?> getFormulaTypeFromTermType(Long type) {
92
- // long env = getEnv();
93
- // if (msat_is_bool_type(env, type)) {
94
- // return FormulaType.BooleanType;
95
- // } else if (msat_is_integer_type(env, type)) {
96
- // return FormulaType.IntegerType;
97
- // } else if (msat_is_rational_type(env, type)) {
98
- // return FormulaType.RationalType;
99
- // } else if (msat_is_bv_type(env, type)) {
100
- // return FormulaType.getBitvectorTypeWithSize(msat_get_bv_type_size(env, type));
101
- // } else if (msat_is_fp_type(env, type)) {
102
- // return FormulaType.getFloatingPointType(
103
- // msat_get_fp_type_exp_width(env, type), msat_get_fp_type_mant_width(env, type));
104
- // } else if (msat_is_fp_roundingmode_type(env, type)) {
105
- // return FormulaType.FloatingPointRoundingModeType;
106
- // } else if (msat_is_array_type(env, type)) {
107
- // long indexType = msat_get_array_index_type(env, type);
108
- // long elementType = msat_get_array_element_type(env, type);
109
- // return FormulaType.getArrayType(
110
- // getFormulaTypeFromTermType(indexType), getFormulaTypeFromTermType(elementType));
111
- // }
112
- // throw new IllegalArgumentException("Unknown formula type " + msat_type_repr(type));
113
- // }
114
- //
115
89
90
+ /*
91
+ * private FormulaType<?> getFormulaTypeFromTermType(Long type) { // long env = getEnv(); if
92
+ * (msat_is_bool_type(env, type)) { return FormulaType.BooleanType; } else if
93
+ * (msat_is_integer_type(env, type)) { return FormulaType.IntegerType; } else if
94
+ * (msat_is_rational_type(env, type)) { return FormulaType.RationalType; } else if
95
+ * (msat_is_bv_type(env, type)) { return
96
+ * FormulaType.getBitvectorTypeWithSize(msat_get_bv_type_size(env, type)); } else if
97
+ * (msat_is_fp_type(env, type)) { return FormulaType.getFloatingPointType(
98
+ * msat_get_fp_type_exp_width(env, type), msat_get_fp_type_mant_width(env, type)); } else if
99
+ * (msat_is_fp_roundingmode_type(env, type)) { return FormulaType.FloatingPointRoundingModeType; }
100
+ * else if (msat_is_array_type(env, type)) { long indexType = msat_get_array_index_type(env,
101
+ * type); long elementType = msat_get_array_element_type(env, type); return
102
+ * FormulaType.getArrayType( getFormulaTypeFromTermType(indexType),
103
+ * getFormulaTypeFromTermType(elementType)); } throw new
104
+ * IllegalArgumentException("Unknown formula type " + msat_type_repr(type)); }
105
+ */
116
106
@ Override
117
107
public <R > R visit (FormulaVisitor <R > pVisitor , Formula pFormula , Long pF ) {
118
108
// TODO Auto-generated method stub
0 commit comments