On this page
APL Workbench example
This example accompanies the APL Workbench guide. The Vada project contains main.vadb and its expected command-line output.
The source declares X = (1, 2, 3, 4, 5, 6) with host bounds -2 .. 3. Its initializer ⌽ (X × 2) + 1 produces 13 11 9 7 5 3 at the same host indices. APL logical positions are zero-based and are labelled separately from those host indices in the workbench.
Reproduce the source run
From the repository root, with veradic and Z3 installed:
veradic run --proof full --project docs/manuals/examples/apl-workbench/vada/verada.tomlThe command proves and runs the source program. It prints the six values on separate lines, with the leading spaces produced by Integer'Image. Compare them with vada/expected.stdout. This source proof applies to the written program, including its constant input; changing workbench fixtures does not extend that proof to other values.
In the APL Workbench
- Open
vada/main.vadb, place the cursor in the APL string and choose Verada: Open APL Workbench. Preparation showsXas an input with host bounds-2 .. 3. - Enter
1 2 3 4 5 6and choose Run: the result is13 11 9 7 5 3at host indices-2through3. - Change the multiplication block's
2to3. The source becomes⌽ ((X × 3) + 1), and the same inputs give19 16 13 10 7 4. - Undo in the source editor restores the original expression and its blocks.
- After a run, the multiplication block's samples are
12 10 8 6 4 2, six executions at logical positions[5] [4] [3] [2] [1] [0], and the addition block's are13 11 9 7 5 3: the order in which this run executed them.