The essence and origins of FRP

Size: px
Start display at page:

Download "The essence and origins of FRP"

Transcription

1 The essence and origins of FRP Conal Elliott June 13, 2015 Conal Elliott The essence and origins of FRP June 13, / 31

2 What is FRP? Conal Elliott The essence and origins of FRP June 13, / 31

3 FRP s two fundamental properties Continuous time. (Natural & composable.) Precise, simple denotation. (Elegant & rigorous.) Conal Elliott The essence and origins of FRP June 13, / 31

4 FRP s two fundamental properties Continuous time. (Natural & composable.) Precise, simple denotation. (Elegant & rigorous.) Deterministic, continuous concurrency. Warning: most modern FRP systems have neither property. Conal Elliott The essence and origins of FRP June 13, / 31

5 Why continuous & infinite (vs discrete/finite) time? Conal Elliott The essence and origins of FRP June 13, / 31

6 Why continuous & infinite (vs discrete/finite) time? Transformation flexibility with simple & precise semantics Quality/accuracy Efficiency (adapative) Modularity/composability: Fewer assumptions, more uses (resolution-independence). More info available for extraction. Same benefits as pure, non-strict functional programming. See Why Functional Programming Matters. Integration and differentiation: natural, accurate, efficient. Reconcile differing input sampling rates. Conal Elliott The essence and origins of FRP June 13, / 31

7 Why continuous & infinite (vs discrete/finite) time? Transformation flexibility with simple & precise semantics Quality/accuracy Efficiency (adapative) Modularity/composability: Fewer assumptions, more uses (resolution-independence). More info available for extraction. Same benefits as pure, non-strict functional programming. See Why Functional Programming Matters. Integration and differentiation: natural, accurate, efficient. Reconcile differing input sampling rates. Same issues as for space, hence vector graphics. Conal Elliott The essence and origins of FRP June 13, / 31

8 Why continuous & infinite (vs discrete/finite) time? Transformation flexibility with simple & precise semantics Quality/accuracy Efficiency (adapative) Modularity/composability: Fewer assumptions, more uses (resolution-independence). More info available for extraction. Same benefits as pure, non-strict functional programming. See Why Functional Programming Matters. Integration and differentiation: natural, accurate, efficient. Reconcile differing input sampling rates. Same issues as for space, hence vector graphics. Principle: Approximations/prunings compose badly, so postpone. Conal Elliott The essence and origins of FRP June 13, / 31

9 Semantics Central abstract type: Behavior a a flow of values. Conal Elliott The essence and origins of FRP June 13, / 31

10 Semantics Central abstract type: Behavior a a flow of values. Precise & simple semantics: µ :: Behavior a Ñ pt Ñ aq where T R (reals). Conal Elliott The essence and origins of FRP June 13, / 31

11 Semantics Central abstract type: Behavior a a flow of values. Precise & simple semantics: µ :: Behavior a Ñ pt Ñ aq where T R (reals). Much of API and its specification follows from this one choice. Conal Elliott The essence and origins of FRP June 13, / 31

12 Original formulation Conal Elliott The essence and origins of FRP June 13, / 31

13 API time :: Behavior T lift 0 :: a Ñ Behavior a lift 1 :: pa Ñ bq Ñ Behavior a Ñ Behavior b lift 2 :: pa Ñ b Ñ cq Ñ Behavior a Ñ Behavior b Ñ Behavior c timetrans :: Behavior a Ñ Behavior T Ñ Behavior a integral :: VS a ñ Behavior a Ñ T Ñ Behavior a... instance Num a ñ Num pbehavior aq where Reactivity later. Conal Elliott The essence and origins of FRP June 13, / 31

14 Semantics µ time λt Ñ t µ plift 0 aq λt Ñ a µ plift 1 f xsq λt Ñ f pµ xs tq µ plift 2 f xs ysq λt Ñ f pµ xs tq pµ ys tq µ ptimetrans xs ttq λt Ñ µ xs pµ tt tq instance Num a ñ Num pbehavior aq where frominteger lift 0 frominteger p`q lift 2 p`q... Conal Elliott The essence and origins of FRP June 13, / 31

15 Semantics µ time id µ plift 0 aq const a µ plift 1 f xsq f µ xs µ plift 2 f xs ysq lifta 2 f pµ xsq pµ ysq µ ptimetrans xs ttq µ xs µ tt instance Num a ñ Num pbehavior aq where frominteger lift 0 frominteger p`q lift 2 p`q... Conal Elliott The essence and origins of FRP June 13, / 31

16 Events Secondary type: µ :: Event a Ñ rpt, aqs -- non-decreasing times never :: Event a once :: T Ñ a Ñ Event a p..q :: Event a Ñ Event a Ñ Event a pùñq :: Event a Ñ pa Ñ bq Ñ Event b predicate :: Behavior Bool Ñ T Ñ Event pq snapshot :: Event a Ñ Behavior b Ñ Event pa, bq Conal Elliott The essence and origins of FRP June 13, / 31

17 Reactivity Reactive behaviors are defined piecewise, via events. Conal Elliott The essence and origins of FRP June 13, / 31

18 Reactivity Reactive behaviors are defined piecewise, via events.: switcher :: Behavior a Ñ Event pbehavior aq Ñ Behavior a Conal Elliott The essence and origins of FRP June 13, / 31

19 Reactivity Reactive behaviors are defined piecewise, via events.: switcher :: Behavior a Ñ Event pbehavior aq Ñ Behavior a Semantics: µ pb 0 switcher eq t µ plast pb 0 : before pµ eq tqq t before :: rpt, aqs Ñ T Ñ ra s before os t ra pt a, aq Ð os, t a ă t s Conal Elliott The essence and origins of FRP June 13, / 31

