proof/: all 23 Isabelle theory files now verify under Isabelle2025-2

Isabelle toolchain replaced (was genuinely 2011, 14+ years stale) and every
theory file fixed to actually compile -- most had apparently never been
checked under a working Isabelle at all. Fixed the vm_state self-reference
in StarForth_Base.thy properly (word_table is now a free-standing global
constant, not a circular record field), corrected the word_physics_transparent
axiom (was claiming full state equality from mere exec-equivalence, provably
too strong), and worked through 14 years of HOL-Library drift plus several
missing-hypothesis bugs across the physics-loop and ACL theories.

Two genuine (non-tactical) bugs found and left oops-flagged rather than
silently resolved: forth_roll's index arithmetic disagrees with both its own
test lemma and the real C ROLL implementation (three-way inconsistency), and
pm_wf isn't actually preserved by pm_record_hit/pm_record_miss. Both need a
decision, not a proof-script fix.

Full writeup in FABRIC-2.md item 5.2.
This commit is contained in:
Robert Allan James
2026-08-13 12:30:30 -04:00
parent 5787718c30
commit 422ef2fa29
20 changed files with 561 additions and 198 deletions
+9 -5
View File
@@ -2,6 +2,10 @@ theory StarForth_Logical_Words
imports StarForth_Base
begin
(* AND/OR/XOR infix notation moved behind an opt-in bundle at some point
after 2011 -- unbundled by default now. Same fix as StarForth_Q48_16.thy. *)
unbundle bit_operations_syntax
(* =========================================================================
POST-03: Logical and Comparison Words
Mirrors: src/word_source/logical_words.c
@@ -194,13 +198,13 @@ lemma zero_lt_negative:
assumes "data_stack vm = n # xs"
assumes "n < 0"
shows "data_stack (forth_zero_lt vm) = (-1) # xs"
by (simp add: forth_zero_lt_def to_forth_bool_def forth_true_def assms)
using assms by (auto simp: forth_zero_lt_def to_forth_bool_def forth_true_def)
lemma zero_lt_nonneg:
assumes "data_stack vm = n # xs"
assumes "n \<ge> 0"
shows "data_stack (forth_zero_lt vm) = 0 # xs"
by (simp add: forth_zero_lt_def to_forth_bool_def forth_false_def assms)
using assms by (auto simp: forth_zero_lt_def to_forth_bool_def forth_false_def)
lemma zero_lt_underflow:
assumes "data_stack vm = []"
@@ -220,13 +224,13 @@ lemma zero_gt_positive:
assumes "data_stack vm = n # xs"
assumes "n > 0"
shows "data_stack (forth_zero_gt vm) = (-1) # xs"
by (simp add: forth_zero_gt_def to_forth_bool_def forth_true_def assms)
using assms by (auto simp: forth_zero_gt_def to_forth_bool_def forth_true_def)
lemma zero_gt_nonpos:
assumes "data_stack vm = n # xs"
assumes "n \<le> 0"
shows "data_stack (forth_zero_gt vm) = 0 # xs"
by (simp add: forth_zero_gt_def to_forth_bool_def forth_false_def assms)
using assms by (auto simp: forth_zero_gt_def to_forth_bool_def forth_false_def)
lemma zero_gt_underflow:
assumes "data_stack vm = []"
@@ -270,7 +274,7 @@ lemma eq_symmetric:
assumes "data_stack vm = n2 # n1 # rest"
assumes "data_stack vm' = n1 # n2 # rest"
shows "data_stack (forth_eq vm) = data_stack (forth_eq vm')"
by (simp add: forth_eq_def assms)
by (simp add: forth_eq_def assms eq_commute)
lemma eq_underflow_nil:
assumes "data_stack vm = []"