COMPSCI 501: Formal Language Theory Textbook Why Study Formal Language .

1y ago
11 Views
2 Downloads
2.35 MB
5 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Troy Oden
Transcription

COMPSCI 501: Formal Language TheoryCOMPSCI 501: Formal Language TheoryI Instructor: Marius Minea, office hous: Tue 3-4 pm, LGRC A261Marius Mineamarius@cs.umass.eduI Lectures: Goessmann 20, MWF 11:15 - 12:05I TA: Rik Sengupta, office hours: Wed 6-7:30 pm, LGRT 220University of Massachusetts AmherstI Graders: Deeksha Razdan, Gourav SahaJanuary 23, 2019TextbookWhy study formal language theory?For some: for the beauty of theoryUnderstand tools used in practiceregular expressions/automata for string searchgrammars: design programming or domain-specific languagesUnderstand complexity and limits of computationIt’s a great bookImprove ability to analyze and solve problemsIntuition and in-depth understanding of covered topicsAim to read chapters ahead of lectureMotivation: Halting problemThere is no algorithm that can decide whether an arbitrary programhalts on a given input.More formally: Determining whether a Turing machine halts on agiven input is undecidable.Crucial to establish the limits of computation.If we are given a (computer science) problem, is it even solvable?Example: Computer VirusesA virus can be formally defined as a program that replicates itself.Is it possible to build the perfect antivirus?(that detects any virus, with no false positives/negatives)Fred Cohen showed in 1987 that the problem was undecidable.The program P under scrutiny could invoke any proposed decisionprocedure D and infect other programs only if D determines that Pis not a virus.Fred Cohen: Computer Viruses: Theory and Experiments, 1987

Example: Optimizing compilersBig Picture: Automata, Computability and ComplexityI Complexity TheoryIs it possible to build the perfect optimizing compiler?(compiles a program to the shortest/simplest code)What makes some problems computationally hard and others easy?If so, the optimized program should just(1) read (part of) the input(2) halt, or loop foreverthus it would have solved the halting problem!Coping with complexity / change problem for easier solutionMany fundamentally interesting problems in programanalysis/testing/verification are undecidable for the same reason.Classification scheme according to computational difficultyI Computability TheoryLimits of what can be computedLimits of what can be provedI Automata Theoryfinite automataFormally define simple models of computationcontext-free grammars / pushdown automataSelective outlineLogistics and GradingI Deterministic / nondeterministic automata, regular expressionsI Context-free grammars / pushdown automataI Turing machinesI (Un)decidability, reducibilityI ComplexityI timeI space: polynomial, logarithmicI impact of nondeterminismI Homework: 30% (six homeworks)I Midterm 1: 20% (Thu Feb 21, 7 pm, ILC S131)I Midterm 2: 20% (Wed Apr 10, 7 pm, ILC S131)I Final: 25% (Thu May 9, 10:30 am, Goessmann 20)I Moodle quizzes: 5% (throughout semester)I More advanced topicsI alternation, games, circuit complexityReview: SetsI Sets: unordered, unique elementsI multisets, if number of occurrences matters {2, 2, 3, 7, 7, 7}I finite vs. infinite sets (results may differ!)I power set P(A) set of subsets of A (2 A subsets)I Cartesian product / cross product:A B {(x, y) x A, y B}Functions (mappings)f :A BA domain, B rangeinjective: x1 6 x2 f (x1 ) 6 f (x2 )surjective (onto): y B x A . f (x) ybijective (one-to-one correspondence): injective and surjective

