Pola: a language for PTIME Programming. Mike Burrell, Robin Cockett, Brian Redmond LCC 2009
|
|
- Florence Carpenter
- 6 years ago
- Views:
Transcription
1 Pola: a language for PTIME Programming Mike Burrell, Robin Cockett, Brian Redmond LCC 2009
2 Pola overview Allows for general inductive data types And coinductive as well! Breaks variables into two separate worlds Player Affine Opponent Drives recursion
3 Inductive world Allow constructing typical inductive data types data Nat c = Zero : c Succ : c c data List(a) c = Nil : c Cons : a, c c E.g., [a, b] = Cons(a, Cons(b, Nil)) data Tree(a) c = Leaf : a c Node : c, c c Function application, but no recursion!
4 iszero :: Nat Bool; iszero = x.case x of { Zero.True; Succ( ).False }; isempty :: List(a) Bool; isempty = lst.case lst of { Nil.True; Cons(, ).False }; isempty([2, 3]) False
5 Safe recursion The fold construct introduces a safe recursive function What s being folded over must be in the opponent world Everything else in the fold must be in the player world x must be of a universal type add :: Nat Nat Nat; add = x y.fold f(x, y) as { Zero.n; y)) } in f(x, y ); mul :: Nat, Nat Nat; mul = x, y.fold f(x) as { Zero.Zero; f(m)) } in f(x, y );
6 Opponent and player world f = a.fold f(a, b) as { No restrictions in the opponent world.... f(m, b)) } in f(a, Zero);
7 Opponent and player world f = a.fold f(a) as {... } in f(a ); f = a.fold f(a) as {... } in f(a ); f = a.fold f(a) as {... } in f(succ(zero));
8 No exponential mul :: Nat, Nat Nat; exp = x, y.fold f(x) as { Zero.Succ(Zero); f(m)) } in f(x, y );
9 No exponential mul :: Nat, Nat Nat; exp = x, y.fold f(x) as { Zero.Succ(Zero); f(m)) } in f(x, y );
10 Opponent/player round-up Generally no restrictions in the opponent world, but... The opponent context must stay constant within a safe recursion! The player world is restrictive No duplicating! Variables can t be brought to the opponent world
11 Γ,x: X x : X id o Γ,y : Y y : Y id p Γ t : Y Γ,x: X t : Y weak o Γ t : Y Γ,y : Y t : Y weak p Γ t : X Γ,x: X t : Y Γ t [t/x] :Y cut o Γ 1 t : Y Γ 2,y : Y t : Y Γ 1, 2 t [t/y] :Y cut p Γ t : Y Γ, () : 1 t : Y Γ t : Y Γ, () : 1 t : Y Γ () : 1 Γ,x 1 : X 1,x 2 : X 2 t : Y Γ, (x 1,x 2 ):X 1 X 2 t : Y Γ,y 1 : Y 1,y 2 : Y 2 t : Y Γ, (y 1,y 2 ):Y 1 Y 2 t : Y Γ 1 t 1 : Y 1 Γ 2 t 2 : Y 2 Γ 1, 2 (t 1,t 2 ):Y 1 Y 2 Table 1. The basic logic of safety.
12 player types A, a new player type D(A) is added, together with rules for its constructors C i (see table 2). An inductive data type is introduced into the basic Γ t : F i (D(A),A) Γ C i (t) :D(A) cons i {Γ y i : F i (D(A),A), t i : Y } i=1,...,k 8 9 >< C 1 (y 1 ).t 1 >= Γ y : D(A), case y of. >: >; : Y C k (y k ).t k case 8 < Γ,z : D(A) w : Γ, C f : C, Ẽ Y. : y i : F i (D(A),A) y i : F i (C, A), w : Ẽ t i : Y 9 = ; i=1,...,k 8 >< C 1 (y 9 1@y 1 ).t 1 >= Ẽ fold f(z, w) as. >: >; in f(z, w ):Y C k (y k@y k ).t k Table 2. Judgements for fixed points and safe inductive folding. logic of safety with a specification of the form: data D(A) C = {C i : F i (C, A) C} i=1,...,k
13 Peeks Why can t we duplicate in the player world? We could duplicate recursive calls! Definitely not polynomial anymore! What if we don t want to use a value, just peek at it?
14 iszero = x.case x of { Zero.True; Succ(-).False }; callfifnotzero = x.case x of { Zero.Zero; Succ(-).f(x) };
15 iszero = x.case x of { Zero.True; Succ(-).False }; callfifnotzero = x.case x of { Zero.Zero; Succ(-).f(x) }; callfifnotzero = x.case x of { Zero.Zero; Succ(x ).f(succ(x )) };
16 Peeking peek is semantically the same as a case Typing is different Only anonymous patterns Player variables in callfifnotzero = x. peek x of { Zero.Zero; Succ( ).f(x) }; subject can be reused
17 Coinductive world data c Prod(a, b) = P1 : c a P2 : c b E.g., P1( ( P1 : 3 ; P2 : hello ) ) 3 data c Fn(a, b) = Eval : c, a b E.g., Eval( ( Eval : x. Succ(x) ), 3) 4
18 map :: Fn(a, b), List(a) List(b); map = f, l.fold g(l) as { Nil.Nil; Cons(x, xs).cons(eval(f, x), g(xs)) } in g(l ); map( ( Eval : x.succ(x) ), [3, 4]) [4, 5]
19 Safe recursion data c InfList(a) = Head : c a Tail : c c; naturalnumbers :: InfList(Nat); naturalnumbers =.unfold g(x) as ( Head : x; Tail : g(succ(x)) ) in g(zero); Head(Tail(Tail(naturalNumbers))) 2
20 data c InfTree = Left : c c Right : c c; infinitetree :: InfTree; infinitetree =.unfold g() as ( Left : g(); Right : g() ) in g();
21 data c InfTree = Left : c c Right : c c; infinitetree :: InfTree; infinitetree =.unfold g() as ( Left : g(); Right : g() ) in g(); fold f(x, t) as { Zero.t; Right(t)) } in f(n, infinitetree);
22 12 Γ t : D(A/B) A i Γ D i (t) :G i (D(A/B),B) dest i {Γ,a i : A i t i : G i (D(A/B),B)} i=1...k 0 1 D 1 : a 1.t 1 B D k : a k.t k C A : D(A/B) record Γ ỹ : Γ, C g : Ẽ C 8 < : Ẽ unfold g(ỹ) as. a i : A i, ỹ : Ẽ t i : G i (C, B) 0 1 D 1 : a 1.t 1 D k : a k.t k 9 = ; i=1,...,k C A in g(ỹ ):D(A/B) Table 4. Judgements for destruction, records and safe coinductive unfolding. to a corresponding destructor, together with a value for the variable a i, that computation proceeds by evaluating the appropriate term t i. Example Pola programs using coinductive types are given in figure 4. The type of the function pmap is A B,L(A) L(B) and it simply applies the player function f to every element of the list. This shows that the list function is
23 Polynomial completeness The power of Pola exacts equals PTIME Pola can compute any PTIME algorithm We can compute a fixed polynomial from the size of the input One level of safe recursion per degree of the polynomial Use that to drive the recursion simulating a Turing machine
24 Polynomial completeness Any Pola program is in PTIME Everything in the player world is constant time A single fold is linear in the size of its input Nested folds are polynomial in the size of their input fold f(x) of { Nil.Zero; Cons(y, g(z) of { Nil.Zero; Cons(, ).Zero in g(ys ) in f(x )
25 Polynomials can be assigned to terms inductively by the following rules. In fact, the derivation of the polynomial associated to a term mimics the derivation of the term by the proof rules. x = x (opponent variable) y = 0 (player variable) (t 1,t 2 ) = t 1 + t 2 t[t /x] = t [ t /x] (opponent cut) t[t /y] = t + t (player cut) () =0 C(t) = t +1 case y of {C i (y i).t i } = max i t i [y/y i ] peek y of {C i ( ).t i } = max i t i fold f(z, w) as { } in f(z, w ) = f(z, w ) f(z, w) = z case z of {C i (y i).t i } unfold g(ỹ) as ( ) in g(ỹ ) =0 ( ) = 0 (record) D(t, t ) = {t} + t + t (destruction) where { } is identical to except that: {unfold g(ỹ) as (D 1 : a 1.t 1 ; ; D k : a k.t k ) in g(ỹ )} = max t i i {(D 1 : a 1.t 1 ; ; D k : a k.t k )} = max t i i {D(t, t )} = {t} where has the same inductive definition as except that f(z, w) =0 for each recursive call to f. One can show by induction on the proof rules that if x 1 : X 1,..., x n : X n y 1 : Y 1,..., y m : Y m t : Y is derivable then t is a polynomial in x 1,..., x n. One can then show that whenever t evaluates to e, e t + y y m For example, addition on unary numbers is defined in Pola by x : Nat y :
26 Pola wrap-up Unifies work of Hofmann, Bellantoni and Cook, etc. Aims to be general, practical PTIME language Inductive data types, coinductive data types Peeking at values Implementation nearing stability
27 Thank you.
ON FIRST-ORDER CONS-FREE TERM REWRITING AND PTIME
ON FIRST-ORDER CONS-FREE TERM REWRITING AND PTIME CYNTHIA KOP Department of Computer Science, Copenhagen University e-mail address: kop@diku.dk Abstract. In this paper, we prove that (first-order) cons-free
More informationTyped Arithmetic Expressions
Typed Arithmetic Expressions CS 550 Programming Languages Jeremy Johnson TAPL Chapters 3 and 5 1 Types and Safety Evaluation rules provide operational semantics for programming languages. The rules provide
More informationGeneric Accumulations for Program Calculation
Generic Accumulations for Program Calculation Mauro Jaskelioff Facultad de Cs. Exactas, Ingeniería y Agrimensura Universidad Nacional de Rosario Rosario - Argentina mauro@fceia.unr.edu.ar December 2004
More informationPredicative Copying and Polynomial Time
Clifford Lectures 2002 Predicative Copying and Polynomial Time 1 Predicative Copying and Polynomial Time Samson Abramsky Clifford Lectures 2002 Predicative Copying and Polynomial Time 2 Background: Implicit
More informationNotes on Inductive Sets and Induction
Notes on Inductive Sets and Induction Finite Automata Theory and Formal Languages TMV027/DIT21 Ana Bove, March 15th 2018 Contents 1 Induction over the Natural Numbers 2 1.1 Mathematical (Simple) Induction........................
More informationInductive types and identity types
1 / 49 Inductive types and identity types Michael Shulman February 7, 2012 3 / 49 Type constructors For every type constructor, we have rules for: 1 Constructing types 2 Constructing terms in those types
More informationOperational Semantics Using the Partiality Monad
page.1 Operational Semantics Using the Partiality Monad Nils Anders Danielsson (Göteborg) Shonan Meeting 026: Coinduction for computation structures and programming languages The research leading to these
More informationAn introduction to (co)algebra and (co)induction
1 An introduction to (co)algebra and (co)induction 1.1 Introduction Algebra is a well-established part of mathematics, dealing with sets with operations satisfying certain properties, like groups, rings,
More informationImplicit Computational Complexity
Implicit Computational Complexity Simone Martini Dipartimento di Scienze dell Informazione Università di Bologna Italy Bertinoro International Spring School for Graduate Studies in Computer Science, 6
More informationFinite Automata Theory and Formal Languages TMV027/DIT321 LP Recap: Logic, Sets, Relations, Functions
Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2017 Formal proofs; Simple/strong induction; Mutual induction; Inductively defined sets; Recursively defined functions. Lecture 3 Ana Bove
More informationThe syntactic guard condition of Coq
The syntactic guard condition of Coq Bruno Barras February 2, 2010 Overview 1 Theory Basic criterion Extensions 2 Algorithm Efficiency 3 Discussion 4 Attic A short history of the syntactic guard criterion
More informationQuantum Functional Programming Language & Its Denotational Semantics
Quantum Functional Programming Language & Its Denotational Semantics Ichiro Hasuo Dept. Computer Science University of Tokyo Naohiko Hoshino Research Inst. for Math. Sci. Kyoto University Talk based on:
More informationA categorical model for a quantum circuit description language
A categorical model for a quantum circuit description language Francisco Rios (joint work with Peter Selinger) Department of Mathematics and Statistics Dalhousie University CT July 16th 22th, 2017 What
More informationFocusing on Binding and Computation
Focusing on Binding and Computation Dan Licata Joint work with Noam Zeilberger and Robert Harper Carnegie Mellon University 1 Programming with Proofs Represent syntax, judgements, and proofs Reason about
More informationReview. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007
CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation
More informationCS 4110 Programming Languages & Logics. Lecture 16 Programming in the λ-calculus
CS 4110 Programming Languages & Logics Lecture 16 Programming in the λ-calculus 30 September 2016 Review: Church Booleans 2 We can encode TRUE, FALSE, and IF, as: TRUE λx. λy. x FALSE λx. λy. y IF λb.
More informationNon size-increasing computation. Martin Hofmann LMU München Geocal 06 Luminy, Feb. 2006
1 Non size-increasing computation Martin Hofmann LMU München Geocal 06 Luminy, 9.-10. Feb. 2006 2 Main result of these talks Description: The system LFPL ω is a linearly typed functional language with
More informationWhen is a function a fold or an unfold?
When is a function a fold or an unfold? Jeremy Gibbons University of Oxford Graham Hutton University of Nottingham Thorsten Altenkirch University of Nottingham April 29, 2002 Abstract We give a necessary
More informationCOMPLEXITY HIERARCHIES AND HIGHER-ORDER CONS-FREE TERM REWRITING
COMPLEXITY HIERARCHIES AND HIGHER-ORDER CONS-FREE TERM REWRITING CYNTHIA KOP AND JAKOB GRUE SIMONSEN Department of Computer Science, Copenhagen University e-mail address: {kop,simonsen}@di.ku.dk Abstract.
More informationThe Power of Non-Determinism in Higher-Order Implicit Complexity
The Power of Non-Determinism in Higher-Order Implicit Complexity Characterising Complexity Classes using Non-deterministic Cons-free Programming Cynthia Kop and Jakob Grue Simonsen Department of Computer
More informationElement x is R-minimal in X if y X. R(y, x).
CMSC 22100/32100: Programming Languages Final Exam M. Blume December 11, 2008 1. (Well-founded sets and induction principles) (a) State the mathematical induction principle and justify it informally. 1
More informationSoft Linear Logic and the Polynomial Hierarchy (Extended Abstract)
Soft Linear Logic and the Polynomial Hierarchy (Extended Abstract) Brian F. Redmond Department of Computing, Mathematics and Statistical Sciences Grande Prairie Regional College 10726-106 Avenue, Grande
More informationTyping λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus
Course 2D1453, 200607 Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Some material from B. Pierce: TAPL + some from G. Klein, NICTA Typing λterms The uptyped λcalculus
More informationCS294-9 September 14, 2006 Adam Chlipala UC Berkeley
Interactive Computer Theorem Proving Lecture 4: Inductively- Defined Predicates CS294-9 September 14, 2006 Adam Chlipala UC Berkeley 1 Administrivia The course registration database has been updated so
More informationModeling and reasoning with I-polynomial data types
Modeling and reasoning with I-polynomial data types Peter Padawitz, TU Dortmund, Germany September 1, 2017 (actual version: http://fldit-www.cs.uni-dortmund.de/ peter/ifip2016.pdf) 1 Road map Some examples
More informationProgramming Languages
CSE 230: Winter 2010 Principles of Programming Languages Lecture 10: Programming in λ-calculusc l l Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2
More informationType Systems as a Foundation for Reliable Computing
Type Systems as a Foundation for Reliable Computing Robert Harper Carnegie Mellon University Summer School on Reliable Computing University of Oregon July, 2005 References These lectures are based on the
More informationPrinciples of Program Analysis: Control Flow Analysis
Principles of Program Analysis: Control Flow Analysis Transparencies based on Chapter 3 of the book: Flemming Nielson, Hanne Riis Nielson and Chris Hankin: Principles of Program Analysis. Springer Verlag
More informationFirst-Order Logic. 1 Syntax. Domain of Discourse. FO Vocabulary. Terms
First-Order Logic 1 Syntax Domain of Discourse The domain of discourse for first order logic is FO structures or models. A FO structure contains Relations Functions Constants (functions of arity 0) FO
More informationParallelism and Machine Models
Parallelism and Machine Models Andrew D Smith University of New Brunswick, Fredericton Faculty of Computer Science Overview Part 1: The Parallel Computation Thesis Part 2: Parallelism of Arithmetic RAMs
More informationInterpretation of stream programs:
Author manuscript, published in "21st International Symposium on Algorithms and Computation - ISAAC 2010 (2010)" Interpretation of stream programs: characterizing type 2 polynomial time complexity Hugo
More information(2) (15pts) Using Prolog, implement a type-checker for the following small subset of System F:
CS 6371 Advanced Programming Languages Sample Spring 2018 Final Exam This sample final exam is LONGER than a real final exam (to give you more practice problems) and has a medium difficulty level. You
More informationMetatheory of Recursive Types
Design Principles of Programming Languages Metatheory of Recursive Types Zhenjiang Hu, Haiyan Zhao, Yingfei Xiong Peking University, Spring Term, 2016 提醒 : 课程项目 6 月 8 日课程项目报告 每组报告 20 分钟, 提问 5 分钟 组队的同学请介绍每名成员的贡献
More informationDomain theory and denotational semantics of functional programming
Domain theory and denotational semantics of functional programming Martín Escardó School of Computer Science, Birmingham University MGS 2007, Nottingham, version of April 20, 2007 17:26 What is denotational
More informationCorecursion and coinduction: what they are and how they relate to recursion and induction. Mike Gordon
Corecursion and coinduction: what they are and how they relate to recursion and induction Mike Gordon 1 Contents Preface 3 Summary 4 Data, codata, constructors and destructors............... 4 Recursion
More informationGrammatical resources: logic, structure and control
Grammatical resources: logic, structure and control Michael Moortgat & Dick Oehrle 1 Grammatical composition.................................. 5 1.1 Grammar logic: the vocabulary.......................
More informationSimply Typed Lambda Calculus
Simply Typed Lambda Calculus Mathias Vorreiter Pedersen November 13, 2015 1 Recalling the untyped lambda calculus 1.1 Syntax t ::= x λ x. t t t 1.2 Evaluation x x t t λx.t λx.t t 1 t 1 t 2 t 2 t 1 t 2
More informationOutline. A recursive function follows the structure of inductively-defined data.
Outline A recursive function follows the structure of inductively-defined data. With lists as our example, we shall study 1. inductive definitions (to specify data) 2. recursive functions (to process data)
More informationOperationally-Based Theories of Program Equivalence
Operationally-Based Theories of Program Equivalence Andrew Pitts Contents 1 Introduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : 241 2 Contextual Equivalence : : : : : : : : : : : : : :
More informationInduction and Recursion
Induction and Recursion Prof. Clarkson Fall 2016 Today s music: Dream within a Dream from the soundtrack to Inception by Hans Zimmer Review Previously in 3110: Behavioral equivalence Proofs of correctness
More informationThe L Machines are very high-level, in two senses:
What is a Computer? State of the machine. CMPSCI 630: Programming Languages An Abstract Machine for Control Spring 2009 (with thanks to Robert Harper) Internal registers, memory, etc. Initial and final
More informationA fully abstract semantics for a nondeterministic functional language with monadic types
A fully abstract semantics for a nondeterministic functional language with monadic types Alan Jeffrey 1 School of Cognitive and Computing Sciences University of Sussex, Brighton BN1 9QH, UK alanje@cogs.susx.ac.uk
More informationElements of Category Theory
Elements of Category Theory Robin Cockett Department of Computer Science University of Calgary Alberta, Canada robin@cpsc.ucalgary.ca Estonia, Feb. 2010 Functors and natural transformations Adjoints and
More informationImplicit Computational Complexity
Implicit Computational Complexity Simone Martini Dipartimento di Scienze dell Informazione Università di Bologna Italy Bertinoro International Spring School for Graduate Studies in Computer Science, 6
More informationProgramming with classical quantum datatypes
Programming with classical quantum datatypes Robin Cockett & Brett Giles (robin,gilesb)@cpsc.ucalgary.ca University of Calgary FMCS 2006, Programming with classical quantum datatypes p. 1/49 Yet another
More informationPrinciples of Program Analysis: A Sampler of Approaches
Principles of Program Analysis: A Sampler of Approaches Transparencies based on Chapter 1 of the book: Flemming Nielson, Hanne Riis Nielson and Chris Hankin: Principles of Program Analysis Springer Verlag
More informationCode Generation for a Simple First-Order Prover
Code Generation for a Simple First-Order Prover Jørgen Villadsen, Anders Schlichtkrull, and Andreas Halkjær From DTU Compute, Technical University of Denmark, 2800 Kongens Lyngby, Denmark Abstract. We
More informationAbstract Interpretation II
Abstract Interpretation II Semantics and Application to Program Verification Antoine Miné École normale supérieure, Paris year 2015 2016 Course 11 13 May 2016 Course 11 Abstract Interpretation II Antoine
More informationLecture 7: Dynamic Programming I: Optimal BSTs
5-750: Graduate Algorithms February, 06 Lecture 7: Dynamic Programming I: Optimal BSTs Lecturer: David Witmer Scribes: Ellango Jothimurugesan, Ziqiang Feng Overview The basic idea of dynamic programming
More informationLecture Notes on Data Abstraction
Lecture Notes on Data Abstraction 15-814: Types and Programming Languages Frank Pfenning Lecture 14 October 23, 2018 1 Introduction Since we have moved from the pure λ-calculus to functional programming
More informationA Hierarchy of Ramified Theories around PRA
A Hierarchy of Ramified Theories around PRA Elliott J. Spoors and Stanley S. Wainer 1 (Leeds UK) Logic Colloquium 2012, Manchester. 1 Later parts of this work were done while the second author visited
More informationLecture 3 (Notes) 1. The book Computational Complexity: A Modern Approach by Sanjeev Arora and Boaz Barak;
Topics in Theoretical Computer Science March 7, 2016 Lecturer: Ola Svensson Lecture 3 (Notes) Scribes: Ola Svensson Disclaimer: These notes were written for the lecturer only and may contain inconsistent
More informationTypes and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions)
Types and Programming Languages (15-814), Fall 2018 Assignment 4: Data Representation (Sample Solutions) Contact: 15-814 Course Staff Due Tuesday, October 16, 2018, 10:30am This assignment is due by 10:30am
More informationNotes on ordinals and cardinals
Notes on ordinals and cardinals Reed Solomon 1 Background Terminology We will use the following notation for the common number systems: N = {0, 1, 2,...} = the natural numbers Z = {..., 2, 1, 0, 1, 2,...}
More informationComplexity: moving from qualitative to quantitative considerations
Complexity: moving from qualitative to quantitative considerations Textbook chapter 7 Complexity Theory: study of what is computationally feasible (or tractable) with limited resources: running time (main
More informationCMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008
CMSC 336: Type Systems for Programming Languages Lecture 10: Polymorphism Acar & Ahmed 19 February 2008 Contents 1 Polymorphism 1 2 Polymorphic λ-calculus: Syntax 1 3 Static Semantics 2 4 Dynamic Semantics
More informationType Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth
Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,
More informationM ::= x M M x = M M :: M x :: x
Mini-ML expressions M ::= x variable true boolean values false if M then M else M conditional lx (M) function abstraction MM function application let x = M in M local declaration nil nil list M :: M list
More informationPrinciple of Mathematical Induction
Advanced Calculus I. Math 451, Fall 2016, Prof. Vershynin Principle of Mathematical Induction 1. Prove that 1 + 2 + + n = 1 n(n + 1) for all n N. 2 2. Prove that 1 2 + 2 2 + + n 2 = 1 n(n + 1)(2n + 1)
More informationArithmetical Hierarchy
Arithmetical Hierarchy 1 The Turing Jump Klaus Sutner Carnegie Mellon University Arithmetical Hierarchy 60-arith-hier 2017/12/15 23:18 Definability Formal Systems Recall: Oracles 3 The Use Principle 4
More informationArithmetical Hierarchy
Arithmetical Hierarchy Klaus Sutner Carnegie Mellon University 60-arith-hier 2017/12/15 23:18 1 The Turing Jump Arithmetical Hierarchy Definability Formal Systems Recall: Oracles 3 We can attach an orcale
More informationA first order divided difference
A first order divided difference For a given function f (x) and two distinct points x 0 and x 1, define f [x 0, x 1 ] = f (x 1) f (x 0 ) x 1 x 0 This is called the first order divided difference of f (x).
More informationQF101: Quantitative Finance August 22, Week 1: Functions. Facilitator: Christopher Ting AY 2017/2018
QF101: Quantitative Finance August 22, 2017 Week 1: Functions Facilitator: Christopher Ting AY 2017/2018 The chief function of the body is to carry the brain around. Thomas A. Edison 1.1 What is a function?
More informationSLD-Resolution And Logic Programming (PROLOG)
Chapter 9 SLD-Resolution And Logic Programming (PROLOG) 9.1 Introduction We have seen in Chapter 8 that the resolution method is a complete procedure for showing unsatisfiability. However, finding refutations
More informationNICTA Advanced Course. Theorem Proving Principles, Techniques, Applications
NICTA Advanced Course Theorem Proving Principles, Techniques, Applications λ 1 CONTENT Intro & motivation, getting started with Isabelle Foundations & Principles Lambda Calculus Higher Order Logic, natural
More information1 Introduction. 2 Recap The Typed λ-calculus λ. 3 Simple Data Structures
CS 6110 S18 Lecture 21 Products, Sums, and Other Datatypes 1 Introduction In this lecture, we add constructs to the typed λ-calculus that allow working with more complicated data structures, such as pairs,
More informationCMSC 631 Program Analysis and Understanding Fall Type Systems
Program Analysis and Understanding Fall 2017 Type Systems Type Systems A type system is a tractable syntactic method for proving the absence of certain program behaviors by classifying phrases according
More informationINDUCTIVE DEFINITION
1 INDUCTIVE DEFINITION OUTLINE Judgements Inference Rules Inductive Definition Derivation Rule Induction 2 META-VARIABLES A symbol in a meta-language that is used to describe some element in an object
More informationRoy L. Crole. Operational Semantics Abstract Machines and Correctness. University of Leicester, UK
Midlands Graduate School, University of Birmingham, April 2008 1 Operational Semantics Abstract Machines and Correctness Roy L. Crole University of Leicester, UK Midlands Graduate School, University of
More informationSpace Complexity. Huan Long. Shanghai Jiao Tong University
Space Complexity Huan Long Shanghai Jiao Tong University Acknowledgements Part of the slides comes from a similar course in Fudan University given by Prof. Yijia Chen. http://basics.sjtu.edu.cn/ chen/
More informationPredicate Logic - Undecidability
CS402, Spring 2016 Undecidable Problems Does the following program halts? (1) N : n, total, x, y, z (2) n GetUserInput() (3) total 3 (4) while true (5) for x 1 to total 2 (6) for y 1 to total x 1 (7) z
More information(Ordinary) mathematical induction is a way to prove things about natural numbers. We can write it as a rule: φ(0) x. φ(x) φ(succ(x)) x.
1 Ordinary Induction (Ordinary) mathematical induction is a way to prove things about natural numbers. We can write it as a rule: φ(0) x. φ(x) φ(succ(x)) x. φ(x) where φ(x) is a statement involving a number
More informationOn Elementary Linear Logic and polynomial time (Extended Abstract)
On Elementary Linear Logic and polynomial time (Extended Abstract) Patrick Baillot ENS Lyon, Université de Lyon, LIP (UMR 5668 CNRS-ENSL-INRIA-UCBL) 1 Introduction Linear logic (LL) [Gir87] has been used
More informationTechnische Universität München Department of Computer Science. Joint Advanced Students School 2009 Propositional Proof Complexity.
Technische Universität München Department of Computer Science Joint Advanced Students School 2009 Propositional Proof Complexity May 2009 Frege Systems Michael Herrmann Contents Contents ii 1 Introduction
More informationAdvanced topic: Space complexity
Advanced topic: Space complexity CSCI 3130 Formal Languages and Automata Theory Siu On CHAN Chinese University of Hong Kong Fall 2016 1/28 Review: time complexity We have looked at how long it takes to
More informationLecture 23: More PSPACE-Complete, Randomized Complexity
6.045 Lecture 23: More PSPACE-Complete, Randomized Complexity 1 Final Exam Information Who: You On What: Everything through PSPACE (today) With What: One sheet (double-sided) of notes are allowed When:
More information0.1 Random useful facts. 0.2 Language Definition
0.1 Random useful facts Lemma double neg : P : Prop, {P} + { P} P P. Lemma leq dec : n m, {n m} + {n > m}. Lemma lt dec : n m, {n < m} + {n m}. 0.2 Language Definition Definition var := nat. Definition
More informationChapter 11: Automated Proof Systems (1)
Chapter 11: Automated Proof Systems (1) SYSTEM RS OVERVIEW Hilbert style systems are easy to define and admit a simple proof of the Completeness Theorem but they are difficult to use. Automated systems
More informationTheory of Computation
Theory of Computation Unit 4-6: Turing Machines and Computability Decidability and Encoding Turing Machines Complexity and NP Completeness Syedur Rahman syedurrahman@gmail.com Turing Machines Q The set
More informationClasses of Boolean Functions
Classes of Boolean Functions Nader H. Bshouty Eyal Kushilevitz Abstract Here we give classes of Boolean functions that considered in COLT. Classes of Functions Here we introduce the basic classes of functions
More informationExercise sheet 6: Review Corrections. Turing machines
Exercise sheet 6: Review Corrections Turing machines 1. Consider a k-head Turing machine having a single tape and k heads; more than one head can be on the same cell at a time. At each move, the TM will
More informationInfinite and Finite Model Theory Part II
Infinite and Finite Model Theory Part II Anuj Dawar Computer Laboratory University of Cambridge Lent 2002 3/2002 0 Finite Model Theory Finite Model Theory motivated by computational issues; relationship
More informationInduction; Operational Semantics. Fall Software Foundations CIS 500
CIS 500 Software Foundations Fall 2005 Induction; Operational Semantics CIS 500, Induction; Operational Semantics 1 Announcements Review recitations start this week. You may go to any recitation section
More informationComplexity Theory 112. Space Complexity
Complexity Theory 112 Space Complexity We ve already seen the definition SPACE(f(n)): the languages accepted by a machine which uses O(f(n)) tape cells on inputs of length n. Counting only work space NSPACE(f(n))
More informationNunchaku: Flexible Model Finding for Higher-Order Logic
Nunchaku: Flexible Model Finding for Higher-Order Logic Simon Cruanes, Jasmin Blanchette, Andrew Reynolds Veridis, Inria Nancy https://cedeela.fr/~simon/ April 7th, 2016 1 / 21 Summary Introduction Nunchaku
More informationINAPPROX APPROX PTAS. FPTAS Knapsack P
CMPSCI 61: Recall From Last Time Lecture 22 Clique TSP INAPPROX exists P approx alg for no ε < 1 VertexCover MAX SAT APPROX TSP some but not all ε< 1 PTAS all ε < 1 ETSP FPTAS Knapsack P poly in n, 1/ε
More informationSEPARATING NOTIONS OF HIGHER-TYPE POLYNOMIAL-TIME. Robert Irwin Syracuse University Bruce Kapron University of Victoria Jim Royer Syracuse University
SEPARATING NOTIONS OF HIGHER-TYPE POLYNOMIAL-TIME Robert Irwin Syracuse University Bruce Kapron University of Victoria Jim Royer Syracuse University FUNCTIONALS & EFFICIENCY Question: Suppose you have
More informationDepending on equations
Depending on equations A proof-relevant framework for unification in dependent type theory Jesper Cockx DistriNet KU Leuven 3 September 2017 Unification for dependent types Unification is used for many
More informationChapter 1: Constraints. Constraints. Constraints. Constraint Logic Programming. Peter Stuckey 1
Chapter 1: Constraints What are they, what do they do and what can I use them for. Constraints What are constraints? Modelling problems Constraint solving ree constraints Other constraint domains Properties
More informationOn Additive Polynomials
On Additive Polynomials Zachary Scherr 1 Preliminaries The purpose of this article is to explore the following question: Question 1. Let K be a field. For which f(z) K[z] does f(a+b) = f(a)+f(b) for all
More informationMidterm Exam Types and Programming Languages Frank Pfenning. October 18, 2018
Midterm Exam 15-814 Types and Programming Languages Frank Pfenning October 18, 2018 Name: Andrew ID: Instructions This exam is closed-book, closed-notes. You have 80 minutes to complete the exam. There
More informationA note on monotone real circuits
A note on monotone real circuits Pavel Hrubeš and Pavel Pudlák March 14, 2017 Abstract We show that if a Boolean function f : {0, 1} n {0, 1} can be computed by a monotone real circuit of size s using
More informationFunctional Programming with Coq. Yuxin Deng East China Normal University
Functional Programming with Coq Yuxin Deng East China Normal University http://basics.sjtu.edu.cn/ yuxin/ September 10, 2017 Functional Programming Y. Deng@ECNU 1 Reading materials 1. The Coq proof assistant.
More informationRecursion and Intro to Coq
L02-1 Recursion and Intro to Coq Armando Solar Lezama Computer Science and Artificial Intelligence Laboratory M.I.T. With content from Arvind and Adam Chlipala. Used with permission. September 21, 2015
More information5. The Primitive Recursive Function
5. The Primitive Recursive Function URM and TM based on universal programming languages. In this and the next section we introduce a third model of computation. It is given as a set of partial functions
More informationChapter 1: Constraints
Chapter 1: Constraints What are they, what do they do and what can I use them for. 1 Constraints What are constraints? Modelling problems Constraint solving Tree constraints Other constraint domains Properties
More informationGATE EC Previous Year Solved Paper
GATE EC Previous Year Solved Paper GATE 2017 is just round the corner. Engineering Mathematics is a highly scoring portion in GATE. A basic understanding of the concepts and a thorough practice is enough
More information2.7.1 Foundations of Proof Systems
2.7.1 Foundations of Proof Systems Exam 2017-2018 1 Warming up... Question 1 Give a proof in natural deduction of the following proposition : ( f = (g = h)) = (( f = g) = ( f = h)). Solution. f (g h);
More informationAutomatic Deduction for Theories of. Algebraic Data Types. Igor A. Chikanian
Automatic Deduction for Theories of Algebraic Data Types by Igor A. Chikanian A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy Department of Computer
More informationGTI. Undecidability. Total Recall 3. Halting. Undecidability. A. Ada, K. Sutner Carnegie Mellon University. Spring 2018
GTI Undecidability A. Ada, K. Sutner Carnegie Mellon University Spring 2018 1 Cardinality Halting Undecidability Total Recall 3 A set A is finite countably infinite uncountable bijection {0, 1,..., n 1}
More information