DEVELOPMENT EDITION · 769442725406
Examples
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.toml

The 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

  1. Open vada/main.vadb, place the cursor in the APL string and choose Verada: Open APL Workbench. Preparation shows X as an input with host bounds -2 .. 3.
  2. Enter 1 2 3 4 5 6 and choose Run: the result is 13 11 9 7 5 3 at host indices -2 through 3.
  3. Change the multiplication block's 2 to 3. The source becomes ⌽ ((X × 3) + 1), and the same inputs give 19 16 13 10 7 4.
  4. Undo in the source editor restores the original expression and its blocks.
  5. 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 are 13 11 9 7 5 3: the order in which this run executed them.