Field manual

A language for programs, proofs and EVM contracts

Omegyu

Write a function and a property it must satisfy in the same file. Omegyu checks both before you run the program or build a contract.

01 / Worked example

A greeting with a proof

The assertion checks one call. The last line returns its greeting.

A greeting and a check
let greet = \(name : Text) -> "Hello, ${name}!"
let test = assert : greet "Ada" === "Hello, Ada!"
in  greet "Ada"
Your result
Complete example · with imports

Normal form

"Hello, Ada!"
Open the playground →

Study / 01

Follow a function

twice calls its argument twice. Supply add2 and the body changes from f (f x) to add2 (add2 x). The input x still has to be supplied.

Watch both substitutions →

Study / 02

Prove a law

double 3 === 6 is one case. To prove the result for every natural number, use the answer for k: adding two to each side gives the case for k + 1.

Follow the recursive proof →

Study / 03

Rule out a write

A View handler gets a record with read but not write. Asking for access.write yields E0006: the field is missing. No transaction has to run to discover that mistake.

Inspect the rejected handler →

Omegyu vs. Solidity: see how to share a function across types and rule out empty inputs.