T - Aula 2
18 Setembro 2023 - #MFES
Conteúdo
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.
- SAT is an NP-complete decision problem.
- SAT was the first problem to be shown NP-complete.
- There are no known polynomial time algorithms for SAT.
Usually SAT solvers deal with formulas in conjunctive normal form (CNF)
- literal: propositional variable or its negation A, ¬A, B, ¬B, C, ¬C
- clause: disjuntion of literals. (A _ ¬B _ C)
- conjunctive normal form: conjuction of clauses. (A _ ¬B _ C) ^ (B _ ¬A) ^ ¬C
SAT is NP-complete
1.2 Proposicional Logic (PL)
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
We write A
An assignment is a function
propositional variable a truth value. An assignment
| F | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 1 | 1 | 0 | 0 | 1 | |
| 0 | 0 | 1 | 0 | 0 | 1 | 1 | 0 | 1 | |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 1 | |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 |
A formula
- valid iff it holds under every assignment. We write
. A valid formula is called a tautology. - satisfiable iff it folds (true) under some assignment.
- unsatisfiable iff it holds under no assignment. An unsatisfiable formula is called a contradiction.
- refutable iff it is not valid.
-
iff for every assignment , if then . We say is a consequence of . -
iff and . We say and are equivalent. -
Let
be a set of formulas. iff for each formula in . We say models . iff implies for every assignment . We say is a consequence of .
Propositioniff . and finite iff .
is consistent or satisfiable iff there is an assignment that models . - We say that
is inconsistent or unsatisfiable iff there is not consistent and denote this by .
Proposition- {
} - If
and , then iff
-
Formula
is a subformula of formula F if it occurs syntactically within F -
Formula G is a strict subformula of F if G is a subformula of
and
Basic Equivalences:
2. SAT Solvers
-
There are several techniques and algorithms for SAT solving.
-
Usually SAT solvers receive as input a formula in a specific syntatical format.
-
SAT solvers deal with formulas in conjunctive normal form (CNF).
-
Most current state-of-the-art SAT solvers are based on the Davis-Putnam-Logemann-Loveland (DPLL) framework.
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.