1 Module 10 • Recursive and r.e. language classes – representing solvable and half- solvable problems • Proofs of closure properties – for the set of recursive (solvable) languages – for the set of r.e. (half-solvable) languages • Generic Element proof technique
Module 10. Recursive and r.e. language classes representing solvable and half-solvable problems Proofs of closure properties for the set of recursive (solvable) languages for the set of r.e. (half-solvable) languages Generic Element proof technique. RE and REC language classes. REC - PowerPoint PPT Presentation
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Module 10
• Recursive and r.e. language classes– representing solvable and half-solvable problems
• Proofs of closure properties – for the set of recursive (solvable) languages– for the set of r.e. (half-solvable) languages
• Generic Element proof technique
2
RE and REC language classes
• REC– A solvable language is commonly referred to as
a recursive language for historical reasons– REC is defined to be the set of solvable or
recursive languages
• RE– A half-solvable language is commonly referred
to as a recursively enumerable or r.e. language– RE is defined to be the set of r.e. or half-
solvable languages
3
Closure Properties of REC *
• We now prove REC is closed under two set operations– Set Complement– Set Intersection
• In these proofs, we try to highlight intuition and common sense
4
REC and Set Complement
RECEVEN
All Languages
ODD• Even: set of even length strings
• Is Even solvable (recursive)?
• Give a program P that solves it.
• Complement of Even?– Odd: set of odd length strings
• Is Odd recursive (solvable)?
• Does this prove REC is closed under set complement?
• How is the program P’ that solves Odd related to the program P that solves Even?
5
P’ Illustration
PInput x Yes/No
P’
No/Yes
6
Code for P’
bool main(string y)
{
if (P (y)) return no; else return yes;
}
bool P (string y)
/* details deleted; key fact is P is guaranteed to halt on all inputs */
7
Set Complement Lemma
• If L is a solvable language, then L complement is a solvable language
• Proof– Let L be an arbitrary solvable language
• First line comes from For all L in REC
– Let P be the C++ program which solves L• P exists by definition of REC
8
– Modify P to form P’ as follows• Identical except at very end
• Complement answer – Yes → No– No → Yes
– Program P’ solves L complement• Halts on all inputs
• Answers correctly
– Thus L complement is solvable• Definition of solvable
proof continued
9
REC Closed Under Set Union
All Languages
L1
L2
L1 U L2
REC
• If L1 and L2 are solvable languages, then L1 U L2 is a solvable language
• Proof– Let L1 and L2 be arbitrary
solvable languages
– Let P1 and P2 be programs which solve L1 and L2, respectively
10
REC Closed Under Set Union
All Languages
L1
L2
L1 U L2
REC
– Construct program P3 from P1 and P2 as follows
– P3 solves L1 U L2 • Halts on all inputs• Answers correctly