@@ -1042,14 +1042,6 @@ sealed class Z3Context(val config: Map[String, String]) {
1042
1042
}
1043
1043
1044
1044
// Parser interface
1045
- private def parseSMTLIB (file : Boolean , str : String ) : Unit = {
1046
- if (file) {
1047
- Native .parseSmtlibFile(this .ptr, str, 0 , null , null , 0 , null , null )
1048
- } else {
1049
- Native .parseSmtlibString(this .ptr, str, 0 , null , null , 0 , null , null )
1050
- }
1051
- }
1052
-
1053
1045
private def parseSMTLIB2 (file : Boolean , str : String ) : Z3AST = {
1054
1046
if (file) {
1055
1047
new Z3AST (Native .parseSmtlib2File(this .ptr, str, 0 , null , null , 0 , null , null ), this )
@@ -1058,16 +1050,6 @@ sealed class Z3Context(val config: Map[String, String]) {
1058
1050
}
1059
1051
}
1060
1052
1061
- private def parseSMTLIB (file : Boolean , str : String , sorts : Map [Z3Symbol ,Z3Sort ], decls : Map [Z3Symbol ,Z3FuncDecl ]) : Unit = {
1062
- val (sortNames, z3Sorts) = sorts.unzip
1063
- val (declNames, z3Decls) = decls.unzip
1064
- if (file) {
1065
- Native .parseSmtlibFile(this .ptr, str, sorts.size, toPtrArray(sortNames), toPtrArray(z3Sorts), decls.size, toPtrArray(declNames), toPtrArray(z3Decls))
1066
- } else {
1067
- Native .parseSmtlibString(this .ptr, str, sorts.size, toPtrArray(sortNames), toPtrArray(z3Sorts), decls.size, toPtrArray(declNames), toPtrArray(z3Decls))
1068
- }
1069
- }
1070
-
1071
1053
private def parseSMTLIB2 (file : Boolean , str : String , sorts : Map [Z3Symbol ,Z3Sort ], decls : Map [Z3Symbol ,Z3FuncDecl ]) : Z3AST = {
1072
1054
val (sortNames, z3Sorts) = sorts.unzip
1073
1055
val (declNames, z3Decls) = decls.unzip
@@ -1078,26 +1060,6 @@ sealed class Z3Context(val config: Map[String, String]) {
1078
1060
}
1079
1061
}
1080
1062
1081
- /** Uses the SMT-LIB parser to read in a benchmark file.
1082
- * @see getSMTLIBFormulas, getSMTLIBAssumptions, getSMTLIBDecls, getSMTLIBSorts, getSMTLIBError
1083
- */
1084
- def parseSMTLIBFile (fileName : String ) : Unit = parseSMTLIB(true , fileName)
1085
-
1086
- /** Uses the SMT-LIB parser to read in a benchmark string.
1087
- * @see getSMTLIBFormulas, getSMTLIBAssumptions, getSMTLIBDecls, getSMTLIBSorts, getSMTLIBError
1088
- */
1089
- def parseSMTLIBString (str : String ) : Unit = parseSMTLIB(false , str)
1090
-
1091
- /** Uses the SMT-LIB parser to read in a benchmark file. The maps are used to override symbols that would otherwise be created by the parser.
1092
- * @see getSMTLIBFormulas, getSMTLIBAssumptions, getSMTLIBDecls, getSMTLIBSorts, getSMTLIBError
1093
- */
1094
- def parseSMTLIBFile (fileName : String , sorts : Map [Z3Symbol ,Z3Sort ], decls : Map [Z3Symbol ,Z3FuncDecl ]) : Unit = parseSMTLIB(true , fileName, sorts, decls)
1095
-
1096
- /** Uses the SMT-LIB parser to read in a benchmark string. The maps are used to override symbols that would otherwise be created by the parser.
1097
- * @see getSMTLIBFormulas, getSMTLIBAssumptions, getSMTLIBDecls, getSMTLIBSorts, getSMTLIBError
1098
- */
1099
- def parseSMTLIBString (str : String , sorts : Map [Z3Symbol ,Z3Sort ], decls : Map [Z3Symbol ,Z3FuncDecl ]) : Unit = parseSMTLIB(false , str, sorts, decls)
1100
-
1101
1063
/** Uses the SMT-LIB 2 parser to read in a benchmark file.
1102
1064
*/
1103
1065
def parseSMTLIB2File (fileName : String ) : Z3AST = parseSMTLIB2(true , fileName)
@@ -1114,72 +1076,6 @@ sealed class Z3Context(val config: Map[String, String]) {
1114
1076
*/
1115
1077
def parseSMTLIB2String (str : String , sorts : Map [Z3Symbol ,Z3Sort ], decls : Map [Z3Symbol ,Z3FuncDecl ]) : Z3AST = parseSMTLIB2(false , str, sorts, decls)
1116
1078
1117
- /** Returns an iterator of the formulas created by the SMT-LIB parser. */
1118
- def getSMTLIBFormulas : Iterator [Z3AST ] = {
1119
- val ctx = this
1120
- new Iterator [Z3AST ] {
1121
- val total : Int = Native .getSmtlibNumFormulas(ctx.ptr)
1122
- var returned : Int = 0
1123
-
1124
- override def hasNext : Boolean = (returned < total)
1125
- override def next () : Z3AST = {
1126
- val toReturn = new Z3AST (Native .getSmtlibFormula(ctx.ptr, returned), ctx)
1127
- returned += 1
1128
- toReturn
1129
- }
1130
- }
1131
- }
1132
-
1133
- /** Returns an iterator of the assumptions created by the SMT-LIB parser. */
1134
- def getSMTLIBAssumptions : Iterator [Z3AST ] = {
1135
- val ctx = this
1136
- new Iterator [Z3AST ] {
1137
- val total : Int = Native .getSmtlibNumAssumptions(ctx.ptr)
1138
- var returned : Int = 0
1139
-
1140
- override def hasNext : Boolean = (returned < total)
1141
- override def next () : Z3AST = {
1142
- val toReturn = new Z3AST (Native .getSmtlibAssumption(ctx.ptr, returned), ctx)
1143
- returned += 1
1144
- toReturn
1145
- }
1146
- }
1147
- }
1148
-
1149
- /** Returns an iterator of the function and constant declarations created by the SMT-LIB parser. */
1150
- def getSMTLIBDecls : Iterator [Z3FuncDecl ] = {
1151
- val ctx = this
1152
- new Iterator [Z3FuncDecl ] {
1153
- val total : Int = Native .getSmtlibNumDecls(ctx.ptr)
1154
- var returned : Int = 0
1155
-
1156
- override def hasNext : Boolean = (returned < total)
1157
- override def next () : Z3FuncDecl = {
1158
- val fdPtr = Native .getSmtlibDecl(ctx.ptr, returned)
1159
- val arity = Native .getDomainSize(ctx.ptr, fdPtr)
1160
- val toReturn = new Z3FuncDecl (Native .getSmtlibDecl(ctx.ptr, returned), arity, ctx)
1161
- returned += 1
1162
- toReturn
1163
- }
1164
- }
1165
- }
1166
-
1167
- /** Returns an iterator of the sorts created by the SMT-LIB parser. */
1168
- def getSMTLIBSorts : Iterator [Z3Sort ] = {
1169
- val ctx = this
1170
- new Iterator [Z3Sort ] {
1171
- val total : Int = Native .getSmtlibNumSorts(ctx.ptr)
1172
- var returned : Int = 0
1173
-
1174
- override def hasNext : Boolean = (returned < total)
1175
- override def next () : Z3Sort = {
1176
- val toReturn = new Z3Sort (Native .getSmtlibSort(ctx.ptr, returned), ctx)
1177
- returned += 1
1178
- toReturn
1179
- }
1180
- }
1181
- }
1182
-
1183
1079
def substitute (ast : Z3AST , from : Array [Z3AST ], to : Array [Z3AST ]) : Z3AST = {
1184
1080
if (from.length != to.length)
1185
1081
throw new IllegalArgumentException (" from and to must have the same length" );
@@ -1247,7 +1143,4 @@ sealed class Z3Context(val config: Map[String, String]) {
1247
1143
def interrupt () = {
1248
1144
Native .interrupt(this .ptr)
1249
1145
}
1250
-
1251
- /** Returns the last error issued by the SMT-LIB parser. */
1252
- def getSMTLIBError : String = Native .getSmtlibError(this .ptr)
1253
1146
}
0 commit comments