DEVELOPMENT EDITION · 769442725406
Toolchain Manual

Beta quick start

The Verada owl perched on a leafy branch
On this page

This page installs Verada from the beta's disk image, Verada-0.1.0.0-arm64.dmg, on a Mac with Apple silicon, and takes you through a first project in each of Verada's three syntaxes. You do not need a Verada source checkout, Homebrew or Haskell. To build Verada from source instead, see Building and installing Verada.

What you install separately

What Needed for How
Apple's Command Line Tools veradic build (it links native programs with the system C compiler), and C files in a project xcode-select --install in Terminal, once
Visual Studio Code An optional external editor; the browser IDE is included code.visualstudio.com
cvc5 The larger proof budgets and some floating-point proofs (optional) A release from github.com/cvc5/cvc5/releases, with cvc5 on your PATH
Yices (yices-smt2) Faster proofs of some linear arithmetic (optional) yices.csl.sri.com, with yices-smt2 on your PATH

Everything else is in the disk image: veradic with its browser IDE and local Guide, the LLVM code generator it uses, Z3 for proofs, and the VS Code extension. check, prove and run need only what the disk image holds; build also needs the Command Line Tools. cvc5 and Yices are not bundled because their licences differ from Verada's; Verada proves without them, and uses them when it finds them on PATH.

Copy Verada to your Mac

  1. Open Verada-0.1.0.0-arm64.dmg. Its window shows a Verada folder and a shortcut to Applications.
  2. Drag Verada onto Applications (or anywhere else you like: the folder works wherever it is, as long as its contents stay together).
  3. Eject the disk image.

The folder holds:

Let macOS run it

macOS marks everything downloaded from the internet as quarantined, and will not run a quarantined program that Apple has not notarised. This beta is not notarised, so clear the mark once. In Terminal (if you put the folder somewhere other than Applications, use its path instead):

xattr -dr com.apple.quarantine /Applications/Verada

Until you do, macOS stops veradic and z3 as soon as they start: the shell prints killed, or a window says that Apple could not verify them. The command-line tool's installer below clears the mark itself, so if you run it you can skip this step. Clearing the mark is needed again only for a new copy of the folder.

Install the command-line tool

Run, in Terminal:

/Applications/Verada/"Install Command Line Tool.command"

It clears the quarantine mark, then makes veradic a command: it links /usr/local/bin/veradic to the folder's bin/veradic when /usr/local/bin is writable, and otherwise ~/.local/bin/veradic. When the directory it chose is not on your PATH, it prints the line that adds it; open a new Terminal window afterwards. Instead of Terminal, you can double-click the .command file in Finder; if macOS then says it cannot verify the developer, choose Done, open System Settings > Privacy & Security, choose Open Anyway beside the message about it, and double-click it again.

To do the same by hand:

xattr -dr com.apple.quarantine /Applications/Verada
mkdir -p ~/.local/bin
ln -sf /Applications/Verada/bin/veradic ~/.local/bin/veradic

Then check:

veradic --version

It names the compiler and its revision, and the solvers it found: Z3 from the Verada folder, and cvc5 and Yices if you installed them.

Start in the browser IDE

Create a project and open its IDE with:

veradic ide new ~/hello-ide --syntax varc

Choose vada, varc or vibe for the starter's syntax. Open the complete private URL printed in Terminal and keep that command running. The IDE includes source tabs, a file explorer, project tools, an interactive REPL and the local Guide; no model or separate editor is needed. In Project, select Prove, then Run: the starter proves and prints hello-ide: 42. Project execution initially uses Full proof.

Use veradic ide ~/hello-ide to reopen it later, or run veradic ide inside an existing project. The browser IDE chapter explains saving, working with unsaved changes, diagnostics, code wizards and the optional Assistant. The next section takes the same check/prove/run workflow through the terminal.

Your first project

Each project is a directory with a verada.toml that says where its sources are. Copy the examples somewhere you can write:

cp -R /Applications/Verada/share/verada/examples/first-proof ~/first-proof
cd ~/first-proof/vada/after

Vada

Vada is Verada's Ada syntax. The after project has bounded.vads:

package Bounded is
   function Increment (Value : Natural) return Natural
     with Pre => Value < Natural'Last,
          Post => Increment'Result = Value + 1;
end Bounded;

its body bounded.vadb, and the main program main.vadb, which prints Increment (41). Run the four commands:

veradic check
veradic prove
veradic run
veradic build -o answer && ./answer

check prints nothing when the program is correct; prove reports how many checks it proved; run compiles the program in memory and runs it, and build writes a native executable. Both print answer: 42.

Now try ~/first-proof/vada/before, the same program without the precondition: veradic prove there reports that Value + 1 can overflow, with the value that makes it fail. The first proof lesson walks through that repair.

Varc

Varc is the same language with C-family syntax. In ~/first-proof/varc/after, bounded.va is:

package Bounded {
    pub fn increment(value: Natural) -> Natural
        requires value < Natural::Last
        ensures result == value + 1
    {
        return value + 1;
    }
}

Run the same four commands there.

Vibe

Vibe is the same language as typed Python: a Vibe program is a Python program, and Verada proves it. In ~/first-proof/vibe/after, bounded.vb is:

from verada import Natural, ensures, requires, result


def increment(value: Natural) -> Natural:
    requires(value < Natural.last)
    ensures(result == value + 1)
    return value + 1

Run the same four commands there.

A project of your own

veradic new starts one: a directory with a verada.toml, the same small program with its contract in src, and a .gitignore, in the syntax you choose (vada, the default, varc or vibe):

cd ~
veradic new hello --syntax varc
cd hello
veradic check && veradic prove && veradic run

run prints hello: 42. new never writes into a directory that already exists; --dir puts the project somewhere other than a new directory named after it. See starting a project. The Programmer Guide continues from here.

Visual Studio Code

Install the extension from the Verada folder:

code --install-extension /Applications/Verada/verada-0.1.0.vsix

(or, in VS Code, Extensions > ... > Install from VSIX... and choose the file). Then set verada.path to the full path of veradic, because VS Code started from the Dock does not see the PATH your shell sets: open Settings, search for verada.path, and enter /Applications/Verada/bin/veradic. Or add to your user settings.json:

{
  "verada.path": "/Applications/Verada/bin/veradic"
}

Open one of the example directories as a folder, or make a new project with Verada: New Project… in the Command Palette. The extension checks Vada, Varc and Vibe files as you type and proves them in the background. The buttons in the editor's title bar run Check, Prove, Run and Build on the file's project, with the results in the Problems panel, and Cmd+Shift+B builds; see Editors and the language server.

Updating and removing

A new beta comes as a new disk image: replace the Verada folder with the new one and clear its quarantine mark again; the link to veradic keeps working. To remove Verada, delete the folder, the link (/usr/local/bin/veradic or ~/.local/bin/veradic), and if you like its caches in ~/.cache/verada.

Reporting problems

Send Luke:

For a proof that fails unexpectedly, add the output of veradic prove --explain. For the editor, add the extension's log: View > Output, then choose Verada in the list. Troubleshooting covers the common failures.