Skip to content

Commit

Permalink
Merge branch 'main' into gabriela/quint-to-tla-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
bugarela authored Nov 29, 2024
2 parents f28e16e + b58649e commit 7b4e7db
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 36 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ Related reports and publications can be found at the
[releases page]: https://github.com/apalache-mc/apalache/releases
[master]: https://github.com/apalache-mc/apalache/tree/master
[main branch]: https://github.com/apalache-mc/apalache/tree/main
[apalache zulip stream]: https://informal-systems.zulipchat.com/#narrow/stream/265309-apalache
[tendermint specs]: https://github.com/tendermint/tendermint/tree/master/spec/light-client/accountability
[tendermint blockchain]: https://github.com/tendermint
[standard repository of tla+ examples]: https://github.com/tlaplus/Examples
Expand Down
4 changes: 2 additions & 2 deletions docs/src/adr/006rfc-unit-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,14 +621,14 @@ By having all test options specified directly in tests, we reach two goals:

Let us know:

- At [Apalache Zulip stream][],
- At [Apalache Discourse][],

- On [ApalacheTLA Twitter][],

- email: igor at informal.systems.


[Apalache Zulip stream]: https://informal-systems.zulipchat.com/#narrow/stream/265309-apalache
[Apalache Discourse]: https://apalache.discourse.group/
[ApalacheTLA Twitter]: https://twitter.com/ApalacheTLA
[Unit testing]: https://en.wikipedia.org/wiki/Unit_testing
[Property-based testing]: https://en.wikipedia.org/wiki/QuickCheck
Expand Down
40 changes: 20 additions & 20 deletions docs/src/lang/variants.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ To make it easier to represent the fruits, we can introduce variants together wi
user-defined constructors for each option::

```tla
\* @typeAlias: FRUIT = Apple(Str) | Orange(Bool);
\* @typeAlias: fruit = Apple(Str) | Orange(Bool);
\* @type: Str => FRUIT;
\* @type: Str => $fruit;
Apple(color) == Variant("Apple", color)
\* @type: Bool => FRUIT;
\* @type: Bool => $fruit;
Orange(seedless) == Variant("Orange", seedless)
```

Expand All @@ -92,20 +92,20 @@ Orange(TRUE)
Variants can wrap records, for when we want to represent compound data with named fields:

```tla
\* @typeAlias: DRINK =
\* @typeAlias: drink =
\* Water({ sparkling: Bool })
\* | Beer({ malt: Str, strength: Int });
\*
\* @type: Bool => DRINK;
\* @type: Bool => $drink;
Water(sparkling) == Variant("Water", [ sparkling |-> sparkling ])
\* @type: (Str, Int) => DRINK;
\* @type: (Str, Int) => $drink;
Beer(malt, strength) == Variant("Beer", [ malt |-> malt, strength |-> strength ])
```

Once a variant is constructed, it becomes opaque to the type checker, that is,
the type checker only knows that `Water(TRUE)` and `Beer("Dark", 5)` are both
of type `DRINK`. This is exactly what we want, in order to combine these values
of type `drink`. This is exactly what we want, in order to combine these values
in a single set. However, we have lost the ability to access the fields of
these values. To deconstruct values of a variant type, we have to use other
operators, presented below.
Expand All @@ -115,7 +115,7 @@ untyped TLA+, we can filter a set of variants:

```tla
LET Drinks == { Water(TRUE), Water(FALSE), Beer("Radler", 2) } IN
\E d \in VariantFilter("Beer", Drink):
\E d \in VariantFilter("Beer", Drinks):
d.strength < 3
```

Expand Down Expand Up @@ -195,14 +195,14 @@ type variable that captures other options in the variant type.
**Example in TLA+:**

```tla
\* @typeAlias: DRINK =
\* @typeAlias: drink =
\* Water({ sparkling: Bool })
\* | Beer({ malt: Str, strength: Int });
\*
\* @type: Bool => DRINK;
\* @type: Bool => $drink;
Water(sparkling) == Variant("Water", [ sparkling |-> sparkling ])
\* @type: (Str, Int) => DRINK;
\* @type: (Str, Int) => $drink;
Beer(malt, strength) == Variant("Beer", [ malt |-> malt, strength |-> strength ])
```

