Skip to content

Commit b0fa012

Browse files
committed
Decompose Max/MinInterval to avoid CHOOSE in one-liner BY
THEOREM MaxInterval and THEOREM MinInterval in FiniteSetsExtTheorems_proofs were both discharged by a single BY DEF Max (resp. BY DEF Min) After unfolding, the obligation contains the raw CHOOSE that defines Max/Min, e.g. (CHOOSE x \in a..b : \A y \in a..b : x >= y) = b To close that in one shot, a backend has to reason about CHOOSE uniqueness while simultaneously doing arithmetic on the interval a..b. Zenon has very limited support for CHOOSE and reported "exhausted search space" with the macOS arm64 build of TLAPS 1.6.0-pre, while another bundled prover happened to find the proof on Linux. Either way, relying on a CHOOSE-savvy backend for these two facts is fragile across tlapm builds. Rewrite both proofs to go through the existing MaxInt / MinInt introduction rules of the same module, which already hide the CHOOSE behind ASSUME S \in SUBSET Int, x \in S, \A y \in S : x >= y PROVE Max(S) = x interface. Each new proof supplies the two trivial arithmetic side conditions (b \in a..b and \A y \in a..b : b >= y, and the symmetric pair for Min) so that no backend ever sees the CHOOSE. All 419 obligations of FiniteSetsExtTheorems_proofs continue to check locally with `tlapm --cleanfp`. [Proofs] Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
1 parent 4d49b1f commit b0fa012

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

modules/FiniteSetsExtTheorems_proofs.tla

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,11 @@ THEOREM MaxIntBounded ==
550550
THEOREM MaxInterval ==
551551
ASSUME NEW a \in Int, NEW b \in Int, a <= b
552552
PROVE Max(a..b) = b
553-
BY DEF Max
553+
<1>1. b \in a..b
554+
OBVIOUS
555+
<1>2. \A y \in a..b : b >= y
556+
OBVIOUS
557+
<1>. QED BY <1>1, <1>2, MaxInt
554558

555559
THEOREM MinInt ==
556560
ASSUME NEW S \in SUBSET Int, NEW x \in S, \A y \in S : x <= y
@@ -605,7 +609,11 @@ THEOREM MinIntBounded ==
605609
THEOREM MinInterval ==
606610
ASSUME NEW a \in Int, NEW b \in Int, a <= b
607611
PROVE Min(a..b) = a
608-
BY DEF Min
612+
<1>1. a \in a..b
613+
OBVIOUS
614+
<1>2. \A y \in a..b : a <= y
615+
OBVIOUS
616+
<1>. QED BY <1>1, <1>2, MinInt
609617

610618
THEOREM MinNat ==
611619
ASSUME NEW S \in SUBSET Nat, S # {}

0 commit comments

Comments
 (0)