Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Decision Procedure for Presburger Arithmetic: Automata-Based Approach, Slides of Mathematical logic

A comprehensive guide to the decision procedure for presburger arithmetic, focusing on the construction of automata for solving atomic inequalities and equations. it details the algorithms involved, explores extensions to more complex formulas, and analyzes the complexity of the procedure. Valuable for students studying mathematical logic, automata theory, and theoretical computer science.

Typology: Slides

2024/2025

Available from 04/22/2025

adithya-m-s
adithya-m-s 🇮🇳

3 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Presburger Arithmetic Decision procedure Extensions Complexity References
Decision Procedure for Presburger Logic
Adithya M S and Karishma Kuriya
Computer Science and Automation
Indian Institute of Science, Bengaluru
April 15, 2025
Mathematical Logic and Theorem Proving Decision Procedure for PresburgerLogic April 15, 2025 1 / 28
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download Decision Procedure for Presburger Arithmetic: Automata-Based Approach and more Slides Mathematical logic in PDF only on Docsity!

Decision Procedure for Presburger Logic

Adithya M S and Karishma Kuriya

Computer Science and Automation Indian Institute of Science, Bengaluru

April 15, 2025

1 Presburger Arithmetic

2 Decision procedure

3 Extensions

4 Complexity

5 References

Introduction to Presburger Arithmetic

What is Presburger Arithmetic?

  • (^) Presburger Arithmetic is a First Order theory over the natural numbers where 0 and 1 are the only constants
  • ≤ relation is also part of the logic to compare natural numbers
  • (^) This logic allows only for addition and also multiplication by a constant (well, multiplication by a constant is just a shorthand for adding the same variable multiple times)
  • (^) No multiplication is allowed between non constant variables
  • (^) It is a decidable logic. Given a formula, we can decide whether it is satisfiable and given a sentence we can decide whether it is TRUE or FALSE with an algorithm called the decision procedure

Introduction to Presburger Arithmetic

Syntax of Presburger Arithmetic

Presburger logic is governed by the following formal grammars

  • (^) (Terms) Let VAR be a finite set of variables. The following grammar then describes the Presburger arithmetic terms t ::= N | VAR | t + t | N ∗ t
  • (^) (Formula) An atomic formula consists of two terms without negation, logical operators or quantifiers:

af ::= t < t | tt | tt | t = t

Atomic formulas are also formulas. Formulas are defined as follows:

f ::= af | ¬ f | ff | ff | ∃ xf | ∀ xf

1 Presburger Arithmetic

2 Decision procedure

3 Extensions

4 Complexity

5 References

Atomic Inequalities

All inequalites of the form ∑ t 1 ≤ t 2 can be rewritten to an inequality of the form n i = 1 ai^ ·^ xi^ ≤^ b^ where all^ ai ,^ b^ ∈^ Z This can be rewritten as a vector expression ⃗ a ·⃗ xb Our decision procedure involves constructing an automaton (either DFA or NFA) given a Presburger formula, that accepts all solutions of this formula Satisfiability of the formula is just equivalent to checking emptiness of the automaton

DFA for Atomic Inequalities

Given a Presburger formula, the solutions over the naturals for them may be viewed as a tuple⃗ c = ( c 1 , c 2 , c 3 , ..., cn ) For instance, a solution for x + 2 y − 3 z ≤ 8 is (8, 7, 12). We encode the solution tuple in binary format with least significant bit first encoding The tuple (8, 7, 12) is represented by (0001, 1110, 0011) or as a matrix  

x y z

All words of the automation are binary tuples in matrix representation. The automaton reads the matrix column by column. For shorter binary words, 0’s are added at the end till same length is reached.

Key Idea and Transitions in DFA

Given an atomic inequality⃗ a ·⃗ xb with n variables. Let w = σ · wr be a word encoding tuple⃗ c (Here · is the concatenation of the first column and remaining columns of the matrix). Let ⃗ cr be the tuple encoded by wr Let ⃗ σ be the tuple encoded by σ. Then⃗ c can be rewritten as ⃗ c = 2 · ⃗ cr +⃗ σ where tuples are added element-wise The following result holds :-

a · (2 · ⃗ cr + ⃗ σ ) ≤ b ⇐⇒ ⃗ a · ⃗ cr

( b −⃗ a ·⃗ σ )

This is the key idea in the construction

Algorithm to construct DFA

Algorithm 1 Procedure INEQtoDFA Input: An atomic inequality of the form⃗ a ·⃗ xb Result: An automaton Aaxb = ( Q , Σ, δ , q 0 , F ) Qϕ , δϕ , Fϕ , q 0 ← b , W ← { b }, Σ ← {0, 1} n while W 6 = ϕ do pick k from W , remove k from W and add k to Q if k ≥ 0 then add k to F end if for σ ∈ Σ do j ← b 12 ( k −⃗ a ·⃗ σ )c if jQ then add j to W end if add ( k , σ , j ) to δ end for end while return ( Q , σ , δ , q 0 , F )

Algorithm to construct DFA

The algorithm INEQtoDFA returns a DFA that accepts the solutions of a given input atomic inequality. We can check whether this inequality is satisfiable at all for any assignment of the variables by simply removing the labels on the transition arrows and using graph algorithms to check whether some final state is reachable from the initial state

Termination

Let ∑ ni = 1 ai · xib be an inequality and s = ∑ ni = 1 | ai | We can prove by induction on the states of the automaton that every state q satisfies the property

−| b | − sq ≤ | b | + s

The initial state already satisfies this property. Let q ′^ be the successor of another state in the automaton. Then there is a σ ∈ {0, 1} n^ for a state q such that q ′^ = b 12 ( q −⃗ a ·⃗ σ )c By induction hypothesis −| b | − sq ≤ | b | + s For q ′, the same property holds:

−| b | − s ≤ − b^ − 2 2 s

⌊ (^) −| b | − s −⃗ aσ 2

⌋ ≤ q ′^ ≤

⌊ (^) | b | + s −⃗ aσ 2

⌋ ≤ | b | + s

Algorithm to construct DFA

Correctness

The transitions from state q to q ′^ = b q −⃗ 2 a ·⃗^ σ c are correct as w satisfying the original inequality ⃗ a ·⃗ cb is equivalent to wr satisfying the inequality ⃗ a · ⃗ cr ≤ b q −⃗ 2 a ·⃗^ σ c The final states are precisely those labelled with non-negative numbers as, if we have a sequence of transitions ⃗ δ starting at q and ending at q ′, we have that

q −⃗ a ·⃗ cq

Thus q ′^ < 0 would give ⃗ a ·⃗ c > q , which CANNOT be accepted from state q

1 Presburger Arithmetic

2 Decision procedure

3 Extensions

4 Complexity

5 References

Strict Inequations

We can also construct automaton for strict inequations of the form⃗ a ·⃗ x < b Let w = σ · wr be an accepted word and for a tuple ⃗ cr of naturals, encoded by wr a similar property holds:

a ·⃗ c < b ⇐⇒ ⃗ a · ⃗ cr <

( b −⃗ a · ⃗ δ )

The only difference here is that we would mark state k as final only if k > 0 and use the ceiling instead of the floor function

Equations

We can extend our construction to equations as well. Again the similar property holds :

a ·⃗ c = b ⇐⇒ ⃗ a · cr =

( b −⃗ a · ⃗ δ )

We define the transition relation as :-

δ ( q , σ ) =

2 ( q^ −⃗^ a^ ·^ ⃗ σ )^ if^ q^ −⃗^ a^ ·^ ⃗ σ^ is even st otherwise

Only 0 is marked as the final state (s t is the trap state)