Skip to content

Commit 2a26eee

Browse files
committed
Improvements
1 parent 91e2958 commit 2a26eee

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

concepts/refinements.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Refinement predicates use a language similar to Java, where you can write boolea
4545
| Literals | `true` `false` `0` `1.5` | `@Refinement("_ == true") boolean ok = true;` |
4646

4747
LiquidJava currently only supports a small set of types in refinements:
48-
- Primitive types: `int`, `boolean`, `long`, `double`, `float`
49-
- Boxed types: `Boolean`, `Integer`, `Double`
48+
- The primitive types `int` `boolean` `long` `double` `float`
49+
- The boxed types `Boolean` `Integer` `Double`

concepts/state-refinements.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ nav_order: 3
88

99
Beyond basic refinements, LiquidJava supports object state modeling through typestates. This lets you describe when a method can or cannot be called based on the state of the object.
1010

11-
The possible states of a class are declared with `@StateSet`, and the state transitions are described with `@StateRefinement(from = "...", to = "...")`:
12-
- `from` describes the **precondition** - the object state in which the method can be invoked
13-
- `to` describes the **postcondition** - the state the object will have after the method is called
11+
The possible states of a class are declared with `@StateSet`, and the state transitions are described with `@StateRefinement(from="...", to="...")`.
12+
- The `from` describes the **precondition** - the object state in which the method can be invoked
13+
- The `to` describes the **postcondition** - the state the object will have after the method is called
1414

1515
```java
1616
import liquidjava.specification.*;
@@ -55,7 +55,7 @@ public class Buffer {
5555
}
5656
```
5757

58-
If no `to` transition is written, LiquidJava defaults the constructor to the first state listed in the corresponding `@StateSet`.
58+
If no `to` transition is declared, LiquidJava defaults the constructor to the first state listed in the corresponding `@StateSet`.
5959

6060
Constructors must always be present for typestate checking to work correctly, because they are the point where the initial state values are assigned. Otherwise, the initial values are not set and the verifier won't be able to track the state of the object across method calls, which can lead to unexpected type errors.
6161

@@ -88,4 +88,4 @@ public class Device {
8888

8989
Each state set is exclusive: at any moment, the object can only be in one state from that specific set. In the example above, the object cannot be both `open` and `closed`, and it cannot be both `clean` and `dirty`.
9090

91-
When a transition affects multiple orthogonal states, the states must be combined with `&&` in the `from` and `to` annotations. In the example above, the `use` method transitions from `open && clean` to `open && dirty`, and the `close` method transitions from `open && clean` to `closed && clean`.
91+
When using more than one state set, the states must be combined with `&&` in the `from` and `to` annotations, as shown in the example above. This is because the object must always be in exactly one state from each set, so we need to specify the full state of the object in the preconditions and postconditions.

getting-started/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ has_toc: false
66
permalink: /getting-started/
77
description: Start with the LiquidJava basics, from overview to setup and a first verification run.
88
cards:
9-
- title: Overview
10-
url: /getting-started/overview/
11-
description: Learn what LiquidJava adds to Java.
129
- title: Setup
1310
url: /getting-started/setup/
1411
description: Set up the dependency, verifier, and VS Code extension to start using LiquidJava.
12+
- title: Overview
13+
url: /getting-started/overview/
14+
description: Learn what LiquidJava adds to Java.
1515
---
1616

1717
# Getting Started

0 commit comments

Comments
 (0)