Files
LithosAnanake/proof/ROOT
T
Robert Allan JamesandClaude Sonnet 5 fe3169dac9 proof/: add StarForth_String_Words.thy (BL/COUNT/CMOVE/CMOVE>/BLANK/-TRAILING/SCAN/SKIP/COMPARE)
Covers the 9 self-contained words in string_words.c that operate purely on
data_stack/memory with no dependency outside the existing model. Introduces
vm_addr_ok_m, a literal transcription of the real C vm_addr_ok bounds check
(src/vm.c:815-820) using VM_MEMORY_SIZE -- more precise than the sign-only
check earlier memory words used -- and resolve_span, a shared helper for
the auto-detect-counted-string pattern that recurs across six of this
file's words.

16 words deliberately not modeled, in three groups (full reasoning in the
theory header): (a) WORD/SPAN/TIB/>IN/SOURCE/QUERY/EXPECT depend on the
lazily-allocated TIB input subsystem (vm->tib_buf via vm_input_ensure),
which has no vm_state counterpart; QUERY/EXPECT also call fgets(stdin)
directly, real I/O with no HOL formalization; (b) CONVERT/NUMBER/ENCLOSE
depend on raw C-string scanning (strlen past a single vm_addr_ok-checked
byte -- a genuine unbounded-read hazard, noted not chased) or strtol(); (c)
S"/(s")/LITERAL/[LITERAL]/['] depend on the same compile-time/threaded-code
machinery already out of scope from control_words.c. SEARCH is deferred
despite being self-contained -- its nested substring search needs a bigger
proof-engineering lift than the single-pass helpers used here.

Third occurrence of the file-scope-static-instead-of-per-VM-field bug
pattern noted (WORD's word_scratch_addr), matching control_words.c's
cf_stack and dictionary_manipulation_words.c's state_variable -- not fixed,
flagged for aggregation when raised to Bob.

29 theory files verify with zero errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-13 22:58:18 -04:00

33 lines
953 B
Plaintext

session "StarForth" = "HOL-Library" +
description "Formal proofs of StarForth FORTH-79 primitive correctness and physics-loop invariants"
theories [document = false]
StarForth_Base
StarForth_Q48_16
StarForth_Stack_Words
StarForth_Double_Words
StarForth_Arithmetic_Words
StarForth_Mixed_Arithmetic_Words
StarForth_Logical_Words
StarForth_Return_Stack_Words
StarForth_Memory_Words
StarForth_Dictionary_Words
StarForth_Dictionary_Manipulation_Words
StarForth_Control_Words
StarForth_String_Words
StarForth_Mutex
StarForth_Transition
StarForth_Loop1_Heat
StarForth_Loop2_Window
StarForth_Loop3_Decay
StarForth_Loop4_Pipeline
StarForth_Loop5_WinInf
StarForth_Loop6_DecayInf
StarForth_Loop7_Heartrate
StarForth_Concurrent
StarForth_Correctness
ACL_Pin_Monotone
ACL_Inherit_Clears_Pin
ACL_TTL_Bounded
ACL_Emergency_Bypass
ACL_No_Escalation