Closed nspin closed 4 months ago
Many thanks!
If you could add a regression test for this, that’d be great (it’s painful that this has lingered for 5 years!). I can do something super minimal based on your example above but if there are more test-cases that could be used, the tests would presumably be better still.
I'll add a selftest.exe
target which covers the test cases in https://github.com/HOL-Theorem-Prover/HOL/blob/develop/examples/l3-machine-code/arm/prog/arm_tests.sml. That set of test cases already includes some that were failing due to this bug.
Thanks for this. I didn't realise we had (sadly, unused) tests already...
Thanks for your work on this!
Having just tried the tests in arm_tests.sml
(running the harness in test.sml
), I get:
val failed = ["e1810f91", "e95d7ffc", "e95d7fff"]: string list
val l =
[[ [0w ≠ 1w, s.Architecture = ARMv7_A]
⊢ DecodeARM
(v2w
[T; T; T; F; F; F; F; T; T; F; F; F; F; F; F; T; F; F; F; F; T;
T; T; T; T; F; F; T; F; F; F; T])
(s with Encoding := Encoding_ARM) =
(Store (StoreExclusive (0w,1w,1w,0w)),
s with
<|CurrentCondition := 14w; Encoding := Encoding_ARM; undefined := F|>)],
[
[v2w [T; T; T; T; T; T; T; T; T; T; T; T; T; F; F] ≠ 0w,
s.Architecture = ARMv7_A]
⊢ DecodeARM
(v2w
[T; T; T; F; T; F; F; T; F; T; F; T; T; T; F; T; F; T; T; T; T;
T; T; T; T; T; T; T; T; T; F; F])
(s with Encoding := Encoding_ARM) =
(Load
(LoadMultipleUserRegisters
(F,F,13w,v2w [T; T; T; T; T; T; T; T; T; T; T; T; T; F; F])),
s with
<|CurrentCondition := 14w; Encoding := Encoding_ARM; undefined := F|>)],
[
[v2w [T; T; T; T; T; T; T; T; T; T; T; T; T; T; T] ≠ 0w,
s.Architecture = ARMv7_A]
⊢ DecodeARM
(v2w
[T; T; T; F; T; F; F; T; F; T; F; T; T; T; F; T; F; T; T; T; T;
T; T; T; T; T; T; T; T; T; T; T])
(s with Encoding := Encoding_ARM) =
(Load
(LoadMultipleUserRegisters
(F,F,13w,v2w [T; T; T; T; T; T; T; T; T; T; T; T; T; T; T])),
s with
<|CurrentCondition := 14w; Encoding := Encoding_ARM; undefined := F|>)]]:
thm list list
stateLib.spec
has been broken for certain ARM instructions since https://github.com/HOL-Theorem-Prover/HOL/commit/4875b1b60d4ee6357932f6ca7e384107130d1169 was merged. This PR fixes it.Before this PR:
After this PR: