Running Probabilistic. Programs Backwards

Size: px
Start display at page:

Download "Running Probabilistic. Programs Backwards"

Transcription

1 Running Probabilistic Programs Backwards Neil Toronto * Jay McCarthy David Van Horn * * University of Maryland Vassar College ESOP /04/14

2 Roadmap Probabilistic inference, and why it s hard 1

3 Roadmap Probabilistic inference, and why it s hard Limitations of current probabilistic programming languages (PPLs) 1

4 Roadmap Probabilistic inference, and why it s hard Limitations of current probabilistic programming languages (PPLs) Contributions 1

5 Roadmap Probabilistic inference, and why it s hard Limitations of current probabilistic programming languages (PPLs) Contributions Uncomputable, compositional ways to not limit language 1

6 Roadmap Probabilistic inference, and why it s hard Limitations of current probabilistic programming languages (PPLs) Contributions Uncomputable, compositional ways to not limit language Computable, compositional ways to not limit language 1

7 (let ([x (flip 0.5)]) x) Programming Coin Flips 2

8 (let ([x (flip 0.5)]) x) Programming Coin Flips 0.5 2

9 (let ([x (flip 0.5)]) x) Programming Coin Flips

10 (let ([x (flip 0.5)] [y (flip 0.5)]) (cons x y)) Programming Coin Flips , 0.5, 2

11 (let ([x (flip 0.5)] [y (flip 0.5)]) (cons x y)) Programming Coin Flips ,, 0.5,, 2

12 (let ([x (flip 0.5)] [y (flip 0.5)]) (cons x y)) Programming Coin Flips ,, 0.5,, 2

13 Programming Coin Flips (let* ([x (flip 0.5)] [y (flip (if (equal? x heads) ))]) (cons x y)) ,, 0.5,, 2

14 Programming Coin Flips (let* ([x (flip 0.5)] [y (flip (if (equal? x heads) ))]) (cons x y)) ,, 0.5,,

15 Programming Coin Flips ,, 0.5,,

16 Programming Coin Flips ,, 0.5,,

17 Programming Coin Flips , 0.5, 0.3 2

18 Stochastic Ray Tracing sto cha stic /stō-ˈkas-tik/ adj. fancy word for "randomized" 2

19 Stochastic Ray Tracing sto cha stic /stō-ˈkas-tik/ adj. fancy word for "randomized" 2

20 Stochastic Ray Tracing ap er ture /ˈap-ə(r)-chər/ n. fancy word for "opening" 2

21 Stochastic Ray Tracing ap er ture /ˈap-ə(r)-chər/ n. fancy word for "opening" 2

22 Stochastic Ray Tracing Simulate projecting rays onto a sensor... 2

23 Stochastic Ray Tracing... and collect them to form an image 2

24 Programming Stochastic Ray Tracing Normally thousands of lines of code 2

25 Programming Stochastic Ray Tracing Normally thousands of lines of code Bears little resemblance to the physical process 2

