{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Module10 - Module 10 Recursive and r.e language classes...

Info icon This preview shows pages 1–12. Sign up to view the full content.

View Full Document Right Arrow Icon
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
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
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
Image of page 2
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
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 REC and Set Complement REC EVEN 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?
Image of page 4
5 P Illustration P Input x Yes/No P’ No/Yes
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
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 */
Image of page 6
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
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
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
Image of page 8
9 REC Closed Under Set Union All Languages L 1 L 2 L 1 U L 2 REC • If L 1 and L 2 are solvable languages, then L 1 U L 2 is a solvable language Proof – Let L 1 and L 2 be arbitrary solvable languages – Let P 1 and P 2 be programs which solve L 1 and L 2 , respectively
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10 REC Closed Under Set Union All Languages L 1 L 2 L 1 U L 2 REC – Construct program P 3 from P 1 and P 2 as follows P 3 solves L 1 U L 2 Halts on all inputs Answers correctly L 1 U L 2 is solvable
Image of page 10
11 Yes/No Yes/No P 3 Illustration P 1 P 2 OR Yes/No P 3
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 12
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern