Feature index
Every feature piac builds today, with the page that explains it and a working example: a file in tests/verify that bazel test //tests/verify:<name>_test proves, and whose expected report sits in its comments. To see a feature at work, read its example, or run piac --verify on it. Status says what is built and what comes next; the standard library lists the modules written with these features.
tools/docs/check.py fails a pull request that adds a feature test without a line here.
Values and types
| Feature |
Explained in |
Examples |
| Bounded integers, range types and overflow modes |
tour, design |
overflow |
Digit separators, min t and max t |
tour, grammar |
digit_separators, type_bounds |
Bit operators and the builtins clz, ctz, popcount, bswap, rotl, rotr |
verifier, Pia.Core.Bit |
bits, bit_counts |
No shadowing, and primed names such as x' |
tour |
primes |
| Arrays and slices, constant tables |
tour |
slices, local_arrays, array_results, consts, const_array_views |
| Records, and buffers of records |
tour |
records, record_buffers, slice_aggregates |
Variants and match, record payloads |
tour |
variants, record_payloads |
Type aliases, let byte = u8 |
tour |
type_aliases |
Distinct types, type u32, and their derives |
tour, ADR 0064 |
distinct_types, distinct_derives |
Parameter modifiers, inout and old |
tour |
inout_values, old_calls |
Recursive types, let rec variants |
verifier |
rec_types, rec_aliasing, rec_fill |
Floats, f32 and f64 |
tour, verifier |
floats |
Contracts and proofs
| Feature |
Explained in |
Examples |
requires, ensures and assert, and calls proved from contracts |
tour, how verification works |
contracts, callee_exact |
| Contracts are exact mathematics |
verifier |
spec_exact, contract_equality, contract_guards |
| Goals proved by intervals, before Z3 |
verifier |
intervals |
| How products are encoded, exact division facts, int-blasting |
verifier, ADR 0066 |
widths, division_facts, int_blast |
Loop invariants and decreases |
verifier, verifier |
loops, int_measures |
Mutual recursion: a decreases goal at each call within a cycle of functions |
verifier |
mutual_recursion |
| Spec functions and lemmas |
verifier |
specs, pure_calls, fuel_counterexamples |
Opaque spec functions, @opaque and with f |
verifier, ADR 0063 |
opaque |
Frames, reads xs.[lo .. hi] |
verifier |
frames |
Spec-only int and real |
verifier |
reals |
Spec state: let spec locals and spec fields |
verifier, ADR 0058 |
spec_locals, spec_fields, spec_buffers |
Cost bounds, costs iterations and costs calls |
tour, verifier, ADR 0062 |
costs |
assume, @trusted and --trust-report --why |
how verification works, ADR 0023 |
assumes |
--check-vacuity |
verifier |
vacuity |
| Parallel, sliced and cached proving |
verifier |
parallel |
Solver strategies @solver and tactics @by |
verifier |
solver, tactics |
--emit=mlir with proved ops marked |
getting started |
emit |
Theories
| Feature |
Explained in |
Examples |
| Theories: sorts, abstract functions, axioms and triggers |
theories, verifier |
theory_lip, theory_closure |
| Models, which prove a theory's axioms |
theories |
models, model_check |
| Consistency of trusted theories |
verifier |
trust_checks |
Theories built by metaprograms, such as machine |
theories, meta |
machine |
The target as a theory, and @target(m) items |
theories, ADR 0049 |
target, target_items, target_theory |
| Feature |
Explained in |
Examples |
| Generic functions and types |
tour |
generic_functions, generic_types |
| Generic bodies proved once |
verifier, ADR 0043 |
generic_proofs |
| Concepts with laws, and adapters |
tour, ADR 0034 |
concepts, adapters, generic_meets_concept |
| Overloading, ranked by constraints and chosen by precondition |
verifier, ADR 0034 |
overloads, concept_ranking, precondition_overloads |
Type-level metaprograms, match on types, substitution failure |
meta, ADR 0035 |
type_functions, type_match, total_metaprograms, soft_failure |
| Lambdas and function values |
tour, ADR 0044 |
lambda_find, lambda_generic, lambda_generic_forms, lambda_named, lambda_overloads |
| Contracts on function types |
verifier |
lambda_arrow_contract, lambda_requires |
| Captures, partial application and closures as results |
tour |
lambda_captures, lambda_results |
Function references: let h : (x : u8) -> u8 requires ... = succ |
tour, ADR 0071 |
fn_references |
Function objects, any type with an apply |
tour |
function_object |
Errors, resources and memory
| Feature |
Explained in |
Examples |
Error sets, ? and handle |
stdlib, ADR 0028 |
error_sets, handlers |
defer |
stdlib |
defer |
Foreign functions, contracted or unsafe, and unsafe view |
codegen |
ffi, views |
| Allocators: bump, arenas, pools and size classes |
stdlib, theories, Pia.Mem |
bump, arena, pool, pool_alloc, pool_owner_errors, size_classes |
| Growable vectors |
stdlib, Pia.Mem |
vec_bump, vec_generic, vec_region, vec_allocator |
box t, and box over a concept |
Pia.Mem, ADR 0046 |
box, box_errors, box_concept |
Buffers whose elements hold slices or boxes, @linear |
ADR 0048 |
slice_buffers, vec_boxes |
| Atomics |
codegen, ADR 0052 |
atomics |
Modules and concurrency
Demos