T - Aula 2

18 Setembro 2023 - #MFES

Conteúdo

  1. Intro
    1. SAT
    2. Lógica Proposicional
  2. SAT Solvers

1. Intro

Formal modeling - formally represent the system and its properties in the syntactic conventions that the tool understands and can process.

Formal Logic = logical language (logical symbols + non-logical symbols) + semantics +proof system

1.1 SAT

The Boolean satisfiability (SAT) problem:

Find an assignment to the propositional variables of the formula such that the formula evaluates to TRUE, or prove that no such assignment exists.

Usually SAT solvers deal with formulas in conjunctive normal form (CNF)

Cook's theorem(1971)

SAT is NP-complete

1.2 Proposicional Logic (PL)

Nota

Esta secção basicamente só contém revisão de conceitos. Aconselha-se a ver a coisa rapidamente, porque é só a formalidade de lógica escrita por extenso.

Let A be an assignment and let F be a formula. If A(F)=1, then we say F holds under assignment, or A models F.
We write A F iff A(F)=1, and AF iff A(F)=0.

An assignment is a function A : Vprop0,1 , that assigns to every
propositional variable a truth value. An assignment A naturally extends to all formulas, A : Form 0,1. The truth value of a formula is computed using truth tables:

F A B ¬A AB AB AB AB
A1(F) 0 1 1 0 1 1 0 0 1
A2(F) 0 0 1 0 0 1 1 0 1
A3(F) 1 1 0 1 1 1 1 0 1
A4(F) 1 0 0 0 1 0 0 0 1

A formula F is:

  1. valid iff it holds under every assignment. We write F. A valid formula is called a tautology.
  2. satisfiable iff it folds (true) under some assignment.
  3. unsatisfiable iff it holds under no assignment. An unsatisfiable formula is called a contradiction.
  4. refutable iff it is not valid.
Proposition

F is valid iff ¬F is unsatisfiable.

Basic Equivalences:

  1. ¬¬AA
  2. AAA
  3. AAA
  4. A¬A
  5. A¬A
  6. ABBA
  7. ABBA
  8. AA
  9. A
  10. A
  11. AA
  12. A(BA)A
  13. A(BC)(AB)(AC)
  14. A(BC)(AB)(AC)
  15. ¬(AB)¬A¬B
  16. ¬(AB)¬A¬B
  17. AB¬AB
  18. AB(AB)(BA)

2. SAT Solvers

2.1 DPLL Framework

The idea is to incrementally construct an assignment compatible with a CNF, propagating the implications of the decisions made that are easy to detect and simplifying the clauses.

A CNF is satisfied by an assignment if all its clauses are satisfied. And a clause is satisfied if at least one of its literals is satisfied.