20 Reactivity Reactive behaviors are defined piecewise, via events.: switcher :: Behavior a Ñ Event pbehavior aq Ñ Behavior a Semantics: µ pb 0 switcher eq t µ plast pb 0 : before pµ eq tqq t before :: rpt, aqs Ñ T Ñ ra s before os t ra pt a, aq Ð os, t a ă t s Question: Can occurrences be extracted ( changes )? Conal Elliott The essence and origins of FRP June 13, / 31

21 Modernized formulation Conal Elliott The essence and origins of FRP June 13, / 31

22 API Replace several operations with standard abstractions: instance Functor Behavior where... instance Applicative Behavior where... instance Monoid a ñ Monoid pbehavior aq where... instance Functor Event where... instance Monoid a ñ Monoid pevent aq where... Less learning, more leverage. Conal Elliott The essence and origins of FRP June 13, / 31

23 Semantic instances instance Functor ppñq z q where... instance Applicative ppñq z q where... instance Monoid a ñ Monoid pz Ñ aq where... instance Num a ñ Num pz Ñ aq where The Behavior instances follow in precise analogy. Conal Elliott The essence and origins of FRP June 13, / 31

24 Homomorphisms A homomorphism h is a function that preserves (distributes over) an algebraic structure. For instance, for Monoid: h ε ε h pas bsq h as h bs Conal Elliott The essence and origins of FRP June 13, / 31

25 Homomorphisms A homomorphism h is a function that preserves (distributes over) an algebraic structure. For instance, for Monoid: h ε ε h pas bsq h as h bs Some monoid homomorphisms: length 1 :: ra s Ñ Sum Int length 1 Sum length log 1 :: Product R Ñ Sum R log 1 Sum log getproduct Conal Elliott The essence and origins of FRP June 13, / 31

26 More homomorphism properties Functor: h pfmap f xsq fmap f ph xsq Applicative: h ppure aq pure a h pfs ă ą xsq h fs ă ą h xs Monad: h pm ą kq h m ą h k Conal Elliott The essence and origins of FRP June 13, / 31

27 Specification by semantic homomorphism Specification: µ as homomorphism. For instance, µ pfmap f asq fmap f pµ asq µ ppure aq pure a µ pfs ă ą xsq µ fs ă ą µ xs Conal Elliott The essence and origins of FRP June 13, / 31

28 Semantic instances instance Monoid a ñ Monoid pz Ñ aq where ε λz Ñ ε f g λz Ñ f z g z instance Functor ppñq z q where fmap g f g f instance Applicative ppñq z q where pure a λz Ñ a ff ă ą fx λz Ñ pff zq pfx zq Conal Elliott The essence and origins of FRP June 13, / 31

29 Semantic homomorphisms Put the pieces together: µ ppure aq pure a µ pfs ă ą xsq µ fs ă ą µ xs λt Ñ a λt Ñ pµ fs tq pµ xs tq Likewise for Functor, Monoid, Num, etc. Conal Elliott The essence and origins of FRP June 13, / 31

30 Semantic homomorphisms Put the pieces together: µ ppure aq pure a µ pfs ă ą xsq µ fs ă ą µ xs λt Ñ a λt Ñ pµ fs tq pµ xs tq Likewise for Functor, Monoid, Num, etc. Notes: Corresponds exactly to the original FRP denotation. Follows inevitably from semantic homomorphism principle. Laws hold for free (already paid for). Conal Elliott The essence and origins of FRP June 13, / 31

31 Laws for free µ ε ε µ pa bq µ a µ b ñ a ε a ε b b a pb cq pa bq c where equality is semantic. Conal Elliott The essence and origins of FRP June 13, / 31

32 Laws for free µ ε ε µ pa bq µ a µ b ñ a ε a ε b b a pb cq pa bq c where equality is semantic. Proofs: µ pa εq µ a µ ε µ a ε µ a µ pε bq µ ε µ b ε µ b µ b µ pa pb cqq µ a pµ b µ cq pµ a µ bq µ c µ ppa bq cq Works for other classes as well. Conal Elliott The essence and origins of FRP June 13, / 31

33 Events newtype Event a Event pbehavior ra sq deriving pmonoid, Functor q -- discretely non-empty Conal Elliott The essence and origins of FRP June 13, / 31

34 Events newtype Event a Event pbehavior ra sq deriving pmonoid, Functor q -- discretely non-empty Derived instances: instance Monoid a ñ Monoid pevent aq where ε Event ppure εq Event u Event v Event plifta 2 p q u vq instance Functor Event where fmap f pevent bq Event pfmap pfmap f q bq Conal Elliott The essence and origins of FRP June 13, / 31

35 Events newtype Event a Event pbehavior ra sq deriving pmonoid, Functor q -- discretely non-empty Derived instances: instance Monoid a ñ Monoid pevent aq where ε Event ppure εq Event u Event v Event plifta 2 p q u vq instance Functor Event where fmap f pevent bq Event pfmap pfmap f q bq Alternatively, type Event Behavior r s Conal Elliott The essence and origins of FRP June 13, / 31

36 Conclusion Two fundamental properties: Continuous time. (Natural & composable.) Precise, simple denotation. (Elegant & rigorous.) Warning: most recent FRP systems lack both. Conal Elliott The essence and origins of FRP June 13, / 31

37 Conclusion Two fundamental properties: Continuous time. (Natural & composable.) Precise, simple denotation. (Elegant & rigorous.) Warning: most recent FRP systems lack both. Semantic homomorphisms: Mine semantic model for API. Inevitable API semantics (minimize invention). Laws hold for free (already paid for). No abstraction leaks. Matches original FRP semantics. Generally useful principle for library design. Conal Elliott The essence and origins of FRP June 13, / 31

38 History Conal Elliott The essence and origins of FRP June 13, / 31

39 at CMU I went for graphics. Did program transformation, FP, type theory. Class in denotational semantics. Conal Elliott The essence and origins of FRP June 13, / 31

