Skip to content

Commit ca22844

Browse files
authored
Merge pull request #3069 from scala-steward/update/scalafmt-core-3.8.5
Update scalafmt-core to 3.8.5
2 parents c61c7e9 + 1898ec2 commit ca22844

20 files changed

+118
-42
lines changed

.git-blame-ignore-revs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@
99

1010
# Scala Steward: Reformat with scalafmt 3.8.3
1111
60dd752b3c25a2b578b9f0a967878904d6941982
12+
13+
# Scala Steward: Reformat with scalafmt 3.8.5
14+
11a37745e7051f1346f84101f9b9b4bd9e5dec32

.scalafmt.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.8.3"
1+
version = "3.8.5"
22

33
runner.dialect = scala213
44
fileOverride {

mod-tool/src/main/scala/at/forsyte/apalache/tla/tooling/opt/ServerCmd.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import org.backuity.clist._
77
import at.forsyte.apalache.infra.passes.options.Config
88
import at.forsyte.apalache.infra.passes.options.OptionGroup
99

10-
class ServerCmd
11-
extends ApalacheCommand(name = "server", description = "Run in server mode (in early development)")
10+
class ServerCmd extends ApalacheCommand(name = "server", description = "Run in server mode (in early development)")
1211
with LazyLogging {
1312

1413
var port = opt[Option[Int]](description = "the port served by the RPC server, default: 8822 (overrides envvar PORT)",

passes/src/main/scala/at/forsyte/apalache/tla/passes/pp/ConfigurationPassImpl.scala

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@ class ConfigurationPassImpl @Inject() (
122122
OperEx(TlaOper.eq, NameEx(varName)(body.typeTag), body)(boolTag)
123123
}
124124

125-
val newCinitDecl = oldCinitOpt
126-
.map { d =>
127-
d.copy(body = OperEx(TlaBoolOper.and, d.body +: overridesAsEql: _*)(boolTag))
128-
}
129-
.getOrElse {
130-
TlaOperDecl(cinitName, List.empty, OperEx(TlaBoolOper.and, overridesAsEql: _*)(boolTag))(Typed(OperT1(Seq.empty,
131-
BoolT1)))
132-
}
125+
val newCinitDecl =
126+
oldCinitOpt
127+
.map { d =>
128+
d.copy(body = OperEx(TlaBoolOper.and, d.body +: overridesAsEql: _*)(boolTag))
129+
}
130+
.getOrElse {
131+
TlaOperDecl(cinitName, List.empty, OperEx(TlaBoolOper.and, overridesAsEql: _*)(boolTag))(
132+
Typed(OperT1(Seq.empty, BoolT1)))
133+
}
133134

134135
// Since declarations are a Seq not a Set, we may need to remove the old CInit first
135136
tlaModule.declarations.filterNot(_.name == derivedPreds.cinit) :+ newCinitDecl

tla-assignments/src/main/scala/at/forsyte/apalache/tla/assignments/SmtFreeSymbolicTransitionExtractor.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class SmtFreeSymbolicTransitionExtractor(
2121

2222
/** Checks whether expressions, which cannot contain assignments, use unassigned variables */
2323
private def throwOnUseBeforeAssignment(unassignedVars: Set[String]): TlaEx => Unit = {
24+
2425
/** Manual assignments at such locations throw exceptions */
2526
case ex @ OperEx(ApalacheOper.assign, OperEx(TlaActionOper.prime, NameEx(_)), _) =>
2627
val locString = getLocString(ex)
@@ -75,6 +76,7 @@ class SmtFreeSymbolicTransitionExtractor(
7576

7677
// Transition method between partial states
7778
private def getStrategyOptInternal(currentState: PartialState, operMap: BodyMap): TlaEx => PartialState = {
79+
7880
/** Base case, assignment candidates */
7981
case ex @ OperEx(TlaOper.eq, OperEx(TlaActionOper.prime, NameEx(name)), assignmentFreeRhs) =>
8082
// First, check if assignmentFreeRhs contains unassigned varaible access
@@ -101,6 +103,7 @@ class SmtFreeSymbolicTransitionExtractor(
101103
case OperEx(TlaBoolOper.and, args @ _*) =>
102104
// We sequentially update the partial state
103105
args.foldLeft(currentState) { getStrategyOptInternal(_, operMap)(_) }
106+
104107
/** Disjunction */
105108
case OperEx(TlaBoolOper.or, args @ _*) =>
106109
handleDisjunctionOrITE(currentState, operMap, args)

tla-assignments/src/main/scala/at/forsyte/apalache/tla/assignments/SymbTransGenerator.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class SymbTransGenerator(tracker: TransformationTracker) {
5454
* A mapping of the form [e.ID |-> { B \cap A | B \in Branches( e ) } | e \in Sub(ex)]
5555
*/
5656
def allSelections(ex: TlaEx, letInMap: letInMapType = Map.empty): SelMapType = ex match {
57+
5758
/** Base case, assignments */
5859
case e @ OperEx(ApalacheOper.assign, _, _) => Map(e.ID -> Set(Set(e.ID)))
5960

tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/smt/SolverConfig.scala

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ object SolverConfig {
3434
* Get the default configuration.
3535
*/
3636
val default: SolverConfig =
37-
new SolverConfig(debug = false, profile = false, randomSeed = 0, smtEncoding = SMTEncoding.OOPSLA19,
38-
z3StatsSec = 60, z3Params = Map())
37+
new SolverConfig(
38+
debug = false,
39+
profile = false,
40+
randomSeed = 0,
41+
smtEncoding = SMTEncoding.OOPSLA19,
42+
z3StatsSec = 60,
43+
z3Params = Map(),
44+
)
3945
}

tla-bmcmt/src/main/scala/at/forsyte/apalache/tla/bmcmt/stratifiedRules/aux/caches/UninterpretedLiteralCache.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ class UninterpretedLiteralCache extends Cache[PureArena, (TlaType1, String), Are
4949
* d2 + ... + dN` disequalities, i.e. {{{\sum_{n=1}^N n(n-1)/2 = N(N^2 -1)/6}}} In contrast, `addAllConstraints`
5050
* produces `dN = N(N-1)/2` disequalities, which is `O(N^2)`, instead of `O(N^3)`.
5151
*/
52-
override def addConstraintsForElem(ctx: SolverContext): (((TlaType1, String), ArenaCell)) => Unit = {
53-
case ((utype, _), v) =>
54-
require(utype == StrT1 || utype.isInstanceOf[ConstT1], "Type must be Str, or an uninterpreted type.")
55-
val others = values().withFilter { c => c.cellType == CellTFrom(utype) && c != v }.map(_.toBuilder).toSeq
56-
// The cell should differ from the previously created cells.
57-
// We use the SMT constraint (distinct ...).
58-
ctx.assertGroundExpr(tla.distinct(v.toBuilder +: others: _*))
52+
override def addConstraintsForElem(
53+
ctx: SolverContext): (((TlaType1, String), ArenaCell)) => Unit = { case ((utype, _), v) =>
54+
require(utype == StrT1 || utype.isInstanceOf[ConstT1], "Type must be Str, or an uninterpreted type.")
55+
val others = values().withFilter { c => c.cellType == CellTFrom(utype) && c != v }.map(_.toBuilder).toSeq
56+
// The cell should differ from the previously created cells.
57+
// We use the SMT constraint (distinct ...).
58+
ctx.assertGroundExpr(tla.distinct(v.toBuilder +: others: _*))
5959
}
6060

6161
/**

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/TestSeqModelCheckerTrait.scala

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,13 @@ trait TestSeqModelCheckerTrait extends FixtureAnyFunSuite {
572572
val notInv = not(inv).typed(types, "b")
573573

574574
val checkerInput =
575-
new CheckerInput(mkModuleWithXandY(), initTrans, nextTrans, None, CheckerInputVC(List((inv, notInv))))
575+
new CheckerInput(
576+
mkModuleWithXandY(),
577+
initTrans,
578+
nextTrans,
579+
None,
580+
CheckerInputVC(List((inv, notInv))),
581+
)
576582
val params = new ModelCheckerParams(checkerInput, stepsBound = 2, Map())
577583
// initialize the model checker
578584
val ctx = new IncrementalExecutionContext(rewriter)
@@ -787,7 +793,13 @@ trait TestSeqModelCheckerTrait extends FixtureAnyFunSuite {
787793
.typed(types, "b")
788794
val dummyModule = TlaModule("root", List(TlaConstDecl("N")(intTag), TlaVarDecl("x")(intTag)))
789795
val checkerInput =
790-
new CheckerInput(dummyModule, initTrans, nextTrans, Some(cInit), CheckerInputVC(List((inv, notInv))))
796+
new CheckerInput(
797+
dummyModule,
798+
initTrans,
799+
nextTrans,
800+
Some(cInit),
801+
CheckerInputVC(List((inv, notInv))),
802+
)
791803
val params = new ModelCheckerParams(checkerInput, stepsBound = 10, Map())
792804
// initialize the model checker
793805
val ctx = new IncrementalExecutionContext(rewriter)

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/TestSymbStateRewriterSet.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,13 @@ trait TestSymbStateRewriterSet extends RewriterBase {
725725
val setBool = enumSet(bool(false), bool(true)).as(boolSetT)
726726
val mapping = tuple(name("y").as(boolT)).as(parser("<<Bool>>"))
727727
val mappedSet =
728-
map(mapping, name("x").as(intT), set12minus2.as(intSetT), name("y").as(boolT), setBool).as(
729-
parser("Set(<<Bool>>)"))
728+
map(
729+
mapping,
730+
name("x").as(intT),
731+
set12minus2.as(intSetT),
732+
name("y").as(boolT),
733+
setBool,
734+
).as(parser("Set(<<Bool>>)"))
730735
val inMappedSet = in(tuple(bool(true)).typed(TupT1(BoolT1)), mappedSet)
731736
.typed(BoolT1)
732737

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/smt/TestRecordingSolverContextWithArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ import org.scalatestplus.junit.JUnitRunner
88
@RunWith(classOf[JUnitRunner])
99
class TestRecordingSolverContextWithArrays extends TestRecordingSolverContext {
1010
override protected def withFixture(test: NoArgTest): Outcome = {
11-
solverConfig = SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
12-
smtEncoding = SMTEncoding.Arrays)
11+
solverConfig = SolverConfig(
12+
debug = false,
13+
profile = false,
14+
randomSeed = 0,
15+
z3StatsSec = 0,
16+
smtEncoding = SMTEncoding.Arrays,
17+
)
1318
test()
1419
}
1520
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/smt/TestRecordingSolverContextWithFunArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ import org.scalatestplus.junit.JUnitRunner
88
@RunWith(classOf[JUnitRunner])
99
class TestRecordingSolverContextWithFunArrays extends TestRecordingSolverContext {
1010
override protected def withFixture(test: NoArgTest): Outcome = {
11-
solverConfig = SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
12-
smtEncoding = SMTEncoding.FunArrays)
11+
solverConfig = SolverConfig(
12+
debug = false,
13+
profile = false,
14+
randomSeed = 0,
15+
z3StatsSec = 0,
16+
smtEncoding = SMTEncoding.FunArrays,
17+
)
1318
test()
1419
}
1520
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/smt/TestRecordingSolverContextWithOOPSLA19.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ import org.scalatestplus.junit.JUnitRunner
88
@RunWith(classOf[JUnitRunner])
99
class TestRecordingSolverContextWithOOPSLA19 extends TestRecordingSolverContext {
1010
override protected def withFixture(test: NoArgTest): Outcome = {
11-
solverConfig = SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
12-
smtEncoding = SMTEncoding.OOPSLA19)
11+
solverConfig = SolverConfig(
12+
debug = false,
13+
profile = false,
14+
randomSeed = 0,
15+
z3StatsSec = 0,
16+
smtEncoding = SMTEncoding.OOPSLA19,
17+
)
1318
test()
1419
}
1520
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithIncrementalAndArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ class TestTransitionExecutorWithIncrementalAndArrays
1212
with TestFilteredTransitionExecutor[IncrementalExecutionContextSnapshot] {
1313
override protected def withFixture(test: OneArgTest): Outcome = {
1414
val solver =
15-
new Z3SolverContext(SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
16-
smtEncoding = SMTEncoding.Arrays))
15+
new Z3SolverContext(SolverConfig(
16+
debug = false,
17+
profile = false,
18+
randomSeed = 0,
19+
z3StatsSec = 0,
20+
smtEncoding = SMTEncoding.Arrays,
21+
))
1722
withFixtureInContext(solver, new IncrementalExecutionContext(_), test)
1823
}
1924
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithIncrementalAndFunArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ class TestTransitionExecutorWithIncrementalAndFunArrays
1111
extends TestTransitionExecutorImpl[IncrementalExecutionContextSnapshot]
1212
with TestFilteredTransitionExecutor[IncrementalExecutionContextSnapshot] {
1313
override protected def withFixture(test: OneArgTest): Outcome = {
14-
val solver = new Z3SolverContext(SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
15-
smtEncoding = SMTEncoding.FunArrays))
14+
val solver = new Z3SolverContext(SolverConfig(
15+
debug = false,
16+
profile = false,
17+
randomSeed = 0,
18+
z3StatsSec = 0,
19+
smtEncoding = SMTEncoding.FunArrays,
20+
))
1621
withFixtureInContext(solver, new IncrementalExecutionContext(_), test)
1722
}
1823
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithIncrementalAndOOPSLA19.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ class TestTransitionExecutorWithIncrementalAndOOPSLA19
1818
with TestFilteredTransitionExecutor[IncrementalExecutionContextSnapshot] {
1919
override protected def withFixture(test: OneArgTest): Outcome = {
2020
val solver =
21-
new Z3SolverContext(SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
22-
smtEncoding = SMTEncoding.OOPSLA19))
21+
new Z3SolverContext(SolverConfig(
22+
debug = false,
23+
profile = false,
24+
randomSeed = 0,
25+
z3StatsSec = 0,
26+
smtEncoding = SMTEncoding.OOPSLA19,
27+
))
2328
withFixtureInContext(solver, new IncrementalExecutionContext(_), test)
2429
}
2530
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithOfflineAndArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,13 @@ class TestTransitionExecutorWithOfflineAndArrays extends TestTransitionExecutorI
1313
override protected def withFixture(test: OneArgTest): Outcome = {
1414
val solver = RecordingSolverContext
1515
.createZ3(None,
16-
SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
17-
smtEncoding = SMTEncoding.Arrays))
16+
SolverConfig(
17+
debug = false,
18+
profile = false,
19+
randomSeed = 0,
20+
z3StatsSec = 0,
21+
smtEncoding = SMTEncoding.Arrays,
22+
))
1823
withFixtureInContext(solver, new OfflineExecutionContext(_, new IncrementalRenaming(new IdleTracker)), test)
1924
}
2025
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithOfflineAndFunArrays.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ class TestTransitionExecutorWithOfflineAndFunArrays
1414
override protected def withFixture(test: OneArgTest): Outcome = {
1515
val solver = RecordingSolverContext
1616
.createZ3(None,
17-
SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
18-
smtEncoding = SMTEncoding.FunArrays))
17+
SolverConfig(
18+
debug = false,
19+
profile = false,
20+
randomSeed = 0,
21+
z3StatsSec = 0,
22+
smtEncoding = SMTEncoding.FunArrays,
23+
))
1924
withFixtureInContext(solver, new OfflineExecutionContext(_, new IncrementalRenaming(new IdleTracker)), test)
2025
}
2126
}

tla-bmcmt/src/test/scala/at/forsyte/apalache/tla/bmcmt/trex/TestTransitionExecutorWithOfflineAndOOPSLA19.scala

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,13 @@ class TestTransitionExecutorWithOfflineAndOOPSLA19 extends TestTransitionExecuto
1919
override def withFixture(test: OneArgTest): Outcome = {
2020
val solver = RecordingSolverContext
2121
.createZ3(None,
22-
SolverConfig(debug = false, profile = false, randomSeed = 0, z3StatsSec = 0,
23-
smtEncoding = SMTEncoding.OOPSLA19))
22+
SolverConfig(
23+
debug = false,
24+
profile = false,
25+
randomSeed = 0,
26+
z3StatsSec = 0,
27+
smtEncoding = SMTEncoding.OOPSLA19,
28+
))
2429
withFixtureInContext(solver, new OfflineExecutionContext(_, new IncrementalRenaming(new IdleTracker)), test)
2530
}
2631
}

tlair/src/main/scala/at/forsyte/apalache/tla/lir/smt/SmtTools.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ object SmtTools {
5959
*/
6060
def simplify(phi: BoolFormula): BoolFormula = {
6161
phi match {
62+
6263
/**
6364
* Recursively simplify branches first. If any branch is false, the whole formula is false. It is important to
6465
* recurse first, since otherwise false-simplification would not propagate upward.

0 commit comments

Comments
 (0)