Reasoning with Sets and Sums of Sets Markus Bender mbender@uni-koblenz.de Universität Koblenz-Landau
Motivation Ways for Reasoning with Complex Systems ◮ Introduce calculus/reasoner specifically tailored to the complex system ◮ Reduce complex system to an established problem (abstraction) 2 / 30
Motivation Ways for Reasoning with Complex Systems ◮ Introduce calculus/reasoner specifically tailored to the complex system ◮ Reduce complex system to an established problem (abstraction) 2 / 30
Motivation Boolean Algebra with Presburger Arithmetic ◮ Introduced by Kuncak et al. ◮ Transform to equisatisfiable problem in pure arithmetic ◮ Proven useful for many reasoning task ◮ Good tool support 3 / 30
Contributions Boolean Algebra with Presburger Arithmetic and Sums ◮ Add sum as new bridging function ◮ Arbitrary mixture of quantified and free set variables 4 / 30
Syntax F ::= A | F ∧ F | F ∨ F | ¬ F | ∃ x . F | ∀ x . F | ∃ k . F | ∀ k . F A ::= B ≈ B | B ⊆ B | T ≈ T | T < T | B ::= x | ∅ | U | B ∪ B | B ∩ B | B T ::= k | K | MAXC | T + T | K · T | card ( B ) K ::= . . . | − 2 | − 1 | 0 | 1 | 2 | . . . 5 / 30
Syntax F ::= A | F ∧ F | F ∨ F | ¬ F | ∃ x . F | ∀ x . F | ∃ k . F | ∀ k . F A ::= B ≈ B | B ⊆ B | T ≈ T | T < T | B ::= x | ∅ | U | B ∪ B | B ∩ B | B T ::= k | K | MAXC | T + T | K · T | card ( B ) | MAXS | sum ( B ) K ::= a number 5 / 30
Syntax F ::= A | F ∧ F | F ∨ F | ¬ F | ∃ x . F | ∀ x . F | ∃ k . F | ∀ k . F A ::= B ≈ B | B ⊆ B | T ≈ T | T < T | B ::= x | ∅ | U | B ∪ B | B ∩ B | B T ::= k | K | MAXC | T + T | K · T | card ( B ) | MAXS | sum ( B ) K ::= a number Sets are finite. 5 / 30
Extension BAPA card with sort: α set �→ N , where α : an arbitrary sort Specific members of the involved sets do not matter. 6 / 30
Extension BAPA card with sort: α set �→ N , where α : an arbitrary sort Specific members of the involved sets do not matter. BAPA S sum with sort: β set �→ β , where β : a numerical sort Specific members of the involved sets do matter. 6 / 30
Semantics Structures A := ( N , F , Ω A , Π A ) N : only codomain for card F : element support ; elements of sets ( F ⊆ R ) Ω A : (more or less) common semantics of functions Π A : common semantics of predicates 7 / 30
Overview Transformation: Original Formula (OF) 1. Eliminate ≈ set 2. Eliminate ⊆ Transformation 3. Introduce atomic decompositions Transformed Formula (TF) 4. Distribute cardinality 5. Purify cardinality Arith. Solver 6. Distribute sum Model for TF 7. Purify sum 8. Eliminate quantifiers and add axioms Model for OF 8 / 30
Example Given Formula ∃ x 1 ( x 0 ⊆ x 1 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) 9 / 30
Example Eliminate ≈ set , and eliminate ⊆ ∃ x 1 ( x 0 ⊆ x 1 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) 10 / 30
Example Eliminate ≈ set , and eliminate ⊆ ∃ x 1 ( x 0 ⊆ x 1 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) 10 / 30
Example Eliminate ≈ set , and eliminate ⊆ ∃ x 1 ( x 0 ⊆ x 1 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) � ∃ x 1 ( card ( x 0 ∩ x 1 ) ≈ 0 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) 10 / 30
Atomic Sets and Atomic Decompositions 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 1 Ohlbach, Kuncak 11 / 30
Atomic Sets and Atomic Decompositions 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 S 00 := x 0 ∩ x 1 , S 01 := x 0 ∩ x 1 , S 10 := x 0 ∩ x 1 , S 11 := x 0 ∩ x 1 1 Ohlbach, Kuncak 11 / 30
Atomic Sets and Atomic Decompositions 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 x 0 ∩ x 1 S 00 := x 0 ∩ x 1 , S 01 := x 0 ∩ x 1 , S 10 := x 0 ∩ x 1 , S 11 := x 0 ∩ x 1 x 0 := S 10 ∪ S 11 = ( x 0 ∩ x 1 ) ∪ ( x 0 ∩ x 1 ) x 1 := S 01 ∪ S 11 = ( x 0 ∩ x 1 ) ∪ ( x 0 ∩ x 1 ) . 1 Ohlbach, Kuncak 11 / 30
Example Introduce Atomic Decompositions ∃ x 1 ( card ( x 0 ∩ x 1 ) ≈ 0 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) 12 / 30
Example Introduce Atomic Decompositions ∃ x 1 ( card ( x 0 ∩ x 1 ) ≈ 0 → sum ( x 0 ) ≈ sum ( x 0 ∩ x 1 )) � ∃ x 1 ( card ( S 10 ) ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) 12 / 30
Example Distribute card, purify card ∃ x 1 ( card ( S 10 ) ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) 13 / 30
Example Distribute card, purify card ∃ x 1 ( card ( S 10 ) ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) � ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) 13 / 30
Example Distribute sum ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) 14 / 30
Example Distribute sum ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ∪ S 11 ) ≈ sum ( S 11 )) � ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ) + sum ( S 11 ) ≈ sum ( S 11 )) 14 / 30
Example Purify sum ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ) + sum ( S 11 ) ≈ sum ( S 11 )) 15 / 30
Example Purify sum ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ ( l 10 ≈ 0 → sum ( S 10 ) + sum ( S 11 ) ≈ sum ( S 11 )) � ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ sum ( S 00 ) ≈ s 00 ∧ · · · ∧ sum ( S 11 ) ≈ s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 15 / 30
Example ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ sum ( S 00 ) ≈ s 00 ∧ · · · ∧ sum ( S 11 ) ≈ s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 16 / 30
Quantifier Elimination 2 x 2 Kuncak 17 / 30
Quantifier Elimination 2 x l , k natural numbers card ( x ) = k + l . 2 Kuncak 17 / 30
Quantifier Elimination 2 y y x ∩ y x ∩ y l , k natural numbers card ( x ) = k + l . 2 Kuncak 17 / 30
Quantifier Elimination 2 y y x ∩ y x ∩ y l , k natural numbers card ( x ) = k + l . ⇔ ∃ y ( card ( x ∩ y ) = k ∧ card ( x ∩ y ) = l ) , with y a finite set. 2 Kuncak 17 / 30
Example Remove Quantifier (Use Equivalence) ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ sum ( S 00 ) ≈ s 00 ∧ · · · ∧ sum ( S 11 ) ≈ s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 18 / 30
Example Remove Quantifier (Use Equivalence) ∃ x 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( S 00 ) ≈ l 00 ∧ · · · ∧ card ( S 11 ) ≈ l 11 ∧ sum ( S 00 ) ≈ s 00 ∧ · · · ∧ sum ( S 11 ) ≈ s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) � ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( x 0 ) ≈ l 00 + l 01 ∧ card ( x 0 ) ≈ l 10 + l 11 ∧ sum ( x 0 ) ≈ s 00 + s 01 ∧ sum ( x 0 ) ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 18 / 30
Example Remove Quantifier (Purify) ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( x 0 ) ≈ l 00 + l 01 ∧ card ( x 0 ) ≈ l 10 + l 11 ∧ sum ( x 0 ) ≈ s 00 + s 01 ∧ sum ( x 0 ) ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 19 / 30
Example Remove Quantifier (Purify) ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 card ( x 0 ) ≈ l 00 + l 01 ∧ card ( x 0 ) ≈ l 10 + l 11 ∧ sum ( x 0 ) ≈ s 00 + s 01 ∧ sum ( x 0 ) ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) � ∃ l 0 , l 1 , ∃ s 0 , s 1 , card ( x 0 ) ≈ l 0 ∧ card ( x 0 ) ≈ l 1 ∧ sum ( x 0 ) ≈ s 0 ∧ sum ( x 0 ) ≈ s 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 l 0 ≈ l 00 + l 01 ∧ l 1 ≈ l 10 + l 11 ∧ s 0 ≈ s 00 + s 01 ∧ s 1 ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 19 / 30
Example Remove Quantifier (Delete Quantifier) ∃ l 0 , l 1 , ∃ s 0 , s 1 , card ( x 0 ) ≈ l 0 ∧ card ( x 0 ) ≈ l 1 ∧ sum ( x 0 ) ≈ s 0 ∧ sum ( x 0 ) ≈ s 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 l 0 ≈ l 00 + l 01 ∧ l 1 ≈ l 10 + l 11 ∧ s 0 ≈ s 00 + s 01 ∧ s 1 ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 20 / 30
Example Remove Quantifier (Delete Quantifier) ∃ l 0 , l 1 , ∃ s 0 , s 1 , card ( x 0 ) ≈ l 0 ∧ card ( x 0 ) ≈ l 1 ∧ sum ( x 0 ) ≈ s 0 ∧ sum ( x 0 ) ≈ s 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 l 0 ≈ l 00 + l 01 ∧ l 1 ≈ l 10 + l 11 ∧ s 0 ≈ s 00 + s 01 ∧ s 1 ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) � card ( x 0 ) ≈ l 0 ∧ card ( x 0 ) ≈ l 1 ∧ sum ( x 0 ) ≈ s 0 ∧ sum ( x 0 ) ≈ s 1 ∃ l 00 , l 01 , l 10 , l 11 ∃ s 00 , s 01 , s 10 , s 11 l 0 ≈ l 00 + l 01 ∧ l 1 ≈ l 10 + l 11 ∧ s 0 ≈ s 00 + s 01 ∧ s 1 ≈ s 10 + s 11 ∧ ( l 10 ≈ 0 → s 10 + s 11 ≈ s 11 ) 20 / 30
Recommend
More recommend