Skip to content

Commit 54dd138

Browse files
committed
Minor Improvements
1 parent 6edb77d commit 54dd138

File tree

6 files changed

+15
-46
lines changed

6 files changed

+15
-46
lines changed

pages/concepts/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ nav_order: 2
44
has_children: true
55
has_toc: false
66
permalink: /concepts/
7-
description: "Browse LiquidJava concepts: for refinements, aliases, state refinements, ghosts, and external refinements."
7+
description: Learn LiquidJava concepts to understand how to write specifications.
88
cards:
99
- title: Refinements
1010
url: /concepts/refinements/

pages/concepts/state-refinements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Constructors must always be present for typestate checking to work correctly, be
6363
When refining interfaces, which cannot have a constructor, LiquidJava still needs an initialization point. In those cases, the refinement interface must declare a method whose name matches the class we are refining. For example, an interface named `ArrayListRefinements` that is refining `java.util.ArrayList` should declare the method `public void ArrayList()`. This method plays the role of a constructor for the typestate system and ensures the initial values are set correctly.
6464

6565

66-
## Multiple StateSets
66+
## Multiple State Sets
6767

6868
Classes can declare more than one `@StateSet` annotation. This is useful when the object has independent, orthogonal dimensions of state.
6969

pages/examples/email.md

Lines changed: 7 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,24 @@ import liquidjava.specification.*;
1717

1818
@StateSet({"empty", "senderSet", "receiverSet", "bodySet"})
1919
public class Email {
20-
private String sender;
21-
private List<String> receiver;
22-
private String subject;
23-
private String body;
2420

2521
@StateRefinement(to="empty()")
26-
public Email() {
27-
receiver = new ArrayList<>();
28-
}
22+
public Email() {}
2923

3024
@StateRefinement(from="empty()", to="senderSet()")
31-
public void from(String s) {
32-
sender = s;
33-
}
25+
public Email from(String s) {}
3426

3527
@StateRefinement(from="senderSet() || receiverSet()", to="receiverSet()")
36-
public void to(String s) {
37-
receiver.add(s);
38-
}
28+
public Email to(String s) {}
3929

4030
@StateRefinement(from="receiverSet()", to="receiverSet()")
41-
public void subject(String s) {
42-
subject = s;
43-
}
31+
public Email subject(String s) {}
4432

4533
@StateRefinement(from="receiverSet()", to="bodySet()")
46-
public void body(String s) {
47-
body = s;
48-
}
34+
public Email body(String s) {}
4935

50-
@StateRefinement(from="bodySet()", to="bodySet()")
51-
public String build() {
52-
StringBuilder sb = new StringBuilder();
53-
sb.append("From: " + sender + "\n");
54-
sb.append("To: " + String.join(", ", receiver) + "\n");
55-
sb.append("Subject: " + subject + "\n");
56-
sb.append("\n");
57-
sb.append(body);
58-
return sb.toString();
59-
}
36+
@StateRefinement(from="bodySet()")
37+
public Email build() {}
6038
}
6139
```
6240

pages/examples/order.md

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,13 @@ public class Order {
2020
public Order() {}
2121

2222
@StateRefinement(from="ordering()", to="ordering() && total() == total(old(this)) + price")
23-
@Refinement("_ == this")
24-
public Order addItem(String name, @Refinement("_ > 0") int price) {
25-
return this;
26-
}
23+
public Order addItem(String name, @Refinement("_ > 0") int price) {}
2724

2825
@StateRefinement(from="ordering() && total() > 0", to="checkout() && total() == total(old(this))")
29-
@Refinement("_ == this")
30-
public Order checkout() {
31-
return this;
32-
}
26+
public Order checkout() {}
3327

3428
@StateRefinement(from="checkout() && amount == total()", to="finished()")
35-
@Refinement("_ == this")
36-
public Order pay(@Refinement("_ > 0") int amount) {
37-
return this;
38-
}
29+
public Order pay(@Refinement("_ > 0") int amount) {}
3930
}
4031
```
4132

pages/getting-started/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ nav_order: 1
44
has_children: true
55
has_toc: false
66
permalink: /getting-started/
7-
description: Start with the LiquidJava basics, from overview to setup and a first verification run.
7+
description: Set up your environment and run your first LiquidJava verification.
88
cards:
99
- title: Setup
1010
url: /getting-started/setup/

pages/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ description: Documentation for LiquidJava, a lightweight verification system for
88
cards:
99
- title: Getting Started
1010
url: /getting-started/
11-
description: Learn the basics, set up your environment, and run your first LiquidJava verification.
11+
description: Set up your environment and run your first LiquidJava verification.
1212
- title: Concepts
1313
url: /concepts/
14-
description: Look up LiquidJava concepts, annotations, and protocol rules in a more formal, detailed format.
14+
description: Learn LiquidJava concepts to understand how to write specifications.
1515
- title: Diagnostics
1616
url: /diagnostics/
1717
description: Understand LiquidJava errors and warnings.

0 commit comments

Comments
 (0)