26 Programming Stochastic Ray Tracing Normally thousands of lines of code Bears little resemblance to the physical process In DrBayes, it s simple physics simulation: (define/drbayes (ray-plane-intersect p0 v n d) (let ([denom (- (dot v n))]) (if (> denom 0) (let ([t (/ (+ d (dot p0 n)) denom)]) (if (> t 0) (collision t (vec+ p0 (vec* v t)) n) #f)) #f))) 2

27 Programming Stochastic Ray Tracing Normally thousands of lines of code Bears little resemblance to the physical process In DrBayes, it s simple physics simulation: (define/drbayes (ray-plane-intersect p0 v n d) (let ([denom (- (dot v n))]) (if (> denom 0) (let ([t (/ (+ d (dot p0 n)) denom)]) (if (> t 0) (collision t (vec+ p0 (vec* v t)) n) #f)) #f))) Other PPLs really aren t up to this yet 2

28 Programming Stochastic Ray Tracing Normally thousands of lines of code Bears little resemblance to the physical process In DrBayes, it s simple physics simulation: (define/drbayes (ray-plane-intersect p0 v n d) (let ([denom (- (dot v n))]) (if (> denom 0) (let ([t (/ (+ d (dot p0 n)) denom)]) (if (> t 0) (collision t (vec+ p0 (vec* v t)) n) #f)) #f))) Other PPLs really aren t up to this yet The issue is one of theory, not engineering effort 2

29 Simpler Example Assume (random) returns a value uniformly in 3

30 Simpler Example Assume (random) returns a value uniformly in Density function for value of (random): p(x) x 3

31 Simpler Example Assume (random) returns a value uniformly in Density function for value of (random): p(x) x 3

32 Simpler Example Assume (random) returns a value uniformly in Density function for value of (random): p(x) x 3

33 Simpler Example Assume (random) returns a value uniformly in Density function for value of (max 0.5 (random)): pₘ(x) =???.75 pₘ(x) x 3

34 Simpler Example Assume (random) returns a value uniformly in Density function for value of (max 0.5 (random)): pₘ(x) =???.75 pₘ(x) x 3

35 Simpler Example Assume (random) returns a value uniformly in Density function for value of (max 0.5 (random)): pₘ(x) =???.75 pₘ(x) x 3

36 Simpler Example Assume (random) returns a value uniformly in Density function for value of (max 0.5 (random)): pₘ(x) doesn't exist.75 pₘ(x) x 3

37 What Can t Densities Model? 4

38 What Can t Densities Model? Results of discontinuous functions (bounded measuring devices) (let ([temperature (normal 99 1)]) (min 100 temperature)) 4

39 What Can t Densities Model? Results of discontinuous functions (bounded measuring devices) (let ([temperature (normal 99 1)]) (min 100 temperature)) Variable-dimensional things (union types) (if test? none (just x)) 4

40 What Can t Densities Model? Results of discontinuous functions (bounded measuring devices) (let ([temperature (normal 99 1)]) (min 100 temperature)) Variable-dimensional things (union types) (if test? none (just x)) Infinite-dimensional things (recursion) 4

41 What Can t Densities Model? Results of discontinuous functions (bounded measuring devices) (let ([temperature (normal 99 1)]) (min 100 temperature)) Variable-dimensional things (union types) (if test? none (just x)) Infinite-dimensional things (recursion) In general: the distributions of program values 4

42 Probability Measures Like already-integrated densities, but a primitive concept 5

43 Probability Measures Like already-integrated densities, but a primitive concept Measure of (random) is, defined by 5

44 Probability Measures Like already-integrated densities, but a primitive concept Measure of (random) is, defined by 5

45 Probability Measures Like already-integrated densities, but a primitive concept Measure of (random) is, defined by Measure of (max 0.5 (random)) defined by 5

46 Probability Measures Like already-integrated densities, but a primitive concept Measure of (random) is, defined by Measure of (max 0.5 (random)) defined by This term assigns probability 5

47 Probability Measures Like already-integrated densities, but a primitive concept Measure of (random) is, defined by Measure of (max 0.5 (random)) defined by This term assigns probability Need a way to derive measures from code 5

48 Probability Measures Via Preimages Interpret (max 0.5 (random)) as, defined 6

49 Probability Measures Via Preimages Interpret (max 0.5 (random)) as, defined Derive measure of (max 0.5 (random)) as 6

50 Probability Measures Via Preimages Interpret (max 0.5 (random)) as, defined Derive measure of (max 0.5 (random)) as where 6

51 Probability Measures Via Preimages Interpret (max 0.5 (random)) as, defined Derive measure of (max 0.5 (random)) as where Factored into random and deterministic parts: 6

52 Probability Measures Via Preimages Interpret (max 0.5 (random)) as, defined Derive measure of (max 0.5 (random)) as where Factored into random and deterministic parts: In other words, compute measures of expressions by running them backwards 6

53 Crazy Idea is Feasible If... Seems like we need: 7

54 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source 7

55 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets 7

56 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets Efficient representation of arbitrary sets 7

57 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets Efficient representation of arbitrary sets Efficient way to compute areas of preimage sets 7

58 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets Efficient representation of arbitrary sets Efficient way to compute areas of preimage sets Proof of correctness w.r.t. standard interpretation 7

59 Crazy Idea is Feasible If... Seems like we need: Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets Efficient representation of arbitrary sets Efficient way to compute areas of preimage sets Proof of correctness w.r.t. standard interpretation WAT 7

60 What About Approximating? Conservative approximation with rectangles: 8

61 What About Approximating? Conservative approximation with rectangles: 8

62 What About Approximating? Restricting preimages to rectangular subdomains: 9

63 What About Approximating? Restricting preimages to rectangular subdomains: 9

64 What About Approximating? Restricting preimages to rectangular subdomains: 9

65 What About Approximating? Restricting preimages to rectangular subdomains: 9

66 What About Approximating? Restricting preimages to rectangular subdomains: 9

67 What About Approximating? Restricting preimages to rectangular subdomains: 9

68 What About Approximating? Restricting preimages to rectangular subdomains: 9

69 What About Approximating? Restricting preimages to rectangular subdomains: 9

70 What About Approximating? Restricting preimages to rectangular subdomains: 9

71 What About Approximating? Restricting preimages to rectangular subdomains: 9

72 What About Approximating? Restricting preimages to rectangular subdomains: 9

73 What About Approximating? Restricting preimages to rectangular subdomains: 9

74 What About Approximating? Sampling: exponential to quadratic (e.g. days to minutes) 10

75 What About Approximating? Sampling: exponential to quadratic (e.g. days to minutes) 10

76 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute preimage sets Efficient representation of arbitrary sets Efficient way to compute volumes of preimage sets Proof of correctness w.r.t. standard interpretation 11

77 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute abstract preimage subsets Efficient representation of arbitrary sets Efficient way to compute volumes of preimage sets Proof of correctness w.r.t. standard interpretation 11

78 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute abstract preimage subsets Efficient representation of abstract sets Efficient way to compute volumes of preimage sets Proof of correctness w.r.t. standard interpretation 11

79 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute abstract preimage subsets Efficient representation of abstract sets Efficient way to sample uniformly in preimage sets Proof of correctness w.r.t. standard interpretation 11

80 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute abstract preimage subsets Efficient representation of abstract sets Efficient way to sample uniformly in preimage sets Efficient domain partition sampling Proof of correctness w.r.t. standard interpretation 11

81 Contribution: Making This Crazy Idea Feasible Standard interpretation of programs as pure functions from a random source Efficient way to compute abstract preimage subsets Efficient representation of abstract sets Efficient way to sample uniformly in preimage sets Efficient domain partition sampling Efficient way to determine whether a domain sample is actually in the preimage (just use standard interpretation) Proof of correctness w.r.t. standard interpretation 11

82 How Many Meanings? Start with pure programs, then lift by threading a random store 11

83 How Many Meanings? Start with pure programs, then lift by threading a random store Nonrecursive, nonprobabilistic programs:,, 11

84 How Many Meanings? Start with pure programs, then lift by threading a random store Nonrecursive, nonprobabilistic programs:,, Add 3 semantic functions for recursion and probabilistic choice 11

85 How Many Meanings? Start with pure programs, then lift by threading a random store Nonrecursive, nonprobabilistic programs:,, Add 3 semantic functions for recursion and probabilistic choice Full development needs 2 more to transfer theorems from measure theory... 11

86 How Many Meanings? Start with pure programs, then lift by threading a random store Nonrecursive, nonprobabilistic programs:,, Add 3 semantic functions for recursion and probabilistic choice Full development needs 2 more to transfer theorems from measure theory oh, and 1 more to collect information for Monte Carlo integration 11

87 How Many Meanings? Start with pure programs, then lift by threading a random store Nonrecursive, nonprobabilistic programs:,, Add 3 semantic functions for recursion and probabilistic choice Full development needs 2 more to transfer theorems from measure theory oh, and 1 more to collect information for Monte Carlo integration Tally: = 9 semantic functions, 11 or 12 rules each 11

88 Enter Category Theory Moggi (1989): Introduces monads for interpreting effects 11

89 Enter Category Theory Moggi (1989): Introduces monads for interpreting effects Other kinds of categories: idioms, arrows 11

90 Enter Category Theory Moggi (1989): Introduces monads for interpreting effects Other kinds of categories: idioms, arrows Arrow defined by type constructor combinators: and these 11

91 Enter Category Theory Moggi (1989): Introduces monads for interpreting effects Other kinds of categories: idioms, arrows Arrow defined by type constructor combinators: and these Arrows are always function-like 11

92 Reducing Complexity Function arrow: is just 11

93 Reducing Complexity Function arrow: is just 11

94 Reducing Complexity Function arrow: is just 11

95 Reducing Complexity Function arrow: is just 11

96 Reducing Complexity Function arrow: is just 11

97 Reducing Complexity Function arrow: is just 11

98 Reducing Complexity Function arrow: is just 11

99 Reducing Complexity Function arrow: is just 11

100 Reducing Complexity Function arrow: is just 11

101 Pair Preimages 12

102 Pair Preimages 12

103 Pair Preimages : 12

104 Pair Preimages and : 12

105 Pair Preimages : 12

106 Correctness Theorems For Low, Low Prices Define 12

107 Correctness Theorems For Low, Low Prices Define Derive and others so that distributes; e.g. 12

108 Correctness Theorems For Low, Low Prices Define Derive and others so that distributes; e.g. Distributive properties makes proving this very easy: Theorem (correctness). For all,. 12

109 Correctness Theorems For Low, Low Prices Define Derive and others so that distributes; e.g. Distributive properties makes proving this very easy: Theorem (correctness). For all,. In English: computes preimages under. 12

110 Correctness Theorems For Low, Low Prices Define Derive and others so that distributes; e.g. Distributive properties makes proving this very easy: Theorem (correctness). For all,. In English: computes preimages under. Other correctness proofs are similarly easy: prove 5 distributive properties 12

111 Correctness Theorems For Low, Low Prices Define Derive and others so that distributes; e.g. Distributive properties makes proving this very easy: Theorem (correctness). For all,. In English: computes preimages under. Other correctness proofs are similarly easy: prove 5 distributive properties Can add (random) and recursion to all semantics in one shot 12

112 Abstraction Rectangle: An interval or union of intervals, a subset of for rectangles and, or 13

113 Abstraction Rectangle: An interval or union of intervals, a subset of for rectangles and, or Easy representation; easy intersection, join (which overapproximates union), empty test, etc. 13

114 Abstraction Rectangle: An interval or union of intervals, a subset of for rectangles and, or Easy representation; easy intersection, join (which overapproximates union), empty test, etc. Define (and therefore ) by replacing sets and set operations with rectangles and rectangle operations 13

115 Abstraction Rectangle: An interval or union of intervals, a subset of for rectangles and, or Easy representation; easy intersection, join (which overapproximates union), empty test, etc. Define (and therefore ) by replacing sets and set operations with rectangles and rectangle operations Recursion is somewhat tricky requires fine control over recursion depth or if choices 13

116 In Theory... Theorem (sound). computes overapproximations of the preimages computed by. Consequence: Sampling in abstract preimages doesn t leave anything out 14

117 In Theory... Theorem (sound). computes overapproximations of the preimages computed by. Consequence: Sampling in abstract preimages doesn t leave anything out Theorem (decreasing). the given subdomain. never returns preimages larger than Consequence: Refining abstract preimage sets never results in a worse approximation 14

118 In Theory... Theorem (sound). computes overapproximations of the preimages computed by. Consequence: Sampling in abstract preimages doesn t leave anything out Theorem (decreasing). the given subdomain. never returns preimages larger than Consequence: Refining abstract preimage sets never results in a worse approximation Theorem (monotone). is monotone. Consequence: Partitioning and then refining never results in a worse approximation 14

119 In Practice... Theorems prove this always works: 15

120 In Practice... Theorems prove this always works: 15

121 In Practice... Theorems prove this always works: 15

122 In Practice... Theorems prove this always works: 15

123 In Practice... Theorems prove this always works: 15

124 In Practice... Theorems prove this always works: 15

125 In Practice... Theorems prove this always works: 15

126 In Practice... Theorems prove this always works: 15

127 In Practice... Theorems prove this always works: 15

128 Program Domain Values 16

129 Program Domain Values Program inputs are infinite binary trees: 16

130 Program Domain Values Program inputs are infinite binary trees: Every expression in a program is assigned a node 16

131 Program Domain Values Program inputs are infinite binary trees: Every expression in a program is assigned a node Implemented using lazy trees of random values 16

132 Program Domain Values Program inputs are infinite binary trees: Every expression in a program is assigned a node Implemented using lazy trees of random values No probability density for domain, but there is a measure 16 16

133 Example: Stochastic Ray Tracing 17

134 Example: Probabilistic Verification (struct/drbayes float-any ()) (struct/drbayes float (value error)) 18

135 Example: Probabilistic Verification (struct/drbayes float-any ()) (struct/drbayes float (value error)) (define/drbayes (flsqrt x) (if (float-any? x) x (let ([v (float-value x)] [e (float-error x)]) (cond [(negative? v) (float-any)] [(zero? v) (float 0 0)] [else (float (sqrt v) (+ (- 1 (sqrt (- 1 e))) (* 1/2 epsilon)))])))) 18

136 Example: Probabilistic Verification (struct/drbayes float-any ()) (struct/drbayes float (value error)) (define/drbayes (flsqrt x) (if (float-any? x) x (let ([v (float-value x)] [e (float-error x)]) (cond [(negative? v) (float-any)] [(zero? v) (float 0 0)] [else (float (sqrt v) (+ (- 1 (sqrt (- 1 e))) (* 1/2 epsilon)))])))) Idea: sample e where (> (float-error e) threshold) 18

137 Example: Probabilistic Verification (struct/drbayes float-any ()) (struct/drbayes float (value error)) (define/drbayes (flsqrt x) (if (float-any? x) x (let ([v (float-value x)] [e (float-error x)]) (cond [(negative? v) (float-any)] [(zero? v) (float 0 0)] [else (float (sqrt v) (+ (- 1 (sqrt (- 1 e))) (* 1/2 epsilon)))])))) Idea: sample e where (> (float-error e) threshold) Verified flhypot, flsqrt1pm1, flsinh in Racket s math library, as well as others 18

138 Examples: Other Inference Tasks Typical Bayesian inference Hierarchical models Bayesian regression Model selection 19

139 Examples: Other Inference Tasks Typical Bayesian inference Hierarchical models Bayesian regression Model selection Atypical Programs that halt with probability < 1, or never halt Probabilistic context-free grammars with context-sensitive constraints 19

140 Summary Probabilistic inference is hard, so PPLs have been popping up 20

141 Summary Probabilistic inference is hard, so PPLs have been popping up Interpreting every program requires measure theory 20

142 Summary Probabilistic inference is hard, so PPLs have been popping up Interpreting every program requires measure theory Defined a semantics that computes preimages 20

143 Summary Probabilistic inference is hard, so PPLs have been popping up Interpreting every program requires measure theory Defined a semantics that computes preimages Measuring abstract preimages or sampling in them carries out inference 20

144 Summary Probabilistic inference is hard, so PPLs have been popping up Interpreting every program requires measure theory Defined a semantics that computes preimages Measuring abstract preimages or sampling in them carries out inference Can do a lot of cool stuff that s normally inaccessible 20

145 21

From Bayesian Notation to Pure Racket *

From Bayesian Notation to Pure Racket * I'm Neil Toronto of Toronto and McCarthy, from the PLT group at Brigham Young University. We're developing languages for Bayesian modeling and queries. From Bayesian Notation to Pure Racket * via Discrete

More information

Markov Logic: Representation

Markov Logic: Representation Markov Logic: Representation Overview Statistical relational learning Markov logic Basic inference Basic learning Statistical Relational Learning Goals: Combine (subsets of) logic and probability into

More information

Typed Racket: Racket with Static Types

Typed Racket: Racket with Static Types Typed Racket: Racket with Static Types Version 5.0.2 Sam Tobin-Hochstadt November 6, 2010 Typed Racket is a family of languages, each of which enforce that programs written in the language obey a type

More information

Computational Geometry

Computational Geometry Windowing queries Windowing Windowing queries Zoom in; re-center and zoom in; select by outlining Windowing Windowing queries Windowing Windowing queries Given a set of n axis-parallel line segments, preprocess

More information

Computational Geometry

Computational Geometry Windowing queries Windowing Windowing queries Zoom in; re-center and zoom in; select by outlining Windowing Windowing queries Windowing Windowing queries Given a set of n axis-parallel line segments, preprocess

More information

Propositional Logic. Part I

Propositional 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 information

Lecture 15: The subspace topology, Closed sets

Lecture 15: The subspace topology, Closed sets Lecture 15: The subspace topology, Closed sets 1 The Subspace Topology Definition 1.1. Let (X, T) be a topological space with topology T. subset of X, the collection If Y is a T Y = {Y U U T} is a topology

More information

Logic and Computation

Logic and Computation Logic and Computation From Conceptualization to Formalization Here's what we do when we build a formal model (or do a computation): 0. Identify a collection of objects/events in the real world. This is

More information

Chapter 3. Set Theory. 3.1 What is a Set?

Chapter 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 information

Randomized algorithms have several advantages over deterministic ones. We discuss them here:

Randomized algorithms have several advantages over deterministic ones. We discuss them here: CS787: Advanced Algorithms Lecture 6: Randomized Algorithms In this lecture we introduce randomized algorithms. We will begin by motivating the use of randomized algorithms through a few examples. Then

More information

Course notes for Data Compression - 2 Kolmogorov complexity Fall 2005

Course 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 information

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13

Lecture 17: Solid Modeling.... a cubit on the one side, and a cubit on the other side Exodus 26:13 Lecture 17: Solid Modeling... a cubit on the one side, and a cubit on the other side Exodus 26:13 Who is on the LORD's side? Exodus 32:26 1. Solid Representations A solid is a 3-dimensional shape with

More information

Short-Cut MCMC: An Alternative to Adaptation

Short-Cut MCMC: An Alternative to Adaptation Short-Cut MCMC: An Alternative to Adaptation Radford M. Neal Dept. of Statistics and Dept. of Computer Science University of Toronto http://www.cs.utoronto.ca/ radford/ Third Workshop on Monte Carlo Methods,

More information

Angelic Hierarchical Planning. Bhaskara Marthi Stuart Russell Jason Wolfe Willow Garage UC Berkeley UC Berkeley

Angelic Hierarchical Planning. Bhaskara Marthi Stuart Russell Jason Wolfe Willow Garage UC Berkeley UC Berkeley Angelic Hierarchical Planning Bhaskara Marthi Stuart Russell Jason Wolfe Willow Garage UC Berkeley UC Berkeley 1 Levels of Decision-Making Task: which object to move where? Grasp planner: where to grasp

More information

Lecture-12: Closed Sets

Lecture-12: Closed Sets and Its Examples Properties of Lecture-12: Dr. Department of Mathematics Lovely Professional University Punjab, India October 18, 2014 Outline Introduction and Its Examples Properties of 1 Introduction

More information

Lecture 11: Ray tracing (cont.)

Lecture 11: Ray tracing (cont.) Interactive Computer Graphics Ray tracing - Summary Lecture 11: Ray tracing (cont.) Graphics Lecture 10: Slide 1 Some slides adopted from H. Pfister, Harvard Graphics Lecture 10: Slide 2 Ray tracing -

More information

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5

Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 Formal Methods of Software Design, Eric Hehner, segment 24 page 1 out of 5 [talking head] This lecture we study theory design and implementation. Programmers have two roles to play here. In one role, they

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively 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 information

Critical Analysis of Computer Science Methodology: Theory

Critical Analysis of Computer Science Methodology: Theory Critical Analysis of Computer Science Methodology: Theory Björn Lisper Dept. of Computer Science and Engineering Mälardalen University bjorn.lisper@mdh.se http://www.idt.mdh.se/ blr/ March 3, 2004 Critical

More information

Lambda Calculus and Computation

Lambda Calculus and Computation 6.037 Structure and Interpretation of Computer Programs Chelsea Voss csvoss@mit.edu Massachusetts Institute of Technology With material from Mike Phillips and Nelson Elhage February 1, 2018 Limits to Computation

More information

The Typed Racket Guide

The Typed Racket Guide The Typed Racket Guide Version 5.3.6 Sam Tobin-Hochstadt and Vincent St-Amour August 9, 2013 Typed Racket is a family of languages, each of which enforce

More information

Time Complexity of an Algorithm

Time Complexity of an Algorithm CPSC 211 Data Structures & Implementations (c) Texas A&M University [ 335] Time Complexity of an Algorithm Time complexity of an algorithm: the function T (n) that describes the (worst-case) running time

More information

Functional Programming. Pure Functional Languages

Functional Programming. Pure Functional Languages Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure

More information

Monads. Mark Hills 6 August Department of Computer Science University of Illinois at Urbana-Champaign

Monads. Mark Hills 6 August Department of Computer Science University of Illinois at Urbana-Champaign Monads Mark Hills mhills@cs.uiuc.edu Department of Computer Science University of Illinois at Urbana-Champaign 6 August 2009 Hills Monads 1 / 19 Overview Overview Hills Monads 2 / 19 Why Monads? Overview

More information

PAIRS AND LISTS 6. GEORGE WANG Department of Electrical Engineering and Computer Sciences University of California, Berkeley

PAIRS AND LISTS 6. GEORGE WANG Department of Electrical Engineering and Computer Sciences University of California, Berkeley PAIRS AND LISTS 6 GEORGE WANG gswang.cs61a@gmail.com Department of Electrical Engineering and Computer Sciences University of California, Berkeley June 29, 2010 1 Pairs 1.1 Overview To represent data types

More information

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309

Index. object lifetimes, and ownership, use after change by an alias errors, use after drop errors, BTreeMap, 309 A Arithmetic operation floating-point arithmetic, 11 12 integer numbers, 9 11 Arrays, 97 copying, 59 60 creation, 48 elements, 48 empty arrays and vectors, 57 58 executable program, 49 expressions, 48

More information

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Fall CSE 20 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Final exam The final exam is Saturday December 16 11:30am-2:30pm. Lecture A will take the exam in Lecture B will take the exam

More information

Denotational semantics

Denotational 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 information

Functional Programming. Pure Functional Languages

Functional Programming. Pure Functional Languages Functional Programming Pure functional PLs S-expressions cons, car, cdr Defining functions read-eval-print loop of Lisp interpreter Examples of recursive functions Shallow, deep Equality testing 1 Pure

More information

Modern Programming Languages. Lecture LISP Programming Language An Introduction

Modern Programming Languages. Lecture LISP Programming Language An Introduction Modern Programming Languages Lecture 18-21 LISP Programming Language An Introduction 72 Functional Programming Paradigm and LISP Functional programming is a style of programming that emphasizes the evaluation

More information

CSC 501 Semantics of Programming Languages

CSC 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 information

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees

Lecture 25 of 41. Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees Spatial Sorting: Binary Space Partitioning Quadtrees & Octrees William H. Hsu Department of Computing and Information Sciences, KSU KSOL course pages: http://bit.ly/hgvxlh / http://bit.ly/evizre Public

More information

Algorithms for GIS:! Quadtrees

Algorithms for GIS:! Quadtrees Algorithms for GIS: Quadtrees Quadtree A data structure that corresponds to a hierarchical subdivision of the plane Start with a square (containing inside input data) Divide into 4 equal squares (quadrants)

More information

(Refer Slide Time: 0:19)

(Refer Slide Time: 0:19) Theory of Computation. Professor somenath Biswas. Department of Computer Science & Engineering. Indian Institute of Technology, Kanpur. Lecture-15. Decision Problems for Regular Languages. (Refer Slide

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts

More information

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017

W[1]-hardness. Dániel Marx. Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017 1 W[1]-hardness Dániel Marx Recent Advances in Parameterized Complexity Tel Aviv, Israel, December 3, 2017 2 Lower bounds So far we have seen positive results: basic algorithmic techniques for fixed-parameter

More information

More intensional versions of Rice s Theorem

More intensional versions of Rice s Theorem More intensional versions of Rice s Theorem Jean-Yves Moyen Jean-Yves.Moyen@univ-paris13.fr Jakob Grue Simonsen simonsen@diku.dk Department of Computer Science, University of Copenhagen (DIKU) Njalsgade

More information

Program verification. Generalities about software Verification Model Checking. September 20, 2016

Program verification. Generalities about software Verification Model Checking. September 20, 2016 Program verification Generalities about software Verification Model Checking Laure Gonnord David Monniaux September 20, 2016 1 / 43 The teaching staff Laure Gonnord, associate professor, LIP laboratory,

More information

Negations in Refinement Type Systems

Negations in Refinement Type Systems Negations in Refinement Type Systems T. Tsukada (U. Tokyo) 14th March 2016 Shonan, JAPAN This Talk About refinement intersection type systems that refute judgements of other type systems. Background Refinement

More information

Section 13. Basis for a Topology

Section 13. Basis for a Topology 13. Basis for a Topology 1 Section 13. Basis for a Topology Note. In this section, we consider a basis for a topology on a set which is, in a sense, analogous to the basis for a vector space. Whereas a

More information

9.5 Equivalence Relations

9.5 Equivalence Relations 9.5 Equivalence Relations You know from your early study of fractions that each fraction has many equivalent forms. For example, 2, 2 4, 3 6, 2, 3 6, 5 30,... are all different ways to represent the same

More information

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 9 Simply Typed Lambda Calculus. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 9 Simply Typed Lambda Calculus Dan Grossman 2012 Types Major new topic worthy of several lectures: Type systems Continue to use (CBV) Lambda Caluclus as our

More information

4.1 Review - the DPLL procedure

4.1 Review - the DPLL procedure Applied Logic Lecture 4: Efficient SAT solving CS 4860 Spring 2009 Thursday, January 29, 2009 The main purpose of these notes is to help me organize the material that I used to teach today s lecture. They

More information

B553 Lecture 12: Global Optimization

B553 Lecture 12: Global Optimization B553 Lecture 12: Global Optimization Kris Hauser February 20, 2012 Most of the techniques we have examined in prior lectures only deal with local optimization, so that we can only guarantee convergence

More information

EECS 203 Spring 2016 Lecture 8 Page 1 of 6

EECS 203 Spring 2016 Lecture 8 Page 1 of 6 EECS 203 Spring 2016 Lecture 8 Page 1 of 6 Algorithms (3.1-3.3) Algorithms are a huge topic. In CSE we have 2 theory classes purely dedicated to algorithms (EECS 477 and EECS 586) and a number of classes

More information

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems

DATABASE THEORY. Lecture 11: Introduction to Datalog. TU Dresden, 12th June Markus Krötzsch Knowledge-Based Systems DATABASE THEORY Lecture 11: Introduction to Datalog Markus Krötzsch Knowledge-Based Systems TU Dresden, 12th June 2018 Announcement All lectures and the exercise on 19 June 2018 will be in room APB 1004

More information

CSE 417 Network Flows (pt 4) Min Cost Flows

CSE 417 Network Flows (pt 4) Min Cost Flows CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it

More information

Theory of mind and bounded rationality without interpretive overhead

Theory of mind and bounded rationality without interpretive overhead Theory of mind and bounded rationality without interpretive overhead Chung-chieh Shan (Rutgers Aarhus), with Oleg Kiselyov Theory of mind False-belief (Sally-Anne) task Gricean reasoning p-beauty contest

More information

Assignment: 7. Due: Language level: Allowed recursion:

Assignment: 7. Due: Language level: Allowed recursion: Assignment: 7 Due: Language level: Allowed recursion: CS 135 Winter 2018 Graham, Nijjar Tuesday, March 13th, 2018 9:00pm Beginning Student with List Abbreviations Pure Structural and Structural Recursion

More information

What is Set? Set Theory. Notation. Venn Diagram

What is Set? Set Theory. Notation. Venn Diagram What is Set? Set Theory Peter Lo Set is any well-defined list, collection, or class of objects. The objects in set can be anything These objects are called the Elements or Members of the set. CS218 Peter

More information

! Linear programming"! Duality "! Smallest enclosing disk"

! Linear programming! Duality ! Smallest enclosing disk ! Linear programming"! Duality "! Smallest enclosing disk" 14. 24.! Define:" " i types of foods (1!i!d).! " j types of vitamins (1!j!n)." " x i the amount of food of type i." " a ji the amount of vitamin

More information

Monolingual probabilistic programming using generalized coroutines

Monolingual probabilistic programming using generalized coroutines Monolingual probabilistic programming using generalized coroutines Oleg Kiselyov FNMOC oleg@pobox.com Chung-chieh Shan Rutgers University ccshan@cs.rutgers.edu 19 June 2009 This session... programming

More information

6.001 Notes: Section 17.5

6.001 Notes: Section 17.5 6.001 Notes: Section 17.5 Slide 17.5.1 Now, let's look at one example in which changing the evaluation model allows us to explore a very different kind of computational problem. Our goal is to show how

More information

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017

Anti-aliasing and Monte Carlo Path Tracing. Brian Curless CSE 557 Autumn 2017 Anti-aliasing and Monte Carlo Path Tracing Brian Curless CSE 557 Autumn 2017 1 Reading Required: Marschner and Shirley, Section 13.4 (online handout) Pharr, Jakob, and Humphreys, Physically Based Ray Tracing:

More information

UCT Algorithm Circle: Probabilistic Algorithms

UCT Algorithm Circle: Probabilistic Algorithms UCT Algorithm Circle: 24 February 2011 Outline 1 2 3 Probabilistic algorithm A probabilistic algorithm is one which uses a source of random information The randomness used may result in randomness in the

More information

Computer Vision Group Prof. Daniel Cremers. 4. Probabilistic Graphical Models Directed Models

Computer Vision Group Prof. Daniel Cremers. 4. Probabilistic Graphical Models Directed Models Prof. Daniel Cremers 4. Probabilistic Graphical Models Directed Models The Bayes Filter (Rep.) (Bayes) (Markov) (Tot. prob.) (Markov) (Markov) 2 Graphical Representation (Rep.) We can describe the overall

More information

CSE-505: Programming Languages. Lecture 20.5 Recursive Types. Zach Tatlock 2016

CSE-505: Programming Languages. Lecture 20.5 Recursive Types. Zach Tatlock 2016 CSE-505: Programming Languages Lecture 20.5 Recursive Types Zach Tatlock 2016 Where are we System F gave us type abstraction code reuse strong abstractions different from real languages (like ML), but

More information

Abstracting Definitional Interpreters

Abstracting Definitional Interpreters Abstracting Definitional Interpreters David Darais University of Maryland Nicholas Labich University of Maryland Phúc C. Nguyễn University of Maryland David Van Horn University of Maryland Does my program

More information

Theory of Computations Spring 2016 Practice Final Exam Solutions

Theory of Computations Spring 2016 Practice Final Exam Solutions 1 of 8 Theory of Computations Spring 2016 Practice Final Exam Solutions Name: Directions: Answer the questions as well as you can. Partial credit will be given, so show your work where appropriate. Try

More information

II (Sorting and) Order Statistics

II (Sorting and) Order Statistics II (Sorting and) Order Statistics Heapsort Quicksort Sorting in Linear Time Medians and Order Statistics 8 Sorting in Linear Time The sorting algorithms introduced thus far are comparison sorts Any comparison

More information

Anti-aliasing and Monte Carlo Path Tracing

Anti-aliasing and Monte Carlo Path Tracing Reading Required: Anti-aliasing and Monte Carlo Path Tracing Brian Curless CSE 557 Autumn 2017 Marschner and Shirley, Section 13.4 (online handout) Pharr, Jakob, and Humphreys, Physically Based Ray Tracing:

More information

Submitted to the Onward track of OOPSLA-03 ABSTRACT. Keywords

Submitted to the Onward track of OOPSLA-03 ABSTRACT. Keywords GUI Environments for Functional Languages Daniel J. Pless & George F. Luger University of New Mexico, Computer Science Ferris Engineering Center Albuquerque, NM 87131 (505) 277-9424 {dpless,luger}@cs.unm.edu

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 Guessing Game: NP-Complete? 1. LONGEST-PATH: Given a graph G = (V, E), does there exists a simple path of length at least k edges? YES. SHORTEST-PATH: Given a graph G = (V, E), does there exists a simple

More information

31.6 Powers of an element

31.6 Powers of an element 31.6 Powers of an element Just as we often consider the multiples of a given element, modulo, we consider the sequence of powers of, modulo, where :,,,,. modulo Indexing from 0, the 0th value in this sequence

More information

Lecture 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 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 information

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall

1KOd17RMoURxjn2 CSE 20 DISCRETE MATH Fall CSE 20 https://goo.gl/forms/1o 1KOd17RMoURxjn2 DISCRETE MATH Fall 2017 http://cseweb.ucsd.edu/classes/fa17/cse20-ab/ Today's learning goals Explain the steps in a proof by mathematical and/or structural

More information

Robotics. Lecture 5: Monte Carlo Localisation. See course website for up to date information.

Robotics. Lecture 5: Monte Carlo Localisation. See course website  for up to date information. Robotics Lecture 5: Monte Carlo Localisation See course website http://www.doc.ic.ac.uk/~ajd/robotics/ for up to date information. Andrew Davison Department of Computing Imperial College London Review:

More information

Timing Analysis of Parallel Software Using Abstract Execution

Timing Analysis of Parallel Software Using Abstract Execution Timing Analysis of Parallel Software Using Abstract Execution Björn Lisper School of Innovation, Design, and Engineering Mälardalen University bjorn.lisper@mdh.se 2014-09-10 EACO Workshop 2014 Motivation

More information

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Art Gallery Problems and Polygon Triangulation EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified

More information

Consistency and Set Intersection

Consistency and Set Intersection Consistency and Set Intersection Yuanlin Zhang and Roland H.C. Yap National University of Singapore 3 Science Drive 2, Singapore {zhangyl,ryap}@comp.nus.edu.sg Abstract We propose a new framework to study

More information

Limitations of Algorithmic Solvability In this Chapter we investigate the power of algorithms to solve problems Some can be solved algorithmically and

Limitations 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 information

Theory of Programming Languages COMP360

Theory of Programming Languages COMP360 Theory of Programming Languages COMP360 Sometimes it is the people no one imagines anything of, who do the things that no one can imagine Alan Turing What can be computed? Before people even built computers,

More information

Flat (Draft) Pasqualino Titto Assini 27 th of May 2016

Flat (Draft) Pasqualino Titto Assini 27 th of May 2016 Flat (Draft) Pasqualino Titto Assini (tittoassini@gmail.com) 27 th of May 206 Contents What is Flat?...................................... Design Goals...................................... Design Non-Goals...................................

More information

CS-XXX: Graduate Programming Languages. Lecture 17 Recursive Types. Dan Grossman 2012

CS-XXX: Graduate Programming Languages. Lecture 17 Recursive Types. Dan Grossman 2012 CS-XXX: Graduate Programming Languages Lecture 17 Recursive Types Dan Grossman 2012 Where are we System F gave us type abstraction code reuse strong abstractions different from real languages (like ML),

More information

Restricted-Orientation Convexity in Higher-Dimensional Spaces

Restricted-Orientation Convexity in Higher-Dimensional Spaces Restricted-Orientation Convexity in Higher-Dimensional Spaces ABSTRACT Eugene Fink Derick Wood University of Waterloo, Waterloo, Ont, Canada N2L3G1 {efink, dwood}@violetwaterlooedu A restricted-oriented

More information

Probability and Statistics for Final Year Engineering Students

Probability and Statistics for Final Year Engineering Students Probability and Statistics for Final Year Engineering Students By Yoni Nazarathy, Last Updated: April 11, 2011. Lecture 1: Introduction and Basic Terms Welcome to the course, time table, assessment, etc..

More information

THE HALTING PROBLEM. Joshua Eckroth Chautauqua Nov

THE HALTING PROBLEM. Joshua Eckroth Chautauqua Nov THE HALTING PROBLEM Joshua Eckroth Chautauqua Nov 10 2015 The year is 1928 Sliced bread is invented. Calvin Coolidge is President. David Hilbert challenged mathematicians to solve the Entscheidungsproblem:

More information

Maths: Phase 5 (Y12-13) Outcomes

Maths: Phase 5 (Y12-13) Outcomes Maths: Phase 5 (Y12-13) Outcomes I know numbers are beautiful. If they aren t beautiful nothing is. Paul Erdose Maths is discovered it doesn t just exist. Maths is a tool to understand, question and criticise

More information

4.5 Pure Linear Functional Programming

4.5 Pure Linear Functional Programming 4.5 Pure Linear Functional Programming 99 4.5 Pure Linear Functional Programming The linear λ-calculus developed in the preceding sections can serve as the basis for a programming language. The step from

More information

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia

CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia CS6160 Theory of Computation Problem Set 2 Department of Computer Science, University of Virginia Gabriel Robins Please start solving these problems immediately, and work in study groups. Please prove

More information

Generative and discriminative classification techniques

Generative and discriminative classification techniques Generative and discriminative classification techniques Machine Learning and Category Representation 013-014 Jakob Verbeek, December 13+0, 013 Course website: http://lear.inrialpes.fr/~verbeek/mlcr.13.14

More information

COMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking

COMP 181. Agenda. Midterm topics. Today: type checking. Purpose of types. Type errors. Type checking Agenda COMP 181 Type checking October 21, 2009 Next week OOPSLA: Object-oriented Programming Systems Languages and Applications One of the top PL conferences Monday (Oct 26 th ) In-class midterm Review

More information

From the λ-calculus to Functional Programming Drew McDermott Posted

From the λ-calculus to Functional Programming Drew McDermott Posted From the λ-calculus to Functional Programming Drew McDermott drew.mcdermott@yale.edu 2015-09-28 Posted 2015-10-24 The λ-calculus was intended from its inception as a model of computation. It was used by

More information

Solution for Homework set 3

Solution for Homework set 3 TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

More information

Total No. of Questions : 18] [Total No. of Pages : 02. M.Sc. DEGREE EXAMINATION, DEC First Year COMPUTER SCIENCE.

Total No. of Questions : 18] [Total No. of Pages : 02. M.Sc. DEGREE EXAMINATION, DEC First Year COMPUTER SCIENCE. (DMCS01) Total No. of Questions : 18] [Total No. of Pages : 02 M.Sc. DEGREE EXAMINATION, DEC. 2016 First Year COMPUTER SCIENCE Data Structures Time : 3 Hours Maximum Marks : 70 Section - A (3 x 15 = 45)

More information

On the Finiteness of the Recursive Chromatic Number

On the Finiteness of the Recursive Chromatic Number On the Finiteness of the Recursive Chromatic Number William I Gasarch Andrew C.Y. Lee Abstract A recursive graph is a graph whose vertex and edges sets are recursive. A highly recursive graph is a recursive

More information

Treaps. 1 Binary Search Trees (BSTs) CSE341T/CSE549T 11/05/2014. Lecture 19

Treaps. 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 information

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007

CSCI 3155: Principles of Programming Languages Exam preparation #1 2007 CSCI 3155: Principles of Programming Languages Exam preparation #1 2007 Exercise 1. Consider the if-then-else construct of Pascal, as in the following example: IF 1 = 2 THEN PRINT X ELSE PRINT Y (a) Assume

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University February 26, 2017 Version: 100 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

CSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341)

CSE 413 Languages & Implementation. Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341) CSE 413 Languages & Implementation Hal Perkins Winter 2019 Structs, Implementing Languages (credits: Dan Grossman, CSE 341) 1 Goals Representing programs as data Racket structs as a better way to represent

More information

Continuous functions and homeomorphisms

Continuous 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 information

Program Static Analysis. Overview

Program Static Analysis. Overview Program Static Analysis Overview Program static analysis Abstract interpretation Data flow analysis Intra-procedural Inter-procedural 2 1 What is static analysis? The analysis to understand computer software

More information

An introduction to Scheme

An introduction to Scheme An introduction to Scheme Introduction A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize

More information

Probabilistic Graphical Models

Probabilistic Graphical Models School of Computer Science Probabilistic Graphical Models Theory of Variational Inference: Inner and Outer Approximation Eric Xing Lecture 14, February 29, 2016 Reading: W & J Book Chapters Eric Xing @

More information

Monte Carlo Integration COS 323

Monte Carlo Integration COS 323 Monte Carlo Integration COS 323 Last time Interpolatory Quadrature Review formulation; error analysis Newton-Cotes Quadrature Midpoint, Trapezoid, Simpson s Rule Error analysis for trapezoid, midpoint

More information

New Directions in Traffic Measurement and Accounting. Need for traffic measurement. Relation to stream databases. Internet backbone monitoring

New Directions in Traffic Measurement and Accounting. Need for traffic measurement. Relation to stream databases. Internet backbone monitoring New Directions in Traffic Measurement and Accounting C. Estan and G. Varghese Presented by Aaditeshwar Seth 1 Need for traffic measurement Internet backbone monitoring Short term Detect DoS attacks Long

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Abstract Interpretation

Abstract Interpretation Abstract Interpretation Ranjit Jhala, UC San Diego April 22, 2013 Fundamental Challenge of Program Analysis How to infer (loop) invariants? Fundamental Challenge of Program Analysis Key issue for any analysis

More information

Accepting that the simple base case of a sp graph is that of Figure 3.1.a we can recursively define our term:

Accepting that the simple base case of a sp graph is that of Figure 3.1.a we can recursively define our term: Chapter 3 Series Parallel Digraphs Introduction In this chapter we examine series-parallel digraphs which are a common type of graph. They have a significant use in several applications that make them

More information

16 Greedy Algorithms

16 Greedy Algorithms 16 Greedy Algorithms Optimization algorithms typically go through a sequence of steps, with a set of choices at each For many optimization problems, using dynamic programming to determine the best choices

More information