Skip to content

Commit 66fe1a4

Browse files
hyperpolymathclaude
andcommitted
refactor(WokeLang): prove value_eq_dec constructively via decide equality
Replace bare Axiom with a Theorem proved by decide equality: - VInt: Z.eq_dec - VFloat: Req_EM_T (from Coq.Reals.Reals via total_order_T — uses classical real axioms already in scope, no new axioms introduced) - VString/VOops: String.string_dec - VBool: Bool.bool_dec - VArray: list_eq_dec with recursive IH from decide equality - VOkay: handled recursively by decide equality Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b52742a commit 66fe1a4

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

docs/proofs/verification/WokeLang.v

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,23 @@ Definition extend_type_env (x : string) (t : woke_type) (e : type_env) : type_en
120120
(* 2b. Value Equality (decidable) *)
121121
(* ========================================================================= *)
122122

123-
(** Decidable equality on values. We axiomatize this because Coq's real
124-
numbers (R) do not have decidable equality without classical axioms.
125-
In a computational setting, float equality would use IEEE comparison.
126-
The axiom is sound because all value constructors carry data with
127-
decidable equality in any concrete implementation. *)
128-
129-
Axiom value_eq_dec : forall (v1 v2 : value), {v1 = v2} + {v1 <> v2}.
123+
(** Decidable equality on values. Constructive proof:
124+
- VInt/VString/VBool/VOops: standard stdlib decidability.
125+
- VFloat (R): Req_EM_T from Coq.Reals.Reals (uses total_order_T,
126+
which relies on the classical axioms already imported for R).
127+
No new axioms are introduced beyond those implicit in Coq.Reals.
128+
- VArray: list_eq_dec with the recursive IH from decide equality.
129+
- VOkay: handled recursively by decide equality. *)
130+
Theorem value_eq_dec : forall (v1 v2 : value), {v1 = v2} + {v1 <> v2}.
131+
Proof.
132+
decide equality.
133+
- apply Z.eq_dec.
134+
- apply Req_EM_T.
135+
- apply String.string_dec.
136+
- apply Bool.bool_dec.
137+
- apply list_eq_dec; assumption.
138+
- apply String.string_dec.
139+
Qed.
130140

131141
(* ========================================================================= *)
132142
(* 3. Type Checking *)

0 commit comments

Comments
 (0)