extend source and target calculi with observable tick effects + add invariant checks for relation preservation and target arity/shape

This commit is contained in:
2026-04-27 12:51:47 +00:00
parent 7f024737cf
commit 31596491f0
18 changed files with 395 additions and 44 deletions
+13 -1
View File
@@ -57,6 +57,18 @@ let () =
assert_true
"expected strictness shift witness"
(strict.failure_mode = Audit.Strictness_shift);
let effect_audit = Audit.audit_case (find_case "effect-elision-breaks-observation") in
assert_true
"expected effect shift witness"
(effect_audit.failure_mode = Audit.Effect_shift);
assert_true
"expected unsafe effect rewrite to emit effect observation obligation"
(has_obligation Pipeline.Effect_observation effect_audit.compiled.obligations);
assert_true
"expected effect trace invariant failure"
(List.exists
(fun result -> result.Audit.kind = Audit.Effect_trace && not result.Audit.passed)
effect_audit.Audit.invariants);
let generated = Gen.sample_terms ~count:80 ~max_depth:4 () in
List.iter
(fun specimen ->
@@ -84,7 +96,7 @@ let () =
"expected unsupported worker-wrapper source shape to be rejected"
(fun () ->
Pipeline.compile
{ Pipeline.default_flags with unsafe_repr_eq = false; unsafe_strict_unroll = false }
{ Pipeline.default_flags with unsafe_repr_eq = false; unsafe_strict_unroll = false; unsafe_effect_drop = false }
(Types.TArrow (Types.TPair (Types.TInt, Types.TBool), Types.TPair (Types.TInt, Types.TBool)))
(Source.Lam
( "p",