40 1989 at CMU Kavi Arya s visit Functional animation Streams of pictures Mostly elegant John Reynolds insight: continuous time. Roughly, You can think of sequences as functions from the natural numbers. Have you thought about functions from the reals instead? Doing so might help with the awkwardness of interpolation. Finished my dissertation anyway. Conal Elliott The essence and origins of FRP June 13, / 31

41 at Sun: TBAG 3D geometry etc as first-class immutable values. Optimizing compiler via partial evaluation. For animation & interaction, immutable functions of time. Multi-way constraints on time-functions. Differentiation, integration and ODEs specified via derivative. Adaptive Runge-Kutta-5 solver (fast & accurate). Efficient multi-user distributed execution for free. Reactivity via assert/retract (high-level but imperative). In Common Lisp, C++, Scheme. Conal Elliott The essence and origins of FRP June 13, / 31

42 at MSR: RBML/ActiveVRML Programming model & fast implementation for new 3D hardware. TBAG + denotative/functional reactivity. Add event algebra to behavior algebra. Reactivity via behavior-valued events. Drop multi-way constraints at first. Started in ML as RBML. Rebranded to ActiveVRML, then DirectAnimation. Conal Elliott The essence and origins of FRP June 13, / 31

43 at MSR: RBMH/Fran Found Haskell: reborn as RBMH (research vehicle). Very fast implementation via sprite engine. John Hughes suggested using Arrow. Conal Elliott The essence and origins of FRP June 13, / 31

44 2000 at MSR: first try at push-based implementation Algebra of imperative event listeners. Challenges: Garbage collection & dependency reversal. Determinacy of timing & simultaneity. I doubt anyone has gotten correct. Conal Elliott The essence and origins of FRP June 13, / 31

45 2009: Push-pull FRP Minimal computation, low latency, provably correct. Push for reactivity and pull for continuous phases. Push is really blocked pull. Modernized API: Standard abstractions. Semantics as homomorphisms. Laws for free. Reactive normal form, via equational properties (denotation!). Uses lub (basis of PL semantics). Implementation subtleties & GHC RTS bugs. Didn t quite work. Conal Elliott The essence and origins of FRP June 13, / 31

46 : Paul Hudak / Yale Paul Hudak visited MSR in 1996 or so and saw RBMH. Encouraged me to publish and suggested collaboration. Proposed names Fran & FRP. Many FRP-based papers and theses, drawing much attention. July 15, 1952 April 29, 2015 Conal Elliott The essence and origins of FRP June 13, / 31

Push-pull functional reactive programming

Push-pull functional reactive programming 3 September, 2009 Haskell Symposium 1 Semantics Building blocks Refactoring 2 Class instances Future times 3 Description and problems Improving 4 Semantics Building blocks Refactoring What is Functional

More information

The simple essence of automatic differentiation

The simple essence of automatic differentiation The simple essence of automatic differentiation Conal Elliott Target January 2018 Conal Elliott January 2018 1 / 45 What s a derivative? Number Vector Covector Matrix Higher derivatives Chain rule for

More information

The simple essence of automatic differentiation

The simple essence of automatic differentiation The simple essence of automatic differentiation Conal Elliott Target January/June 2018 Conal Elliott January/June 2018 1 / 51 Differentiable programming made easy Current AI revolution runs on large data,

More information

The simple essence of automatic differentiation

The simple essence of automatic differentiation The simple essence of automatic differentiation Conal Elliott Target January/June 2018 Conal Elliott January/June 2018 1 / 52 Machine learning: promise and problems Current AI revolution runs on large

More information

A Full RNS Implementation of Fan and Vercauteren Somewhat Homomorphic Encryption Scheme

A Full RNS Implementation of Fan and Vercauteren Somewhat Homomorphic Encryption Scheme A Full RNS Implementation of Fan and Vercauteren Somewhat Homomorphic Encryption Scheme Presented by: Vincent Zucca 1 Joint work with: Jean-Claude Bajard 1, Julien Eynard 2 and Anwar Hasan 2 1 Sorbonne

More information

6 Coalgebraic modalities via predicate liftings

6 Coalgebraic modalities via predicate liftings 6 Coalgebraic modalities via predicate liftings In this chapter we take an approach to coalgebraic modal logic where the modalities are in 1-1 correspondence with so-called predicate liftings for the functor

More information

Beautiful Differentiation

Beautiful Differentiation Under consideration for publication in J. Functional Programming 1 Beautiful Differentiation Conal M. Elliott LambdaPix (e-mail: conal@conal.net) Abstract Automatic differentiation (AD) is a precise, efficient,

More information

L11: Algebraic Path Problems with applications to Internet Routing Lecture 15. Path Weight with functions on arcs?

L11: Algebraic Path Problems with applications to Internet Routing Lecture 15. Path Weight with functions on arcs? L11: Algebraic Path Problems with applications to Internet Routing Lecture 15 Timothy G. Griffin timothy.griffin@cl.cam.ac.uk Computer Laboratory University of Cambridge, UK Michaelmas Term, 2016 tgg22

More information

Entropy and Ergodic Theory Notes 22: The Kolmogorov Sinai entropy of a measure-preserving system

Entropy and Ergodic Theory Notes 22: The Kolmogorov Sinai entropy of a measure-preserving system Entropy and Ergodic Theory Notes 22: The Kolmogorov Sinai entropy of a measure-preserving system 1 Joinings and channels 1.1 Joinings Definition 1. If px, µ, T q and py, ν, Sq are MPSs, then a joining

More information

CHAPTER 1: Functions

CHAPTER 1: Functions CHAPTER 1: Functions 1.1: Functions 1.2: Graphs of Functions 1.3: Basic Graphs and Symmetry 1.4: Transformations 1.5: Piecewise-Defined Functions; Limits and Continuity in Calculus 1.6: Combining Functions

More information

NOTES WEEK 15 DAY 1 SCOT ADAMS

