Operational semantics for disintegration

Size: px
Start display at page:

Download "Operational semantics for disintegration"

Transcription

1 Operational semantics for disintegration Chung-chieh Shan (Indiana University) Norman Ramsey (Tufts University) Mathematical Foundations of Programming Semantics

2 What is semantics for? 1. Language for composing generative stories do {x normal 0 10; (monadic bind, unit) 2. Guarantee that terms denote distributions (product measure tricky) 2

3 What is semantics for? 1. Language for composing generative stories do {x normal 0 10; normal x 1} (monadic bind, unit) 2. Guarantee that terms denote distributions (product measure tricky) 2

4 What is semantics for? 1. Language for composing generative stories do {x normal 0 10; return e x } (monadic bind, unit) 2. Guarantee that terms denote distributions (product measure tricky) 2

5 What is semantics for? 1. Language for composing generative stories do {x normal 0 10; return e x } (monadic bind, unit) 2. Guarantee that terms denote distributions do {x m; do {y n; return (x, y)}} (product measure tricky) 2

6 What is semantics for? 1. Language for composing generative stories do {x normal 0 10; return e x } (monadic bind, unit) 2. Guarantee that terms denote distributions do {x m; do {y n; return (x, y)}} = do {x m; y n; return (x, y)} (product measure tricky) 2

7 What is semantics for? 3. Equational reasoning by semantics-preserving rewriting! Fubini do {x m; y n; return (x, y)} = do {y n; x m; return (x, y)} Conjugacy do {x normal 0 1; factor e x2 ; return x} = do {factor (1/ 3); x normal 0 3; return x} 3

8 What is semantics for? 3. Equational reasoning by semantics-preserving rewriting! Fubini do {x m; y n; return (x, y)} = do {y n; x m; return (x, y)} Conjugacy do {x normal 0 1; factor e x2 ; return x} = do {factor (1/ 3); x normal 0 3; return x} 3

9 What is semantics for? 3. Equational reasoning by semantics-preserving rewriting! Fubini do {x m; y n; return (x, y)} = do {y n; x m; return (x, y)} Conjugacy do {x normal 0 1; factor e x2 ; return x} = do {factor (1/ 3); x normal 0 3; return x} (convenient factor expresses non-(sub)probability measures) 3

10 Two program transformations specified semantically 1. Simplification m = m 2. Disintegration m = do {t m 1 ; x m 2 ; return (t, x)} (typically t appears free in m 2 ) 4

11 Two program transformations specified semantically 1. Simplification m = m 2. Disintegration m = do {t m 1 ; x m 2 ; return (t, x)} (typically t appears free in m 2 ) 4

12 Two program transformations specified semantically 1. Simplification m = m 2. Disintegration m = do {t m 1 ; x m 2 ; return (t, x)} (typically t appears free in m 2 ) 4

13 Two program transformations specified semantically 1. Simplification m = m 2. Disintegration m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } (typically t appears free in m 2 ) 4

14 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } 5

15 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration defines conditional distributions t x do {x normal 0 10; t normal x 1; return (t, x)} -- latent cause -- observed effect 5

16 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration defines conditional distributions t x do {x normal 0 10; t normal x 1; return (t, x)} -- latent cause -- observed effect = do {t normal 0 101; x normal (t 100/101) (10/ 101); return (t, x)} 5

17 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration defines conditional distributions t x do {x normal 0 10; t normal x 1; return (t, x)} -- latent cause -- observed effect = do {t normal 0 101; normal (t 100/101) (10/ 101)} 5

18 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration allows an uncountable space of observations 1 do {x uniform 0 1; y uniform 0 1; t ; return (t, (x, y))} 0 1 6

19 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration allows an uncountable space of observations 1 do {x uniform 0 1; y uniform 0 1; t return (y 2 x); return (t, (x, y))} 0 1 6

20 What is disintegration for? m = do {t m 1 ; x m 2 ; return (t, x)} = do {t m 1 ; m 2 } Disintegration allows an uncountable space of observations 1 do {x uniform 0 1; y uniform 0 1; t return (y/x); return (t, (x, y))} 0 1 6

21 From denotation to operation Denotation: equivalence relation Operation: directed graph So denotation justifies soundness of operation 7

22 From denotation to operation Denotation: equivalence relation Operation: directed graph So denotation justifies soundness of operation 7

23 From denotation to operation Denotation: equivalence relation Operation: directed graph So denotation justifies soundness of operation This setup is typical for execution, but what about disintegration? Rest of this talk: a disintegrator that justifies its work, step by step A contextual operational semantics, implemented in PLT Redex 7

24 Syntax Term e, m ::= do {factor e; m} do {x m; m} do {x m; m} return e uniform e e normal e e lebesgue (e, e) fst e snd e number e e e/e x (not shown: conditionals) 8

25 Syntax Stratified syntax during disintegration State s ::= do {factor e; s} do {x m; s} do {delimit; t} Thread t ::= do {factor e; t} do {x m; t} do {x m; m} Term e, m ::= do {factor e; m} do {x m; m} return e uniform e e normal e e lebesgue (e, e) fst e snd e number e e e/e x (not shown: conditionals) 8

