Phase 6A: .aji layer 5 (linear values, own, regions, outcome matches, or trap)

- explicit move for named linear values; E7003 with suggestion "move x";
  move of a copyable value is E7006; moved state left to the verifier
- own.new/own.array/region.create/region.new/region.array/cap.narrow.budget
  as outcome matches or with `or trap`; own.take/own.free/region.reset/
  region.destroy as AIR names in AIR operand order
- region.new/region.array take an explicit ref/mut region binding (E7005
  otherwise); reset/destroy end nothing (verifier E2104)
- match kind (enum/outcome/integer) decided by the parser; built-in error
  enums (alloc_error, cap_error, io_error) matched exhaustively
- cap<K> types; linear owners borrowed in place
- features header = registry closure of the features used
- parameters keep their source names (grants by @main parameter name)
- aji lower --stats: mechanical_air_eliminated = 1 - source/AIR bytes
- spec 15, grammar, quick reference, plan updated
This commit is contained in:
dev committed 2026-10-05 12:06:23 +03:00
1 parent eca30f817a
commit bdcf871e5d
28 files changed
+882 -78

No files matched your search

@@ -3,22 +3,22 @@ air 0
lang 0.1
features [arrays, effects, ownership]
fn @get(%s_1: slice<u64>, %i_2: usize) -> u64
fn @get(%s: slice<u64>, %i: usize) -> u64
effects []
entry:
%len_3 = slice.len %s_1
%cmp_4 = lt.usize %i_2, %len_3
cbr %cmp_4, @then_5(), @else_6()
then_5:
%e_7 = borrow.index.proven %s_1, %i_2
%v_8 = load %e_7
borrow.end %e_7
ret %v_8
else_6:
br @endif_9()
endif_9:
%c_10 = const.u64 0
ret %c_10
%len_1 = slice.len %s
%cmp_2 = lt.usize %i, %len_1
cbr %cmp_2, @then_3(), @else_4()
then_3:
%e_5 = borrow.index.proven %s, %i
%v_6 = load %e_5
borrow.end %e_5
ret %v_6
else_4:
br @endif_7()
endif_7:
%c_8 = const.u64 0
ret %c_8
fn @main() -> u64
effects []