CDM Other Models. Klaus Sutner Carnegie Mellon Universality. Fall 2017
|
|
- Grant Stone
- 6 years ago
- Views:
Transcription
1 CDM Other Models Klaus Sutner Carnegie Mellon Universality Fall 2017
2 1 General Recursion Herbrand-Gödel Computability µ-recursive Functions Church-Turing Thesis
3 Where Are We? 3 We have encountered two clones of intuitively computable functions: the primitive recursive functions and the register machine computable functions (following Turing, these arguably capture the notion of computability perfectly). By nesting recursions deeply, one can produce primitive recursive functions that are nowhere near computable in any practical sense of the word (see below). So the questions is: is every computable function primitive recursive? And, if not, how far off are we? How much do we have to add to p.r. to get all computable functions?
4 Are We There Yet? 4 The key idea behind primitive recursive functions is to formalize a certain type of recursion (or, if you prefer, inductive definition). As we have seen, even some extension of this basic idea like course-of-value recursion remains within this framework. Here is another example: simultaneous recursion. To simplify matters, let us only consider two simultaneously defined functions as in f i (0, y) = g i (y) f i (x +, y) = h i (x, f 1 (x, y), f 2 (x, y), y) where i = 1, 2.
5 Lame Example 5 f 1 (0) = 1 f 1 (x + ) = f 2 (x) f 2 (0) = 0 f 2 (x + ) = f 1 (x) Then f 1 is the characteristic function of the even numbers. We ll see better examples later when we talk about context free grammars. Lemma Simultaneous recursion is admissible for primitive recursive functions.
6 Ackermann s Function (1928) 6 And yet, there is more to recursion that this. Define the Ackermann function A : N N N by the following double recursion (this version is actually due to Rózsa Péter and simpler than Ackermann s original function): A(0, y) = y + A(x +, 0) = A(x, 1) A(x +, y + ) = A(x, A(x +, y)) On the surface, this looks more complicated than primitive recursion. Of course, it is not at all clear that Ackermann could not somehow be turned into a p.r. function.
7 Ackermann is Computable 7 Here is a bit of C code that implements the Ackermann function (assuming that we have infinite precision integers). int acker(int x, int y) { return( x? (acker( x-1, y? acker( x, y-1 ): 1 )): y+1 ); } All the work of organizing the nested recursion is handled by the compiler and the execution stack. So this provides overwhelming evidence that the Ackermann function is intuitively computable.
8 Memoizing 8 We could memoize the values that are computed during a call to A(a, b). It is not hard to see that whenever A(x, y) is in the hash table, so is A(x, z) for all z < y (except for x = 0). Think of the table as having x rows. But note that the computation of A(a, b) will require entries A(a 1, z) for z > b. So each row in the table gets longer and longer as x gets smaller. For example, the computation of A(3, 3) = 61 requires A(2, 29) and A(1, 59). Note that the hash table provides a proof that A(3, 3) = 61.
9 Family Perspective 9 It is useful to think of Ackermann s function as a family of unary functions (A x ) x 0 where A x (y) = A(x, y) ( level x of the Ackermann hierarchy ). The definition then looks like so: A 0 (y) = y + A x +(0) = A x (1) A x +(y + ) = A x (A x +(y)) From this it follows easily by induction that Lemma Each of the functions A x is primitive recursive (and hence total).
10 The Bottom Hierarchy 10 A(0, y) = y + A(1, y) = y ++ A(2, y) = 2y + 3 A(3, y) = 2 y+3 3 A(4, y) = The first 4 levels of the Ackermann hierarchy are easy to understand, though A 4 starts causing problems: the stack of 2 s in the exponentiation has height y + 3. This usually called super-exponentiation or tetration and often written y x or x y.
11 The Mystery of A(6, 6) 11 Alas, if we continue just a few more levels, darkness befalls. A(5, y) super-super exponentiation A(6, y) an unspeakable horror A(7, y) speechless For level 5, one can get some vague understanding of iterated super-exponentiation, but things start to get murky. At level 6, we iterate over the already nebulous level 5 function, and things really start to fall apart. At level 7, Wittgenstein comes to mind: Wovon man nicht sprechen kann, darüber muss man schweigen.
12 Ackermann and Union/Find 12 One might think that the only purpose of the Ackermann function is to refute the claim that computable is the same as p.r. Surprisingly, the function pops up in the analysis of the Union/Find algorithm (with ranking and path compression). The running time of Union/Find differs from linear only by a minuscule amount, which is something like the inverse of the Ackermann function. But in general anything beyond level 3.5 of the Ackermann hierarchy is irrelevant for practical computation. Exercise Read an algorithms text that analyzes the run time of the Union/Find method.
13 Ackermann vs. PR 13 Theorem The Ackermann function dominates every primitive recursive function f in the sense that there is a k such that Hence A is not primitive recursive. f(x) < A(k, max x). Sketch of proof. One can argue by induction on the buildup of f. The atomic functions are easy to deal with. The interesting part is to show that the property is preserved during an application of composition and of primitive recursion. Alas, the details are rather tedious.
14 Insane Growth 14 Informally, the Ackermann is not primitive recursive because it grows too fast. We will give another example of mind-numbing growth. To this end, it is easier to use a slight variant of the Ackermann function. B 1 (x) = 2x B k +(x) = B x k (1) So B 1 is doubling, B 2 exponentiation, B 3 super-exponentiation and so on. In general, B k is closely related to A k+1.
15 Subsequence Order 15 Recall the subsequence ordering on words where u = u 1... u n precedes v = v 1 v 2... v m if there exists a strictly increasing sequence 1 i 1 < i 2 <... i n m of positions such that u = v i1 v i2... v in. In symbols: u v. In other words, we can erase some letters in v to get u. Subsequence order is not total unless the alphabet has size 1. Note that subsequence order is independent of any underlying order of the alphabet (unlike, say, lexicographic or length-lex order).
16 Warmup: Antichains 16 An antichain in a partial order is a sequence x 0, x 1,..., x n,... of elements such that i < j implies that x i and x j are incomparable. Example Consider the powerset of [n] = {1, 2,..., n} with the standard subset ordering. How does one construct a long antichain? For example, x 0 = {1} is a bad idea, and x 0 = [n] is even worse. What is the right way to get a long antichain?
17 Higman s Lemma 17 Theorem (Higman s 1952) Every antichain in the subsequence order is finite. Proof. Here is the Nash-Williams proof (1963): assume there is an antichain. For each n, let x n be the length-lex minimal word such that x 0, x 1,..., x n starts an antichain, producing a sequence x = (x i ). For any sequence of words y = (y i ) and a letter a define a 1 y to be the sequence consisting of all words in y starting with letter a, and with a removed. Since the alphabet is finite, there exists a letter a such that x = a 1 x is an antichain. But then x 0 < x 0, contradiction.
18 Friedman s Self-Avoiding Words 18 For a finite or infinite word x write x[i] for the block x i, x i+1,..., x 2i. We will always assume that i x /2 when x is finite. Bizarre Definition: A word is self-avoiding if for i < j the block x[i] is not a subsequence of x[j]. The following is an easy consequence of Higman s theorem. Theorem Every self-avoiding word is finite.
19 How Long? 19 Write Σ k for an alphabet of size k. By the last theorem and König s lemma, the set S k of all finite self-avoiding words over Σ k must itself be finite. But then we can define the following function: α(k) = max ( x x S k ) So α(k) is the length of the longest self-avoiding word over Σ k. Note that α is intuitively computable: we can build the tree of all self-avoiding words by brute-force.
20 How Big? 20 Trivially, α(1) = 3. A little work shows that α(2) = 11, as witnessed by abbbaaaaaaa. But α(3) > B 7198 (158386), an incomprehensibly large number. Smelling salts, anyone? It is truly surprising that a function with as simple a definition as α should exhibit this kind of growth.
21 PR versus Computable 21 Functions like A, B or α are all intuitively computable, but fail to be primitive recursive. So how much do we have to add to primitive recursion to capture these functions? Proposition (Unbounded Search) There is a primitive recursive relation R such that A(a, b) = (min ( z R(a, b, z) ) ) 0 Think of z as a pair c, t where t encodes a data structure that represents the whole computation of the Ackermann function on input a and b, something like a huge memoization table. c is the final result of this computation. Here is a much better description.
22 Ackermann and Lists 22 A computation of A(2, 1) might start like A(2, 1) = A(1, A(2, 0)) = A(1, A(1, 1)) = A(1, A(0, A(1, 0))) =... Note that the A s and parens are just syntactic sugar, a better description would be 2, 1 1, 2, 0 1, 1, 1 1, 0, 1, 0 1, 0, 0, 1 1, 0, 2 1, 3 0, 1, 2 0, 0, 1, 1 0, 0, 0, 1, 0 0, 0, 0, 0, 1 0, 0, 0, 2 0, 0, 3 0, 4 5 We can recover the original expression by applying A like a right-associative binary operator to these argument lists. Clearly, we can model these steps by a function defined on sequences of naturals or, via coding, just naturals.
23 List Operation 23 (..., 0, y) = (..., y + ) (..., x +, 0) = (..., x, 1) (..., x +, y + ) = (..., x, x +, y) Since A is total, we know that for any a and b there is some time t such that t (a, b) = (c) Clearly this condition is primitive recursive.
24 A(3, 4) 24
25 The Diagonal 25 The diagonal function A(x, x) fails to be primitive recursive. But Claim The predicate A(x, x) = z is primitive recursive. Proof. We have A(x, y) > y. But then (L) L i + i 1.
26 Evaluation 26 Here is another obstacle to capturing computability: recall the evaluation operator for our PR language: eval(τ, x) = value of τ on input x It is clear that eval is intuitively computable (take a compilers course). If fact, it is not hard to implement in eval in any modern programming language. Question: Could eval be primitive recursive? A useless answer would be to say no, the types don t match.
27 Indices 27 The first argument of eval is a term τ in our PR language, so our first step will be to replace τ by an index τ N. The index τ will be constructed in a way that makes sure that all the operations we need on indices are clearly primitive recursive. The argument vector x N n will also be replaced by its sequence number x 1,..., x n. Hence we will be able to interpret eval as a function of type N N N and this function might potentially be primitive recursive.
28 Coding PR 28 C n 0, n Pi n 1, n, i S 2, 1 Prec[h, g] 3, n, ĥ, ĝ Comp[h, g 1,..., g n ] 4, m, ĥ, ĝ 1,..., ĝ n Thus for any index e, the first component (e) 0 indicates the type of function, and (e) 1 indicates the arity. There is nothing sacred about this way of coding PR terms, there are many other, equally natural ways.
29 Diagonalization 29 Now suppose eval is p.r., and define the following function f(x) := eval(x, x) + 1 Then f is also p.r. and must have an index e. But then and we have a contradiction. f(e) = eval(e, e) + 1 = f(e) + 1 So eval is another example of an intuitively computable function that fails to be primitive recursive. This example may be less sexy than the Ackermann function, but it appears in similar form in other contexts.
30 Avoiding Diagonalization 30 More precisely, given a good formal definition of computability (one that matches our intuitive ideas), we would still expect to have indices for the functions in this class. We also would expect to have something like an operation eval : N N N that works like an interpreter for functions in this class. Most importantly, we want eval to be itself computable. In light of the last result, this may sound like mission impossible, but we will see that things work out fine as long as we are willing to deal with partial functions.
31 General Recursion 2 Herbrand-Gödel Computability µ-recursive Functions Church-Turing Thesis
32 Models of Computation 32 As we already mentioned, there are several other ways to define computability that, on the face of it, use rather different approaches. It is interesting to see how some of these methods compare to what we already have. Note that it could happen in principle that each definition produces a new and separate kind of computability. As it turns out, this is not the case: all roads lead to Cairo. Computability is very, very robust and does not depend on little incidentals.
33 Equations and Computability 33 Here is another way to tackle the computability question that stays close to standard mathematical practice and uses equations to define arithmetic functions. We will allow the use of constant 0 and the successor function x x + 1. Recall that we often write x + rather than x + 1. Consider the following equation E: f(x) = x ++ Intuitively, E defines the operation plus two. For example f(2) = 2 ++ = 3 + = 4 This may seem utterly braindead, but hold on.
34 Numerals 34 The last chain of equations assumes basic arithmetic, but this is really backwards: we want our equations to define arithmetic, not the other way around. To fix this problem, we will use numerals denoting natural numbers: 0 1 = = = In general, we have precisely one numeral n for every natural number n. Writing 2 instead of 0 ++ is just syntactic sugar, nothing new is happening here. The previous example really should be written f(2) = f(0 ++ ) = = = 2 ++ = 3 + = 4
35 Example: Addition 35 Time for a slightly more ambitious example. As Dedekind pointed out in the late 19th century, we can define addition by the following system of equations E: f(x, 0) = x f(x, y + ) = f(x, y) + We can check that E really defines addition: f(3, 2) = f(3, 1 + ) = f(3, 1) + = f(3, 0 + ) + = f(3, 0) ++ = 3 ++ = 4 + = 5
36 Equational Reasoning 36 If we wanted to be strictly formal about this, we would need to spell out a few rules on how to manipulate our equations. You already know these rules from high school: Substitution: We can replace a free variable everywhere in an equation by a numeral. Replacement: A term f(a 1,..., a k ) can be replaced by a numeral b if we have already proven f(a 1,..., a k ) = b.
37 3 + 2 = 5 37 (1) f(3, 0) = 3 subst of E 1 (2) f(3, 1) = f(3, 0) + subst. E 2 (3) f(3, 2) = f(3, 1) + subst. E 2 (4) f(3, 1) = 3 + = 4 repl. (1), (2) (5) f(3, 2) = 4 + = 5 repl. (4), (3) Tedious and blindingly boring for a human, but completely mechanical and easy to implement in any language with good support for pattern matching.
38 Herbrand-Gödel Computability 38 This idea extends naturally to arbitrary systems of equations E: we can manipulate the equations to derive assertions about concrete numerals. With a little more effort we could define a notion of derivability (or provability), usually written E f(a 1,..., a k ) = b Definition A partial function f : N k N is Herbrand-Gödel computable if there is a finite system of equations E that has an k-ary function symbol f such that E f(a 1,..., a k ) = b f(a 1,..., a k ) b for all a i, b N.
39 Comments 39 Note that we assume f only to be a partial function: for some inputs a it may not be possible to derive f(a) = b for any b. This is a bit of a nuisance, but remember the comment at the end of the section on evaluation: divergence is your friend. Other, traditional names in the literature: partial recursive functions or general recursive functions. This is rather misleading, since recursion (or inductive definition) is not really the basic design principle here. Science advances one funeral at a time. Max Planck
40 Warning: Identity 40 Also note the mysterious notation α β This means that either both α and β are defined (the computations involved all terminate) and have the same value, or both α and β are undefined (some computation diverges). By contrast, we write α = β if convergence is not an issue. For example, for primitive recursive functions there is no problem. In computability theory, identity is more complicated than you might think.
41 Good News 41 We have not given a careful and detailed description of what we mean by a system of equations, but it should be rather clear that any primitive recursive function can be defined by such a system. The basic functions successor, zero and projection are all defined in terms of equations. Composition and primitive recursion are also defined in terms of equations (rename and combine). Exercise Verify the last two claims by writing down the appropriate systems of equations.
42 More Good News 42 Recall our definition of the Ackermann function: A(0, y) = y + A(x +, 0) = A(x, 1) A(x +, y + ) = A(x, A(x +, y)) It follows immediately that A is Herbrand-Gödel computable. Alas, that it is far from clear that the evaluation function from above is similarly Herbrand-Gödel computable (it is, but it is a pain to prove this directly, we ll take a different route).
43 Bad News 43 Not every system of equations defines a function. Here are two counterexamples (we ll drop the underscores from now on). f(0, 0) = 0 f(x +, y) = f(x, y + ) g(x, 0) = x + g(x, y + ) = g(x +, y) g(x +, y + ) = g(x, g(x, y)) Exercise Figure out what s wrong with these systems of equations.
44 Closing the Gap 44 Systems of equations are naturally very appealing to any math person, but less so from a computer science perspective: we need to filter out the right systems of equations. Unfortunately, as it turns out, there is no algorithm to do this: we can not tell whether a system of equations defines an arithmetic function. It is therefore rather tempting to try to expand primitive recursive functions in a different way, by adding some other construction method that closes the gap to full computability.
45 General Recursion Herbrand-Gödel Computability 3 µ-recursive Functions Church-Turing Thesis
46 (General) Recursive Functions 46 Definition The clone of µ-recursive functions is defined like the primitive recursive functions, but with one additional operation: unbounded search. f(x) = min ( z g(z, x) = 0 ) Here g is required to be total. Thus, f(x) = 3 means g(3, x) = 0, but g(2, x), g(1, x), g(0, x) > 0.
47 More Convergence 47 Note f is intuitively computable whenever g is: we just conduct a potentially unbounded search for the least z such that g(z, x) = 0. As a result, even though we insist that g is total, f will in general just be a partial function: for some x there may well be no suitable witness z. Warning: one cannot allow for g itself to be partial; there are examples that show that this would violate intuitive computability.
48 Terminology 48 This last class of intuitively computable functions is due to Kleene. The notion µ-recursive function comes from the fact that in the older literature one often finds the more compact and rather cryptic notation f = µ g rather than a reference to min. So now we have primitive recursive functions, register machine computable functions, Herbrand-Gödel computable (partial recursive) functions, and µ-recursive functions. We know that p.r. is weaker than the other two classes, but what is the relationship between them?
49 Comparisons 49 Register machine computable is at least as strong as all the others: think about how a register machine could simulate the other models (using our coding machinery). Also, primitive recursive functions are strictly weaker. So the real questions are these: What is the relationship between register machine computable, µ-recursive and Herbrand-Gödel computable?
50 HG implies Mu 50 Suppose we have a finite system E of equations that defines a (partial) function f. To show that f(x) y we need to construct a derivation that uses only the given equations, plus substitution and replacement. With modest effort one can show that this whole machinery is primitive recursive in the following sense: there is a p.r. relation D such that D(t, x, y) t is a derivation of f(x) = y from E But then we can simply search for the least such t and extract the corresponding y.
51 Mu implies HG 51 We need to show how to express the min operator in terms of equations. Here is a trick due to Kleene (1952). Assume f(x) = µz(g(z, x) = 0). Introduce three new function symbols α, β and G with equations α(x, y + ) = x β(x, 0) = x G(0, x) = g(0, x) G(y +, x) = α(g(y +, x), G(y, x)) f(x) = β(z, G(z, x)) Ponder deeply.
52 RM versus Mu 52 With a bit of effort one can convince oneself that µ-recursive functions can be computed by a register machine: the unbounded search is no problem, we can have a loop that increments a register until a witness is found. In the opposite direction, each step in a computation of a register machine is primitive recursive, and by adding one unbounded search we can express computations of a register machine in terms of a µ-recursive function. So, they are all equivalent, and there are simple (primitive recursive) translations between the different models.
53 General Recursion Herbrand-Gödel Computability µ-recursive Functions 4 Church-Turing Thesis
54 The Key Ideas 54 We can specify a model M of computation by defining a space C of possible configurations (snapshots), a one-step relation, an input and output convention, a coding convention (if needed). The details vary greatly, but we always have the same pattern. Major Warning: Minute details about input/output/coding conventions become really important in low complexity classes; higher up they are mostly interchangeable.
55 Whole Computation 55 1 Given a one-step relation C M C, multiple steps and whole computations are defined in the obvious way: C M 0 C : C = C C M t C : C t 1 C M C C 1 M C C M C : t C M t C A computation (or a run) of M is a sequence of configurations C 0, C 1, C 2,... where C i M C i+1.
56 Input/Output 56 One needs a way to provide input from some set X, a map inp : X C as well as an output map to some set Y : outp: C Y Both maps are very simple, essentially just a bit of re-formatting. A minor technical issue: the output map may only be defined on some of the configurations (the halting configurations).
57 Models of Computation 57 C C C N k N The number-theoretic scenario: input and output are natural numbers.
58 Models of Computation, II 58 C C C Σ Σ The string scenario: input and output are words over some alphabet.
59 More History 59 In 1930, A. Church introduced yet another way of defining computability, based on his λ-calculus, the general theory of functional composition. There are lots of places in our curriculum where you can hear about the λ-calculus, so we will skip all details. In fact, the λ-calculus is hugely important for the semantics of programming languages, but plays much less of a role in classical computability theory. Suffice it to say that Church s student S. C. Kleene showed that many arithmetic functions are λ-definable.
60 Empirical Observation 60 For all the models mentioned so far, one can simulate model M in any other model M. In fact, the cross-model simulation maps are all very simple (say, primitive recursive). Of course, the length of a computation may differ a bit in different models, a major issue in complexity theory.
61 Church s Proposals 61 Church s Thesis I (1934): Effectively calculable iff λ-definable. Church s Thesis II (1935): Effectively calculable iff general recursive. Gödel rejected these early proposals by Church.
62 Gödel s Position 62 But then in 1936, A. Turing introduced his theory of computability based on Turing machines. Gödel responded most enthusiastically to Turing s work: This concept,... is equivalent to the concept of a computable function of integers... The most satisfactory way, in my opinion, is that of reducing the concept of finite procedure to that of a machine with a finite number of parts, as has been done by the British mathematician Turing.
63 Gödel Later 63 But I was completely convinced only by Turing s paper. See A. Turing [1936] and the almost simultaneous paper by E.L. Post [1936]. As for previous equivalent definitions of computability, which, however, are much less suitable for our purpose, see A. Church [1936]. Gödel explains his position in He always gave full credit to Turing, never to Church or himself.
64 Church s Response to Turing 64 The first has the advantage of making the identification with effectiveness in the ordinary (not explicitly defined) sense evident immediately, i.e., without the necessity of proving preliminary theorems. Church, in his 1937 review of Turing [1936].
65 Church-Turing Thesis 65 Church was the first to become convinced that All (reasonable) models of computation are equivalent, and correspond exactly to our intuitive notion of computability. So far (Fall 2017), there are no interesting objections to this idea. So from now on we will often simply talk about computable functions and reference specific models only when necessary.
66 The Cult of Hypercomputation 66 A lot of people would agree that the Church-Turing thesis also has a physical interpretation: All (reasonable) models of computation correspond exactly to physically realizable computability. This is much more problematic, since our actual universe appears to be finite in many ways we would need to ignore these constraints. Alas, we have nothing resembling an axiomatization of physics, so there is the logical possibility that some currently unknown physical phenomenon would allow one to break through the Turing limit. Possible, but not very likely. Forcryingoutloud, we can t even factor numbers.
CDM Register Machines
CDM Register Machines Klaus Sutner Carnegie Mellon Universality Fall 2017 1 More Recursion Register Machines Coding Universality Recall: Computability 3 Recall that we are looking for a formal definition
More informationCDM Register Machines
CDM Register Machines 1 More Recursion Klaus Sutner Carnegie Mellon Universality Register Machines 1-register-mach 217/12/15 23:18 Coding Universality Recall: Computability 3 Notation 4 Recall that we
More informationLecture 5: The Halting Problem. Michael Beeson
Lecture 5: The Halting Problem Michael Beeson Historical situation in 1930 The diagonal method appears to offer a way to extend just about any definition of computable. It appeared in the 1920s that it
More informationCOMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS
COMPUTABILITY THEORY AND RECURSIVELY ENUMERABLE SETS JOSHUA LENERS Abstract. An algorithm is function from ω to ω defined by a finite set of instructions to transform a given input x to the desired output
More informationCDM Loop Programs. 05-loop-progs 2017/12/15 23:18. Program Equivalence 3. Program Transformations 4. Rudimentary Functions 5. Rudimentary Programs 6
CDM Loop Programs 1 Rudimentary and Elementary Functions Klaus Sutner Carnegie Mellon Universality 05-loop-progs 2017/12/15 23:18 LOOP Programs Program Equivalence Program Equivalence 3 Program Transformations
More informationNotes on Turing s Theorem and Computability
Notes on Turing s Theorem and Computability Walter Neumann About 60 years ago there was a revolution in mathematics and philosophy. First Gödel and then Turing showed that there are impossible problems
More informationRecursively Enumerable Languages, Turing Machines, and Decidability
Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm
More informationCS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011
CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e
More informationCourse notes for Data Compression - 2 Kolmogorov complexity Fall 2005
Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005 Peter Bro Miltersen September 29, 2005 Version 2.0 1 Kolmogorov Complexity In this section, we present the concept of Kolmogorov Complexity
More informationCAS 701 Presentation. Ackermann's Function. Qinglei Zhang, Nov. 20, 2008.
CAS 701 Presentation Ackermann's Function Qinglei Zhang, Nov. 20, 2008. History The belief in the early 1900s: every computable function was also primitive recursive A strict subset of the recursive functions:
More informationLecture 7: Primitive Recursion is Turing Computable. Michael Beeson
Lecture 7: Primitive Recursion is Turing Computable Michael Beeson Closure under composition Let f and g be Turing computable. Let h(x) = f(g(x)). Then h is Turing computable. Similarly if h(x) = f(g 1
More informationCS 275 Automata and Formal Language Theory. First Problem of URMs. (a) Definition of the Turing Machine. III.3 (a) Definition of the Turing Machine
CS 275 Automata and Formal Language Theory Course Notes Part III: Limits of Computation Chapt. III.3: Turing Machines Anton Setzer http://www.cs.swan.ac.uk/ csetzer/lectures/ automataformallanguage/13/index.html
More informationp x i 1 i n x, y, z = 2 x 3 y 5 z
3 Pairing and encoding functions Our aim in this part of the course is to show that register machines can compute everything that can be computed, and to show that there are things that can t be computed.
More information3.7 Denotational Semantics
3.7 Denotational Semantics Denotational semantics, also known as fixed-point semantics, associates to each programming language construct a well-defined and rigorously understood mathematical object. These
More informationMaterial from Recitation 1
Material from Recitation 1 Darcey Riley Frank Ferraro January 18, 2011 1 Introduction In CSC 280 we will be formalizing computation, i.e. we will be creating precise mathematical models for describing
More informationThis is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS
1 THE FORMALIZATION OF MATHEMATICS by Harvey M. Friedman Ohio State University Department of Mathematics friedman@math.ohio-state.edu www.math.ohio-state.edu/~friedman/ May 21, 1997 Can mathematics be
More informationTheory of Computer Science. D2.1 Introduction. Theory of Computer Science. D2.2 LOOP Programs. D2.3 Syntactic Sugar. D2.
Theory of Computer Science April 20, 2016 D2. LOOP- and WHILE-Computability Theory of Computer Science D2. LOOP- and WHILE-Computability Malte Helmert University of Basel April 20, 2016 D2.1 Introduction
More informationPrim Rec, Decidable, Undecidable, and Beyond. William Gasarch-U of MD
Primitive Recursive An attempt to pin down the set of functions that are computable. A function f is Primitive Recursive 1) f (x 1,..., x n ) = 0 OR f (x 1,..., x n ) = x i + c, c N. 2) If g 1 (x 1,...,
More informationCSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel
CSCI 270: Introduction to Algorithms and Theory of Computing Fall 2017 Prof: Leonard Adleman Scribe: Joseph Bebel We will now discuss computer programs, a concrete manifestation of what we ve been calling
More informationSemantics via Syntax. f (4) = if define f (x) =2 x + 55.
1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)
More informationLimitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and
Computer Language Theory Chapter 4: Decidability 1 Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and
More information14.1 Encoding for different models of computation
Lecture 14 Decidable languages In the previous lecture we discussed some examples of encoding schemes, through which various objects can be represented by strings over a given alphabet. We will begin this
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18
601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can
More informationIntroduction to the Lambda Calculus
Introduction to the Lambda Calculus Overview: What is Computability? Church s Thesis The Lambda Calculus Scope and lexical address The Church-Rosser Property Recursion References: Daniel P. Friedman et
More informationaxiomatic semantics involving logical rules for deriving relations between preconditions and postconditions.
CS 6110 S18 Lecture 18 Denotational Semantics 1 What is Denotational Semantics? So far we have looked at operational semantics involving rules for state transitions, definitional semantics involving translations
More informationCS 6110 S14 Lecture 1 Introduction 24 January 2014
CS 6110 S14 Lecture 1 Introduction 24 January 2014 1 Introduction What is a program? Is it just something that tells the computer what to do? Yes, but there is much more to it than that. The basic expressions
More informationMATH Iris Loeb.
MATH 134 http://www.math.canterbury.ac.nz/math134/09/su1/c Iris Loeb I.Loeb@math.canterbury.ac.nz Office Hours: Thur 10.00-11.00, Room 703 (MSCS Building) The Limits of Formal Logic We now turn our attention
More informationLecture 3: Recursion; Structural Induction
15-150 Lecture 3: Recursion; Structural Induction Lecture by Dan Licata January 24, 2012 Today, we are going to talk about one of the most important ideas in functional programming, structural recursion
More informationComplexity Theory. Compiled By : Hari Prasad Pokhrel Page 1 of 20. ioenotes.edu.np
Chapter 1: Introduction Introduction Purpose of the Theory of Computation: Develop formal mathematical models of computation that reflect real-world computers. Nowadays, the Theory of Computation can be
More informationCS422 - Programming Language Design
1 CS422 - Programming Language Design Denotational Semantics Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 Denotational semantics, alsoknownasfix-point semantics,
More information(a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the
COMPUTER SCIENCE TRIPOS Part IB 205 Paper 6 4 (AMP) (a) Give inductive definitions of the relations M N and M N of single-step and many-step β-reduction between λ-terms M and N. (You may assume the definition
More informationDenotational semantics
1 Denotational semantics 2 What we're doing today We're looking at how to reason about the effect of a program by mapping it into mathematical objects Specifically, answering the question which function
More informationLectures 20, 21: Axiomatic Semantics
Lectures 20, 21: Axiomatic Semantics Polyvios Pratikakis Computer Science Department, University of Crete Type Systems and Static Analysis Based on slides by George Necula Pratikakis (CSD) Axiomatic Semantics
More informationDiagonalization. The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets?
Diagonalization Cardinalities The cardinality of a finite set is easy to grasp: {1,3,4} = 3. But what about infinite sets? We say that a set S has at least as great cardinality as set T, written S T, if
More informationComputability Theory
CSC 438F/2404F Notes (S. Cook) Fall, 2008 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10. Other references:
More informationIntroduction to Denotational Semantics. Brutus Is An Honorable Man. Class Likes/Dislikes Survey. Dueling Semantics
Brutus Is An Honorable Man HW2 will not be due today. Homework X+1 will never be due until after I have returned Homework X to you. Normally this is never an issue, but I was sick yesterday and was hosting
More informationIntroduction to Denotational Semantics. Class Likes/Dislikes Survey. Dueling Semantics. Denotational Semantics Learning Goals. You re On Jeopardy!
Introduction to Denotational Semantics Class Likes/Dislikes Survey would change [the bijection question] to be one that still tested students' recollection of set theory but that didn't take as much time
More informationComputation Club: Gödel s theorem
Computation Club: Gödel s theorem The big picture mathematicians do a lot of reasoning and write a lot of proofs formal systems try to capture the ideas of reasoning and proof in a purely mechanical set
More informationCS 125 Section #4 RAMs and TMs 9/27/16
CS 125 Section #4 RAMs and TMs 9/27/16 1 RAM A word-ram consists of: A fixed set of instructions P 1,..., P q. Allowed instructions are: Modular arithmetic and integer division on registers; the standard
More information1.3. Conditional expressions To express case distinctions like
Introduction Much of the theory developed in the underlying course Logic II can be implemented in a proof assistant. In the present setting this is interesting, since we can then machine extract from a
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2016 Lecture 15 Ana Bove May 23rd 2016 More on Turing machines; Summary of the course. Overview of today s lecture: Recap: PDA, TM Push-down
More informationReview. CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Let bindings (CBV) Adding Stuff. Booleans and Conditionals
Review CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics e ::= λx. e x ee c v ::= λx. e c (λx. e) v e[v/x] e 1 e 2 e 1 e 2 τ ::= int τ τ Γ ::= Γ,x : τ e 2 e 2 ve 2 ve 2 e[e /x]:
More informationLecture Notes on Contracts
Lecture Notes on Contracts 15-122: Principles of Imperative Computation Frank Pfenning Lecture 2 August 30, 2012 1 Introduction For an overview the course goals and the mechanics and schedule of the course,
More information6.001 Notes: Section 6.1
6.001 Notes: Section 6.1 Slide 6.1.1 When we first starting talking about Scheme expressions, you may recall we said that (almost) every Scheme expression had three components, a syntax (legal ways of
More informationComputability via Recursive Functions
Computability via Recursive Functions Church s Thesis All effective computational systems are equivalent! To illustrate this point we will present the material from chapter 4 using the partial recursive
More informationCDM Primitive Recursion
CDM Primitive Recursion Klaus Sutner Carnegie Mellon Universality Fall 2017 1 Primitive Recursive Functions Properties of PR Coding Computability, Definition 3 We need a formal definition of computability
More informationCDM Primitive Recursion
CDM Primitive Recursion 1 Primitive Recursive Functions Klaus Sutner Carnegie Mellon Universality Properties of PR Fall 2017 Coding Computability, Definition 3 Knee-Jerk Reaction 4 We need a formal definition
More informationWhat computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora
What computers just cannot do. COS 116: 2/28/2008 Sanjeev Arora Administrivia In class midterm in midterms week; Thurs Mar 13 (closed book;? No lab in midterms week; review session instead. What computers
More informationAn Interesting Way to Combine Numbers
An Interesting Way to Combine Numbers Joshua Zucker and Tom Davis October 12, 2016 Abstract This exercise can be used for middle school students and older. The original problem seems almost impossibly
More informationRecursive Functions. 6.1 Primitive Recursive Functions
6 Recursive Functions The intuitive notion of an effectively computable function is the notion of a function for which there are definite, explicit rules, following which one could in principle compute
More information3.4 Deduction and Evaluation: Tools Conditional-Equational Logic
3.4 Deduction and Evaluation: Tools 3.4.1 Conditional-Equational Logic The general definition of a formal specification from above was based on the existence of a precisely defined semantics for the syntax
More informationElementary Recursive Function Theory
Chapter 6 Elementary Recursive Function Theory 6.1 Acceptable Indexings In a previous Section, we have exhibited a specific indexing of the partial recursive functions by encoding the RAM programs. Using
More informationWe show that the composite function h, h(x) = g(f(x)) is a reduction h: A m C.
219 Lemma J For all languages A, B, C the following hold i. A m A, (reflexive) ii. if A m B and B m C, then A m C, (transitive) iii. if A m B and B is Turing-recognizable, then so is A, and iv. if A m
More informationMath 5593 Linear Programming Lecture Notes
Math 5593 Linear Programming Lecture Notes Unit II: Theory & Foundations (Convex Analysis) University of Colorado Denver, Fall 2013 Topics 1 Convex Sets 1 1.1 Basic Properties (Luenberger-Ye Appendix B.1).........................
More informationDoes this program exist? Limits of computability. Does this program exist? A helper function. For example, if the string program is
Does this program exist? For example, if the string program is Limits of computability public void abc(string s) { if( s == "abc" ) { print "Hello world!"; } else { print "Whatever"; }} then test called
More informationTyping Control. Chapter Conditionals
Chapter 26 Typing Control 26.1 Conditionals Let s expand our language with a conditional construct. We can use if0 like before, but for generality it s going to be more convenient to have a proper conditional
More informationPresented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee. Joint work with: Prof. Padam Kumar
Presented By : Abhinav Aggarwal CSI-IDD, V th yr Indian Institute of Technology Roorkee Joint work with: Prof. Padam Kumar A Seminar Presentation on Recursiveness, Computability and The Halting Problem
More informationCHAPTER 4. COMPUTABILITY AND DECIDABILITY
CHAPTER 4. COMPUTABILITY AND DECIDABILITY 1. Introduction By definition, an n-ary function F on N assigns to every n-tuple k 1,...,k n of elements of N a unique l N which is the value of F at k 1,...,k
More informationLecture T4: Computability
Puzzle ("Post s Correspondence Problem") Lecture T4: Computability Given a set of cards: N card types (can use as many of each type as possible) Each card has a top string and bottom string Example : N
More informationContinuous functions and homeomorphisms
Continuous functions and homeomorphisms 1 Motivation Up to now we have defined just a few topological properties, like the first three T -axioms and the countability properties (separable, ccc, first and
More informationPropositional Logic. Part I
Part I Propositional Logic 1 Classical Logic and the Material Conditional 1.1 Introduction 1.1.1 The first purpose of this chapter is to review classical propositional logic, including semantic tableaux.
More informationExact Algorithms Lecture 7: FPT Hardness and the ETH
Exact Algorithms Lecture 7: FPT Hardness and the ETH February 12, 2016 Lecturer: Michael Lampis 1 Reminder: FPT algorithms Definition 1. A parameterized problem is a function from (χ, k) {0, 1} N to {0,
More information6.001 Notes: Section 8.1
6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything
More informationReflection in the Chomsky Hierarchy
Reflection in the Chomsky Hierarchy Henk Barendregt Venanzio Capretta Dexter Kozen 1 Introduction We investigate which classes of formal languages in the Chomsky hierarchy are reflexive, that is, contain
More informationLecture Notes on Program Equivalence
Lecture Notes on Program Equivalence 15-312: Foundations of Programming Languages Frank Pfenning Lecture 24 November 30, 2004 When are two programs equal? Without much reflection one might say that two
More informationGenerating Functions
6.04/8.06J Mathematics for Computer Science Srini Devadas and Eric Lehman April 7, 005 Lecture Notes Generating Functions Generating functions are one of the most surprising, useful, and clever inventions
More informationCSC 501 Semantics of Programming Languages
CSC 501 Semantics of Programming Languages Subtitle: An Introduction to Formal Methods. Instructor: Dr. Lutz Hamel Email: hamel@cs.uri.edu Office: Tyler, Rm 251 Books There are no required books in this
More informationLecture 1 Contracts : Principles of Imperative Computation (Fall 2018) Frank Pfenning
Lecture 1 Contracts 15-122: Principles of Imperative Computation (Fall 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,
More information1 Counting triangles and cliques
ITCSC-INC Winter School 2015 26 January 2014 notes by Andrej Bogdanov Today we will talk about randomness and some of the surprising roles it plays in the theory of computing and in coding theory. Let
More informationPCP and Hardness of Approximation
PCP and Hardness of Approximation January 30, 2009 Our goal herein is to define and prove basic concepts regarding hardness of approximation. We will state but obviously not prove a PCP theorem as a starting
More information3.1 Constructions with sets
3 Interlude on sets Sets and functions are ubiquitous in mathematics. You might have the impression that they are most strongly connected with the pure end of the subject, but this is an illusion: think
More informationChapter 11 :: Functional Languages
Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Copyright 2016 Elsevier 1 Chapter11_Functional_Languages_4e - Tue November 21, 2017 Historical Origins The imperative
More information1 The language χ. Models of Computation
Bengt Nordström, 1 2017-10-13 Department of Computing Science, Chalmers and University of Göteborg, Göteborg, Sweden 1 The language χ The main purpose of the language χ is to illustrate some basic results
More information6.001 Notes: Section 4.1
6.001 Notes: Section 4.1 Slide 4.1.1 In this lecture, we are going to take a careful look at the kinds of procedures we can build. We will first go back to look very carefully at the substitution model,
More informationLecture Notes on Data Representation
Lecture Notes on Data Representation 15-814: Types and Programming Languages Frank Pfenning Lecture 9 Tuesday, October 2, 2018 1 Introduction In this lecture we ll see our type system in action. In particular
More informationSteven Skiena. skiena
Lecture 22: Introduction to NP-completeness (1997) Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Among n people,
More informationAn Annotated Language
Hoare Logic An Annotated Language State and Semantics Expressions are interpreted as functions from states to the corresponding domain of interpretation Operators have the obvious interpretation Free of
More information2.8 Universal Turing Machines and the Halting Problem
2.8 Universal Turing Machines and the Halting Problem Through the hierarchy of Slide 74 we indirectly get a sense that Turing Machines are at least as computationally powerful as any other known model
More informationLecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets
Lecture 4: examples of topological spaces, coarser and finer topologies, bases and closed sets Saul Glasman 14 September 2016 Let s give the definition of an open subset of R. Definition 1. Let U R. We
More informationLecture 1. 1 Notation
Lecture 1 (The material on mathematical logic is covered in the textbook starting with Chapter 5; however, for the first few lectures, I will be providing some required background topics and will not be
More informationIntroduction to the λ-calculus
Announcements Prelim #2 issues: o Problem 5 grading guide out shortly o Problem 3 (hashing) issues Will be on final! Friday RDZ office hours are 11-12 not 1:30-2:30 1 Introduction to the λ-calculus Today
More informationLecture 1 Contracts. 1 A Mysterious Program : Principles of Imperative Computation (Spring 2018) Frank Pfenning
Lecture 1 Contracts 15-122: Principles of Imperative Computation (Spring 2018) Frank Pfenning In these notes we review contracts, which we use to collectively denote function contracts, loop invariants,
More informationProgramming Lecture 3
Programming Lecture 3 Expressions (Chapter 3) Primitive types Aside: Context Free Grammars Constants, variables Identifiers Variable declarations Arithmetic expressions Operator precedence Assignment statements
More information1 Introduction CHAPTER ONE: SETS
1 Introduction CHAPTER ONE: SETS Scientific theories usually do not directly describe the natural phenomena under investigation, but rather a mathematical idealization of them that abstracts away from
More informationTo prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):
CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning
More informationProgram Verification & Testing; Review of Propositional Logic
8/24: p.1, solved; 9/20: p.5 Program Verification & Testing; Review of Propositional Logic CS 536: Science of Programming, Fall 2018 A. Why Course guidelines are important. Active learning is the style
More informationRecursive Function Theory
The Initial Functions The Building Operations Composition Primitive Recursion Minimization Summary Recursive Function Theory Peter Suber, Philosophy Department, Earlham College Recursive function theory,
More informationChapter 12. Computability Mechanizing Reasoning
Chapter 12 Computability Gödel s paper has reached me at last. I am very suspicious of it now but will have to swot up the Zermelo-van Neumann system a bit before I can put objections down in black & white.
More informationTopic 1: What is HoTT and why?
Topic 1: What is HoTT and why? May 5, 2014 Introduction Homotopy type theory (HoTT) is a newly emerging field of mathematics which is currently being developed as a foundation of mathematics which is in
More informationHandout 9: Imperative Programs and State
06-02552 Princ. of Progr. Languages (and Extended ) The University of Birmingham Spring Semester 2016-17 School of Computer Science c Uday Reddy2016-17 Handout 9: Imperative Programs and State Imperative
More information05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability.
05. Turing Machines and Spacetime. I. Turing Machines and Classical Computability. 1. Turing Machines A Turing machine (TM) consists of (Turing 1936): Alan Turing 1. An unbounded tape. Divided into squares,
More informationCONVENTIONAL EXECUTABLE SEMANTICS. Grigore Rosu CS522 Programming Language Semantics
CONVENTIONAL EXECUTABLE SEMANTICS Grigore Rosu CS522 Programming Language Semantics Conventional Semantic Approaches A language designer should understand the existing design approaches, techniques and
More informationNote that in this definition, n + m denotes the syntactic expression with three symbols n, +, and m, not to the number that is the sum of n and m.
CS 6110 S18 Lecture 8 Structural Operational Semantics and IMP Today we introduce a very simple imperative language, IMP, along with two systems of rules for evaluation called small-step and big-step semantics.
More informationRecursive Functions. Recursive functions are built up from basic functions by some operations.
Recursive Functions Recursive functions are built up from basic functions by some operations. The Successor Function Let s get very primitive. Suppose we have 0 defined, and want to build the nonnegative
More informationLecture 6: Arithmetic and Threshold Circuits
IAS/PCMI Summer Session 2000 Clay Mathematics Undergraduate Program Advanced Course on Computational Complexity Lecture 6: Arithmetic and Threshold Circuits David Mix Barrington and Alexis Maciel July
More informationMassachusetts Institute of Technology Department of Electrical Engineering and Computer Science Algorithms For Inference Fall 2014
Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science 6.438 Algorithms For Inference Fall 2014 Recitation-6: Hardness of Inference Contents 1 NP-Hardness Part-II
More information6. Advanced Topics in Computability
227 6. Advanced Topics in Computability The Church-Turing thesis gives a universally acceptable definition of algorithm Another fundamental concept in computer science is information No equally comprehensive
More informationChapter 3. Set Theory. 3.1 What is a Set?
Chapter 3 Set Theory 3.1 What is a Set? A set is a well-defined collection of objects called elements or members of the set. Here, well-defined means accurately and unambiguously stated or described. Any
More informationTreaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19
CSE34T/CSE549T /05/04 Lecture 9 Treaps Binary Search Trees (BSTs) Search trees are tree-based data structures that can be used to store and search for items that satisfy a total order. There are many types
More informationChapter 2 The Language PCF
Chapter 2 The Language PCF We will illustrate the various styles of semantics of programming languages with an example: the language PCF Programming language for computable functions, also called Mini-ML.
More information