Skip to content
Snippets Groups Projects
Commit ff41b7b9 authored by Etienne Kneuss's avatar Etienne Kneuss
Browse files

Make sure we don't crash in case there is no variables

parent 216ffee1
Branches
Tags
No related merge requests found
......@@ -702,20 +702,24 @@ trait SMTLIBTarget {
override def getModel: Map[Identifier, Expr] = {
val syms = variables.bSet.toList
val cmd: Command =
GetValue(syms.head,
syms.tail.map(s => QualifiedIdentifier(SMTIdentifier(s)))
)
if (syms.isEmpty) {
Map()
} else {
val cmd: Command =
GetValue(syms.head,
syms.tail.map(s => QualifiedIdentifier(SMTIdentifier(s)))
)
val GetValueResponseSuccess(valuationPairs) = sendCommand(cmd)
val GetValueResponseSuccess(valuationPairs) = sendCommand(cmd)
valuationPairs.collect {
case (SimpleSymbol(sym), value) if variables.containsB(sym) =>
val id = variables.toA(sym)
valuationPairs.collect {
case (SimpleSymbol(sym), value) if variables.containsB(sym) =>
val id = variables.toA(sym)
(id, fromSMT(value, id.getType)(Map(), Map()))
}.toMap
(id, fromSMT(value, id.getType)(Map(), Map()))
}.toMap
}
}
override def push(): Unit = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment