Skip to content

Commit 813f304

Browse files
committed
Minor Changes
1 parent 5c0ab2d commit 813f304

1 file changed

Lines changed: 16 additions & 8 deletions

File tree

tutorial-data.js

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ window.LIQUID_JAVA_TUTORIAL = {
4242
4343
public class RGB {
4444
public static void main(String[] args) {
45-
// Add the RGB channel refinement here
45+
// Add the RGB refinement here
4646
int red = 300;
4747
}
4848
}`,
@@ -94,12 +94,12 @@ public class RGB {
9494
"Method refinements describe which calls are valid and what the implementation promises about its result.",
9595
concept: {
9696
label: "Inputs and outputs",
97-
code: `@Refinement("_ == numerator / denominator")
97+
code: `@Refinement("_ == x / y")
9898
public static int divide(
99-
int numerator,
100-
@Refinement("_ != 0") int denominator
99+
int x,
100+
@Refinement("_ != 0") int y
101101
) {
102-
return numerator / denominator;
102+
return x / y;
103103
}`,
104104
explanation:
105105
"The parameter contract prevents division by zero. The return contract connects the result to the two inputs.",
@@ -177,6 +177,9 @@ public class Midpoint {
177177
label: "Follow the transition",
178178
code: `@StateSet({"off", "on"})
179179
public class LightBulb {
180+
@StateRefinement(to="off(this)")
181+
public void LightBulb() { } // Constructor
182+
180183
@StateRefinement(from="off(this)", to="on(this)")
181184
public void turnOn() { }
182185
}`,
@@ -208,7 +211,7 @@ import liquidjava.specification.StateSet;
208211
@StateSet({"unconnected", "bound", "connected", "closed"})
209212
public interface SocketRefinements {
210213
@StateRefinement(to="unconnected(this)")
211-
public void Socket();
214+
public void Socket(); // Constructor
212215
213216
@StateRefinement(from="true", to="true")
214217
public void bind(SocketAddress add);
@@ -301,7 +304,12 @@ public interface SocketRefinements {
301304
code: `@ExternalRefinementsFor("java.util.ArrayList")
302305
@Ghost("int size")
303306
public interface ArrayListRefinements<E> {
304-
@StateRefinement(to="size(this) == size(old(this)) + 1")
307+
@StateRefinement(to="size(this) == 0")
308+
public void ArrayList(); // Constructor
309+
310+
@StateRefinement(
311+
to="size(this) == size(old(this)) + 1"
312+
)
305313
public boolean add(E element);
306314
}`,
307315
explanation:
@@ -324,7 +332,7 @@ import liquidjava.specification.StateRefinement;
324332
@Ghost("int size")
325333
public interface StackRefinements<E> {
326334
@StateRefinement(to="true")
327-
public void Stack();
335+
public void Stack(); // Constructor
328336
329337
@StateRefinement(to="true")
330338
public E push(E elem);

0 commit comments

Comments
 (0)