26 Example disintegration do {delimit; r do {x uniform 0 1; y uniform 0 1; return (y/x, (x, y))} t return (fst r); Stage 1: Isolate (evaluate) Stage 2: Invert (unevaluate) 9

27 Example disintegration do {delimit; r do {x uniform 0 1; y uniform 0 1; return (y/x, (x, y))}; t return (fst r); 9

28 Example disintegration (step 1) bind do {delimit; do {delimit; r do {x uniform 0 1; x uniform 0 1; y uniform 0 1; r do {y uniform 0 1; return (y/x, (x, y))}; return (y/x, (x, y))}; t return (fst r); t return (fst r); 9

29 Example disintegration (step 1) bind do {delimit; do {delimit; r do {x uniform 0 1; x uniform 0 1; y uniform 0 1; r do {y uniform 0 1; return (y/x, (x, y))}; return (y/x, (x, y))}; t return (fst r); t return (fst r); do {delimit; H; r do {x m 1 ; m 2 }; P[r]} bind do {delimit; H; x m 1 ; r m 2 ; P[r]} H is a heap of bindings P[r] is a program that demands r 9

30 Example disintegration (step 1) do {delimit; x uniform 0 1; r do {y uniform 0 1; return (y/x, (x, y))}; t return (fst r); 9

31 Example disintegration (step 2) do {delimit; x uniform 0 1; r do {y uniform 0 1; return (y/x, (x, y))}; t return (fst r); 10

32 Example disintegration (step 2) do {delimit; x uniform 0 1; r do {y uniform 0 1; return (y/x, (x, y))}; t return (fst r); bind do {delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (fst r); do {delimit; H; r do {x m 1 ; m 2 }; P[r]} bind do {delimit; H; x m 1 ; r m 2 ; P[r]} 10

33 Example disintegration (step 3) do {delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (fst r); return do {delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (fst (y/x, (x, y))); do {delimit; H; r return v; P[r]} return do {delimit; H; r return v; P[v]} v is head normal form for lazy evaluation 11

34 Example disintegration (step 4) do {delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (fst (y/x, (x, y))); fst do {delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (y/x); do {delimit; P[fst (e 1, e 2 )]} fst do {delimit; P[e 1 ]} 12

35 Example disintegration (step 5) do { delimit; x uniform 0 1; y uniform 0 1; r return (y/x, (x, y)); t return (y/x); Fubini do {x uniform 0 1; delimit; x return x ; y uniform 0 1; r return (y/x, (x, y)); t return (y/x); do { delimit; H; x uniform v 1 v 2 ; P[x]} Fubini do {x uniform v 1 v 2 ; delimit; H; x return x ; P[x]} 13

36 Example disintegration (step 6) do {x uniform 0 1; delimit; x return x ; y uniform 0 1; r return (y/x, (x, y)); t return (y/x); return do {x uniform 0 1; delimit; x return x ; y uniform 0 1; r return (y/x, (x, y)); t return (y/x ); do {delimit; H; r return v; P[r]} return do {delimit; H; r return v; P[v]} 14

37 Example disintegration (step 7) do {x uniform 0 1; delimit; x return x ; y uniform 0 1; r return (y/x, (x, y)); t return (y/x ); un/ do {x uniform 0 1; delimit; z uniform (0/x ) (1/x ); y return (z x ); x return x ; r return (y/x, (x, y)); t return (z); do {delimit; H 1 ; y uniform v 1 v 2 ; H 2 ; t return E[y/v]; m} un/ do {delimit; z uniform (v 1 /v) (v 2 /v); y return (z v); H 1 ; H 2 ; t return E[z]; m} 15

38 Example disintegration (step 8) do {x uniform 0 1; delimit; z uniform (0/x ) (1/x ); y return (z x ); x return x ; r return (y/x, (x, y)); t return z; do {delimit; H 1 ; z m 1 ; H 2 ; t return z; m 2 } unreturn do {x uniform 0 1; delimit; t uniform (0/x ) (1/x ); z return t; y return (z x ); x return x ; r return (y/x, (x, y)); unreturn do {delimit; H 1 ; t m 1 ; z return t; H 2 ; m 2 } 16

39 Example disintegration (step 9) done do { x uniform 0 1; delimit; t uniform (0/x ) (1/x ); z return t; y return (z x ); x return x ; r return (y/x, (x, y)); do {t lebesgue; x uniform 0 1; factor if t is between 0/x and 1/x then x else 0; z return t; y return (z x ); x return x ; r return (y/x, (x, y)); 17

40 Summary Disintegration is useful: defines conditional distributions allows an uncountable space of observations Disintegrator is useful: generates steps by operational semantics justifies steps by denotational semantics resembles lazy evaluator + change of variables leaves verification conditions behind for exchanging integrals 18

Symbolic disintegration with a variety of base measures

Symbolic disintegration with a variety of base measures 1 Symbolic disintegration with a variety of base measures PRAVEEN NARAYANAN, Indiana University, USA CHUNG-CHIEH SHAN, Indiana University, USA Disintegration is a relation on measures and a transformation

More information

Exact Bayesian Inference by Symbolic Disintegration

Exact Bayesian Inference by Symbolic Disintegration Exact Bayesian Inference by Symbolic Disintegration Chung-chieh Shan Indiana University, USA ccshan@indiana.edu Norman Ramsey Tufts University, USA nr@cs.tufts.edu Abstract Bayesian inference, of posterior

More information

Symbolic Bayesian Inference by Lazy Partial Evaluation

Symbolic Bayesian Inference by Lazy Partial Evaluation Submitted to POPL 2016 Symbolic Bayesian Inference by Lazy Partial Evaluation Chung-chieh Shan Indiana University ccshan@indiana.edu Norman Ramsey Tufts University nr@cs.tufts.edu Abstract Bayesian inference,

More information

Recitation 2: Binding, Semantics, and Safety : Foundations of Programming Languages

Recitation 2: Binding, Semantics, and Safety : Foundations of Programming Languages Recitation 2: Binding, Semantics, and Safety 15-312: Foundations of Programming Languages Charles Yuan, Jeanne Luning Prak September 5, 2018 1 Abstract Binding Trees The abstract syntax trees we saw previously

More information

COMPUTER SCIENCE TRIPOS

COMPUTER SCIENCE TRIPOS CST.2014.6.1 COMPUTER SCIENCE TRIPOS Part IB Thursday 5 June 2014 1.30 to 4.30 pm COMPUTER SCIENCE Paper 6 Answer five questions. Submit the answers in five separate bundles, each with its own cover sheet.

More information

Conditioning and density, mathematically and computationally

Conditioning and density, mathematically and computationally This work is supported by DARPA grant FA87-14-2-7. 1 Conditioning and density, mathematically and computationally Chung-chieh Shan (with Wazim Mohammed Ismail) Mathematical Foundations of Programming Semantics

More information

Abstracting Definitional Interpreters. David Van Horn

Abstracting Definitional Interpreters. David Van Horn Abstracting Definitional Interpreters David Van Horn Abstracting Definitional Interpreters David Van Horn Northeastern University Definitional interpreters written in monadic style can express a wide variety

More information

Typed metaprogramming with effects

Typed metaprogramming with effects Typed metaprogramming with effects Chung-chieh Shan (Rutgers University) with Chris Barker, Yukiyoshi Kameyama, Oleg Kiselyov LFMTP 14 July 2010 2/32 Accidental language design Documents Fonts T E X Pages

More information

Predicate Logic. x. x + 0 = x. Predicate logic over integer expressions: a language of logical assertions, for example. Why discuss predicate logic?

Predicate Logic. x. x + 0 = x. Predicate logic over integer expressions: a language of logical assertions, for example. Why discuss predicate logic? Predicate Logic Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic? It is an example of a simple language It has simple denotational

More information

Relative Hilbert-Post completeness for exceptions

Relative Hilbert-Post completeness for exceptions Relative Hilbert-Post completeness for exceptions Dominique Duval with J.-G. Dumas, B. Ekici, D. Pous, J.-C. Reynaud LJK University of Grenoble-Alpes and ENS Lyon November 12., 2015 MACIS 2015, Berlin

More information

Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32

Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32 Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd joe.hurd@cl.cam.ac.uk University of Cambridge Verifying Probabilistic Programs using the HOL Theorem Prover Joe Hurd p.1/32 Contents

More information

Programming Languages

Programming Languages CSE 230: Winter 2008 Principles of Programming Languages Lecture 6: Axiomatic Semantics Deriv. Rules for Hoare Logic `{A} c {B} Rules for each language construct ` {A} c 1 {B} ` {B} c 2 {C} ` {A} skip

More information

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg

Type Inference. For the Simply-Typed Lambda Calculus. Peter Thiemann, Manuel Geffken. Albert-Ludwigs-Universität Freiburg. University of Freiburg Type Inference For the Simply-Typed Lambda Calculus Albert-Ludwigs-Universität Freiburg Peter Thiemann, Manuel Geffken University of Freiburg 24. Januar 2013 Outline 1 Introduction 2 Applied Lambda Calculus

More information

A Lattice-Based Approach to Deterministic Parallelism

A Lattice-Based Approach to Deterministic Parallelism A Lattice-Based Approach to Deterministic Parallelism Lindsey Kuper and Ryan R. Newton Indiana University POPL 2013 Student Session 25 January 2013 What does this program evaluate to? let = put l 3 in

More information

Reasoning with Quantified Boolean Formulas

Reasoning with Quantified Boolean Formulas Reasoning with Quantified Boolean Formulas Martina Seidl Institute for Formal Models and Verification Johannes Kepler University Linz 1 What are QBF? Quantified Boolean formulas (QBF) are formulas of propositional

More information

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth

Type Systems. Today. 1. What is the Lambda Calculus. 1. What is the Lambda Calculus. Lecture 2 Oct. 27th, 2004 Sebastian Maneth Today 1. What is the Lambda Calculus? Type Systems 2. Its Syntax and Semantics 3. Church Booleans and Church Numerals 4. Lazy vs. Eager Evaluation (call-by-name vs. call-by-value) Lecture 2 Oct. 27th,

More information

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation

CMSC 631 Program Analysis and Understanding Fall Abstract Interpretation Program Analysis and Understanding Fall 2017 Abstract Interpretation Based on lectures by David Schmidt, Alex Aiken, Tom Ball, and Cousot & Cousot What is an Abstraction? A property from some domain Blue

More information

Continuations, Processes, and Sharing. Paul Downen, Luke Maurer, Zena M. Ariola, Daniele Varacca. September 8, 2014

Continuations, Processes, and Sharing. Paul Downen, Luke Maurer, Zena M. Ariola, Daniele Varacca. September 8, 2014 Continuations, Processes, and Sharing Paul Downen, Luke Maurer, Zena M. Ariola, Daniele Varacca University of Oregon, Université Paris Diderot September 8, 2014 The plethora of semantic artifacts Many

More information

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC)

Predicate Logic. Xinyu Feng 09/26/2011. University of Science and Technology of China (USTC) University of Science and Technology of China (USTC) 09/26/2011 Overview Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic?

More information

Probabilistic NetKAT

Probabilistic NetKAT Probabilistic NetKAT Nate Foster (Cornell) Dexter Kozen (Cornell) Konstantinos Mamouras (Penn) Mark Reitblatt (Facebook) Alexandra Silva (UCL) Steffen Smolka (Cornell) Team ProbNetKAT Nate Foster Dexter

More information

Cartesian closed 2-categories and rewriting

Cartesian closed 2-categories and rewriting Cartesian closed 2-categories and rewriting Aurore Alcolei A brief presentation of Tom Hirschowitz s paper, Cartesian closed 2-categories and permutation equivalence in higher-order rewriting June 7, 2014

More information

How to combine diagrammatic logics

How to combine diagrammatic logics How to combine diagrammatic logics Dominique Duval To cite this version: Dominique Duval. How to combine diagrammatic logics. 2009. HAL Id: hal-00432330 https://hal.archives-ouvertes.fr/hal-00432330v2

More information

Conditional probability by lazy partial evaluation

Conditional probability by lazy partial evaluation Conditional probability by lazy partial evaluation Chung-chieh Shan Indiana University ccshan@indiana.edu Abstract This is the text of the abstract. G.3 [Probability and Statis- Categories and Subject

More information

Program Analysis Part I : Sequential Programs

Program Analysis Part I : Sequential Programs Program Analysis Part I : Sequential Programs IN5170/IN9170 Models of concurrency Program Analysis, lecture 5 Fall 2018 26. 9. 2018 2 / 44 Program correctness Is my program correct? Central question for

More information

COP4020 Programming Languages. Introduction to Axiomatic Semantics Prof. Robert van Engelen

COP4020 Programming Languages. Introduction to Axiomatic Semantics Prof. Robert van Engelen COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen Assertions and Preconditions Assertions are used by programmers to verify run-time execution An assertion is a

More information

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule.

3.2 Reduction 29. Truth. The constructor just forms the unit element,. Since there is no destructor, there is no reduction rule. 32 Reduction 29 32 Reduction In the preceding section, we have introduced the assignment of proof terms to natural deductions If proofs are programs then we need to explain how proofs are to be executed,

More information

CSE 505, Fall 2009, Midterm Examination 5 November Please do not turn the page until everyone is ready.

CSE 505, Fall 2009, Midterm Examination 5 November Please do not turn the page until everyone is ready. CSE 505, Fall 2009, Midterm Examination 5 November 2009 Please do not turn the page until everyone is ready Rules: The exam is closed-book, closed-note, except for one side of one 85x11in piece of paper

More information

Embedded probabilistic programming

Embedded probabilistic programming Embedded probabilistic programming Oleg Kiselyov FNMOC oleg@pobox.com Chung-chieh Shan Rutgers University ccshan@cs.rutgers.edu 17 July 2009 Probabilistic inference Model (what) Pr(Reality) Pr(Obs j Reality)

More information

A Systematic Approach to Delimited Control with Multiple Prompts. Paul Downen, Zena M. Ariola. March 25, University of Oregon

A Systematic Approach to Delimited Control with Multiple Prompts. Paul Downen, Zena M. Ariola. March 25, University of Oregon A Systematic Approach to Delimited Control with Multiple Prompts Paul Downen, Zena M. Ariola University of Oregon March 25, 2012 Introduction to control operators Separating a redex from its evaluation

More information

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth.

Type Systems. Lecture 2 Oct. 27th, 2004 Sebastian Maneth. Type Systems Lecture 2 Oct. 27th, 2004 Sebastian Maneth http://lampwww.epfl.ch/teaching/typesystems/2004 Today 1. What is the Lambda Calculus? 2. Its Syntax and Semantics 3. Church Booleans and Church

More information

The Suspension Notation as a Calculus of Explicit Substitutions

The Suspension Notation as a Calculus of Explicit Substitutions The Suspension Notation as a Calculus of Explicit Substitutions Gopalan Nadathur Digital Technology Center and Department of Computer Science University of Minnesota [Joint work with D.S. Wilson and A.

More information

Verification of Recursive Programs. Andreas Podelski February 8, 2012

Verification of Recursive Programs. Andreas Podelski February 8, 2012 Verification of Recursive Programs Andreas Podelski February 8, 2012 1 m(x) = x 10 if x > 100 m(m(x + 11)) if x 100 2 procedure m(x) returns (res) `0: if x>100 `1: res:=x-10 else `2: x m := x+11 `3: res

More information

High-Level Small-Step Operational Semantics for Transactions (Technical Companion)

High-Level Small-Step Operational Semantics for Transactions (Technical Companion) High-Level Small-Step Operational Semantics for Transactions (Technical Companion) Katherine F. Moore, Dan Grossman July 15, 2007 Abstract This document is the technical companion to our POPL 08 submission

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

Semantic Foundations for Probabilistic Programming

Semantic Foundations for Probabilistic Programming Semantic Foundations for Probabilistic Programming Chris Heunen Ohad Kammar, Sam Staton, Frank Wood, Hongseok Yang 1 / 21 Semantic foundations programs mathematical objects s1 s2 2 / 21 Semantic foundations

More information

Probability as Logic

Probability as Logic Probability as Logic Prakash Panangaden 1 1 School of Computer Science McGill University Estonia Winter School March 2015 Panangaden (McGill University) Probabilistic Languages and Semantics Estonia Winter

More information

Probabilistic Applicative Bisimulation and Call-by-Value Lam

Probabilistic Applicative Bisimulation and Call-by-Value Lam Probabilistic Applicative and Call-by-Value Lambda Calculi Joint work with Ugo Dal Lago ENS Lyon February 9, 2014 Probabilistic Applicative and Call-by-Value Lam Introduction Fundamental question: when

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

Axiomatic Semantics. Lecture 9 CS 565 2/12/08

Axiomatic Semantics. Lecture 9 CS 565 2/12/08 Axiomatic Semantics Lecture 9 CS 565 2/12/08 Axiomatic Semantics Operational semantics describes the meaning of programs in terms of the execution steps taken by an abstract machine Denotational semantics

More information

Math-2. Lesson 1-2 Solving Single-Unknown Linear Equations

Math-2. Lesson 1-2 Solving Single-Unknown Linear Equations Math-2 Lesson 1-2 Solving Single-Unknown Linear Equations Linear Equation: an equation where all of the letters (either variables or unknown values) have NO EXPONENTS. 4x 2 = 6 2x + 3y = 6 Previous Vocabulary

More information

Notes. Corneliu Popeea. May 3, 2013

Notes. Corneliu Popeea. May 3, 2013 Notes Corneliu Popeea May 3, 2013 1 Propositional logic Syntax We rely on a set of atomic propositions, AP, containing atoms like p, q. A propositional logic formula φ Formula is then defined by the following

More information

A Concrete Representation of Observational Equivalence for PCF

A Concrete Representation of Observational Equivalence for PCF A of Observational Equivalence for PCF Martin Churchill, Jim Laird and Guy McCusker University of Bath March 28th, 2009 GaLoP workshop, University of York Martin Churchill, Jim Laird and Guy McCusker University

More information

The Assignment Axiom (Hoare)

The Assignment Axiom (Hoare) The Assignment Axiom (Hoare) Syntax: V := E Semantics: value of V in final state is value of E in initial state Example: X:=X+ (adds one to the value of the variable X) The Assignment Axiom {Q[E/V ]} V

More information

λ S : A Lambda Calculus with Side-effects

λ S : A Lambda Calculus with Side-effects L14-1 λ S : A Lambda Calculus with Side-effects delivered by Jacob Schwartz Laboratory for Computer Science M.I.T. Lecture 14 M-Structures and Barriers L14-2 Some problems cannot be expressed functionally

More information

Probabilistic Partial Evaluation: Exploiting rule structure in probabilistic inference

Probabilistic Partial Evaluation: Exploiting rule structure in probabilistic inference Probabilistic Partial Evaluation: Exploiting rule structure in probabilistic inference David Poole University of British Columbia 1 Overview Belief Networks Variable Elimination Algorithm Parent Contexts

More information

Predicate Logic. Xinyu Feng 11/20/2013. University of Science and Technology of China (USTC)

Predicate Logic. Xinyu Feng 11/20/2013. University of Science and Technology of China (USTC) University of Science and Technology of China (USTC) 11/20/2013 Overview Predicate logic over integer expressions: a language of logical assertions, for example x. x + 0 = x Why discuss predicate logic?

More information

CS 6112 (Fall 2011) Foundations of Concurrency

CS 6112 (Fall 2011) Foundations of Concurrency CS 6112 (Fall 2011) Foundations of Concurrency 29 November 2011 Scribe: Jean-Baptiste Jeannin 1 Readings The readings for today were: Eventually Consistent Transactions, by Sebastian Burckhardt, Manuel

More information

BN Semantics 3 Now it s personal!

BN Semantics 3 Now it s personal! Readings: K&F: 3.3, 3.4 BN Semantics 3 Now it s personal! Graphical Models 10708 Carlos Guestrin Carnegie Mellon University September 22 nd, 2008 10-708 Carlos Guestrin 2006-2008 1 Independencies encoded

More information

Great Theoretical Ideas in Computer Science

Great Theoretical Ideas in Computer Science 15-251 Great Theoretical Ideas in Computer Science Probability Theory: Counting in Terms of Proportions Lecture 10 (September 27, 2007) Some Puzzles Teams A and B are equally good In any one game, each

More information

Introduction to lambda calculus Part 2

Introduction to lambda calculus Part 2 Introduction to lambda calculus Part 2 Antti-Juhani Kaijanaho 2017-01-24... 1 Untyped lambda calculus 1.1 Syntax... x, y, z Var t, u Term t, u ::= x t u λx t... In this document, I will be using the following

More information

Classical First-Order Logic

Classical First-Order Logic Classical First-Order Logic Software Formal Verification Maria João Frade Departmento de Informática Universidade do Minho 2008/2009 Maria João Frade (DI-UM) First-Order Logic (Classical) MFES 2008/09

More information

Denotational event structure for relaxed memory

Denotational event structure for relaxed memory Denotational event structure for relaxed memory Jade Alglave 1, Simon Castellan 2, Jean-Marie Madiot 3 1 ARM, and University College London, UK 2 Imperial College London, UK 3 INRIA 7th July, 2018 LOLA

More information

Programming Languages

Programming Languages CSE 230: Winter 2010 Principles of Programming Languages Lecture 10: Programming in λ-calculusc l l Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2

More information

Q B (pk, sk) Gen x u M pk y Map pk (x) return [B(pk, y)? = x]. (m, s) A O h

Q B (pk, sk) Gen x u M pk y Map pk (x) return [B(pk, y)? = x]. (m, s) A O h MTAT.07.003 Cryptology II Spring 2012 / Exercise session?? / Example Solution Exercise (FRH in RO model). Show that the full domain hash signature is secure against existential forgeries in the random

More information

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007

Review. Principles of Programming Languages. Equality. The Diamond Property. The Church-Rosser Theorem. Corollaries. CSE 230: Winter 2007 CSE 230: Winter 2007 Principles of Programming Languages Lecture 12: The λ-calculus Ranjit Jhala UC San Diego Review The lambda calculus is a calculus of functions: e := x λx. e e 1 e 2 Several evaluation

More information

Typing λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus

Typing λ-terms. Types. Typed λ-terms. Base Types. The Typing Relation. Advanced Formal Methods. Lecture 3: Simply Typed Lambda calculus Course 2D1453, 200607 Advanced Formal Methods Lecture 3: Simply Typed Lambda calculus Mads Dam KTH/CSC Some material from B. Pierce: TAPL + some from G. Klein, NICTA Typing λterms The uptyped λcalculus

More information

The Call-by-Need Lambda Calculus

The Call-by-Need Lambda Calculus The Call-by-Need Lambda Calculus John Maraist, Martin Odersky School of Computer and Information Science, University of South Australia Warrendi Road, The Levels, Adelaide, South Australia 5095 fmaraist,oderskyg@cis.unisa.edu.au

More information

About categorical semantics

About categorical semantics About categorical semantics Dominique Duval LJK, University of Grenoble October 15., 2010 Capp Café, LIG, University of Grenoble Outline Introduction Logics Effects Conclusion The issue Semantics of programming

More information

The L Machines are very high-level, in two senses:

The L Machines are very high-level, in two senses: What is a Computer? State of the machine. CMPSCI 630: Programming Languages An Abstract Machine for Control Spring 2009 (with thanks to Robert Harper) Internal registers, memory, etc. Initial and final

More information

Combined Satisfiability Modulo Parametric Theories

Combined Satisfiability Modulo Parametric Theories Intel 07 p.1/39 Combined Satisfiability Modulo Parametric Theories Sava Krstić*, Amit Goel*, Jim Grundy*, and Cesare Tinelli** *Strategic CAD Labs, Intel **The University of Iowa Intel 07 p.2/39 This Talk

More information

LOGIC. Mathematics. Computer Science. Stanley N. Burris

LOGIC. Mathematics. Computer Science. Stanley N. Burris LOGIC for Mathematics and Computer Science Stanley N. Burris Department of Pure Mathematics University of Waterloo Prentice Hall Upper Saddle River, New Jersey 07458 Contents Preface The Flow of Topics

More information

Lecture Notes: Program Analysis Correctness

Lecture Notes: Program Analysis Correctness Lecture Notes: Program Analysis Correctness 15-819O: Program Analysis Jonathan Aldrich jonathan.aldrich@cs.cmu.edu Lecture 5 1 Termination As we think about the correctness of program analysis, let us

More information

Modelling Membranes with Brane Calculi

Modelling Membranes with Brane Calculi Modelling Membranes with Brane Calculi (and translation of Brane Calculi into CLS) 1/42 Introduction A biological cellular membrane is an closed surface that can perform various molecular functions. Membranes

More information

Independent random variables

Independent random variables CHAPTER 2 Independent random variables 2.1. Product measures Definition 2.1. Let µ i be measures on (Ω i,f i ), 1 i n. Let F F 1... F n be the sigma algebra of subsets of Ω : Ω 1... Ω n generated by all

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

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics

Dynamic Semantics. Dynamic Semantics. Operational Semantics Axiomatic Semantics Denotational Semantic. Operational Semantics Dynamic Semantics Operational Semantics Denotational Semantic Dynamic Semantics Operational Semantics Operational Semantics Describe meaning by executing program on machine Machine can be actual or simulated

More information

Commutative semantics for probabilistic programming

Commutative semantics for probabilistic programming Commutative semantics for probabilistic programming Sam Staton University of Oxford Abstract. We show that a measure-based denotational semantics for probabilistic programming is commutative. The idea

More information

Automata, Logic and Games: Theory and Application

Automata, Logic and Games: Theory and Application Automata, Logic and Games: Theory and Application 1. Büchi Automata and S1S Luke Ong University of Oxford TACL Summer School University of Salerno, 14-19 June 2015 Luke Ong Büchi Automata & S1S 14-19 June

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

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. Lunch-time meeting, 14 May Oxford University Computing Laboratory

The Safe λ-calculus. William Blum. Joint work with C.-H. Luke Ong. Lunch-time meeting, 14 May Oxford University Computing Laboratory The Safe λ-calculus William Blum Joint work with C.-H. Luke Ong Oxford University Computing Laboratory Lunch-time meeting, 14 May 2007 Overview Safety is originally a syntactic restriction for higher-order

More information

Executing the formal semantics of the Accellera Property Specification Language

Executing the formal semantics of the Accellera Property Specification Language Executing the PSL semantics 1/17 Executing the formal semantics of the Accellera Property Specification Language joint work with Joe Hurd & Konrad Slind Standard practice: generate tools from formal syntax

More information

Bilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft)

Bilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft) Bilateral Proofs of Safety and Progress Properties of Concurrent Programs (Working Draft) Jayadev Misra December 18, 2015 Contents 1 Introduction 3 2 Program and Execution Model 4 2.1 Program Structure..........................

More information

Semantics for Probabilistic Programming

Semantics for Probabilistic Programming Semantics for Probabilistic Programming Chris Heunen 1 / 21 Bayes law P(A B) = P(B A) P(A) P(B) 2 / 21 Bayes law P(A B) = P(B A) P(A) P(B) Bayesian reasoning: predict future, based on model and prior evidence

More information

Lecture Notes on Certifying Theorem Provers

Lecture Notes on Certifying Theorem Provers Lecture Notes on Certifying Theorem Provers 15-317: Constructive Logic Frank Pfenning Lecture 13 October 17, 2017 1 Introduction How do we trust a theorem prover or decision procedure for a logic? Ideally,

More information

Lecture Notes on Compositional Reasoning

Lecture Notes on Compositional Reasoning 15-414: Bug Catching: Automated Program Verification Lecture Notes on Compositional Reasoning Matt Fredrikson Ruben Martins Carnegie Mellon University Lecture 4 1 Introduction This lecture will focus on

More information

Logic: The Big Picture

Logic: The Big Picture Logic: The Big Picture A typical logic is described in terms of syntax: what are the legitimate formulas semantics: under what circumstances is a formula true proof theory/ axiomatization: rules for proving

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

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S)

Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) Lecturecise 22 Weak monadic second-order theory of one successor (WS1S) 2013 Reachability in the Heap Many programs manipulate linked data structures (lists, trees). To express many important properties

More information

The Branching-Time Transformation Technique for Chain Datalog Programs

The Branching-Time Transformation Technique for Chain Datalog Programs Journal of Intelligent Information Systems, 17, 71 94, 2001 c 2001 Kluwer Academic Publishers. Manufactured in The Netherlands. The Branching-Time Transformation Technique for Chain atalog Programs PANOS

More information

A probabilistic lambda calculus - Some preliminary investigations

A probabilistic lambda calculus - Some preliminary investigations A probabilistic lambda calculus - Some preliminary investigations Ugo Dal Lago, Margherita Zorzi Università di Bologna, Università di Verona June, 9-11, 2010, Torino Introduction: Λ P We present some results

More information

Continuations in Type Logical Grammar. Grafting Trees: (with Chris Barker, UCSD) NJPLS, 27 February Harvard University

Continuations in Type Logical Grammar. Grafting Trees: (with Chris Barker, UCSD) NJPLS, 27 February Harvard University Grafting Trees: Continuations in Type Logical Grammar Chung-chieh Shan Harvard University ccshan@post.harvard.edu (with Chris Barker, UCSD) NJPLS, 27 February 2004 Computational Linguistics 1 What a linguist

More information

Logic. Propositional Logic: Syntax. Wffs

Logic. Propositional Logic: Syntax. Wffs Logic Propositional Logic: Syntax Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about

More information

Parameterised! Linearisability Andrea Cerone

Parameterised! Linearisability Andrea Cerone ised! Linearisability Andrea Cerone Joint work with Alexey Gotsman and Hongseok Yang ICALP - Copenhagen, July 8th, 2014 A Simple Example Converting a sequential data structure into a concurrent one Trivial

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

Redoing the Foundations of Decision Theory

Redoing the Foundations of Decision Theory Redoing the Foundations of Decision Theory Joe Halpern Cornell University Joint work with Larry Blume and David Easley Economics Cornell Redoing the Foundations of Decision Theory p. 1/21 Decision Making:

More information

Liveness based Garbage Collection

Liveness based Garbage Collection CS738: Advanced Compiler Optimizations Liveness based Garbage Collection Amey Karkare karkare@cse.iitk.ac.in http://www.cse.iitk.ac.in/~karkare/cs738 Department of CSE, IIT Kanpur Ideal Garbage Collection...

More information

Extending higher-order logic with predicate subtyping: application to PVS

Extending higher-order logic with predicate subtyping: application to PVS Extending higher-order logic with predicate subtyping: application to PVS Frédéric Gilbert To cite this version: Frédéric Gilbert. Extending higher-order logic with predicate subtyping: application to

More information

Chapter 4: Computation tree logic

Chapter 4: Computation tree logic INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification

More information

Combinations of Theories for Decidable Fragments of First-order Logic

Combinations of Theories for Decidable Fragments of First-order Logic Combinations of Theories for Decidable Fragments of First-order Logic Pascal Fontaine Loria, INRIA, Université de Nancy (France) Montreal August 2, 2009 Montreal, August 2, 2009 1 / 15 Context / Motivation

More information

Hoare Logic (I): Axiomatic Semantics and Program Correctness

Hoare Logic (I): Axiomatic Semantics and Program Correctness Hoare Logic (I): Axiomatic Semantics and Program Correctness (Based on [Apt and Olderog 1991; Gries 1981; Hoare 1969; Kleymann 1999; Sethi 199]) Yih-Kuen Tsay Dept. of Information Management National Taiwan

More information

Lecture 3: Reductions and Completeness

Lecture 3: Reductions and Completeness CS 710: Complexity Theory 9/13/2011 Lecture 3: Reductions and Completeness Instructor: Dieter van Melkebeek Scribe: Brian Nixon Last lecture we introduced the notion of a universal Turing machine for deterministic

More information

Dag-Calculus: A Calculus for Parallel Computation

Dag-Calculus: A Calculus for Parallel Computation Dag-Calculus: A Calculus for Parallel Computation Technical Appendix This appendix consists of two main parts: in the first, we prove correct the translations of parallel primitives into the dag calculus,

More information

Proof Rules for Correctness Triples

Proof Rules for Correctness Triples Proof Rules for Correctness Triples CS 536: Science of Programming, Fall 2018 A. Why? We can t generally prove that correctness triples are valid using truth tables. We need proof axioms for atomic statements

More information

Type Systems. Lecture 9: Classical Logic. Neel Krishnaswami University of Cambridge

Type Systems. Lecture 9: Classical Logic. Neel Krishnaswami University of Cambridge Type Systems Lecture 9: Classical Logic Neel Krishnaswami University of Cambridge Where We Are We have seen the Curry Howard correspondence: Intuitionistic propositional logic Simply-typed lambda calculus

More information

Propositional Logic: Syntax

Propositional Logic: Syntax Logic Logic is a tool for formalizing reasoning. There are lots of different logics: probabilistic logic: for reasoning about probability temporal logic: for reasoning about time (and programs) epistemic

More information

Program Analysis and Verification

Program Analysis and Verification Program Analysis and Verification 0368-4479 Noam Rinetzky Lecture 4: Axiomatic Semantics Slides credit: Tom Ball, Dawson Engler, Roman Manevich, Erik Poll, Mooly Sagiv, Jean Souyris, Eran Tromer, Avishai

More information

Uniform Schemata for Proof Rules

Uniform Schemata for Proof Rules Uniform Schemata for Proof Rules Ulrich Berger and Tie Hou Department of omputer Science, Swansea University, UK {u.berger,cshou}@swansea.ac.uk Abstract. Motivated by the desire to facilitate the implementation

More information

INTEROPERATION FOR LAZY AND EAGER EVALUATION. A Thesis. Presented to. the Faculty of California Polytechnic State University.

INTEROPERATION FOR LAZY AND EAGER EVALUATION. A Thesis. Presented to. the Faculty of California Polytechnic State University. INTEROPERATION FOR LAZY AND EAGER EVALUATION A Thesis Presented to the Faculty of California Polytechnic State University San Luis Obispo In Partial Fulfillment of the Requirements for the Degree Master

More information

Inverting Proof Systems for Secrecy under OWA

Inverting Proof Systems for Secrecy under OWA Inverting Proof Systems for Secrecy under OWA Giora Slutzki Department of Computer Science Iowa State University Ames, Iowa 50010 slutzki@cs.iastate.edu May 9th, 2010 Jointly with Jia Tao and Vasant Honavar

More information

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0

Equalities and Uninterpreted Functions. Chapter 3. Decision Procedures. An Algorithmic Point of View. Revision 1.0 Equalities and Uninterpreted Functions Chapter 3 Decision Procedures An Algorithmic Point of View D.Kroening O.Strichman Revision 1.0 Outline Decision Procedures Equalities and Uninterpreted Functions

More information