




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































regular languages CFLs
L ( a * b *)
recursive { an^ b n } languages
{ an^ b n^ cn }
boolean ax(String p) { return (p.length()>0 && p.charAt(0)=='a'); }
boolean anbncn2(String p) { String as = "", bs = "", cs = ""; while (true) { String s = as+bs+cs; if (s.length()>p.length()) return false; else if (p.equals(s)) return true; as += 'a'; bs += 'b'; cs += 'c'; } }
String s = "boolean sigmaStar(String p) {return true;}"; run(s,"abc");
String s = "boolean ax(String p) { " + " return (p.length()>0 && p.charAt(0)=='a'); " + "} "; run(s,"ba");
String s = "boolean anbncn1(String p) { " + " String as = "", bs = "", cs = ""; " + " while (true) { " + " String s = as+bs+cs; " + " if (p.equals(s)( return true; " + " as += 'a'; bs += 'b'; cs += 'c'; " + " } " + "} "; run(s,"abbc");
int j = 0; for (int i = 0; i < 100; j++) { j += f(i); }
String x = "boolean anbncn1(String p) { " + " String as = "", bs = "", cs = ""; " + " while (true) { " + " String s = as+bs+cs; " + " if (p.equals(s)) return true; " + " as += 'a'; bs += 'b'; cs += 'c'; " + " } " + "} "; shortcut(x,"abbc")