Skip to content

Commit c2e9776

Browse files
committed
Improvements
1 parent 5ab5690 commit c2e9776

7 files changed

Lines changed: 39 additions & 146 deletions

File tree

examples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Start with the full examples repository when you want a runnable setup, then use
1111

1212
To try out the examples, you can:
1313

14-
- Clone locally: `git clone {{ site.liquidjava_examples_url }}.git`
14+
- Clone locally: `git clone {{ site.liquidjava_examples_url }}`
1515
- Open in the cloud: [GitHub Codespaces]({{ site.liquidjava_examples_codespaces_url }})
1616

1717
Once the project is open, use the [VS Code extension]({{ site.liquidjava_vscode_extension_url }}) to run automatically run the verifier and view diagnostics directly in the editor.

getting-started/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ description: Start with the LiquidJava basics, from overview to installation and
88
cards:
99
- title: Overview
1010
url: /getting-started/overview/
11-
description: Learn what LiquidJava adds to Java and how the documentation is organized.
11+
description: Learn what LiquidJava adds to Java.
1212
- title: Installation
1313
url: /getting-started/installation/
1414
description: Set up the API, verifier, and editor tooling needed to start checking Java code.
15-
- title: Quickstart
16-
url: /getting-started/quickstart/
17-
description: Follow a short end-to-end example that introduces refinements and verification feedback.
1815
---
1916

2017
# Getting Started

getting-started/installation.md

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,12 @@ description: Install the LiquidJava annotation API and choose between the VS Cod
77

88
# Installation
99

10-
LiquidJava has two pieces in practice:
11-
12-
- the `liquidjava-api` annotations added to your Java project
13-
- a verifier workflow, either through VS Code or through the command line
14-
1510
## Requirements
1611

17-
- Java 20+
18-
- Maven 3.6+
12+
- Java 17 or newer
13+
- Maven 3.6 or newer
1914
- Visual Studio Code, if you want the extension workflow
20-
21-
## Add the Annotation API
22-
23-
Use the annotation dependency from Maven Central.
15+
- The `liquidjava-api` dependency in the Java project you want to verify
2416

2517
### Maven
2618

@@ -44,32 +36,34 @@ dependencies {
4436
}
4537
```
4638

47-
## Option 1: VS Code Extension
39+
You can work use LiquidJava in two ways:
40+
41+
- Through the [VS Code extension]({{ '/tooling/vscode-extension/' | relative_url }})
42+
- Through the [command-line interface]({{ '/tooling/cli/' | relative_url }})
43+
44+
## VS Code Extension
4845

4946
The easiest setup for most users is:
5047

51-
1. Install the [LiquidJava VS Code extension](https://marketplace.visualstudio.com/items?itemName=AlcidesFonseca.liquid-java).
52-
2. Install [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java).
53-
3. Open a Maven-based Java project that already includes `liquidjava-api`.
48+
1. Install the [LiquidJava VS Code extension](https://marketplace.visualstudio.com/items?itemName=AlcidesFonseca.liquid-java)
49+
2. Install [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java)
50+
3. Open a Java project with the `liquidjava-api` dependency
51+
52+
The extension then provides real-time diagnostics, syntax highlighting for refinements, and more.
5453

55-
The extension then provides live diagnostics, syntax highlighting for refinements, and richer diagnostic views.
54+
You can find more about the extension [here]({{ '/tooling/vscode-extension/' | relative_url }}).
5655

57-
## Option 2: Build the Verifier Locally
56+
## Command Line Interface
5857

5958
If you want the command-line verifier directly:
6059

6160
```bash
62-
git clone {{ site.liquidjava_repo_url }}.git
61+
git clone {{ site.liquidjava_repo_url }}
6362
cd liquidjava
64-
./mvnw clean install
63+
mvn clean install
64+
./liquidjava /path/to/your/project
6565
```
6666

67-
If you prefer system Maven, `mvn clean install` works as well.
68-
69-
## Verify the Installation
70-
71-
- Open [Quickstart]({{ '/getting-started/quickstart/' | relative_url }}) and run the sample verifier command.
72-
- Or open [Examples]({{ '/examples/' | relative_url }}) and try the example repository in Codespaces or locally.
67+
This runs the verifier on your project and prints any errors to the console.
7368

74-
{: .note }
75-
The VS Code extension still expects the `liquidjava-api` dependency in the project being checked.
69+
You can find more about the command-line interface [here]({{ '/tooling/cli/' | relative_url }}).

getting-started/overview.md

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,33 @@ description: Learn what LiquidJava adds to Java, which problems it solves, and w
77

88
# Overview
99

10-
LiquidJava is an additional type checker for Java. It extends Java with three main specification tools:
10+
LiquidJava is an additional type checker for Java. It extends Java with three main features:
1111

12-
- **Refinement types** to restrict the values variables, parameters, and return values may take.
12+
- **Liquid types** to restrict the values variables, parameters, and return values can have using logical predicates.
1313
- **Typestates** to describe valid object protocols across method calls.
14-
- **Ghost variables** to track extra state when a protocol depends on counters or flags rather than named states alone.
14+
- **Ghost variables** to track extra state when typestates aren't enough.
1515

16-
At a high level, LiquidJava helps catch mistakes that ordinary Java typing does not express well, including:
16+
At a high level, LiquidJava helps catch mistakes that the standard Java type system cannot, including:
1717

18-
- division by zero
19-
- values falling outside accepted ranges
20-
- invalid call sequences such as using an object after it is closed
21-
- incorrect use of external library types that have been refined separately
18+
- Division by zero
19+
- Array index out-of-bounds
20+
- Values falling outside valid ranges
21+
- Invalid protocol usages such as reading a file after it is closed
2222

23-
## A Small Example
23+
## Example
2424

2525
```java
26-
import liquidjava.specification.Refinement;
26+
import liquidjava.specification.*;
2727

2828
public class Example {
2929
public static int divide(int a, @Refinement("b != 0") int b) {
3030
return a / b;
3131
}
32-
3332
public static void main(String[] args) {
34-
int ok = divide(8, 2);
35-
int bad = divide(8, 0); // verification error
33+
int result = divide(1, 0); // type error!
3634
}
3735
}
3836
```
3937

40-
The refinement on `b` states that callers must provide a non-zero argument. Instead of waiting for a runtime exception, LiquidJava rejects the invalid call during verification.
41-
42-
## What You Need
43-
44-
- Java 20 or newer
45-
- Maven 3.6 or newer
46-
- The `liquidjava-api` dependency in the Java project you want to verify
47-
48-
You can work with LiquidJava in two main ways:
49-
50-
- through the [VS Code extension]({{ '/tooling/vscode-extension/' | relative_url }}) for an editor-first workflow
51-
- through the [CLI verifier]({{ '/tooling/cli/' | relative_url }}) for direct command-line verification
52-
53-
## Documentation Map
54-
55-
- Start with [Installation]({{ '/getting-started/installation/' | relative_url }}) to set up the API and tooling.
56-
- Follow [Quickstart]({{ '/getting-started/quickstart/' | relative_url }}) for a concise first run.
57-
- Use the [Reference]({{ '/reference/' | relative_url }}) section to learn the annotation model in more detail.
58-
- Visit [Examples]({{ '/examples/' | relative_url }}) when you want runnable projects.
38+
The refinement on `b` states that callers must provide a non-zero argument, which is checked at compile time using an [SMT solver](https://en.wikipedia.org/wiki/Satisfiability_modulo_theories).
39+
The call `divide(1, 0)` violates this contract, so the verifier reports an error without the program even running.

getting-started/quickstart.md

Lines changed: 0 additions & 74 deletions
This file was deleted.

index.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ title: LiquidJava Docs
33
layout: default
44
nav_exclude: true
55
has_toc: false
6-
description: Start with installation, quickstart, runnable examples, and reference material for LiquidJava.
6+
description: Start with installation, runnable examples, and reference material for LiquidJava.
77
cards:
8-
- title: Quickstart
9-
url: /getting-started/quickstart/
10-
description: Install the annotation API, run the verifier, and see a failing refinement in a few minutes.
118
- title: VS Code Extension
129
url: /tooling/vscode-extension/
1310
description: Use real-time diagnostics, syntax highlighting, and state-machine visualizations directly in the editor.
@@ -31,7 +28,7 @@ cards:
3128

3229
<div class="home-actions">
3330
<a class="home-button primary" href="{{ '/getting-started/installation/' | relative_url }}">Install LiquidJava</a>
34-
<a class="home-button secondary" href="{{ '/getting-started/quickstart/' | relative_url }}">Learn More</a>
31+
<a class="home-button secondary" href="{{ '/getting-started/overview/' | relative_url }}">Learn More</a>
3532
</div>
3633

3734
<div class="home-banner">

tooling/cli.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ LiquidJava ships with a command-line entry point for verifying Java files or pro
1111
## Build the Project
1212

1313
```bash
14-
git clone {{ site.liquidjava_repo_url }}.git
14+
git clone {{ site.liquidjava_repo_url }}
1515
cd liquidjava
1616
./mvnw clean install
1717
```
@@ -43,5 +43,3 @@ mvn exec:java -pl liquidjava-verifier \
4343
- quick local experiments
4444
- environments where you do not want to rely on VS Code
4545
- debugging verifier behavior separately from editor integration
46-
47-
For a faster first experience, the [Quickstart]({{ '/getting-started/quickstart/' | relative_url }}) page uses the same command on a tiny example.

0 commit comments

Comments
 (0)