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
No related branches found
No related tags found
No related merge requests found
...@@ -702,20 +702,24 @@ trait SMTLIBTarget { ...@@ -702,20 +702,24 @@ trait SMTLIBTarget {
override def getModel: Map[Identifier, Expr] = { override def getModel: Map[Identifier, Expr] = {
val syms = variables.bSet.toList val syms = variables.bSet.toList
val cmd: Command = if (syms.isEmpty) {
GetValue(syms.head, Map()
syms.tail.map(s => QualifiedIdentifier(SMTIdentifier(s))) } 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 { valuationPairs.collect {
case (SimpleSymbol(sym), value) if variables.containsB(sym) => case (SimpleSymbol(sym), value) if variables.containsB(sym) =>
val id = variables.toA(sym) val id = variables.toA(sym)
(id, fromSMT(value, id.getType)(Map(), Map())) (id, fromSMT(value, id.getType)(Map(), Map()))
}.toMap }.toMap
}
} }
override def push(): Unit = { override def push(): Unit = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment