rocq/theories/HelloReach.v
Reference closure of the linked GNU Hello image, including function addresses passed as callbacks and symbols stored in data. This checks the image we run, not preservation of the original object collection: pruning is trusted, checked by link.pl's own reachability traversal.
Every global or initializer symbol below a term, following the same reference forms as link.pl; a callback address is not just a call.
The linked image's named items and all their outgoing references, computed once rather than unfolding its large bodies in proofs.
Static reachability from main follows all references, not just direct calls, so registration and data initialization cannot hide an edge.
External data imports may be supplied by startup, unlike function imports, which hello_linked requires to stay outside the globals.
Classification uses actual decoded functions and allocated globals; no missing definition is silently treated as an arbitrary import.
Every edge in the image ends at a definition or an enumerated libc import, including edges originating in data rather than code.
Explore proof 2 tactics
Initial goal
vm_compute
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Every statically reachable symbol is a decoded function, allocated module symbol, external function import, or external data import.
Explore proof 35 tactics
Initial goal
intro Hreach
assert Hok : hello_reference_okn = true
2 openfocused goal
{destruct Hreach as | source refs target Hsource Hedge Hin
3 openfocused goal
deferred goal
–vm_compute
3 opendeferred goal
deferred goal
reflexivity
2 opendeferred goal
deferred goal
–pose proof hello_edges_closed as Hclosed
2 opendeferred goal
apply forallb_forall with x := source, refs in Hclosed ; | exact Hedge
2 opendeferred goal
apply forallb_forall with x := target in Hclosed ; exact Hclosed | exact Hin
deferred goal
unfold hello_reference_ok in Hok
destruct find_directn hello_module as f | outside_name | eqn: Hfn
3 openfocused goal
focused goal
–left
3 opendeferred goal
deferred goal
exists f
3 opendeferred goal
deferred goal
reflexivity
2 opendeferred goal
deferred goal
–right
2 opendeferred goal
destruct lookupn hello_globals as p | eqn: Hp
3 openfocused goal
deferred goal
+left
3 opendeferred goal
deferred goal
exists p
3 opendeferred goal
deferred goal
reflexivity
2 opendeferred goal
deferred goal
+right
2 opendeferred goal
destruct n as z | s | tag args | items ; try discriminate Hok
2 opendeferred goal
exists s
2 opendeferred goal
split ; reflexivity |
2 opendeferred goal
apply orb_true_iff
2 opendeferred goal
exact Hok
deferred goal
–right
destruct lookupn hello_globals as p | eqn: Hp
2 openfocused goal
+left
2 opendeferred goal
exists p
2 opendeferred goal
reflexivity
deferred goal
+right
destruct n as z | s | tag args | items ; try discriminate Hok
exists s
split ; reflexivity |
apply orb_true_iff
exact Hok
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A direct call has a decoded body or names one of the enumerated external functions; a data import can never discharge this check.
All calls in the decoded image meet the function-only classification, independently of whether a particular control-flow path is taken.
Explore proof 2 tactics
Initial goal
vm_compute
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Every call target of a module function is defined in the module or is a libc function import. This also covers code reached by callback.
Explore proof 17 tactics
Initial goal
intros Hf Hn
pose proof hello_calls_closed as Hall
apply forallb_forall with x := IFuncf in Hall ; | exact Hf
apply forallb_forall with x := n in Hall ; | exact Hn
unfold hello_call_ok in Hall
destruct find_directn hello_module as body | outside_name | eqn: Hfn
3 openfocused goal
focused goal
–left
3 opendeferred goal
deferred goal
exists body
3 opendeferred goal
deferred goal
reflexivity
2 opendeferred goal
deferred goal
–right
2 opendeferred goal
destruct n as z | s | tag args | items ; try discriminate Hall
2 opendeferred goal
exists s
2 opendeferred goal
split ; reflexivity | exact Hall
deferred goal
–right
destruct n as z | s | tag args | items ; try discriminate Hall
exists s
split ; reflexivity | exact Hall
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
A reference with neither a function definition nor a module symbol is explicitly imported; the image cannot refer to an unlisted name.
Explore proof 9 tactics
Initial goal
intros Hr Hfn Hp
destruct hello_reachable_closedn Hr as Hbody | Hglobal | Himport
3 openfocused goal
focused goal
–destruct Hbody as f Hf
3 opendeferred goal
deferred goal
rewrite Hfn in Hf
3 opendeferred goal
deferred goal
discriminate Hf
2 opendeferred goal
deferred goal
–destruct Hglobal as p Hglobal
2 opendeferred goal
rewrite Hp in Hglobal
2 opendeferred goal
discriminate Hglobal
deferred goal
–exact Himport
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Runtime-specific linking keeps the image and its own symbol prefix fixed, leaving only actual libc data cells to the entry proof.
Module definitions take precedence over any startup data extension.
A data-only extension does not bind any external function import. Cell layout and initialized representation remain entry obligations.
Prefix lookup needs no uniqueness or disjointness premise: the actual association-list lookup deliberately chooses the module's binding.
Explore proof 4 tactics
Initial goal
intro Hp
change lookupn hello_globals ++ libc_globals = Somep
rewrite lookup_app , Hp
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The module itself never binds one of its external function imports.
Explore proof 7 tactics
Initial goal
intro Hs
assert Hall : forallbλs ⇒ match lookupTAtoms hello_globals with None ⇒ true _ ⇒ false end hello_externals = true by vm_compute ; reflexivity
apply existsb_exists in Hs as s′ & Hin & Heq
apply String.eqb_eq in Heq
subst s′
apply forallb_forall with x := s in Hall ; | exact Hin
destruct lookupTAtoms hello_globals ; discriminate Hall | reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
The constructed environment discharges the leaf proofs' full linking contract when startup supplies no external function binding.
Explore proof 11 tactics
Initial goal
intro Hdata
split ; reflexivity |
split
2 openfocused goal
–intros n p Hp
2 opendeferred goal
apply hello_global_agreement
2 opendeferred goal
exact Hp
deferred goal
–intros s Hs
change lookupTAtoms hello_globals ++ libc_globals = None
rewrite lookup_app , hello_function_imports_unbounds Hs
apply Hdata
exact Hs
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
No wrapper changes the runtime's free operation.
Explore proof 1 tactics
Initial goal
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
Function lookup reads only the module. This stronger agreement holds for every name, whether reachable, missing, or an external import.
Explore proof 4 tactics
Initial goal
intro Hmodule
unfold find_fn
rewrite Hmodule
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
In particular every reachable function definition is the exact body the linked environment dispatches, not a replacement with its name.
Explore proof 4 tactics
Initial goal
intros Hmodule Hreach Hfn
unfold find_fn
rewrite Hmodule , Hfn
reflexivity
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.
Source script
External function imports cannot become internal pointer targets in any environment satisfying the leaf proofs' linking contract.
Explore proof 5 tactics
Initial goal
intros Hmodule Hglobals Himports Hs
split
2 openfocused goal
–apply Himports
2 opendeferred goal
exact Hs
deferred goal
–apply hello_outside ; assumption
No remaining goals.
Qed
✓ Proof checked and closed by Rocq.