Transcript Module 8

Module 8
• Closure Properties
– Definition
– Language class definition
• set of languages
– Closure properties and first-order logic
statements
• For all, there exists
1
Closure Properties
• A set is closed under an operation if
applying the operation to elements of the set
produces another element of the set
• Example/Counterexample
– set of integers and addition
– set of integers and division
2
Integers and Addition
2
7
5
Integers
3
Integers and Division
.4
2
5
Integers
4
Language Classes
– We will be interested in closure properties of
language classes
• A language class is a set of languages
• Thus, the elements of a language class (set of
languages) are languages which are sets themselves
– Crucial Observation
• When we say that a language class is closed under
some set operation, we apply the set operation to the
languages (elements of the language classes) rather
than the language classes themselves
5
Example Language Classes *
• In all these examples, we do not explicitly
state what the underlying alphabet S is
• Finite languages
– Languages with a finite number of strings
• CARD-3
– Languages with at most 3 strings
6
Finite Sets and Set Union *
{0,1,00}
{0,1,00,11}
{0,1,11}
Finite Sets
7
CARD-3 and Set Union
{0,1,00,11}
{0,1,00}
{0,1,11}
CARD-3
CARD-3: sets with at most 3 elements
8
Finite Sets and Set Complement
{/\,00,10,11,000,...}
{0,1,01}
Finite Sets
9
Infinite Number of Facts
• A closure property often represents an infinite
number of facts
• Example: The set of finite languages is closed
under the set union operation
–
–
–
–
–
–
{} union {} is a finite language
{} union {l} is a finite language
{} union {0} is a finite language
...
{l} union {} is a finite language
...
10
First-order logic and closure
properties *
• A way to formally write (not prove) a
closure property
– For all L1, ...,Lk in LC, op (L1, ... Lk) in LC
– Only one expression is needed because of the
for all quantifier
• Number of languages k is determined by
arity of the operation op
11
Example F-O logic statements *
• For all L1,L2 in FINITE, L1 union L2 in
FINITE
• For all L1,L2 in CARD-3, L1 union L2 in
CARD-3
• For all L in FINITE, Lc in FINITE
• For all L in CARD-3, Lc in CARD-3
12
Stating a closure property is false
• What is true if a set is not closed under
some k-ary operator?
– There exist k elements of that set which, when
combined together under the given operator,
produce an element not in the set
– There exists L1, ...,Lk in LC, op (L1, …, Lk) not
in LC
• Example
– Finite sets and set complement
13
Complementing a F-O logic
statement
• Complement “For all L1,L2 in CARD-3, L1
union L2 in CARD-3”
– not (For all L1,L2 in CARD-3, L1 union L2 in
CARD-3)
– There exists L1,L2 in CARD-3, not (L1 union
L2 in CARD-3)
– There exists L1,L2 in CARD-3, L1 union L2 not
in CARD-3
14
Proving/Disproving *
• Which is easier and why?
– Proving a closure property is true
– Proving a closure property is false
15