NOTES WEEK 15 DAY 1 SCOT ADAMS NOTES WEEK 15 DAY 1 SCOT ADAMS We fix some notation for the entire class today: Let n P N, W : R n, : 2 P N pw q, W : LpW, W q, I : id W P W, z : 0 W 0 n. Note that W LpR n, R n q. Recall, for all T P

More information

Categories and Functors (Lecture Notes for Midlands Graduate School, 2013) Uday S. Reddy The University of Birmingham

Categories and Functors (Lecture Notes for Midlands Graduate School, 2013) Uday S. Reddy The University of Birmingham Categories and Functors (Lecture Notes for Midlands Graduate School, 2013) Uday S. Reddy The University of Birmingham April 7, 2013 2 Contents 1 Categories 5 1.1 Categories with and without elements.......................

More information

NOTES WEEK 13 DAY 2 SCOT ADAMS

NOTES WEEK 13 DAY 2 SCOT ADAMS NOTES WEEK 13 DAY 2 SCOT ADAMS Recall: Let px, dq be a metric space. Then, for all S Ď X, we have p S is sequentially compact q ñ p S is closed and bounded q. DEFINITION 0.1. Let px, dq be a metric space.

More information

DIFFERENTIAL EQUATIONS

DIFFERENTIAL EQUATIONS DIFFERENTIAL EQUATIONS Basic Concepts Paul Dawkins Table of Contents Preface... Basic Concepts... 1 Introduction... 1 Definitions... Direction Fields... 8 Final Thoughts...19 007 Paul Dawkins i http://tutorial.math.lamar.edu/terms.aspx

More information

NOTES WEEK 01 DAY 1 SCOT ADAMS

NOTES WEEK 01 DAY 1 SCOT ADAMS NOTES WEEK 01 DAY 1 SCOT ADAMS Question: What is Mathematics? Answer: The study of absolute truth. Question: Why is it so hard to teach and to learn? Answer: One must learn to play a variety of games called

More information

Egyptian Fractions: Part I

Egyptian Fractions: Part I Egyptian Fractions: Part I Prepared by: Eli Jaffe October 8, 2017 1 Cutting Cakes 1. Imagine you are a teacher. Your class of 10 students is on a field trip to the bakery. At the end of the tour, the baker

More information

MTH 505: Number Theory Spring 2017

