Running a program
The previous chapters showed how the type checker verifies a program.
The interpreter evaluates the resulting core program, producing a value and a
memory snapshot. Program assertions parse surface syntax and lower it to core
before interpretation. assert_interpret! also checks the program;
assert_interpret_only! deliberately skips the checker for runtime tests.
Here is a program that creates a Point and returns it:
crate::assert_interpret!(
r#"
struct Point {
x: Int;
y: Int;
}
struct Main {
fn main(given self) → Point {
let p = new Point(22, 44);
p→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_p = new Point (22, 44) ;
Output: Trace: _1_p = Point { x: 22, y: 44 }
Output: Trace: _1_p → ;
Output: Trace: exit Main.main => Point { x: 22, y: 44 }
Result: Ok: Point { x: 22, y: 44 }
Alloc 0x06: [Int(22), Int(44)]"#]]
);
The interpreter creates a Main() instance and calls its main method.
The result is Point { x: 22, y: 44 }.
The memory model
Memory is a collection of flat allocations. Each allocation contains words, without type tags or named field maps:
/// A flat array of words representing a value in memory.
#[derive(Debug, Clone, PartialEq, Eq)]
struct Alloc {
data: Vec<Word>,
}
Words represent scalar values, flags, pointers, mutable leases, array metadata, or uninitialized storage:
/// A single word of memory.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
enum Word {
Int(i64),
Flags(Flags),
Pointer(Pointer),
Lease(Pointer),
RefCount(i64),
Capacity(usize),
Uninitialized,
}
The flags on a boxed handle record its runtime ownership:
/// Permission flag for unique objects.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
enum Flags {
/// Indicates that the data here is fully owned.
Given,
/// Indicates that the data here has shared ownership.
SharedOwned,
/// Indicates that the data here is a borrowed reference.
SharedPlace,
}
Given: the handle owns its data uniquely.SharedOwned: the handle participates in shared ownership.SharedPlace: the handle shares data owned elsewhere, without owning it.
An uninitialized slot is a Word::Uninitialized, not a flag variant.
A pointer identifies an allocation and an offset within it:
/// Identifies a position within an allocation.
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
struct Pointer {
index: usize,
offset: usize,
}
Object layout
Inline objects contain only their fields. For example, a Point with two
integer fields occupies two words, regardless of its declaration category:
Point value:
+-------------------+
| Int(22) | <- x
| Int(44) | <- y
+-------------------+
There is no per-object flags word for inline classes and structs. Boxed types such as
Array[T] instead have a two-word wrapper [Flags, Pointer], whose pointer
leads to a separate heap allocation. A mutable lease uses a single
Lease(Pointer) word to reach its origin’s data.
An Int or Bool is one word. Unit () has no words. Nested inline fields are
laid out consecutively; a field’s type determines its size.
Types flow through evaluation, not memory
An ObjectValue pairs a pointer with the type needed to interpret its words:
/// A pointer paired with the type needed to interpret the words.
/// For boxed types (e.g., arrays, leases), this will be a pointer to a pointer.
/// For inline objects, this will be a pointer to the object data.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct ObjectValue {
pointer: Pointer,
ty: Ty,
}
The stack frame maps variables to these typed values:
pub struct StackFrame {
env: Env,
variables: Vec<(Var, Pointer)>,
}
When traversing a place, the interpreter combines the static type with any boxed flags and mutable lease indirections encountered along the path. The resulting effective permissions determine whether access moves, duplicates, or mutably borrows the data.
The interpreter and stack frames
The interpreter holds the program, a typing environment used to classify types, and the allocations:
pub struct Interpreter<'a> {
program: &'a Program,
allocs: Vec<Alloc>,
output: String,
indent: usize,
/// Monotonically increasing counter for alpha-renaming method bodies.
/// Each method invocation gets a unique ID so renamed variables
/// (e.g., `_1_self`, `_2_self`) never collide, even across sequential
/// calls at the same stack depth.
next_call_id: usize,
}
Each method call creates a new StackFrame, evaluates the body, and cleans up
its locals and temporaries when returning.
Walking through evaluation
Main in the example has no fields, so its inline value occupies zero words.
Evaluating new Point(22, 44) first creates integer arguments and then builds
the flat object [Int(22), Int(44)]. Field x begins at offset zero and field
y at offset one.
p→ gives the object. For a uniquely owned value, the interpreter copies the
words into result storage and uninitializes the source. Returning transfers
the result out of the callee’s frame. The test snapshot retains only the final
Point allocation; it does not expose temporary storage as part of the result.
Arithmetic
The interpreter supports integer arithmetic:
crate::assert_interpret!(
r#"
struct Main {
fn main(given self) → Int {
let x = 10;
let y = 20;
x→ + y→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_x = 10 ;
Output: Trace: _1_x = 10
Output: Trace: let _1_y = 20 ;
Output: Trace: _1_y = 20
Output: Trace: _1_x → + _1_y → ;
Output: Trace: exit Main.main => 30
Result: Ok: 30
Alloc 0x08: [Int(30)]"#]]
);
Method calls
The receiver’s type determines which method to call. The interpreter evaluates the receiver and arguments, creates the callee’s frame, and evaluates its body:
crate::assert_interpret!(
r#"
struct Adder {
a: Int;
b: Int;
fn sum(given self) → Int {
self.a→ + self.b→;
}
}
struct Main {
fn main(given self) → Int {
let adder = new Adder(3, 4);
adder→.sum();
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_adder = new Adder (3, 4) ;
Output: Trace: _1_adder = Adder { a: 3, b: 4 }
Output: Trace: _1_adder → . sum () ;
Output: Trace: enter Adder.sum
Output: Trace: _2_self . a → + _2_self . b → ;
Output: Trace: exit Adder.sum => 7
Output: Trace: exit Main.main => 7
Result: Ok: 7
Alloc 0x0a: [Int(7)]"#]]
);
For adder→.sum(), adder→ is evaluated first. Its value becomes self in the
new frame. Generic arguments are supplied explicitly in the core call.
Place and value operations at runtime
The checker verifies that accesses are permitted. The interpreter executes those operations using effective permissions. Accessing uninitialized storage faults, allowing runtime tests to expose errors that the checker should reject.
Giving a place
place→ copies the value’s words into result storage. Its effective permissions
determine what happens to ownership:
| Permission | Behavior |
|---|---|
| Unique ownership | Transfer ownership and uninitialize the source |
| Independent shared ownership | Duplicate; increment refcounts of owning boxed handles |
| Sharing from a place | Duplicate without gaining ownership of the origin |
| Mutable lease | Preserve mutable access through a lease indirection |
Giving uniquely owned data transfers it:
crate::assert_interpret!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let d = new Data(42);
d→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_d = new Data (42) ;
Output: Trace: _1_d = Data { x: 42 }
Output: Trace: _1_d → ;
Output: Trace: exit Main.main => Data { x: 42 }
Result: Ok: Data { x: 42 }
Alloc 0x05: [Int(42)]"#]]
);
Giving independently shared data can be repeated:
crate::assert_interpret_only!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let d = new Data(42);
let s = d→.share;
let x1 = s→;
let x2 = s→;
print(x1→);
x2→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_d = new Data (42) ;
Output: Trace: _1_d = Data { x: 42 }
Output: Trace: let _1_s = _1_d → . share ;
Output: Trace: _1_s = shared Data { x: 42 }
Output: Trace: let _1_x1 = _1_s → ;
Output: Trace: _1_x1 = shared Data { x: 42 }
Output: Trace: let _1_x2 = _1_s → ;
Output: Trace: _1_x2 = shared Data { x: 42 }
Output: Trace: print(_1_x1 →) ;
Output: -----> shared Data { x: 42 }
Output: Trace: _1_x2 → ;
Output: Trace: exit Main.main => shared Data { x: 42 }
Result: Ok: shared Data { x: 42 }
Alloc 0x0d: [Int(42)]"#]]
);
Sharing a place
place and place.share make the same shared access. The source stays intact.
For boxed handles in the copied result, the flags determine ownership accounting:
| Source flags | Result |
|---|---|
Given | SharedPlace; no ownership transfer or refcount increment |
SharedOwned | SharedOwned; increment the refcount |
SharedPlace | SharedPlace; no refcount increment |
Sharing a uniquely owned place leaves the original usable:
crate::assert_interpret!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let d = new Data(42);
print(d.share);
d→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_d = new Data (42) ;
Output: Trace: _1_d = Data { x: 42 }
Output: Trace: print(_1_d . share) ;
Output: -----> shared [_1_d] Data { x: 42 }
Output: Trace: _1_d → ;
Output: Trace: exit Main.main => Data { x: 42 }
Result: Ok: Data { x: 42 }
Alloc 0x07: [Int(42)]"#]]
);
Sharing a place containing independently shared data retains that ownership:
crate::assert_interpret_only!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let d = new Data(42);
let s = d→.share;
s.share;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_d = new Data (42) ;
Output: Trace: _1_d = Data { x: 42 }
Output: Trace: let _1_s = _1_d → . share ;
Output: Trace: _1_s = shared Data { x: 42 }
Output: Trace: _1_s . share ;
Output: Trace: exit Main.main => shared Data { x: 42 }
Result: Ok: shared Data { x: 42 }
Alloc 0x07: [Int(42)]"#]]
);
For inline data, the interpreter copies the fields. The result type carries the shared permission; nested boxed fields receive the ownership treatment shown above.
Sharing a value
expr.share, when the operand is a value expression, shares the evaluated
value. To give an existing place’s value and share it independently, write
d→.share. Bare d.share instead shares the place.
The value operation applies shared[] to the result type and changes owned
boxed handles from Given to SharedOwned. It does not create a second handle,
so it does not increment refcounts. Already shared handles need no conversion.
Sharing does not invent ownership of data reached through SharedPlace or a
mutable lease; dependencies in the inner type remain relevant.
The operation visits nested fields:
crate::assert_interpret_only!(
r#"
struct Inner { x: Int; }
struct Outer { inner: Inner; }
struct Main {
fn main(given self) → Outer {
let o = new Outer(new Inner(1));
o→.share;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_o = new Outer (new Inner (1)) ;
Output: Trace: _1_o = Outer { inner: Inner { x: 1 } }
Output: Trace: _1_o → . share ;
Output: Trace: exit Main.main => shared Outer { inner: Inner { x: 1 } }
Result: Ok: shared Outer { inner: Inner { x: 1 } }
Alloc 0x06: [Int(1)]"#]]
);
Inline fields have no flags to flip. Their permissions follow the result type; owned boxed fields encountered during traversal are converted to shared ownership.
Dropping a place
Dropping releases any ownership held at a place:
| Effective permission | Behavior |
|---|---|
| Unique ownership | Run cleanup, drop owned fields, and uninitialize |
| Independent shared ownership | Release owning handles, decrementing refcounts |
| Sharing from a place or a mutable lease | Leave the origin’s data intact |
Dropping a place-dependent shared view does not drop its origin:
crate::assert_interpret!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → () {
let d = new Data(42);
let r = d.share;
drop r;
print(r→);
();
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_d = new Data (42) ;
Output: Trace: _1_d = Data { x: 42 }
Output: Trace: let _1_r = _1_d . share ;
Output: Trace: _1_r = shared [_1_d] Data { x: 42 }
Output: Trace: drop _1_r ;
Output: Trace: print(_1_r →) ;
Output: -----> shared [_1_d] Data { x: 42 }
Output: Trace: () ;
Output: Trace: exit Main.main => ()
Result: Ok: ()"#]]
);
The example also records the model’s current behavior for explicitly dropping such a view: this place operation is a no-op, so the view can still be used. Frame cleanup separately clears temporary storage.
Mutably borrowing a place
place! creates a Lease(Pointer) word pointing at the place’s data. Its type
records ![place]. Traversing the lease grants mutable access to that data;
shared effective permissions reject mutable access. Dropping the lease does
not drop the origin’s value.
Conditionals
The if expression evaluates a condition and selects a branch. Since it
returns unit, these examples communicate a result through assignment:
crate::assert_interpret!(
r#"
struct Main {
fn main(given self) → Int {
let result = 0;
if true { result = 42; } else { result = 0; };
result→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_result = 0 ;
Output: Trace: _1_result = 0
Output: Trace: if true { _1_result = 42 ; } else { _1_result = 0 ; } ;
Output: Trace: _1_result = 42 ;
Output: Trace: _1_result = 42
Output: Trace: _1_result → ;
Output: Trace: exit Main.main => 42
Result: Ok: 42
Alloc 0x08: [Int(42)]"#]]
);
crate::assert_interpret!(
r#"
struct Main {
fn main(given self) → Int {
let result = 0;
if false { result = 42; } else { result = 99; };
result→;
}
}
"#,
expect_test::expect![[r#"
Output: Trace: enter Main.main
Output: Trace: let _1_result = 0 ;
Output: Trace: _1_result = 0
Output: Trace: if false { _1_result = 42 ; } else { _1_result = 99 ; } ;
Output: Trace: _1_result = 99 ;
Output: Trace: _1_result = 99
Output: Trace: _1_result → ;
Output: Trace: exit Main.main => 99
Result: Ok: 99
Alloc 0x08: [Int(99)]"#]]
);
Arrays
Array[T] is the model’s heap-allocation primitive. Its two-word wrapper points
to a refcounted backing allocation:
Array[T] wrapper:
+-------------------+
| Flags(Given) |
| Pointer(alloc) |
+-------------------+
Backing allocation:
+-------------------+
| RefCount(1) |
| Capacity(n) |
| element 0 words |
| element 1 words |
| ... |
+-------------------+
Each element occupies size_of(T) words. An inline Data { x: Int } element
occupies one integer word, just like Int; an element that is itself boxed has
its own flags and pointer wrapper. Element types come from the array’s type,
not from tags stored in the backing allocation.
Creating and accessing arrays
The built-in operations are:
array_new[T](n)allocates capacity forninitially uninitialized elements.array_write[T, P](a, i, v)writes an element through mutable permissionP.array_give[T, P, Q](a, i)gives an element with permissionPthrough array permissionQ.array_drop[T, P, Q](a, from, to)drops a range of elements through array permissionQ, with element permissionP.array_capacity[T, P](a)returns the capacity through array permissionP.
The program supplies the generic arguments explicitly. For example,
array_write[Int, ![a]](a!, 0, 10) writes through a mutable lease of a.
crate::assert_interpret_only!(
r#"
struct Main {
fn main(given self) → Int {
let a = array_new[Int](3);
array_write[Int, ![a]](a!, 0, 10);
array_write[Int, ![a]](a!, 1, 20);
array_write[Int, ![a]](a!, 2, 30);
print(array_give[Int, given, shared[a]](a.share, 0));
print(array_give[Int, given, shared[a]](a.share, 1));
array_give[Int, given, given](a→, 2);
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, ⚡, ⚡, ⚡ }
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 0 , 10) ;
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 1 , 20) ;
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 2 , 30) ;
Output: Trace: print(array_give [Int, given, shared [_1_a]](_1_a . share , 0)) ;
Output: -----> 10
Output: Trace: print(array_give [Int, given, shared [_1_a]](_1_a . share , 1)) ;
Output: -----> 20
Output: Trace: array_give [Int, given, given](_1_a → , 2) ;
Output: Trace: exit Main.main => 30
Result: Ok: 30
Alloc 0x1c: [Int(30)]"#]]
);
Duplicating or moving elements
Giving an Int element duplicates its value:
crate::assert_interpret_only!(
r#"
struct Main {
fn main(given self) → Int {
let a = array_new[Int](1);
array_write[Int, ![a]](a!, 0, 42);
let x = array_give[Int, given, shared[a]](a.share, 0);
let y = array_give[Int, given, shared[a]](a.share, 0);
print(x→);
y→;
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, ⚡ }
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 0 , 42) ;
Output: Trace: let _1_x = array_give [Int, given, shared [_1_a]](_1_a . share , 0) ;
Output: Trace: _1_x = 42
Output: Trace: let _1_y = array_give [Int, given, shared [_1_a]](_1_a . share , 0) ;
Output: Trace: _1_y = 42
Output: Trace: print(_1_x →) ;
Output: -----> 42
Output: Trace: _1_y → ;
Output: Trace: exit Main.main => 42
Result: Ok: 42
Alloc 0x14: [Int(42)]"#]]
);
The array’s effective permissions propagate to element accesses. Access through
an independently shared array duplicates elements and accounts for any nested
owning boxed handles, even if a nested handle’s stored flag is Given:
// Shared array: class elements are accessed with shared semantics —
// giving an element produces a shared copy, element remains available.
crate::assert_interpret_only!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let a = array_new[Data](1);
array_write[Data, ![a]](a!, 0, new Data(42));
let s = a→.share;
let x = array_give[Data, shared, shared[s]](s.share, 0);
print(x→);
// Element still available — shared, no move.
array_give[Data, shared, shared](s→, 0);
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, Data { x: ⚡ } }
Output: Trace: array_write [Data, ! [_1_a]](_1_a ! , 0 , new Data (42)) ;
Output: Trace: let _1_s = _1_a → . share ;
Output: Trace: _1_s = shared Array { flag: SharedOwned, rc: 1, Data { x: 42 } }
Output: Trace: let _1_x = array_give [Data, shared, shared [_1_s]](_1_s . share , 0) ;
Output: Trace: _1_x = shared Data { x: 42 }
Output: Trace: print(_1_x →) ;
Output: -----> shared Data { x: 42 }
Output: Trace: array_give [Data, shared, shared](_1_s → , 0) ;
Output: Trace: exit Main.main => shared Data { x: 42 }
Result: Ok: shared Data { x: 42 }
Alloc 0x15: [Int(42)]"#]]
);
This is the same permission propagation used for fields. Inline struct elements can be duplicated repeatedly through shared access:
crate::assert_interpret_only!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Data {
let a = array_new[Data](2);
array_write[Data, ![a]](a!, 0, new Data(42));
array_write[Data, ![a]](a!, 1, new Data(99));
print(array_give[Data, given, shared[a]](a.share, 0));
array_give[Data, given, given](a→, 1);
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, Data { x: ⚡ }, Data { x: ⚡ } }
Output: Trace: array_write [Data, ! [_1_a]](_1_a ! , 0 , new Data (42)) ;
Output: Trace: array_write [Data, ! [_1_a]](_1_a ! , 1 , new Data (99)) ;
Output: Trace: print(array_give [Data, given, shared [_1_a]](_1_a . share , 0)) ;
Output: -----> Data { x: 42 }
Output: Trace: array_give [Data, given, given](_1_a → , 1) ;
Output: Trace: exit Main.main => Data { x: 99 }
Result: Ok: Data { x: 99 }
Alloc 0x16: [Int(99)]"#]]
);
Sharing and reference counting
A new array has a Given handle and refcount one. a→.share converts the handle
to SharedOwned without changing that count. Duplicating the independently
shared handle increments it:
crate::assert_interpret_only!(
r#"
struct Main {
fn main(given self) → Int {
let a = array_new[Int](2);
array_write[Int, ![a]](a!, 0, 10);
array_write[Int, ![a]](a!, 1, 20);
let s = a→.share;
let b = s→;
drop s;
print(array_give[Int, given, shared[b]](b.share, 0));
array_give[Int, given, shared](b→, 1);
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, ⚡, ⚡ }
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 0 , 10) ;
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 1 , 20) ;
Output: Trace: let _1_s = _1_a → . share ;
Output: Trace: _1_s = shared Array { flag: SharedOwned, rc: 1, 10, 20 }
Output: Trace: let _1_b = _1_s → ;
Output: Trace: _1_b = shared Array { flag: SharedOwned, rc: 2, 10, 20 }
Output: Trace: drop _1_s ;
Output: Trace: print(array_give [Int, given, shared [_1_b]](_1_b . share , 0)) ;
Output: -----> 10
Output: Trace: array_give [Int, given, shared](_1_b → , 1) ;
Output: Trace: exit Main.main => 20
Result: Ok: 20
Alloc 0x19: [Int(20)]"#]]
);
In this example, let b = s→ creates the second owning handle. Dropping s
decrements the count to one; b keeps the backing allocation alive.
The implementation distinguishes conversion from duplication:
and_convert_given_to_sharedchanges ownership flags during value sharing.and_copy_shared_fieldsaccounts for duplication of owning boxed handles.and_share_fields_owned_elsewherehandles place sharing: it producesSharedPlacefrom unique handles, but increments the count when duplicating an existingSharedOwnedhandle.
Reference counts track owning handles, not every shared access to a place.
Uniquely owned arrays
Without value sharing, giving an array transfers its ownership:
crate::assert_interpret_only!(
r#"
struct Main {
fn main(given self) → Int {
let a = array_new[Int](2);
array_write[Int, ![a]](a!, 0, 10);
array_write[Int, ![a]](a!, 1, 20);
let b = a→;
array_give[Int, given, given](b→, 0);
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, ⚡, ⚡ }
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 0 , 10) ;
Output: Trace: array_write [Int, ! [_1_a]](_1_a ! , 1 , 20) ;
Output: Trace: let _1_b = _1_a → ;
Output: Trace: _1_b = Array { flag: Given, rc: 1, 10, 20 }
Output: Trace: array_give [Int, given, given](_1_b → , 0) ;
Output: Trace: exit Main.main => 10
Result: Ok: 10
Alloc 0x12: [Int(10)]"#]]
);
let b = a→ moves the uniquely owned array, leaving a uninitialized.
Dropping arrays
Releasing the final owning handle drops initialized elements and frees the backing allocation:
crate::assert_interpret_only!(
r#"
struct Data { x: Int; }
struct Main {
fn main(given self) → Int {
let a = array_new[Data](2);
array_write[Data, ![a]](a!, 0, new Data(1));
array_write[Data, ![a]](a!, 1, new Data(2));
drop a;
0;
}
}
"#,
expect_test::expect ;
Output: Trace: _1_a = Array { flag: Given, rc: 1, Data { x: ⚡ }, Data { x: ⚡ } }
Output: Trace: array_write [Data, ! [_1_a]](_1_a ! , 0 , new Data (1)) ;
Output: Trace: array_write [Data, ! [_1_a]](_1_a ! , 1 , new Data (2)) ;
Output: Trace: drop _1_a ;
Output: Trace: 0 ;
Output: Trace: exit Main.main => 0
Result: Ok: 0
Alloc 0x11: [Int(0)]"#]]
);
The model represents freed storage with Uninitialized words. The final heap
snapshot contains only the result integer, with no live array allocation.