We looked at the terminology and a few rules in the last chapter, only to find it too hard to follow.
In logic, reasoning by rule is usually more interesting. However, there is time when we have to test every combination of truth values to see if a statement is satisfiable.
Before we find out how such an exhaustive search can be done, let’s first introduce the CNF of logic statements.
“CNF” stands for “conjuctive normal form”, in which
What does that remind you of?
It’s like, well, “(1) a suitcase should weigh no more than 50kg, and (2) not exceed 50cm in length, and (3) not exceed 50cm in width”. When a new rule arrives, we simply add it to the tail.
So “and” means that its branches should both be satisfied. A bunch of clauses connected by “and”s! It seems our statement has a hard constraint on the variables, because we need to satisfy every clause!
But assume that the clauses are connected by “or”s, then we will only look at one of them and discard the rest. That will simply be too easy.
Also, there are “or”s Inside the clauses. Therefore, we only need to adjust one variable to make a clause true.
It is possible for you to look at how a SAT problem is presented, as well as its difficulty, at The SAT Game.
As we see before, “and”, “or” and “not” can represent all kinds of relations. Here we take a step further and think every statement in propositional logic can be represented in such three levels. There are some ways to convert any kind of propositional logic statements, even more general problem statements, into a CNF, and …
Wait! In my experience, “and” and “or” are symmetric! We convert an “and” statement to “or” one, just as easy as the reverse way. If we can easily convert something to a CNF statement, why don’t convert it to something connected by “or”, and it will be much easier to satisfy!
Good point. There are general ways to convert things to those forms, but generally a hard problem in daily life comes with constraints that should all be met, and CNF is more close to such a problem.
In nature however, this derives from the hard core of computational complexity.
Computation… Computers! Do you see some connections between electronic computers and our satisfiability problem?
I’m told that computers are made of tiny switches. It understands only 0 and 1 by turning those switches on and off.
And… A satisfiability problem also deals with variables that take 0 and 1 as its variables! It seems computers should understand logic by design!
I hear that computers are .
I think computing machines are always following some rules. Maybe they can easily reason with the logical rules?
Good. Computers have not only switches but also gates, which can calculate all kinds of operations like “and”. It is sometimes amazing, though, that satisfiability solvers help computer chip design. Metaphorically, I see this as the species of computer breeding offsprings.
As to computer aided reasoning, or “automated reasoning”, they are not so mature as to solve hard puzzles for us, but they are evolving.
Computers usually view problems naively. For example, is two multiplications, while is one, and complex functions are also built on top of additions and multiplications, which takes a fixed amount of time per operation. As a result, we only calculate the operations they need to perform as a rough estimate of the run time.
So, if modern satisfiability solvers, as computer programs, does not rely much on syntactic reasoning, how do they solve a general problem?
The core idea in this is called “search”, which is also a major topic in any kind of computer programming books.
Let’s stick to the example in chapter 1, exploring only the truth values of 3 kid’s statements.
Fix the pic, it should be several blocks, in which one is tall and others are low. It’s better a 3d and can rotate.
In our puzzle, there is only one truth value combination that can satisfy the requirements. To find the combination, we need to enumerate every possibility.
(murmuring) Exactly what I have done?
So far that’s right. However, the number of combinations grows as we add more variables. For 2 variables, the computer enumerates 4 possibilities; for 3 variables, it enumerates 8. And the possible combinations become too many to enumerate, even for powerful computers.
But modern solvers is capable of dealing with hundreds of variables and thousands of clauses, even in the worst case. How can it be?
Well, what we previously do (enumerating everything and evaluating them) is called brutal force search. Imagine troopers breaking into your house and turn it upside down!
However, it’s not the case that we humans will search every place for a pair of lost keys, right? We always have some intuition about where to find things. And some folk managed to teach computers to do that! It’s called heuristic search.
Make machines intuitive!?
That makes sense. But we have another choice! Instead of a piece of information per every possibility, we give the computer some way to decide the information itself.
…PICS…
Fix the pic, it should be several blocks, in which everyone differs in height according to how many clauses it satisfies. better to show the corresponding values on it
As I have said, we have many clauses to satisfy. Once all clauses becomes true, we are done. We imagine that the number of true clauses is some indicator, just like the progress bar in your downloader!
We instruct the machine to stay in one combination, look at its neighbors, and pick up the best one to live in! Ideally, the satisfied clauses adds up, and finally everything is fine.
That sort of search, we often call “local search”, only checks a “local” property. That is, some combinations that live together. It knows very little about the general information, and yet it is powerful enough for many problem sets.
Of course, there are harder problems. Imagine searching for a purloined letter, while the dumb policemen only knew to waylay the minister! We have to rely again on reasoning, though in a structured manner.
explain assignment, sketch the search in combination space by ‘flip’
tell something about local search, describe the basic search procedure, introduce dpll/cdcl elegantly
make a summary that shows the knowledge points in this chapter