Skip to content

Commit a9be5a0

Browse files
committed
reduces diff by undoing some unnecessary changes
1 parent 6884573 commit a9be5a0

File tree

13 files changed

+88
-116
lines changed

13 files changed

+88
-116
lines changed

src/main/scala/viper/gobra/Gobra.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ class Gobra extends GoVerifier with GoIdeVerifier {
298298
// can be found by the well-formedness checks.
299299
val startMs = System.currentTimeMillis()
300300
var transformations: Vector[InternalTransform] = Vector(CGEdgesTerminationTransform, ConstantPropagation)
301-
if (config.checkOverflowsOrDefault) {
301+
if (config.checkOverflows) {
302302
transformations :+= OverflowChecksTransform
303303
}
304304
val result = transformations.foldLeft(program)((prog, transf) => transf.transform(prog))

src/main/scala/viper/gobra/backend/ViperBackends.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ trait ViperBackend extends CliEnumConverter.EnumCase {
2525
var options: Vector[String] = Vector.empty
2626

2727
options ++= exePaths
28-
if (config.assumeInjectivityOnInhaleOrDefault) {
28+
if (config.assumeInjectivityOnInhale) {
2929
options ++= Vector("--assumeInjectivityOnInhale")
3030
}
3131
if (config.respectFunctionPrePermAmounts) {
@@ -48,16 +48,16 @@ trait SiliconBasedBackend extends ViperBackend {
4848
var options: Vector[String] = super.buildOptions(exePaths, config)
4949
options ++= Vector("--logLevel", "ERROR")
5050
options ++= Vector("--disableCatchingExceptions")
51-
if (config.conditionalizePermissionsOrDefault) {
51+
if (config.conditionalizePermissions) {
5252
options ++= Vector("--conditionalizePermissions")
5353
}
54-
if (config.z3APIModeOrDefault) {
54+
if (config.z3APIMode) {
5555
options ++= Vector(s"--prover=${Z3ProverAPI.name}")
5656
}
57-
if (config.disableNLOrDefault) {
57+
if (config.disableNL) {
5858
options ++= Vector(s"--disableNL")
5959
}
60-
if (config.unsafeWildcardOptimizationOrDefault) {
60+
if (config.unsafeWildcardOptimization) {
6161
options ++= Vector(s"--unsafeWildcardOptimization")
6262
}
6363
options ++= Vector(s"--moreJoins=${config.moreJoins.viperValue}")
@@ -70,10 +70,10 @@ trait SiliconBasedBackend extends ViperBackend {
7070
// Gobra seems to be much slower with the new silicon axiomatization of collections.
7171
// For now, we stick to the old one.
7272
options ++= Vector("--useOldAxiomatization")
73-
if (config.parallelizeBranchesOrDefault) {
73+
if (config.parallelizeBranches) {
7474
options ++= Vector("--parallelizeBranches")
7575
}
76-
if (config.disableSetAxiomatizationOrDefault) {
76+
if (config.disableSetAxiomatization) {
7777
// Since resources are stored within the .jar archive, we cannot
7878
// directly pass the axiom file to Silicon.
7979
val tmpPath = Paths.get("gobra_tmp")

src/main/scala/viper/gobra/frontend/Config.scala

Lines changed: 68 additions & 96 deletions
Large diffs are not rendered by default.

src/main/scala/viper/gobra/frontend/PackageResolver.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ object PackageResolver {
9494
for {
9595
// pkgDir stores the path to the directory that should contain source files belonging to the desired package
9696
pkgDir <- getLookupPath(importTarget)(config)
97-
sourceFiles = getSourceFiles(pkgDir, onlyFilesWithHeader = config.onlyFilesWithHeaderOrDefault)
97+
sourceFiles = getSourceFiles(pkgDir, onlyFilesWithHeader = config.onlyFilesWithHeader)
9898
// check whether all found source files belong to the same package (the name used in the package clause can
9999
// be absolutely independent of the import path)
100100
// in case of error, iterate over all resources and close them

src/main/scala/viper/gobra/frontend/info/Info.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ object Info extends LazyLogging {
235235
.mkString("")
236236
val isMainContextKey = if (isMainContext) "1" else "0"
237237
val configKey = config.typeBounds.hashCode().toString ++
238-
(if (config.int32bitOrDefault) "1" else "0")
238+
(if (config.int32bit) "1" else "0")
239239

240240
val key = pkgKey ++
241241
dependentTypeInfoKey ++

src/main/scala/viper/gobra/frontend/info/implementation/typing/ghost/GhostExprTyping.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ trait GhostExprTyping extends BaseTyping { this: TypeInfoImpl =>
5555
// check that the quantifier `body` is either Boolean or an assertion
5656
assignableToSpec(body) ++
5757
// check that the user provided triggers when running with --requireTriggers
58-
error(n, "found a quantifier without triggers.", config.requireTriggersOrDefault && triggers.isEmpty)
58+
error(n, "found a quantifier without triggers.", config.requireTriggers && triggers.isEmpty)
5959

6060
case n@PExists(vars, triggers, body) =>
6161
val mayInit = isEnclosingMayInit(n)
@@ -64,7 +64,7 @@ trait GhostExprTyping extends BaseTyping { this: TypeInfoImpl =>
6464
// check that the quantifier `body` is Boolean
6565
assignableToSpec(body) ++ assignableTo.errors(exprType(body), BooleanT, mayInit)(expr) ++
6666
// check that the user provided triggers when running with --requireTriggers
67-
error(n, "found a quantifier without triggers.", config.requireTriggersOrDefault && triggers.isEmpty)
67+
error(n, "found a quantifier without triggers.", config.requireTriggers && triggers.isEmpty)
6868

6969
case n: PImplication =>
7070
val mayInit = isEnclosingMayInit(n)

src/main/scala/viper/gobra/frontend/info/implementation/typing/ghost/GhostMemberTyping.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ trait GhostMemberTyping extends BaseTyping { this: TypeInfoImpl =>
3636
}
3737
val hasMeasureIfNeeded =
3838
if (spec.isPure || isEnclosingGhost(member))
39-
config.disableCheckTerminationPureFnsOrDefault || spec.terminationMeasures.nonEmpty
39+
config.disableCheckTerminationPureFns || spec.terminationMeasures.nonEmpty
4040
else
4141
true
4242
val needsMeasureError =

src/main/scala/viper/gobra/translator/Translator.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object Translator {
5151
case (errs, _) => errs
5252
}
5353

54-
if (config.checkConsistencyOrDefault) {
54+
if (config.checkConsistency) {
5555
transformedTask
5656
.flatMap(task => {
5757
val consistencyErrs = task.program.checkTransitively

src/test/scala/viper/gobra/DetailedBenchmarkTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ class DetailedBenchmarkTests extends BenchmarkTests {
128128
val c = config.get
129129
assert(c.packageInfoInputMap.size == 1)
130130
val pkgInfo = c.packageInfoInputMap.keys.head
131-
if (c.checkOverflowsOrDefault) {
131+
if (c.checkOverflows) {
132132
val result = OverflowChecksTransform.transform(program)
133133
c.reporter report AppliedInternalTransformsMessage(c.packageInfoInputMap(pkgInfo).map(_.name), () => result)
134134
Right(result)

src/test/scala/viper/gobra/GobraPackageTests.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class GobraPackageTests extends GobraTests {
7676
reporter = NoopReporter,
7777
packageInfoInputMap = Map(pkgInfo -> input.files.toVector.map(FromFileSource(_))),
7878
includeDirs = Vector(currentDir),
79-
checkConsistency = Some(true),
79+
checkConsistency = true,
8080
z3Exe = z3Exe
8181
)
8282

0 commit comments

Comments
 (0)