Logical Properties of CPS Transforms Deepak Garg Fall, 2004.

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Charting the Potential of Description Logic for the Generation of Referring Expression SELLC, Guangzhou, Dec Yuan Ren, Kees van Deemter and Jeff.
Introduction to Proofs
Techniques for Proving the Completeness of a Proof System Hongseok Yang Seoul National University Cristiano Calcagno Imperial College.
Proofs and Programs Wei Hu 11/01/2007. Outline  Motivation  Theory  Lambda calculus  Curry-Howard Isomorphism  Dependent types  Practice  Coq Wei.
Disjunctive Normal Form CS 680: Formal Methods Jeremy Johnson.
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
L41 Lecture 2: Predicates and Quantifiers.. L42 Agenda Predicates and Quantifiers –Existential Quantifier  –Universal Quantifier 
Background information Formal verification methods based on theorem proving techniques and model­checking –to prove the absence of errors (in the formal.
CLF: A Concurrent Logical Framework David Walker Princeton (with I. Cervesato, F. Pfenning, K. Watkins)
What’s left in the course. The course in a nutshell Logics Techniques Applications.
Focusing in Proof-search and Concurrent Synchronization Deepak Garg Carnegie Mellon University (Based on joint work with Frank Pfenning)
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Inference and Resolution for Problem Solving
מבנה המחשב + מבוא למחשבים ספרתיים תרגול 1#
Strict Bidirectional Type Checking Adam Chlipala, Leaf Petersen, and Robert Harper.
Winter 2004/5Pls – inductive – Catriel Beeri1 Inductive Definitions (our meta-language for specifications)  Examples  Syntax  Semantics  Proof Trees.
1 Inference Rules and Proofs Z: Inference Rules and Proofs.
1 Inference Rules and Proofs Z: Inference Rules and Proofs.
Natural deduction  ` A  ` B  ` A Æ B  ` A  ` A Æ B  ` B  ` B  ` A ) B  ` A  ` A ) B  ` B  ` A ÆIÆI ÆE1ÆE1 ÆE2ÆE2 Assume )I)I.
Discrete Structures Chapter 5: Sequences, Mathematical Induction, and Recursion 5.2 Mathematical Induction I [Mathematical induction is] the standard proof.
Propositional Calculus Math Foundations of Computer Science.
Propositional Calculus CS 680: Formal Methods in Verification Computer Systems Jeremy Johnson.
Section Section Summary Introduction to Boolean Algebra Boolean Expressions and Boolean Functions Identities of Boolean Algebra Duality The Abstract.
Predicates and Quantifiers
Chapter 2 Midterm Review
Inequalities and Proof
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
CS 4100 Artificial Intelligence Prof. C. Hafner Class Notes Jan 19, 2012.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
CS1502 Formal Methods in Computer Science
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
The Bernays-Schönfinkel Fragment of First-Order Autoepistemic Logic Peter Baumgartner MPI Informatik, Saarbrücken.
Logic CL4 Episode 16 0 The language of CL4 The rules of CL4 CL4 as a conservative extension of classical logic The soundness and completeness of CL4 The.
1 Knowledge Representation. 2 Definitions Knowledge Base Knowledge Base A set of representations of facts about the world. A set of representations of.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity MATH Some Formal Logic (which is really.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
Automated Reasoning Early AI explored how to automated several reasoning tasks – these were solved by what we might call weak problem solving methods as.
Non-interference in Constructive Authorization Logic Deepak Garg and Frank Pfenning Carnegie Mellon University.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
CS6133 Software Specification and Verification
Mechanizing Metatheory without Typing Contexts TYPES 2011 September 10, 2011 Jonghyun Park, Jeongbong Seo, Sungwoo Park, Gyesik Lee* Pohang University.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Knowledge Repn. & Reasoning Lec. #5: First-Order Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
CS.462 Artificial Intelligence SOMCHAI THANGSATHITYANGKUL Lecture 05 : Knowledge Base & First Order Logic.
Formal Verification. Background Information Formal verification methods based on theorem proving techniques and model­checking –To prove the absence of.
Boolean Expression Evaluation CS 270: Math Foundations of CS Jeremy Johnson.
1 A framework for eager encoding Daniel Kroening ETH, Switzerland Ofer Strichman Technion, Israel (Executive summary) (submitted to: Formal Aspects of.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
(MTH 250) Lecture 19 Calculus. Previous Lecture’s Summary Definite integrals Fundamental theorem of calculus Mean value theorem for integrals Fundamental.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Chapter 7. Propositional and Predicate Logic
Introduction to Logic for Artificial Intelligence Lecture 1
Boolean Algebra A Boolean algebra is a set B of values together with:
Boolean Algebra A Boolean algebra is a set B of values together with:
Disjunctive Normal Form
EPISTEMIC LOGIC.
Computer Security: Art and Science, 2nd Edition
MAT 3100 Introduction to Proof
Chapter 7. Propositional and Predicate Logic
Predicates and Quantifiers
Propositional Logic CMSC 471 Chapter , 7.7 and Chuck Dyer
Presentation transcript:

Logical Properties of CPS Transforms Deepak Garg Fall, 2004

Introduction CPS = Continuation Passing Style Studied to simulate cbv with cbn We look at CPS transforms as proof- transformations CPS transforms embed classical logic into intuitionistic logic

Simply Typed -calculus Terms: Types (Logical Propositions):

Evaluation and Typing Rules Standard Typing Rules Small step, call by value evaluation

Abort (A) Operator

What we have so far … We have INTUITIONISTIC logic with ?

Control (C) Operator

What we have now … We have CLASSICAL logic! Why? Rule of double negation elimination.

Summary -calculus + A $ Intuitionistic logic with ? -calculus + A + C $ Classical logic

CPS Transforms

CPS Transform: History [1975] Plotkin. CPS studied formally. [1986] Felleisen et al. Extended to control operators (call/cc, C and A). [1993] Griffin. Typed CPS transforms. [2003] Wadler. Duality with CPS transforms.

CPS Transform: Properties Translate terms, types and proofs On terms: – No control (C) operator in transformed terms On types: – No double negation elimination in transformed proofs – Translates classical into intuitionistic logic!

CPS: Term Translation -calculus CPS translation Each translated term expects a continuation

CPS: Operational Interpretation Explicitly formalize evaluation in terms of continuations To evaluate (M N) in the continuation k, evaluate M in the continuation that binds its input to m and evaluates N in the continuation that binds its input to n and evaluates (m n) in the continuation k.

CPS: Type Translation Translation for types: Types:

CPS: Logical Interpretation

CPS: A-Operator k is thrown away like E[ ]

Soundness: A-Operator

CPS: C-Operator d is thrown away like E’[ ].

Soundness: C-Operator

CPS: Logical Interpretation

Summary of CPS

CPS as an Embedding

Two more theorems (unrelated to proof- terms):

Doing it all in Twelf

Representing Terms Use HOAS

Classical and Intuitionistic Terms The previous definition is not enough. We have to distinguish classical and intuitionistic logic Introduce two types of terms: – Classical: termc – Intuitionistic: termi

Classical and Intuitionistic Terms

Representing the CPS Transform Terms represented with HOAS No direct representation for variables How do we represent the following? Create a judgment:

More Trouble …

The solution We make the translation a hypothetical judgment Recall: We get:

The solution

Soundness Theorem

Problems: Soundness Theorem Input Coverage Problem:

Problem: Soundness Theorem From worlds (soundnessblock) Output External Can’t be changed (Needed for Induction) Make this an output?

Soundness Theorem Solution New Theorem:

Soundness Theorem? What have we shown? What we need …

Soundness Theorem? Are these theorems the same? To us they are Why? We know that given A, there is exactly one A’ such that A* = A’. We never told Twelf this fact So, in Twelf these are different theorems!

Telling Twelf about Uniqueness Can we tell Twelf that A* is unique? Not directly! There is no uniqueness check We can make an equality judgment

Telling Twelf about Uniqueness Now we prove a theorem

A Typing-soundness Theorem We also need the following theorem

True Soundness Using all our previous theorems, we can now prove the soundness with correct modes.

Extensions Can be extended to include conjunction and disjunction. We can also use a call-by-name transform – Gives a translation from classical to minimal logic – Very similar to Kolmogrov’s double negation translation