Expand Down Expand Up @@ -260,14 +260,14 @@ values that were packed with `Variant`.
**Example in TLA+:**

```tla
\* @typeAlias: DRINK =
\* @typeAlias: drink =
\* Water({ sparkling: Bool })
\* | Beer({ malt: Str, strength: Int });
\*
\* @type: Bool => DRINK;
\* @type: Bool => $drink;
Water(sparkling) == Variant("Water", [ sparkling |-> sparkling ])
\* @type: (Str, Int) => DRINK;
\* @type: (Str, Int) => $drink;
Beer(malt, strength) == Variant("Beer", [ malt |-> malt, strength |-> strength ])
LET Drinks == { Water(TRUE), Water(FALSE), Beer("Radler", 2) } IN
Expand Down Expand Up @@ -303,14 +303,14 @@ Otherwise, the operator returns `defaultValue`.
**Example in TLA+:**

```tla
\* @typeAlias: DRINK =
\* @typeAlias: drink =
\* Water({ sparkling: Bool })
\* | Beer({ malt: Str, strength: Int });
\*
\* @type: Bool => DRINK;
\* @type: Bool => $drink;
Water(sparkling) == Variant("Water", [ sparkling |-> sparkling ])
\* @type: (Str, Int) => DRINK;
\* @type: (Str, Int) => $drink;
Beer(malt, strength) == Variant("Beer", [ malt |-> malt, strength |-> strength ])
LET water == Water(TRUE) IN
Expand Down Expand Up @@ -348,14 +348,14 @@ is always constructed via `Variant`, unless the operator is used with the right
**Example in TLA+:**