RelationsSet of tuples A1 A2 . . . Ak(k-ary relation, k-tuples)A relation defines a predicate over A1 A2 . . . Aktrue if tuple in relation, false if notBinary relation: set of pairs A BBinary relation on a set A: subset of A AEquivalence relation on a set:reflexive: x : R(x, x)symmetric: x, y : R(x, y) R(y, x)transitive: x, y, z : R(x, y) R(y, z) R(x, z)An equivalence relation partitions a set into disjoint subsetse.g., remainders mod n, strongly connected componentsPreview: DecidabilityStrings and LanguagesAlphabet (usually Σ): any nonempty finite setString: finite sequence of symbols from the alphabetΣ : set of all (finite) strings over Σ, incl. empty string (denoted ).Important: distinguish between:finite: all strings in Σ are finitebounded/unbounded: strings can be arbitrarily longinfinite: infinite strings are not in Σ lexicographic order (dictionary order)shortlex order: , 0, 1, 00, 01, 10, 11, 000, . . .useful for enumerating stringsA language is an arbitrary subset of strings (of Σ )GraphsA program can be viewed (encoded) as a string.G (V, E): nodes/vertices, edgesA (decision) problem can be viewed as a set of strings (inputs) forwhich the answer is YES.directed / undirected: edges are ordered / unordered pairsCantor’s theorem says there is no one-to-one mapping (bijection)between a set and its powerset.the powerset has “more” elementsThus, there can be no one-to-one mapping between Σ (a supersetof all programs) and P(Σ ) (the set of all problems). some problems must be undecidableLogic and proofsProofinformally: a convincing logical argument that a statement is trueformally: a sequence of true statements, which are either axioms,hypotheses, or are obtained from previous statements usingdeduction rulesBook gives clear convincing arguments without excessive formalismBut we must still practice being careful that all our steps are correct.degree/in-/outdegree: number of edges (total/entering/leaving)nodepath: sequence of nodes connected by edges (incl. empty)strongly connected: a directed path between any two nodesEulerian path/cycle: contains each edge exactly onceHamiltonian path/cycle: contains each vertex exactly onceHow to prove it ?I Be patientI Come back to itlet it sink in, let ideas developI Be neatdefine notions clearly, be explicit about any deductionsI Be concisethe most beautiful proofs are often short and simple

Proof by constructionProof by construction (2)Prove: There exist irrational numbers x and y so that xy is rational.Def.: A graph is k-regular if every node has degree k.Prove: For any even n 2 there is a 3-regular graph with n nodes.Idea: try a “regular” construction: from each node, an edge going“left”, “middle”, and “right”.Label nodes V {0, 1, . . . , n 1}. Visualize on a circle.Construct edges:(i 1, i) (for i 0) and (n 1, 0), (left/right)and edges (i, i n/2) for i n/2 (middle, to opposite nodes).Finding a pair of numbers is non-obvious.The first irrational number we usually learned of isWhy is it irrational ?Is 22 2.rational? Don’t know.If it were (case 1), we have our x and y. 2Now assume2 irrational. We have 2 2 2 2 22 2 2 2 (rational), so again we have our 2 two numbers: 2 and 2.We’ve shown x and y must exist, without concretely finding them.Proof by contradictionProof by inductionTo prove P , assume P and derive a contradiction.Prove that all elements of an infinite set have a given propertytypically a predicate P (n) over naturalsClosely related: proof by contrapositive (indirect proof)Ordinary inductionContrapositive of P Q is Q P .The two are equivalent.If P (n0 ) holds (typically n0 0, or 1, etc.)and n n0 : P (n) P (n 1)then n n0 : P (n).We could show Q P (by direct proof) and can then claimP Q.We also have (P Q) P Q.Thus, if we assume P and Q and derive a contradiction, we haveproved P Q.Where is the fallacy?Prove: In any set of n horses, all have the same color.Base case: n 1. One horse, clearly the same color.Inductive step: Assume true for n 1, prove for n 1.Remove horse x from set of n 1 horses. Remaining set has nhorses, all of same color.Now add back x and remove a different horse y. Again n horses, allof same color.Thus, adding y back we get n 1 horses of same color, q.e.d.Strong inductionallows us to assume P(n) for all smaller values, not just previous:If P (n0 ) holdsand ( k : n0 k n P (k)) P (n 1)then n n0 : P (n).Proof exercise: Ramsey’s TheoremDef. A clique in a graph G is a subgraph in which any two nodesare connnected by an edge.An anti-clique (independent set) is a subgraph in which any twonodes are not connected by an edge.Prove: Any graph with n nodes contains either a clique or ananti-clique with at least 12 log2 n nodes.Intuition: log2 n suggests we need to successively halve the numberof nodes.

