Skip to content

Commit b9b381a

Browse files
committed
Update satisfiability-semantics.txt
1 parent c2762e3 commit b9b381a

1 file changed

Lines changed: 77 additions & 34 deletions

File tree

bench/cardano-recon-framework/docs/satisfiability-semantics.txt

Lines changed: 77 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,87 @@
22
-------- Satisfiability rules of formulas (assuming a background first-order logic) ------
33
------------------------------------------------------------------------------------------
44

5+
Integer terms: t ::= k·x | c | t₁ + t₂ (k, c ∈ ℤ, x ∈ Var)
6+
Binary relations: rel ∈ {=, <, ≤, >, ≥}
7+
Text terms: s ::= x | v (x ∈ Var, v ∈ Text)
8+
59
∅ ⊧ φ
6-
(∅ ⊧ A ty c̄) ⇔ ⊥
7-
(∅ ⊧ ◯ (φ ∨ ψ)) ⇔ (∅ ⊧ ◯ φ) ∨ (∅ ⊧ ◯ ψ)
8-
(∅ ⊧ ◯ (φ ∧ ψ)) ⇔ (∅ ⊧ ◯ φ) ∧ (∅ ⊧ ◯ ψ)
9-
(∅ ⊧ ◯ (φ ⇒ ψ)) ⇔ (∅ ⊧ ◯ φ) ⇒ (∅ ⊧ ◯ ψ)
10-
(∅ ⊧ ◯ (¬ φ)) ⇔ ¬ (∅ ⊧ ◯ φ)
11-
(∅ ⊧ ◯ ⊥) ⇔ ⊥
12-
(∅ ⊧ ◯ ⊤) ⇔ ⊤
13-
(∅ ⊧ ◯ (t = v)) ⇔ t = v
14-
(∅ ⊧ ◯ (ty c̄)) ⇔ ⊥
15-
(∅ ⊧ ◯ (◯ φ)) ⇔ (∅ ⊧ ◯ φ)
16-
(∅ ⊧ ◯ (◯ᵏ φ)) ⇔ (∅ ⊧ ◯ φ)
17-
(∅ ⊧ ◯ (☐ ᪲ φ)) ⇔ (∅ ⊧ ◯ φ)
18-
(∅ ⊧ ◯ (♢⁰ φ)) ⇔ ⊥
19-
(∅ ⊧ ◯ (♢¹⁺ᵏ φ)) ⇔ (∅ ⊧ ◯ (φ ∨ ◯ (♢ᵏ φ))) ⇔ ... ⇔ (∅ ⊧ ◯ φ)
20-
(∅ ⊧ ◯ (☐⁰ φ)) ⇔ ⊤
21-
(∅ ⊧ ◯ (☐¹⁺ᵏ φ)) ⇔ (∅ ⊧ ◯ (φ ∧ ◯ (☐ᵏ φ))) ⇔ ... ⇔ (∅ ⊧ ◯ φ)
22-
(∅ ⊧ ◯ (φ |⁰ ψ)) ⇔ ⊤
23-
(∅ ⊧ ◯ (φ |¹⁺ᵏ ψ)) ⇔ (∅ ⊧ ◯ (...))
10+
(∅ ⊧ ty c̄) ⇔ ⊥
11+
(∅ ⊧ ◯ (φ ∨ ψ)) ⇔ (∅ ⊧ ◯ φ) ∨ (∅ ⊧ ◯ ψ)
12+
(∅ ⊧ ◯ (φ ∧ ψ)) ⇔ (∅ ⊧ ◯ φ) ∧ (∅ ⊧ ◯ ψ)
13+
(∅ ⊧ ◯ (φ ⇒ ψ)) ⇔ (∅ ⊧ ◯ φ) ⇒ (∅ ⊧ ◯ ψ)
14+
(∅ ⊧ ◯ (¬ φ)) ⇔ ¬ (∅ ⊧ ◯ φ)
15+
(∅ ⊧ ◯ ⊥) ⇔ ⊥
16+
(∅ ⊧ ◯ ⊤) ⇔ ⊤
17+
(∅ ⊧ ◯ (t rel t')) ⇔ t rel t' (Presburger atom; t, t' closed integer terms)
18+
(∅ ⊧ ◯ (s = v)) ⇔ s = v (closed text equality)
19+
(∅ ⊧ ◯ (ty c̄)) ⇔ ⊥
20+
(∅ ⊧ ◯ (◯ φ)) ⇔ (∅ ⊧ ◯ φ)
21+
(∅ ⊧ ◯ (◯ᵏ φ)) ⇔ (∅ ⊧ ◯ φ)
22+
(∅ ⊧ ◯ (☐ ᪲ φ)) ⇔ (∅ ⊧ ◯ φ)
23+
(∅ ⊧ ◯ (♢⁰ φ)) ⇔ ⊥
24+
(∅ ⊧ ◯ (♢¹⁺ᵏ φ)) ⇔ (∅ ⊧ ◯ (φ ∨ ◯ (♢ᵏ φ))) ⇔ ... ⇔ (∅ ⊧ ◯ φ)
25+
(∅ ⊧ ◯ (☐⁰ φ)) ⇔ ⊤
26+
(∅ ⊧ ◯ (☐¹⁺ᵏ φ)) ⇔ (∅ ⊧ ◯ (φ ∧ ◯ (☐ᵏ φ))) ⇔ ... ⇔ (∅ ⊧ ◯ φ)
27+
(∅ ⊧ ◯ (φ |⁰ ψ)) ⇔ ⊤
28+
(∅ ⊧ ◯ (φ |¹⁺ᵏ ψ)) ⇔ (∅ ⊧ ◯ (...))
29+
(∅ ⊧ ◯ (∀x : ℤ. φ)) ⇔ ∀x : ℤ. (∅ ⊧ ◯ φ)
30+
(∅ ⊧ ◯ (∃x : ℤ. φ)) ⇔ ∃x : ℤ. (∅ ⊧ ◯ φ)
31+
(∅ ⊧ ◯ (∀(x ∈ v̄) : ℤ. φ)) ⇔ ∀(x ∈ v̄). (∅ ⊧ ◯ φ)
32+
(∅ ⊧ ◯ (∃(x ∈ v̄) : ℤ. φ)) ⇔ ∃(x ∈ v̄). (∅ ⊧ ◯ φ)
33+
(∅ ⊧ ◯ (∀x : Text. φ)) ⇔ ∀x : Text. (∅ ⊧ ◯ φ)
34+
(∅ ⊧ ◯ (∃x : Text. φ)) ⇔ ∃x : Text. (∅ ⊧ ◯ φ)
35+
(∅ ⊧ ◯ (∀(x ∈ v̄) : Text. φ)) ⇔ ∀(x ∈ v̄). (∅ ⊧ ◯ φ)
36+
(∅ ⊧ ◯ (∃(x ∈ v̄) : Text. φ)) ⇔ ∃(x ∈ v̄). (∅ ⊧ ◯ φ)
2437

2538

2639
t t̄ ⊧ φ
27-
(_ t̄ ⊧ ◯ φ) ⇔ (t̄ ⊧ φ)
28-
(e _ ⊧ p c̄) ⇔ c̄ ⊆ props e if ty e = p
29-
⊥ otherwise, where
40+
(_ t̄ ⊧ ◯ φ) ⇔ (t̄ ⊧ φ)
41+
(e _ ⊧ ty c̄) ⇔ ⋀_{c ∈ c̄} match(e, ty, c) if ty e = ty
42+
⊥ otherwise, where
43+
44+
match(e, ty, key = t : ℤ) ≜ t = intProps(e, ty)[key] (yields PropIntBinRel Eq)
45+
match(e, ty, key = s : Text) ≜ s = textProps(e, ty)[key] (yields PropTextEq)
46+
47+
The resulting constraints carry no temporal operators and are resolved in the
48+
connective & event property fragment below.
3049

31-
∅ ⊆ P ⇔ ⊤
32-
{x = t} ⊔ c̄ ⊆ P ⇔ t = P(x) ∧ c̄ ⊆ P if P(x) is defined
33-
⊥ otherwise
3450

3551
t̄ ⊧ φ // connective & event property fragments
36-
(t̄ ⊧ ∀x. φ) ⇔ (∀x. (t̄ ⊧ φ))
37-
(t̄ ⊧ ∀(x ∈ v̄). φ) ⇔ (∀(x ∈ v̄). (t̄ ⊧ φ))
38-
(t̄ ⊧ ∃x. φ) ⇔ (∃x. (t̄ ⊧ φ))
39-
(t̄ ⊧ ∃(x ∈ v̄). φ) ⇔ (∃(x ∈ v̄). (t̄ ⊧ φ))
40-
(t̄ ⊧ φ ∨ ψ) ⇔ ((t̄ ⊧ φ) ∨ (t̄ ⊧ ψ))
41-
(t̄ ⊧ φ ∧ ψ) ⇔ ((t̄ ⊧ φ) ∧ (t̄ ⊧ ψ))
42-
(t̄ ⊧ φ ⇒ ψ) ⇔ ((t̄ ⊧ φ) ⇒ (t̄ ⊧ ψ))
43-
(t̄ ⊧ ¬ φ) ⇔ ¬ (t̄ ⊧ φ)
44-
(t̄ ⊧ ⊥) ⇔ ⊥
45-
(t̄ ⊧ ⊤) ⇔ ⊤
52+
// Quantifiers
53+
(t̄ ⊧ ∀x : ℤ. φ) ⇔ ∀x : ℤ. (t̄ ⊧ φ) // decided by Cooper's QE
54+
(t̄ ⊧ ∃x : ℤ. φ) ⇔ ∃x : ℤ. (t̄ ⊧ φ) // decided by Cooper's QE
55+
(t̄ ⊧ ∀(x ∈ v̄) : ℤ. φ) ⇔ ⋀_{v ∈ v̄} (t̄ ⊧ φ[v/x])
56+
(t̄ ⊧ ∃(x ∈ v̄) : ℤ. φ) ⇔ ⋁_{v ∈ v̄} (t̄ ⊧ φ[v/x])
57+
(t̄ ⊧ ∀x : Text. φ) ⇔ ∀x : Text. (t̄ ⊧ φ) // see note on text quantifiers below
58+
(t̄ ⊧ ∃x : Text. φ) ⇔ ∃x : Text. (t̄ ⊧ φ) // see note on text quantifiers below
59+
(t̄ ⊧ ∀(x ∈ v̄) : Text. φ) ⇔ ⋀_{v ∈ v̄} (t̄ ⊧ φ[v/x])
60+
(t̄ ⊧ ∃(x ∈ v̄) : Text. φ) ⇔ ⋁_{v ∈ v̄} (t̄ ⊧ φ[v/x])
61+
// Connectives
62+
(t̄ ⊧ φ ∨ ψ) ⇔ (t̄ ⊧ φ) ∨ (t̄ ⊧ ψ)
63+
(t̄ ⊧ φ ∧ ψ) ⇔ (t̄ ⊧ φ) ∧ (t̄ ⊧ ψ)
64+
(t̄ ⊧ φ ⇒ ψ) ⇔ (t̄ ⊧ φ) ⇒ (t̄ ⊧ ψ)
65+
(t̄ ⊧ ¬ φ) ⇔ ¬ (t̄ ⊧ φ)
66+
(t̄ ⊧ ⊥) ⇔ ⊥
67+
(t̄ ⊧ ⊤) ⇔ ⊤
68+
// Atoms
69+
(t̄ ⊧ t rel t') ⇔ t rel t' (Presburger arithmetic; decided by Cooper's QE)
70+
(t̄ ⊧ s = v) ⇔ s = v (text equality)
71+
72+
73+
Notes on decision procedures
74+
// Integer arithmetic — Presburger (Cooper's QE):
75+
// Any closed formula built from t rel t', ∧, ∨, ¬, ⇒, ∀x : ℤ, ∃x : ℤ is decidable.
76+
// Cooper's quantifier-elimination algorithm eliminates each quantifier in turn,
77+
// reducing the formula to a ground arithmetic sentence, then evaluating it.
78+
//
79+
// Text quantifiers — finite enumeration with placeholder:
80+
// Since text variables only appear in equalities (s = v), the truth of ∀x : Text. φ
81+
// depends only on which concrete values x is compared to inside φ.
82+
// Let {v₁, ..., vₙ} be all text constants that x is tested against in φ. Then:
83+
//
84+
// (t̄ ⊧ ∀x : Text. φ) ⇔ (t̄ ⊧ φ[☐/x]) ∧ (t̄ ⊧ φ[v₁/x]) ∧ ... ∧ (t̄ ⊧ φ[vₙ/x])
85+
// (t̄ ⊧ ∃x : Text. φ) ⇔ (t̄ ⊧ φ[☐/x]) ∨ (t̄ ⊧ φ[v₁/x]) ∨ ... ∨ (t̄ ⊧ φ[vₙ/x])
86+
//
87+
// where ☐ is a placeholder string distinct from all vᵢ, so (☐ = vᵢ) ≡ ⊥ for every i.
88+
// This is complete: any string x is either one of the vᵢ or some other string (covered by ☐).

0 commit comments

Comments
 (0)