```tla
\* @typeAlias: DRINK =
\* @typeAlias: drink =
\* Water({ sparkling: Bool })
\* | Beer({ malt: Str, strength: Int });
\*
\* @type: Bool => DRINK;
\* @type: Bool => $drink;
Water(sparkling) == Variant("Water", [ sparkling |-> sparkling ])
\* @type: (Str, Int) => DRINK;
\* @type: (Str, Int) => $drink;
Beer(malt, strength) == Variant("Beer", [ malt |-> malt, strength |-> strength ])
LET drink == Beer("Dunkles", 4) IN
Expand Down
4 changes: 2 additions & 2 deletions docs/src/tutorials/entry-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -1175,7 +1175,7 @@ did not discuss non-determinism, as our specification is entirely
deterministic. We will demonstrate advanced features in future tutorials.

If you are experiencing a problem with Apalache, feel free to [open an issue]
or drop us a message on [Zulip chat].
or drop us a message on [Discourse].


[HOWTO on writing type annotations]: ../HOWTOs/howto-write-type-annotations.md
Expand Down Expand Up @@ -1205,5 +1205,5 @@ or drop us a message on [Zulip chat].
[Specifying Systems]: http://lamport.azurewebsites.net/tla/book.html?back-link=learning.html
[Test-driven development]: https://en.wikipedia.org/wiki/Test-driven_development
[TLC]: https://github.com/tlaplus/tlaplus/
[Zulip chat]: https://informal-systems.zulipchat.com/login/#narrow/stream/265309-apalache
[Discourse]: https://apalache.discourse.group/
[ZIP archive]: https://download-directory.github.io/?url=https://github.com/informalsystems/apalache/tree/main/test/tla/bin-search
4 changes: 2 additions & 2 deletions docs/src/tutorials/pluscal-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ In this tutorial, we have shown how to:
`N=4`).

If you are experiencing a problem with Apalache, feel free to [open an issue]
or drop us a message on [Zulip chat].
or drop us a message on [Discourse].

## Further reading

Expand Down Expand Up @@ -284,6 +284,6 @@ or drop us a message on [Zulip chat].
[Specifying Systems]: http://lamport.azurewebsites.net/tla/book.html?back-link=learning.html
[TLC]: https://github.com/tlaplus/tlaplus/
[TLAPS]: https://tla.msr-inria.inria.fr/tlaps/content/Home.html
[Zulip chat]: https://informal-systems.zulipchat.com/login/#narrow/stream/265309-apalache
[Discourse]: https://apalache.discourse.group/
[Bakery algorithm]: https://en.wikipedia.org/wiki/Lamport%27s_bakery_algorithm
[ZIP archive]: https://download-directory.github.io/?url=https://github.com/informalsystems/apalache/tree/main/test/tla/bakery-pluscal
4 changes: 2 additions & 2 deletions docs/src/tutorials/snowcat-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ type checker. To learn about type aliases, see [HOWTO on writing type
annotations][].

If you are experiencing a problem with Snowcat, feel free to [open an issue][]
or drop us a message on [Zulip chat][].
or drop us a message on [Discourse][].


[ADR002]: ../adr/002adr-types.md
Expand All @@ -312,5 +312,5 @@ or drop us a message on [Zulip chat][].
[CarTalkPuzzleTyped.tla]: https://github.com/informalsystems/apalache/blob/main/test/tla/CarTalkPuzzleTyped.tla
[QueensTyped.tla]: https://github.com/informalsystems/apalache/blob/main/test/tla/QueensTyped.tla
[open an issue]: https://github.com/informalsystems/apalache/issues
[Zulip chat]: https://informal-systems.zulipchat.com/login/#narrow/stream/265309-apalache
[Discourse]: https://apalache.discourse.group/
[Idiom 15]: ../idiomatic/003record-sets.md
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ object Dependencies {

object Deps {
// Versions
lazy val logbackVersion = "1.5.8"
lazy val logbackVersion = "1.5.12"
lazy val clistVersion = "3.5.1"

// Libraries
Expand All @@ -21,7 +21,7 @@ object Dependencies {
val commonsBeanutils =
"commons-beanutils" % "commons-beanutils" % "1.9.4" // Apparently an untracked dependency of commonsConfiguration2
val commonsConfiguration2 = "org.apache.commons" % "commons-configuration2" % "2.11.0"
val commonsIo = "commons-io" % "commons-io" % "2.17.0"
val commonsIo = "commons-io" % "commons-io" % "2.18.0"
val guice = "com.google.inject" % "guice" % "7.0.0"
val kiama = "org.bitbucket.inkytonik.kiama" %% "kiama" % "2.5.1"
val logbackClassic = "ch.qos.logback" % "logback-classic" % logbackVersion
Expand All @@ -40,7 +40,7 @@ object Dependencies {
val zio = "dev.zio" %% "zio" % zioVersion
// Keep up to sync with version in plugins.sbt
val zioGrpcCodgen = "com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % "0.6.0-test3" % "provided"
val grpcNetty = "io.grpc" % "grpc-netty" % "1.68.0"
val grpcNetty = "io.grpc" % "grpc-netty" % "1.68.1"
val scalapbRuntimGrpc =
"com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion
// Ensures we have access to commonly used protocol buffers (e.g., google.protobuf.Struct)
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.3
sbt.version=1.10.5
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.11.0")
// https://github.com/scoverage/sbt-scoverage
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.2.1")
// https://github.com/sbt/sbt-buildinfo
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.13.1")
// https://github.com/sbt/sbt-native-packager
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4")
// https://scalacenter.github.io/scalafix/docs/users/installation.html
Expand Down
2 changes: 1 addition & 1 deletion project/sbt-changeling/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ThisBuild / version := "0.1.0-SNAPSHOT"
ThisBuild / organization := "systems.informal"

libraryDependencies ++= Seq(
"org.scala-sbt" % "sbt" % "1.10.3"
"org.scala-sbt" % "sbt" % "1.10.5"
)

lazy val sbt_changeling = (project in file("."))
Expand Down
2 changes: 1 addition & 1 deletion project/sbt-changeling/project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.10.3
sbt.version=1.10.5

0 comments on commit 7b4e7db

Please sign in to comment.