MTH 505: Number Theory Spring 2017 MTH 505: Number Theory Spring 2017 Homework 1 Drew Armstrong 1.1. From pn, σ, 0q to pn, `,, 0, 1q. Recall Peano s four axioms for the natural numbers: (P1) There exists a special element called 0 P N.

More information

2. Prime and Maximal Ideals

2. Prime and Maximal Ideals 18 Andreas Gathmann 2. Prime and Maximal Ideals There are two special kinds of ideals that are of particular importance, both algebraically and geometrically: the so-called prime and maximal ideals. Let

More information

Egyptian Fractions: Part I

Egyptian Fractions: Part I Egyptian Fractions: Part I Prepared by: Eli Jaffe October 8, 2017 1 Cutting Cakes 1. Imagine you are a teacher. Your class of 10 students is on a field trip to the bakery. At the end of the tour, the baker

More information

Secondary Math 3 Honors Unit 10: Functions Name:

Secondary Math 3 Honors Unit 10: Functions Name: Secondary Math 3 Honors Unit 10: Functions Name: Parent Functions As you continue to study mathematics, you will find that the following functions will come up again and again. Please use the following

More information

On Monoids over which All Strongly Flat Right S-Acts Are Regular

On Monoids over which All Strongly Flat Right S-Acts Are Regular Æ26 Æ4 ² Vol.26, No.4 2006µ11Â JOURNAL OF MATHEMATICAL RESEARCH AND EXPOSITION Nov., 2006 Article ID: 1000-341X(2006)04-0720-05 Document code: A On Monoids over which All Strongly Flat Right S-Acts Are

More information

The Fundamental Group

The Fundamental Group The Fundamental Group Renzo s math 472 This worksheet is designed to accompany our lectures on the fundamental group, collecting relevant definitions and main ideas. 1 Homotopy Intuition: Homotopy formalizes

More information

Conservation of Information

Conservation of Information Conservation of Information Amr Sabry (in collaboration with Roshan P. James) School of Informatics and Computing Indiana University May 8, 2012 Amr Sabry (in collaboration with Roshan P. James) (IU SOIC)

More information

Introduction to lambda calculus Part 6

Introduction to lambda calculus Part 6 Introduction to lambda calculus Part 6 Antti-Juhani Kaijanaho 2017-02-16 1 Untyped lambda calculus 2 Typed lambda calculi 2.1 Dynamically typed lambda calculus with integers 2.2 A model of Lisp 2.3 Simply

More information

From out-of-time design to in-time production of temporal media

From out-of-time design to in-time production of temporal media From out-of-time design to in-time production of temporal media Paul Hudak Department of Computer Science Yale University New Haven, CT 06520 David Janin LaBRI, Bordeaux INP, Université de Bordeaux F-33405

More information

INTRODUCTION TO CATEGORY THEORY FOR FUNCTIONAL PROGRAMMING

INTRODUCTION TO CATEGORY THEORY FOR FUNCTIONAL PROGRAMMING INTRODUCTION TO CATEGORY THEORY FOR FUNCTIONAL PROGRAMMING Andrew R. Plummer Department of Linguistics The Ohio State University 14 Oct, 2009 OUTLINE 1 INTRODUCTION TO CATEGORIES 2 FUNCTORS AND FUNCTOR

More information

Simply Typed Lambda Calculus

Simply Typed Lambda Calculus Simply Typed Lambda Calculus Language (ver1) Lambda calculus with boolean values t ::= x variable x : T.t abstraction tt application true false boolean values if ttt conditional expression Values v ::=

More information

States and Actions: An Automata-theoretic Model of Objects

States and Actions: An Automata-theoretic Model of Objects States and Actions: An Automata-theoretic Model of Objects Uday S. Reddy 1 Brian P. Dunphy 2 1 University of Birmingham 2 University of Illinois at Urbana-Champaign Portland, Oct 2011 Uday S. Reddy (Univ

More information

L11: Algebraic Path Problems with applications to Internet Routing Lecture 9

L11: Algebraic Path Problems with applications to Internet Routing Lecture 9 L11: Algebraic Path Problems with applications to Internet Routing Lecture 9 Timothy G. Griffin timothy.griffin@cl.cam.ac.uk Computer Laboratory University of Cambridge, UK Michaelmas Term, 2017 tgg22

More information

Monoids: Theme and Variations (Functional Pearl)

Monoids: Theme and Variations (Functional Pearl) University of Pennsylvania ScholarlyCommons Departmental Papers (CIS) Department of Computer & Information Science 7-2012 Monoids: Theme and Variations (Functional Pearl) Brent A. Yorgey University of

More information

The Hurewicz Theorem

The Hurewicz Theorem The Hurewicz Theorem April 5, 011 1 Introduction The fundamental group and homology groups both give extremely useful information, particularly about path-connected spaces. Both can be considered as functors,

More information

Math (P)Review Part I:

Math (P)Review Part I: Lecture 1: Math (P)Review Part I: Linear Algebra Computer Graphics CMU 15-462/15-662, Fall 2017 Homework 0.0 (Due Monday!) Exercises will be a bit harder / more rigorous than what you will do for the rest

More information

Bringing class diagrams to life

Bringing class diagrams to life Bringing class diagrams to life Luis S. Barbosa & Sun Meng DI-CCTC, Minho University, Braga & CWI, Amsterdam UML & FM Workshop 2009 Rio de Janeiro 8 December, 2009 Formal Methods proofs problems structures

More information

CS 173 Lecture 7: Arithmetic (II)

CS 173 Lecture 7: Arithmetic (II) CS 173 Lecture 7: Arithmetic (II) José Meseguer University of Illinois at Urbana-Champaign 1 The Fundamental Theorem of Arithmetic (Part II) Fundamental Theorem of Arithmetic (Part II). Every natural number

More information

CONTROL POLYGONS FOR CUBIC CURVES

CONTROL POLYGONS FOR CUBIC CURVES On-Line Geometric Modeling Notes CONTROL POLYGONS FOR CUBIC CURVES Kenneth I. Joy Visualization and Graphics Research Group Department of Computer Science University of California, Davis Overview B-Spline

More information

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010) http://math.sun.ac.za/amsc/sam Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics 2009-2010 Lecture notes in progress (27 March 2010) Contents 2009 Semester I: Elements 5 1. Cartesian product

More information

Parallel-in-time integrators for Hamiltonian systems

Parallel-in-time integrators for Hamiltonian systems Parallel-in-time integrators for Hamiltonian systems Claude Le Bris ENPC and INRIA Visiting Professor, The University of Chicago joint work with X. Dai (Paris 6 and Chinese Academy of Sciences), F. Legoll

More information

Statistical Theory 1

Statistical Theory 1 Statistical Theory 1 Set Theory and Probability Paolo Bautista September 12, 2017 Set Theory We start by defining terms in Set Theory which will be used in the following sections. Definition 1 A set is

More information

String diagrams. a functorial semantics of proofs and programs. Paul-André Melliès. CNRS, Université Paris Denis Diderot.

String diagrams. a functorial semantics of proofs and programs. Paul-André Melliès. CNRS, Université Paris Denis Diderot. String diagrams a functorial semantics of proofs and programs Paul-André Melliès CNRS, Université Paris Denis Diderot Hopf-in-Lux Luxembourg 17 July 2009 1 Proof-knots Aim: formulate an algebra of these

More information

P-adic numbers. Rich Schwartz. October 24, 2014

P-adic numbers. Rich Schwartz. October 24, 2014 P-adic numbers Rich Schwartz October 24, 2014 1 The Arithmetic of Remainders In class we have talked a fair amount about doing arithmetic with remainders and now I m going to explain what it means in a

More information

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach EDA045F: Program Analysis LECTURE 10: TYPES 1 Christoph Reichenbach In the last lecture... Performance Counters Challenges in Dynamic Performance Analysis Taint Analysis Binary Instrumentation 2 / 44 Types

More information

Category Theory. Categories. Definition.

Category Theory. Categories. Definition. Category Theory Category theory is a general mathematical theory of structures, systems of structures and relationships between systems of structures. It provides a unifying and economic mathematical modeling

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

COSE312: Compilers. Lecture 14 Semantic Analysis (4)

COSE312: Compilers. Lecture 14 Semantic Analysis (4) COSE312: Compilers Lecture 14 Semantic Analysis (4) Hakjoo Oh 2017 Spring Hakjoo Oh COSE312 2017 Spring, Lecture 14 May 8, 2017 1 / 30 Denotational Semantics In denotational semantics, we are interested

More information

COMPLEX NUMBERS LAURENT DEMONET

COMPLEX NUMBERS LAURENT DEMONET COMPLEX NUMBERS LAURENT DEMONET Contents Introduction: numbers 1 1. Construction of complex numbers. Conjugation 4 3. Geometric representation of complex numbers 5 3.1. The unit circle 6 3.. Modulus of

More information

Multiple Intermediate Structure Deforestation by Shortcut Fusion

Multiple Intermediate Structure Deforestation by Shortcut Fusion Multiple Intermediate Structure Deforestation by Shortcut Fusion Alberto Pardo 1, João P. Fernandes 2,3, and João Saraiva 2 1 Instituto de Computación, Universidad de la República, Uruguay pardo@fing.edu.uy

More information

Models of Computation,

Models of Computation, Models of Computation, 2010 1 Induction We use a lot of inductive techniques in this course, both to give definitions and to prove facts about our semantics So, it s worth taking a little while to set

More information

Hybrid Systems - Lecture n. 3 Lyapunov stability

Hybrid Systems - Lecture n. 3 Lyapunov stability OUTLINE Focus: stability of equilibrium point Hybrid Systems - Lecture n. 3 Lyapunov stability Maria Prandini DEI - Politecnico di Milano E-mail: prandini@elet.polimi.it continuous systems decribed by

More information

Denotational semantics

Denotational semantics Denotational semantics The method define syntax (syntactic domains) define semantic domains define semantic functions use compositional definitions Andrzej Tarlecki: Semantics & Verification - 63 - Syntactic

More information

Minimally Strict Polymorphic Functions

Minimally Strict Polymorphic Functions Minimally Strict Polymorphic Functions Jan Christiansen Christian-Albrechts-Universität Kiel Institut für Informatik 24098 Kiel, Germany jac@informatik.uni-kiel.de Daniel Seidel Rheinische Friedrich-Wilhelms-Universität

More information

Project: Construction of the Fundamental Group

Project: Construction of the Fundamental Group Project: Construction of the Fundamental Group Renzo s math 472 This worksheet is designed to lead you to define and discover our first functor: the fundamental group. 1 Definitions First of all, let us

More information

Fun with Semirings. A functional pearl on the abuse of linear algebra. Stephen Dolan

Fun with Semirings. A functional pearl on the abuse of linear algebra. Stephen Dolan A functional pearl on the abuse of linear algebra Computer Laboratory University of Cambridge stephen.dolan@cl.cam.ac.uk September 25, 2013 Linear algebra is magic If your problem can be expressed as vectors

More information

Wolfgang Jeltsch. Seminar talk at the Institute of Cybernetics Tallinn, Estonia

Wolfgang Jeltsch. Seminar talk at the Institute of Cybernetics Tallinn, Estonia in in Brandenburgische Technische Universität Cottbus Cottbus, Germany Seminar talk at the Institute of Cybernetics Tallinn, Estonia February 10, 2011 in in in trueness of a proposition depends on time

More information

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky

An Intuitive Introduction to Motivic Homotopy Theory Vladimir Voevodsky What follows is Vladimir Voevodsky s snapshot of his Fields Medal work on motivic homotopy, plus a little philosophy and from my point of view the main fun of doing mathematics Voevodsky (2002). Voevodsky

More information

CS 173 Lecture 2: Propositional Logic

CS 173 Lecture 2: Propositional Logic CS 173 Lecture 2: Propositional Logic José Meseguer University of Illinois at Urbana-Champaign 1 Propositional Formulas A proposition is a statement that is either true, T or false, F. A proposition usually

More information

Conceptual Connections of Circularity and Category Theory

Conceptual Connections of Circularity and Category Theory 1/64 Conceptual Connections of Circularity and Category Theory Larry Moss Indiana University, Bloomington ESSLLI 2012, Opole 2/64 The conceptual comparison chart Filling out the details is my goal for

More information

Reasoning About Imperative Programs. COS 441 Slides 10b

Reasoning About Imperative Programs. COS 441 Slides 10b Reasoning About Imperative Programs COS 441 Slides 10b Last time Hoare Logic: { P } C { Q } Agenda If P is true in the initial state s. And C in state s evaluates to s. Then Q must be true in s. Program

More information

Denoting computation

Denoting computation A jog from Scott Domains to Hypercoherence Spaces 13/12/2006 Outline Motivation 1 Motivation 2 What Does Denotational Semantic Mean? Trivial examples Basic things to know 3 Scott domains di-domains 4 Event

More information

Exam 1 Solutions. Solution: The 16 contributes 5 to the total and contributes 2. All totaled, there are 5 ˆ 2 10 abelian groups.

Exam 1 Solutions. Solution: The 16 contributes 5 to the total and contributes 2. All totaled, there are 5 ˆ 2 10 abelian groups. Math 5372 Spring 2014 Exam 1 Solutions 1. (15 points) How many abelian groups are there of order: (a) 16 For any prime p, there are as many groups of order p k as there are partitions of k. The number

More information

The Lifting Lemma. Ralf Hinze

The Lifting Lemma. Ralf Hinze The Lifting Lemma Ralf Hinze Computing Laboratory, University of Oxford Wolfson Building, Parks Road, Oxford, OX1 3QD, England ralf.hinze@comlab.ox.ac.uk http://www.comlab.ox.ac.uk/ralf.hinze/ June 2009

More information

Topics in Concurrency

Topics in Concurrency Topics in Concurrency Lecture 3 Jonathan Hayman 18 February 2015 Recap: Syntax of CCS Expressions: Arithmetic a and Boolean b Processes: p ::= nil nil process (τ p) silent/internal action (α!a p) output

More information

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11.

CSC 7101: Programming Language Structures 1. Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11. Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 1 Overview We ll develop proof rules, such as: { I b } S { I } { I } while b do S end { I b } That allow us to verify

More information

Hilbert modules, TRO s and C*-correspondences

Hilbert modules, TRO s and C*-correspondences Hilbert modules, TRO s and C*-correspondences (rough notes by A.K.) 1 Hilbert modules and TRO s 1.1 Reminders Recall 1 the definition of a Hilbert module Definition 1 Let A be a C*-algebra. An Hilbert

More information

Separation Logic. Part 3. Arthur Charguéraud. February / 66

Separation Logic. Part 3. Arthur Charguéraud. February / 66 Separation Logic Part 3 Arthur Charguéraud February 2014 1 / 66 Content Reasoning about loops For loops While loops Repeat-loops Total correctness Frame in a while loop Higher-order iterators for pure

More information

MTH 505: Number Theory Spring 2017

MTH 505: Number Theory Spring 2017 MTH 505: Number Theory Spring 017 Homework 4 Drew Armstrong 4.1. (Squares Mod 4). We say that an element ras n P Z{nZ is square if there exists an element rxs n P Z{nZ such that ras n prxs n q rx s n.

More information

Exponential homomorphism. non-commutative probability

Exponential homomorphism. non-commutative probability The exponential homomorphism in non-commutative probability (joint work with Octavio Arizmendi) Texas A&M University March 25, 2016 Classical convolutions. Additive:» R» fpzq dpµ 1 µ 2 qpzq Multiplicative:»»

More information

Math (P)Review Part II:

Math (P)Review Part II: Math (P)Review Part II: Vector Calculus Computer Graphics Assignment 0.5 (Out today!) Same story as last homework; second part on vector calculus. Slightly fewer questions Last Time: Linear Algebra Touched

More information

Testing System Conformance for Cyber-Physical Systems

Testing System Conformance for Cyber-Physical Systems Testing System Conformance for Cyber-Physical Systems Testing systems by walking the dog Rupak Majumdar Max Planck Institute for Software Systems Joint work with Vinayak Prabhu (MPI-SWS) and Jyo Deshmukh

More information

1.010 Uncertainty in Engineering Fall 2008

1.010 Uncertainty in Engineering Fall 2008 MIT OpenCourseWare http://ocw.mit.edu 1.010 Uncertainty in Engineering Fall 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. Application Example 4

More information

Recognizing Safety and Liveness by Alpern and Schneider

Recognizing Safety and Liveness by Alpern and Schneider Recognizing Safety and Liveness by Alpern and Schneider Calvin Deutschbein 17 Jan 2017 1 Intro 1.1 Safety What is safety? Bad things do not happen For example, consider the following safe program in C:

More information

1 Reductions from Maximum Matchings to Perfect Matchings

1 Reductions from Maximum Matchings to Perfect Matchings 15-451/651: Design & Analysis of Algorithms November 21, 2013 Lecture #26 last changed: December 3, 2013 When we first studied network flows, we saw how to find maximum cardinality matchings in bipartite

More information

MODELS OF HORN THEORIES

MODELS OF HORN THEORIES MODELS OF HORN THEORIES MICHAEL BARR Abstract. This paper explores the connection between categories of models of Horn theories and models of finite limit theories. The first is a proper subclass of the

More information

Imperative Abstractions for Functional Actions

Imperative Abstractions for Functional Actions Imperative Abstractions for Functional Actions Walter Guttmann Institut für Programmiermethodik und Compilerbau, Universität Ulm, 89069 Ulm, Germany walter.guttmann@uni-ulm.de Abstract We elaborate our

More information

Nunchaku: Flexible Model Finding for Higher-Order Logic

Nunchaku: 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 information

Crypto math II. Alin Tomescu May 27, Abstract A quick overview on group theory from Ron Rivest s course in Spring 2015.

Crypto math II. Alin Tomescu May 27, Abstract A quick overview on group theory from Ron Rivest s course in Spring 2015. Crypto math II Alin Tomescu alinush@mit.edu May 7, 015 Abstract A quick overview on group theory from Ron Rivest s 6.857 course in Spring 015. 1 Overview Group theory review Diffie-Hellman (DH) key exchange

More information

Monoids: Theme and Variations (Functional Pearl)

Monoids: Theme and Variations (Functional Pearl) Monoids: Theme and Variations (Functional Pearl) Brent A. Yorgey University of Pennsylvania byorgey@cis.upenn.edu Abstract The monoid is a humble algebraic structure, at first glance even downright boring.

More information

Hoare Logic: Reasoning About Imperative Programs

Hoare Logic: Reasoning About Imperative Programs Hoare Logic: Reasoning About Imperative Programs COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2018 Programming Paradigms Functional. (Haskell, SML, OCaml,... ) main paradigm:

More information

Partial model checking via abstract interpretation

Partial model checking via abstract interpretation Partial model checking via abstract interpretation N. De Francesco, G. Lettieri, L. Martini, G. Vaglini Università di Pisa, Dipartimento di Ingegneria dell Informazione, sez. Informatica, Via Diotisalvi

More information

Building Concepts: Solving Systems of Equations Algebraically

Building Concepts: Solving Systems of Equations Algebraically Lesson Overview In this TI-Nspire lesson, students will investigate pathways for solving systems of linear equations algebraically. There are many effective solution pathways for a system of two linear

More information

CHAPTER 1: Review (See also the Precalculus notes at

CHAPTER 1: Review (See also the Precalculus notes at CHAPTER 1: Review (See also the Precalculus notes at http://www.kkuniyuk.com) TOPIC 1: FUNCTIONS (Chapter 1: Review) 1.01 PART A: AN EXAMPLE OF A FUNCTION Consider a function f whose rule is given by f

More information

The Practice of Statistics Third Edition

The Practice of Statistics Third Edition The Practice of Statistics Third Edition Chapter 6: Probability and Simulation: The Study of Randomness Copyright 2008 by W. H. Freeman & Company Probability Rules True probability can only be found by

More information

Categorical Databases

Categorical Databases Categorical Databases Patrick Schultz, David Spivak MIT Ryan Wisnesky Categorical Informatics and others October 2017 Introduction This talk describes a new algebraic (purely equational) way to formalize

More information

Undecidability and Rice s Theorem. Lecture 26, December 3 CS 374, Fall 2015

Undecidability and Rice s Theorem. Lecture 26, December 3 CS 374, Fall 2015 Undecidability and Rice s Theorem Lecture 26, December 3 CS 374, Fall 2015 UNDECIDABLE EXP NP P R E RECURSIVE Recap: Universal TM U We saw a TM U such that L(U) = { (z,w) M z accepts w} Thus, U is a stored-program

More information

Duality in Logic and Computation

Duality in Logic and Computation Duality in Logic and Computation Prakash Panangaden 1 1 School of Computer Science McGill University IEEE Symposium On Logic In Computer Science, June 2013 Panangaden (McGill University) Duality in Logic

More information

Embedding Classical and Quantum Circuits in Haskell

Embedding Classical and Quantum Circuits in Haskell Embedding Classical and Quantum Circuits in Haskell Amr Sabry School of Informatics and Computing Indiana University July 26, 2012 Amr Sabry ( School of Informatics and Computing Embedding Indiana University

More information

From syntax to semantics of Dependent Type Theories - Formalized

From syntax to semantics of Dependent Type Theories - Formalized RDP 2015, Jun. 30, 2015, WCMCS, Warsaw. From syntax to semantics of Dependent Type Theories - Formalized by Vladimir Voevodsky from the Institute for Advanced Study in Princeton, NJ. I will be speaking

More information

MATH 360 Final Exam Thursday, December 14, a n 2. a n 1 1

MATH 360 Final Exam Thursday, December 14, a n 2. a n 1 1 MATH 36 Final Exam Thursday, December 4, 27 Name. The sequence ta n u is defined by a and a n (a) Prove that lim a n exists by showing that ta n u is bounded and monotonic and invoking an appropriate result.

More information

SECTION 1.8 : x = f LEARNING OBJECTIVES

SECTION 1.8 : x = f LEARNING OBJECTIVES SECTION 1.8 : x = f (Section 1.8: x = f ( y) ( y)) 1.8.1 LEARNING OBJECTIVES Know how to graph equations of the form x = f ( y). Compare these graphs with graphs of equations of the form y = f ( x). Recognize

More information

Introduction to Probabilistic Programming Language (with Church as an example) Presenter: Enrique Rosales, Xing Zeng

Introduction to Probabilistic Programming Language (with Church as an example) Presenter: Enrique Rosales, Xing Zeng Introduction to Probabilistic Programming Language (with Church as an example) Presenter: Enrique Rosales, Xing Zeng 1 Knowledge How can we infer knowledge from observations? 2 Ron s box Bob has a box

More information

S n = x + X 1 + X X n.

S n = x + X 1 + X X n. 0 Lecture 0 0. Gambler Ruin Problem Let X be a payoff if a coin toss game such that P(X = ) = P(X = ) = /2. Suppose you start with x dollars and play the game n times. Let X,X 2,...,X n be payoffs in each

More information

OPERAD BIMODULE CHARACTERIZATION OF ENRICHMENT. V2

OPERAD BIMODULE CHARACTERIZATION OF ENRICHMENT. V2 OPERAD BIMODULE CHARACTERIZATION OF ENRICHMENT. 2 STEFAN FORCEY 1. Idea In a recent talk at CT06 http://faculty.tnstate.edu/sforcey/ct06.htm and in a research proposal at http://faculty.tnstate.edu/sforcey/class_home/research.htm

More information

Practical Data Processing With Haskell

Practical Data Processing With Haskell Practical Data Processing With Haskell Ozgun Ataman November 14, 2012 Ozgun Ataman (Soostone Inc) Practical Data Processing With Haskell November 14, 2012 1 / 18 A bit about the speaker Electrical Engineering,

More information

BRIAN OSSERMAN. , let t be a coordinate for the line, and take θ = d. A differential form ω may be written as g(t)dt,

BRIAN OSSERMAN. , let t be a coordinate for the line, and take θ = d. A differential form ω may be written as g(t)dt, CONNECTIONS, CURVATURE, AND p-curvature BRIAN OSSERMAN 1. Classical theory We begin by describing the classical point of view on connections, their curvature, and p-curvature, in terms of maps of sheaves

More information

Vectors and their uses

Vectors and their uses Vectors and their uses Sharon Goldwater Institute for Language, Cognition and Computation School of Informatics, University of Edinburgh DRAFT Version 0.95: 3 Sep 2015. Do not redistribute without permission.

More information

CS 154 Introduction to Automata and Complexity Theory

CS 154 Introduction to Automata and Complexity Theory CS 154 Introduction to Automata and Complexity Theory cs154.stanford.edu 1 INSTRUCTORS & TAs Ryan Williams Cody Murray Lera Nikolaenko Sunny Rajan 2 Textbook 3 Homework / Problem Sets Homework will be

More information

3-1 Graphing and Writing Inequalities. Warm Up Lesson Presentation Lesson Quiz

3-1 Graphing and Writing Inequalities. Warm Up Lesson Presentation Lesson Quiz 3-1 Graphing and Writing Inequalities Warm Up Lesson Presentation Lesson Quiz Holt Holt Algebra Algebra 1 1 Bell Quiz 3-1 Compare. Write , or =. 2 pts 1. 3 2 2 pts 2. 6.5 6.3 1 pt for putting your

More information

Section 2.7 Solving Linear Inequalities

Section 2.7 Solving Linear Inequalities Section.7 Solving Linear Inequalities Objectives In this section, you will learn to: To successfully complete this section, you need to understand: Add and multiply an inequality. Solving equations (.1,.,

More information

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE

Axiomatic Semantics. Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE Axiomatic Semantics Stansifer Ch 2.4, Ch. 9 Winskel Ch.6 Slonneger and Kurtz Ch. 11 CSE 6341 1 Outline Introduction What are axiomatic semantics? First-order logic & assertions about states Results (triples)

More information

MATH 387 ASSIGNMENT 2

MATH 387 ASSIGNMENT 2 MATH 387 ASSIGMET 2 SAMPLE SOLUTIOS BY IBRAHIM AL BALUSHI Problem 4 A matrix A ra ik s P R nˆn is called symmetric if a ik a ki for all i, k, and is called positive definite if x T Ax ě 0 for all x P R

More information

Preface.

Preface. This document was written and copyrighted by Paul Dawkins. Use of this document and its online version is governed by the Terms and Conditions of Use located at. The online version of this document is

More information