For next timeI Review notions in intro chapter(be familiar with terms in one-page glossary)I Revisit any less familiar notions from CS 250 and 311I Sign up for Piazza and GradescopeI Review knowledge on finite automata

COMPSCI 501: Formal Language Theory I Instructor : Marius Minea, o ce hous: Tue 3-4 pm, LGRC A261 . Inductive step : Assume true for n 1, prove for n 1 . Remove horse x from set of n 1 horses. Remaining set has n horses, all of same color. Now add back x and remove a di erent horse y. Again n horses, all

Related Documents:

2/25/2021 Compsci 101, Spring 2021 10 Compsci 101 Pancakes, While loops, Parallel Lists Part 2 of 3 2/25/2021 Compsci 101, Spring 2021 11 Susan Rodger Nikki Washington February 25, 2021 while BOOL_CONDITION: LOOP_BODY # modify variables, affect expression Collatz Code 2/25/2021 Compsci 101, Spring 2021 12

9/5/22 Compsci 201, Fall 2022, OOP 3. Recapping some Java Themes 9/5/22 Compsci 201, Fall 2022, OOP 4. Comments on Java Style Code blocks: Opening {ends first line of if, for, while, or method . Aside: Python uses objects too 9/5/22 Compsci 201, Fall 2022, OOP 15 Split is a methodwe are calling on this String object, not a

Theory of Computation I: Introduction to Formal Languages and Automata Noah Singer April 8, 2018 1 Formal language theory De nition 1.1 (Formal language). A formal language is any set of strings drawn from an alphabet . We use "to denote the \empty string"; that is, the st

Field density and field moisture determinations shall be made according to ASTM D 6938. 501.07.04.02 Method A The Contractor is responsible for establishing QC procedures. Page 5 Rev. Date: 11/2014 OPSS.MUNI 501 501.07.04.03 Method B 501.07.04.03.01 General When Method B is specified in the Contract Documents, QC compaction testing shall be based on material placed and compacted in the Work on .

Research & Writing Skills Success in 20 Minutes a Day, or Getting Down to Busi-ness. A basic knowledge of language will also help you become a better writer. Use these books to get the extra practice you need: 501 Vocabulary Questions, 501 Synonyms and Antonyms, 501 Word Analogies, Goof-Proof Spelling, or Goof-Proof Grammar. x 501 Writing Prompts

FORMAL LANGUAGES AND AUTOMATA THEORY, H S Behera , Janmenjoy Nayak , Hadibandhu Pattnayak , Vikash Publishing, New Delhi. 3. Anand Sharma, “Theory of Automata and Formal Languages”, Laxmi Publisher. Formal language The alphabet of a formal language is the set of s

501 Concrete 501.1 Description (1) This section describes proportioning, mixing, placing, and protecting concrete mixtures. 501.2 Materials 501.2.1 Portland Cement (1) Use cement conforming to ASTM specifications as follows: - Type I portland cement; ASTM C150. - Type II portland cement; ASTM C150. - Type III portland cement; ASTM C150, for high early strength. - Type IP portland-pozzolan .

BCS Foundation Certificate in Artificial Intelligence V1.1 Oct 2020 Syllabus Learning Objectives 1. Ethical and Sustainable Human and Artificial Intelligence (20%) Candidates will be able to: 1.1. Recall the general definition of Human and Artificial Intelligence (AI). 1.1.1. Describe the concept of intelligent agents. 1.1.2. Describe a modern .