Skip to content

Commit

Permalink
Fixed witnesses
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 15, 2024
1 parent 7ca3c7a commit 45f052e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private fun postVerificationLogging(
GraphmlWitnessWriter()
.writeWitness(
safetyResult,
config.inputConfig.input!!,
config.outputConfig.witnessConfig.inputFileForWitness ?: config.inputConfig.input!!,
getSolver(
config.outputConfig.witnessConfig.concretizerSolver,
config.outputConfig.witnessConfig.validateConcretizerSolver,
Expand All @@ -467,7 +467,7 @@ private fun postVerificationLogging(
YmlWitnessWriter()
.writeWitness(
safetyResult,
config.inputConfig.input!!,
config.outputConfig.witnessConfig.inputFileForWitness ?: config.inputConfig.input!!,
config.inputConfig.property,
(config.frontendConfig.specConfig as? CFrontendConfig)?.architecture,
getSolver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ data class WitnessConfig(
"Activates a wrapper, which validates the assertions in the solver in each (SAT) check. Filters some solver issues.",
)
var validateConcretizerSolver: Boolean = false,
@Parameter(names = ["--input-file-for-witness"]) var inputFileForWitness: File? = null,
) : Config

data class ArgConfig(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ fun boundedPortfolio25(
disable = false,
concretizerSolver = "Z3",
validateConcretizerSolver = false,
inputFileForWitness = portfolioConfig.inputConfig.input,
),
argConfig = ArgConfig(disable = true),
enableOutput = portfolioConfig.outputConfig.enableOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ fun complexPortfolio25(
disable = false,
concretizerSolver = "Z3",
validateConcretizerSolver = false,
inputFileForWitness = portfolioConfig.inputConfig.input,
),
argConfig = ArgConfig(disable = true),
enableOutput = portfolioConfig.outputConfig.enableOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ fun hornPortfolio25(
disable = false,
concretizerSolver = "Z3",
validateConcretizerSolver = false,
inputFileForWitness = portfolioConfig.inputConfig.input,
),
argConfig = ArgConfig(disable = true),
enableOutput = portfolioConfig.outputConfig.enableOutput,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import hu.bme.mit.theta.xcfa.model.MetaData
import hu.bme.mit.theta.xcfa.toC
import java.io.File
import java.util.*
import kotlinx.serialization.encodeToString

class YmlWitnessWriter {

Expand Down Expand Up @@ -97,7 +98,7 @@ class YmlWitnessWriter {
},
)

witnessfile.writeText(WitnessYamlConfig.encodeToString(YamlWitness.serializer(), witness))
witnessfile.writeText(WitnessYamlConfig.encodeToString(listOf(witness)))
} else if (safetyResult.isSafe) {

val witness =
Expand All @@ -107,7 +108,7 @@ class YmlWitnessWriter {
content = safetyResult.asSafe().proof.toContent(inputFile, parseContext),
)

witnessfile.writeText(WitnessYamlConfig.encodeToString(YamlWitness.serializer(), witness))
witnessfile.writeText(WitnessYamlConfig.encodeToString(listOf(witness)))
}
}
}
Expand Down

0 comments on commit 45f052e

Please sign in to comment.