Logic: Lecture 19, 27 October 2015
----------------------------------
(Reference: Applied Automata Theory by Wolfgang Thomas, Chapters 0,1)
Goedel: (N,0,+,*) is incomplete (and hence undecidable)
Presburger: (N,0,+) is decidable
Can we extend theory of (N,0,succ) in another direction?
First order vs second order logic
FO: quantify over individual elements of a set
SO: quantify over functions, relations
Monadic second order logic (MSO):
Quantify over unary relations
Equivalent to adding set quantifiers:
Focus on MSO over (N,0,succ)
Examples:
x < y is definable
Singleton(X), Finite(X)
Principle of Mathematical Induction
Restrict to finite models and add labels to positions
Additional constants min, max
Interpret over words over a finite alphabet
MSO definable languages
Given a sentence phi : L(phi) = { w | w |= phi }
Examples: Fix alphabet = {a,b,c}
- Words containing an a
- Words with even length
Regular expressions vs MSO definability
- Words with a pair of b's with no c's in between
- Words without a pair of b's with no c's in between
- Words where every pair of b's has no c's in between
Regular expressions are good for "positive" requirements, not
so natural for "negative" conditions. Not easy to transform
regular expressions to account for small changes in the
requirement.
Logical specifications can be complemented, combined using
and/or. Easy to inductively combine constraints on language.
Finite automata
DFAs and NFAs
Complete and incomplete DFAs
Checking emptiness