• Non ci sono risultati.

Course “Introduction to SAT & SMT” TEST

N/A
N/A
Protected

Academic year: 2021

Condividi "Course “Introduction to SAT & SMT” TEST"

Copied!
11
0
0

Testo completo

(1)

Roberto Sebastiani

DISI, Universit` a di Trento, Italy June 11

th

, 2020

769857918 Name (please print):

Surname (please print):

i

(2)

1

Let φ be a generic Boolean formula, and let φ

treennf def

= N N F

tree

(φ) and φ

dagnnf def

= N N F

dag

(φ), s.c.

N N F ()

tree

and N N F ()

dag

are the conversion into negative normal form using a tree and a DAG representation of the formulas respectively.

Let |φ|, |φ

treennf

| and |φ

dagnnf

| denote the size of φ, φ

treennf

and φ

dagnnf

respectively.

For each of the following sentences, say if it is true or false.

(a)

treennf

| is in worst-case polynomial in size wrt. |φ|.

(b)

dagnnf

| is in worst-case polynomial in size wrt. |φ|.

(c) φ

dagnnf

has the same number of distinct Boolean variables as φ has.

(d) A model for φ

dagnnf

(if any) is also a model for φ, and vice versa.

1

(3)

Using the variable ordering “ A

1

, A

2

, A

3

, A

4

”, draw the OBDD corresponding to the following formulas:

A

1

∧ (¬A

1

∨ ¬A

2

) ∧ ( A

2

∨ A

3

) ∧ (¬A

3

∨ A

4

)

2

(4)

3

Using the semantic tableaux algorithm, decide whether the following formula is satisfiable or not.

(Write the search tree.)

( ¬A

1

) ( A

1

∨ ¬A

2

) ( A

1

A

2

A

3

) ( A

4

∨ ¬A

3

A

6

) ( A

4

∨ ¬A

3

∨ ¬A

6

) ( ¬A

3

∨ ¬A

4

A

7

) ( ¬A

3

∨ ¬A

4

∨ ¬A

7

) (Literal-selection criteria to your choice.)

3

(5)

Consider the following piece of a much bigger formula, which has been fed to a CDCL SAT solver:

c

1

: ¬A

7

∨ A

2

c

2

: A

4

∨ A

1

A

11

c

3

: A

8

¬A

6

∨ ¬A

4

c

4

: ¬A

5

¬A

1

c

5

: A

7

∨ ¬A

8

c

6

: A

7

∨ A

6

A

9

c

7

: ¬A

7

∨ A

3

¬A

12

c

8

: A

4

∨ A

5

A

10

...

Suppose the solver has decided, in order, the following literals (possibly interleaved by others not occurring in the above clauses):

{..., ¬A

9

, ... ¬A

10

, ... ¬A

11

, ... A

12

, ... A

13

, ..., ¬A

7

}

(a) List the sequence of unit-propagations following after the last decision, each literal tagged (in square brackets) by its antecedent clause

(b) Derive the conflict clause via conflict analysis by means of the 1st-UIP technique

(c) Using the 1st-UIP backjumping strategy, update the list of literals above after the backjumping step and the unit-propagation of the UIP

4

(6)

5

Consider the following CNF formula:

( A

7

)

( A

8

∨ ¬A

7

)

( ¬A

4

∨ ¬A

7

∨ ¬A

5

) ( ¬A

8

∨ ¬A

6

A

1

) ( A

2

∨ ¬A

7

∨ ¬A

6

) ( ¬A

8

A

6

∨ ¬A

2

) ( ¬A

1

∨ ¬A

5

∨ ¬A

2

) ( A

2

∨ ¬A

6

∨ ¬A

8

) ( ¬A

1

∨ ¬A

5

A

8

) ( A

2

A

7

∨ ¬A

6

) ( ¬A

6

A

4

∨ ¬A

6

) ( A

3

A

8

∨ ¬A

7

) Decide quickly if it is satisfiable or not, and briefly explain why.

5

(7)

Consider the following Boolean formulas:

φ

1 def

= ( ¬A

7

∨ ¬A

3

) ( A

7

∨ ¬A

3

)

( A

2

)

( ¬A

2

∨ ¬A

4

) φ

2

def

= ( A

3

∨ A

5

) ( A

4

∨ ¬A

1

) ( ¬A

5

∨ A

1

)

which are such that φ

1

∧ φ

2

|= ⊥. For each of the following formulas, say if it is a Craig interpolant for (φ

1

, φ

2

) or not.

(a)

( ¬A

7

∨ ¬A

3

) ( A

7

∨ ¬A

3

) ( ¬A

4

)

(b)

( ¬A

4

) (c)

( ¬A

3

∧ ¬A

4

)

6

(8)

7

Consider the following formula in the theory EUF of linear arithmetic on the Rationals.

φ = {(f(x) = f(f(y))) ∨ A

2

} ∧

{¬(h(x, f(y)) = h(g(x), y)) ∨ ¬(h(x, g(z) = h(f(x), y))) ∨ ¬A

1

} ∧ {A

1

∨ (h(x, y) = h(y, x))} ∧

{(x = f(x)) ∨ A

3

∨ ¬A

1

} ∧ {¬(w(x) = g(f(y))) ∨ A

1

} ∧ {¬A

2

∨ (w(g(x)) = w(f(x)))} ∧ {A

1

∨ (y = g(z)) ∨ A

2

}

and consider the partial truth assignment µ given by the underlined literals above:

{¬(w(x) = g(f(y))), ¬A

2

, ¬(h(x, g(z) = h(f(x), y))), (x = f(x)), (y = g(z))}.

1. Does (the Boolean abstraction of) µ propositionally satisfy (the Boolean abstraction of) φ?

2. Is µ satisfiable in EUF?

(a) If no, find a minimal conflict set for µ and the corresponding conflict clause C.

(b) If yes, show one unassigned literal which can be deduced from µ, and show the corre- sponding deduction clause C.

7

(9)

Consider the following set of clauses φ in the theory of linear arithmetic on the Integers EUF.

 

 

 

( ¬(x = y) ∨ (f(x) = f(y))), ( ¬(x = y) ∨ ¬(f(x) = f(y))), ( (x = y) ∨ (f(x) = f(y))), ( (x = y) ∨ ¬(f(x) = f(y)))

 

 

 

Say which of the following sets is a EUF-unsatisfiable core of φ and which is not. For each one, explain why.

(a)

( ¬(x = y) ∨ ¬(f(x) = f(y))), ( (x = y) ∨ (f(x) = f(y))), ( (x = y) ∨ ¬(f(x) = f(y)))

 

(b)

( ¬(x = y) ∨ (f(x) = f(y))), ( (x = y) ∨ (f(x) = f(y))), ( (x = y) ∨ ¬(f(x) = f(y)))

 

(c)

 

 

( ¬(x = y) ∨ ¬(f(x) = f(y))), ( (x = y) ∨ (f(x) = f(y))), ( (x = y) ∨ ¬(f(x) = f(y))), ((x = f (y)))

 

 

 

8

(10)

9

Let LRA be the logic of linear arithmetic over the rationals and EUF be the logic of equality and uninterpreted functions. Consider the following pure formula φ in the combined logic LRA ∪ EUF:

(x = 1.0) (h = 1.0) (k = 1.0) (y = 2h − k) (z < w) (1)

(z = f (x)) ∧ (w = f(y)) (2)

Say which variables are interface variables, list the interface equalities for this formula (modulo symmetry), and decide whether this formulas is LRA ∪ EUF-satisfiable or not, using either Nelson- Oppen or Delayed Theory Combination.

9

(11)

Consider the following formulas in difference logic ( DL):

φ

1 def

= (x

2

− x

3

≤ −4) ∧ (x

3

− x

4

≤ −6) ∧ (x

5

− x

6

≤ 4) (x

6

− x

1

≤ 2) (x

6

− x

7

≤ −2) ∧ (x

7

− x

8

≤ 1) φ

2 def

= (x

4

− x

9

≤ 2)

(x

9

− x

5

≤ 0) (x

1

− x

2

≤ 1)

which are such that φ

1

∧φ

2

|=

DL

⊥. For each of the following formulas, say if it is a Craig interpolant in DL for (φ

1

, φ

2

), and explain why.

(a) (x

2

− x

3

+ x

6

− x

1

≤ −2) (b) (x

2

− x

4

≤ −10)

(c) (x

2

− x

4

≤ −10) ∧ (x

5

− x

1

≤ 6)

10

Riferimenti

Documenti correlati

● Applications: Classification, Clustering, Regression, Language Modeling, Sentiment Analysis, Opinion Mining, Information Extraction......

automated reasoning, algorithms and combinatorics, artificial intelligence, bioinformatics, constraint programming, electronics, knowledge representation, formal verification of SW

Boolean circuits (Bounded) Planning (Bounded) Model Checking Cryptography.

Learning: in future branches, when all-but-one literals in η are assigned, the remaining literal is assigned to false

In Tools and Algorithms for the Construction and Analysis of Systems - 21st International Conference, TACAS 2015, Held as Part of the European Joint Conferences on Theory and

combine SAT solvers with decision procedures (theory solvers) contributions from SAT, Automated Theorem Proving (ATP), formal verification (FV) and operational research (OR)... SMT

Let LRA be the logic of linear arithmetic over the rationals and EUF be the logic of equality and uninterpreted functions9. (4) Thus, with either technique, we can conclude that φ

(a) List the sequence of unit-propagations following after the last decision, each literal tagged (in square brackets) by its antecedent clause.. (b) Derive the conflict clause