Horn-formulas as Types for Structural Resolution

Similar documents
Structural Resolution

0.1 Equivalence between Natural Deduction and Axiomatic Systems

5 Deduction in First-Order Logic

arxiv: v1 [math.lo] 24 Feb 2014

A Translation of Intersection and Union Types


Strong normalisation and the typed lambda calculus

TABLEAU-BASED DECISION PROCEDURES FOR HYBRID LOGIC

Cut-free sequent calculi for algebras with adjoint modalities

2 Deduction in Sentential Logic

Orthogonality to the value group is the same as generic stability in C-minimal expansions of ACVF

Notes on Natural Logic

Gödel algebras free over finite distributive lattices

Fundamentals of Logic

Introduction An example Cut elimination. Deduction Modulo. Olivier Hermant. Tuesday, December 12, Deduction Modulo

Threshold logic proof systems

Tableau Theorem Prover for Intuitionistic Propositional Logic

Tableau Theorem Prover for Intuitionistic Propositional Logic

École normale supérieure, MPRI, M2 Year 2007/2008. Course 2-6 Abstract interpretation: application to verification and static analysis P.

CS792 Notes Henkin Models, Soundness and Completeness

Characterisation of Strongly Normalising λµ-terms

Isabelle/FOL First-Order Logic

THE OPERATIONAL PERSPECTIVE

SAT and DPLL. Introduction. Preliminaries. Normal forms DPLL. Complexity. Espen H. Lian. DPLL Implementation. Bibliography.

A Syntactic Realization Theorem for Justification Logics

CTL Model Checking. Goal Method for proving M sat σ, where M is a Kripke structure and σ is a CTL formula. Approach Model checking!

Two Notions of Sub-behaviour for Session-based Client/Server Systems

THE NUMBER OF UNARY CLONES CONTAINING THE PERMUTATIONS ON AN INFINITE SET

Chapter 4. Cardinal Arithmetic.

SAT and DPLL. Espen H. Lian. May 4, Ifi, UiO. Espen H. Lian (Ifi, UiO) SAT and DPLL May 4, / 59

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

Level by Level Inequivalence, Strong Compactness, and GCH

In this lecture, we will use the semantics of our simple language of arithmetic expressions,

CIS 500 Software Foundations Fall October. CIS 500, 6 October 1

Chain conditions, layered partial orders and weak compactness

Decidability and Recursive Languages

An effective perfect-set theorem

Untyped Lambda Calculus

Characterizing large cardinals in terms of layered partial orders

A semantics for concurrent permission logic. Stephen Brookes CMU

Harvard School of Engineering and Applied Sciences CS 152: Programming Languages

PARTITIONS OF 2 ω AND COMPLETELY ULTRAMETRIZABLE SPACES

monotone circuit value

R. Selvi 1, P. Thangavelu 2. Sri Parasakthi College for Women Courtallam, INDIA 2 Department of Mathematics

START HERE: Instructions. 1 Exponential Family [Zhou, Manzil]

Discrete Random Variables

Discrete Random Variables

A NEW NOTION OF TRANSITIVE RELATIVE RETURN RATE AND ITS APPLICATIONS USING STOCHASTIC DIFFERENTIAL EQUATIONS. Burhaneddin İZGİ

A Knowledge-Theoretic Approach to Distributed Problem Solving

3 The Model Existence Theorem

Security issues in contract-based computing

Partial Fractions. A rational function is a fraction in which both the numerator and denominator are polynomials. For example, f ( x) = 4, g( x) =

Typed Lambda Calculi Lecture Notes

The Traveling Salesman Problem. Time Complexity under Nondeterminism. A Nondeterministic Algorithm for tsp (d)

Long Term Values in MDPs Second Workshop on Open Games

Continuous images of closed sets in generalized Baire spaces ESI Workshop: Forcing and Large Cardinals

Version A. Problem 1. Let X be the continuous random variable defined by the following pdf: 1 x/2 when 0 x 2, f(x) = 0 otherwise.

Notes to The Resurrection Axioms

COMBINATORICS OF REDUCTIONS BETWEEN EQUIVALENCE RELATIONS

Satisfaction in outer models

Outline Introduction Game Representations Reductions Solution Concepts. Game Theory. Enrico Franchi. May 19, 2010

ExpTime Tableau Decision Procedures for Regular Grammar Logics with Converse

Optimal Satisficing Tree Searches

Maximally Consistent Extensions

Unary PCF is Decidable

Non replication of options

Probability Theory and Simulation Methods. April 9th, Lecture 20: Special distributions

X i = 124 MARTINGALES

Price Theory of Two-Sided Markets

Stochastic Dynamical Systems and SDE s. An Informal Introduction

Brief Notes on the Category Theoretic Semantics of Simply Typed Lambda Calculus

MITCHELL S THEOREM REVISITED. Contents

CHOICE THEORY, UTILITY FUNCTIONS AND RISK AVERSION

Section 7.5 The Normal Distribution. Section 7.6 Application of the Normal Distribution

Separation axioms on enlargements of generalized topologies

Application of Stochastic Calculus to Price a Quanto Spread

Tug of War Game. William Gasarch and Nick Sovich and Paul Zimand. October 6, Abstract

6 Central Limit Theorem. (Chs 6.4, 6.5)

Logic and Artificial Intelligence Lecture 24

Building Infinite Processes from Regular Conditional Probability Distributions

Interpolation of κ-compactness and PCF

Trust Negotiation With Nonmonotonic Access Policies

Pricing Volatility Derivatives with General Risk Functions. Alejandro Balbás University Carlos III of Madrid

Arborescent Architecture for Decentralized Supervisory Control of Discrete Event Systems

Attempt QUESTIONS 1 and 2, and THREE other questions. Do not turn over until you are told to do so by the Invigilator.

Advanced Microeconomics

Pricing Dynamic Solvency Insurance and Investment Fund Protection

Another Variant of 3sat. 3sat. 3sat Is NP-Complete. The Proof (concluded)

Statistics 6 th Edition

An Adaptive Characterization of Signed Systems for Paraconsistent Reasoning

Martingale Optimal Transport and Robust Hedging

Techniques for Calculating the Efficient Frontier

Rohini Kumar. Statistics and Applied Probability, UCSB (Joint work with J. Feng and J.-P. Fouque)

Yao s Minimax Principle

Comparing Goal-Oriented and Procedural Service Orchestration

TWO-PERIODIC TERNARY RECURRENCES AND THEIR BINET-FORMULA 1. INTRODUCTION

6. Continous Distributions

Focusing on contraction

A Logic-based Approach to Decision Making. Magdalena Ivanovska and Martin Giese

Lecture 2: The Simple Story of 2-SAT

Transcription:

Horn-formulas as Types for Structural Resolution Peng Fu, Ekaterina Komendantskaya University of Dundee School of Computing

2 / 17 Introduction: Background Logic Programming(LP) is based on first-order Horn formula The execution of LP is by SLD-resolution SLD-resolution uses Robinson s unification

3 / 17 Introduction: Example of SLD-resolution Connectivity of graph with 3 nodes: κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 )

3 / 17 Introduction: Example of SLD-resolution Connectivity of graph with 3 nodes: κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 ) query: Connect(node 1, node 3 )?

3 / 17 Introduction: Example of SLD-resolution Connectivity of graph with 3 nodes: κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 ) query: Connect(node 1, node 3 )? Execution trace: {Connect(node 1, node 3 )} κ1,[node 1 /x,node 3 /z] {Connect(node 1, y), Connect(y, node 3 )} κ2,[node 1 /x,node 2 /y,node 3 /z] {Connect(node 2, node 3 )} κ3

3 / 17 Introduction: Example of SLD-resolution Connectivity of graph with 3 nodes: κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 ) query: Connect(node 1, node 3 )? Execution trace: {Connect(node 1, node 3 )} κ1,[node 1 /x,node 3 /z] {Connect(node 1, y), Connect(y, node 3 )} κ2,[node 1 /x,node 2 /y,node 3 /z] {Connect(node 2, node 3 )} κ3 So the answer for Connect(node 1, node 3 ) is yes.

4 / 17 Introduction: Motivation Assumptions of LP Provide answers only when a query yields terminating execution Answering a query as proving a formula The notion of proof seems to be of little use in LP Difficulties Hard to model infinite data, where the execution may not terminate How to understand the meaning a query when the query is not terminating

5 / 17 Introduction: Resolution by Term-Matching Let s call LP by SLD-resolution LP-Unif How about resolution by term-matching(lp-tm)? Unifiable t 1 γ t 2, i.e. γt 1 γt 2. Matchable t 1 σ t 2, i.e. σt 1 t 2. A use case for LP-TM: Theorem proving

5 / 17 Introduction: Resolution by Term-Matching Let s call LP by SLD-resolution LP-Unif How about resolution by term-matching(lp-tm)? Unifiable t 1 γ t 2, i.e. γt 1 γt 2. Matchable t 1 σ t 2, i.e. σt 1 t 2. A use case for LP-TM: Theorem proving Given axioms: Q(x) Q(x) P(x) Is P(x) provable? P(x) Q(x)

5 / 17 Introduction: Resolution by Term-Matching Let s call LP by SLD-resolution LP-Unif How about resolution by term-matching(lp-tm)? Unifiable t 1 γ t 2, i.e. γt 1 γt 2. Matchable t 1 σ t 2, i.e. σt 1 t 2. A use case for LP-TM: Theorem proving Given axioms: Q(x) Q(x) P(x) Is P(x) provable? P(x) Q(x) Given axioms: Q(c) Q(x) P(x) Is P(x) provable? P(x) Q(x)

6 / 17 Execution behavior of LP-TM Consider following Stream predicate: κ : Stream(y) Stream(cons(x, y))

6 / 17 Execution behavior of LP-TM Consider following Stream predicate: κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Unif: {Stream(cons(x, y))} κ,[x/x1,y/y 1 ] {Stream(y)} κ,[cons(x2,y 2 )/y,x/x 1,cons(x 2,y 2 )/y 1,] {Stream(y 2 )}...

6 / 17 Execution behavior of LP-TM Consider following Stream predicate: κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Unif: {Stream(cons(x, y))} κ,[x/x1,y/y 1 ] {Stream(y)} κ,[cons(x2,y 2 )/y,x/x 1,cons(x 2,y 2 )/y 1,] {Stream(y 2 )}... In LP-TM: {Stream(cons(x, y))} κ,[x/x1,y/y 1 ] {Stream(y)}

7 / 17 Limitations of LP-TM LP-TM not quite suitable for problem solving The following logic program can describe finite bit list κ 1 : Bit(0) κ 2 : Bit(1) κ 3 : BList(nil) κ 4 : Bit(x), BList(y) BList(cons(x, y))

7 / 17 Limitations of LP-TM LP-TM not quite suitable for problem solving The following logic program can describe finite bit list κ 1 : Bit(0) κ 2 : Bit(1) κ 3 : BList(nil) κ 4 : Bit(x), BList(y) BList(cons(x, y)) Consider query BList(cons(x, y)): {BList(cons(x, y))} κ4,[x/x 1,y/y 1] {Bit(x), BList(y)}

7 / 17 Limitations of LP-TM LP-TM not quite suitable for problem solving The following logic program can describe finite bit list κ 1 : Bit(0) κ 2 : Bit(1) κ 3 : BList(nil) κ 4 : Bit(x), BList(y) BList(cons(x, y)) Consider query BList(cons(x, y)): {BList(cons(x, y))} κ4,[x/x 1,y/y 1] {Bit(x), BList(y)} But what is the answer for x, y?

7 / 17 Limitations of LP-TM LP-TM not quite suitable for problem solving The following logic program can describe finite bit list κ 1 : Bit(0) κ 2 : Bit(1) κ 3 : BList(nil) κ 4 : Bit(x), BList(y) BList(cons(x, y)) Consider query BList(cons(x, y)): {BList(cons(x, y))} κ4,[x/x 1,y/y 1] {Bit(x), BList(y)} But what is the answer for x, y? We need unification to compute substitution: x 0, y nil

7 / 17 Limitations of LP-TM LP-TM not quite suitable for problem solving The following logic program can describe finite bit list κ 1 : Bit(0) κ 2 : Bit(1) κ 3 : BList(nil) κ 4 : Bit(x), BList(y) BList(cons(x, y)) Consider query BList(cons(x, y)): {BList(cons(x, y))} κ4,[x/x 1,y/y 1] {Bit(x), BList(y)} But what is the answer for x, y? We need unification to compute substitution: x 0, y nil The combination of LP-TM with substitution computed by unification leads to Structural Resolution

8 / 17 Formalism: LP-Unif, LP-TM and LP-Struct Term-matching reduction: Φ {A 1,..., A i,..., A n } κ,σ {A 1,..., σb 1,..., σb m,..., A n }, if there exists κ : x.b 1,..., B n C Φ such that C σ A i.

8 / 17 Formalism: LP-Unif, LP-TM and LP-Struct Term-matching reduction: Φ {A 1,..., A i,..., A n } κ,σ {A 1,..., σb 1,..., σb m,..., A n }, if there exists κ : x.b 1,..., B n C Φ such that C σ A i. Unification reduction: Φ {A 1,..., A i,..., A n } κ,γ γ {γa 1,..., γb 1,..., γb m,..., γa n }, if there exists κ : x.b 1,..., B n C Φ such that C γ A i.

8 / 17 Formalism: LP-Unif, LP-TM and LP-Struct Term-matching reduction: Φ {A 1,..., A i,..., A n } κ,σ {A 1,..., σb 1,..., σb m,..., A n }, if there exists κ : x.b 1,..., B n C Φ such that C σ A i. Unification reduction: Φ {A 1,..., A i,..., A n } κ,γ γ {γa 1,..., γb 1,..., γb m,..., γa n }, if there exists κ : x.b 1,..., B n C Φ such that C γ A i. Substitutional reduction: Φ {A 1,..., A i,..., A n } κ,γ γ {γa 1,..., γa i,..., γa n }, if there exists κ : x.b 1,..., B n C Φ such that C γ A i.

8 / 17 Formalism: LP-Unif, LP-TM and LP-Struct Term-matching reduction: Φ {A 1,..., A i,..., A n } κ,σ {A 1,..., σb 1,..., σb m,..., A n }, if there exists κ : x.b 1,..., B n C Φ such that C σ A i. Unification reduction: Φ {A 1,..., A i,..., A n } κ,γ γ {γa 1,..., γb 1,..., γb m,..., γa n }, if there exists κ : x.b 1,..., B n C Φ such that C γ A i. Substitutional reduction: Φ {A 1,..., A i,..., A n } κ,γ γ {γa 1,..., γa i,..., γa n }, if there exists κ : x.b 1,..., B n C Φ such that C γ A i. LP-TM: (Φ, ) LP-Unif: (Φ, ) LP-Struct: (Φ, µ 1 )

9 / 17 LP-Struct: Stream κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Struct: {Stream(cons(x, y))} {Stream(y)}

9 / 17 LP-Struct: Stream κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Struct: {Stream(cons(x, y))} {Stream(y)} [cons(x1,y 1 )/y] {Stream(cons(x 1, y 1 ))} {Stream(y 1 )}

9 / 17 LP-Struct: Stream κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Struct: {Stream(cons(x, y))} {Stream(y)} [cons(x1,y 1 )/y] {Stream(cons(x 1, y 1 ))} {Stream(y 1 )} [cons(x2,y 2 )/y 1,cons(x 1,cons(x 2,y 2 ))/y] {Stream(cons(x 2, y 2 ))} {Stream(y 2 )}

9 / 17 LP-Struct: Stream κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Struct: {Stream(cons(x, y))} {Stream(y)} [cons(x1,y 1 )/y] {Stream(cons(x 1, y 1 ))} {Stream(y 1 )} [cons(x2,y 2 )/y 1,cons(x 1,cons(x 2,y 2 ))/y] {Stream(cons(x 2, y 2 ))} {Stream(y 2 )} [cons(x3,y 3 )/y 2,cons(x 2,cons(x 3,y 3 ))/y 1,cons(x 1,cons(x 2,cons(x 3,y 3 )))/y] {Stream(cons(x 3, y 3 ))} {Stream(y 3 )}

9 / 17 LP-Struct: Stream κ : Stream(y) Stream(cons(x, y)) For query Stream(cons(x, y)), in LP-Struct: {Stream(cons(x, y))} {Stream(y)} [cons(x1,y 1 )/y] {Stream(cons(x 1, y 1 ))} {Stream(y 1 )} [cons(x2,y 2 )/y 1,cons(x 1,cons(x 2,y 2 ))/y] {Stream(cons(x 2, y 2 ))} {Stream(y 2 )} [cons(x3,y 3 )/y 2,cons(x 2,cons(x 3,y 3 ))/y 1,cons(x 1,cons(x 2,cons(x 3,y 3 )))/y] {Stream(cons(x 3, y 3 ))} {Stream(y 3 )}... Partial answer: cons(x 1, cons(x 2, cons(x 3, y 3 )))/y

10 / 17 Question: Relation between LP-Unif and LP-Struct? Both LP-Unif and LP-Struct are sound w.r.t. Herbrand Model

10 / 17 Question: Relation between LP-Unif and LP-Struct? Both LP-Unif and LP-Struct are sound w.r.t. Herbrand Model Operationally, They seem similar but a little different

10 / 17 Question: Relation between LP-Unif and LP-Struct? Both LP-Unif and LP-Struct are sound w.r.t. Herbrand Model Operationally, They seem similar but a little different Again, the graph example κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 )

10 / 17 Question: Relation between LP-Unif and LP-Struct? Both LP-Unif and LP-Struct are sound w.r.t. Herbrand Model Operationally, They seem similar but a little different Again, the graph example κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 ) Connect(node 1, node 3 ) in LP-Unif terminates.

10 / 17 Question: Relation between LP-Unif and LP-Struct? Both LP-Unif and LP-Struct are sound w.r.t. Herbrand Model Operationally, They seem similar but a little different Again, the graph example κ 1 : Connect(x, y), Connect(y, z) Connect(x, z) κ 2 : Connect(node 1, node 2 ) κ 3 : Connect(node 2, node 3 ) Connect(node 1, node 3 ) in LP-Unif terminates. For LP-Struct: Φ {Connect(node 1, node 3 )} κ1,[node 1 /x,node 3 /z] {Connect(node 1, y), Connect(y, node 3 )} κ1,[node 1 /x,y/z] {Connect(node 1, y 1 ), Connect(y 1, y), Connect(y, node 3 )} κ1...

11 / 17 Formalization of a Type System Term t ::= x f (t 1,..., t n ) Atomic Formula A, B, C, D ::= P(t 1,..., t n ) (Horn) Formula F ::= A 1,..., A n A Proof Term p, e ::= κ a λa.e e e

Formalization of a Type System Term t ::= x f (t 1,..., t n ) Atomic Formula A, B, C, D ::= P(t 1,..., t n ) (Horn) Formula F ::= A 1,..., A n A Proof Term p, e ::= κ a λa.e e e Girard s observation on intuitionistic sequent calculus with atomic formulas B A axiom B C σb σc subst A D B, D C A, B C cut 11 / 17

11 / 17 Formalization of a Type System Term t ::= x f (t 1,..., t n ) Atomic Formula A, B, C, D ::= P(t 1,..., t n ) (Horn) Formula F ::= A 1,..., A n A Proof Term p, e ::= κ a λa.e e e Girard s observation on intuitionistic sequent calculus with atomic formulas B A axiom B C σb σc subst A D B, D C A, B C Is Q provable? cut

Formalization of a Type System Term t ::= x f (t 1,..., t n ) Atomic Formula A, B, C, D ::= P(t 1,..., t n ) (Horn) Formula F ::= A 1,..., A n A Proof Term p, e ::= κ a λa.e e e Girard s observation on intuitionistic sequent calculus with atomic formulas B A axiom B C σb σc subst A D B, D C cut A, B C Is Q provable? We internalized as and add proof term annotations κ : x.f axiom e : F e : x.f gen e : x.f e : [t/x]f inst e 1 : A D e 2 : B, D C λa.λb.(e 2 b) (e 1 a) : A, B C cut 11 / 17

12 / 17 Soundness of LP-TM and LP-Unif Soundness of LP-Unif If Φ {A} γ, then there exists a proof e : x. γa given axioms Φ. Soundness of LP-TM If Φ {A}, then there exists a proof e : x. A given axioms Φ. For example, the LP-Unif reductions: {Connect(node 1, node 3 )} κ1,[node 1 /x,node 3 /z] {Connect(node 1, y), Connect(y, node 3 )} κ2,[node 1 /x,node 2 /y,node 3 /z] {Connect(node 2, node 3 )} κ3 The reduction yields a proof (λb.(κ 1 b) κ 3 ) κ 2 for the formula Connect(node 1, node 3 ).

13 / 17 Useful Properties about the Type System Strong Normalization If e : F, then e is strongly normalizable w.r.t. beta-reduction on proof terms. First Orderness If e : [ x.]a B given axioms Φ, then either e is a proof term constant or it is normalizable to the form λa.n, where n is first order normal proof term. If e : [ x.] B, then e is normalizable to a first order proof term.

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B.

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B. Representing First Order Proof Term Let φ be a mapping from proof term variables to first order terms. a φ := φ(a) κ p 1...p n φ := f κ ( p 1 φ,..., p n φ )

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B. Representing First Order Proof Term Let φ be a mapping from proof term variables to first order terms. a φ := φ(a) κ p 1...p n φ := f κ ( p 1 φ,..., p n φ ) For A P(x), we write A[y] P(x, y). Similarly, A[t] P(x, t)

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B. Representing First Order Proof Term Let φ be a mapping from proof term variables to first order terms. a φ := φ(a) κ p 1...p n φ := f κ ( p 1 φ,..., p n φ ) For A P(x), we write A[y] P(x, y). Similarly, A[t] P(x, t) Realizability transformation F on normal proofs

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B. Representing First Order Proof Term Let φ be a mapping from proof term variables to first order terms. a φ := φ(a) κ p 1...p n φ := f κ ( p 1 φ,..., p n φ ) For A P(x), we write A[y] P(x, y). Similarly, A[t] P(x, t) Realizability transformation F on normal proofs F(κ : x.a1,..., A m B) := κ : x. y.a 1 [y 1 ],..., A m [y m ] B[f κ (y 1,..., y m )]

14 / 17 Realizability Transformation Inspired from Kleene s realizability: ϕ realize A B iff for any number a realizes A and ϕ(a) realizes B. Representing First Order Proof Term Let φ be a mapping from proof term variables to first order terms. a φ := φ(a) κ p 1...p n φ := f κ ( p 1 φ,..., p n φ ) For A P(x), we write A[y] P(x, y). Similarly, A[t] P(x, t) Realizability transformation F on normal proofs F(κ : x.a1,..., A m B) := κ : x. y.a 1 [y 1 ],..., A m [y m ] B[f κ (y 1,..., y m )] F(λa.n : [ x].a 1,..., A m B) := λa.n : [ x. y].a 1 [y 1 ],..., A m [y m ] B[ n [y/a] ]

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 )

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u).

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)}

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)} κ1,[node 1/x,node 3/z,f κ1 (u 1,u 2)/u] {Connect(node 1, node 3, f κ1 (u 1, u 2 ))} κ1 {Connect(node 1, y, u 1 ), Connect(y, node 3, u 2 )}

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)} κ1,[node 1/x,node 3/z,f κ1 (u 1,u 2)/u] {Connect(node 1, node 3, f κ1 (u 1, u 2 ))} κ1 {Connect(node 1, y, u 1 ), Connect(y, node 3, u 2 )} κ2,[c κ2 /u 1,node 1/x,node 2/y,,node 3/z,f κ1 (c κ2,u 2)/u]

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)} κ1,[node 1/x,node 3/z,f κ1 (u 1,u 2)/u] {Connect(node 1, node 3, f κ1 (u 1, u 2 ))} κ1 {Connect(node 1, y, u 1 ), Connect(y, node 3, u 2 )} κ2,[c κ2 /u 1,node 1/x,node 2/y,,node 3/z,f κ1 (c κ2,u 2)/u] {Connect(node1, node 2, c κ2 ), Connect(node 2, node 3, u 2 )} κ2 {Connect(node 2, node 3, u 2 )}

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)} κ1,[node 1/x,node 3/z,f κ1 (u 1,u 2)/u] {Connect(node 1, node 3, f κ1 (u 1, u 2 ))} κ1 {Connect(node 1, y, u 1 ), Connect(y, node 3, u 2 )} κ2,[c κ2 /u 1,node 1/x,node 2/y,,node 3/z,f κ1 (c κ2,u 2)/u] {Connect(node1, node 2, c κ2 ), Connect(node 2, node 3, u 2 )} κ2 {Connect(node 2, node 3, u 2 )} κ3,[c κ3 /u 2,c κ2 /u 1,node 3/z,node 1/x,node 2/y,f κ1 (c κ2,c κ3 )/u] {Connect(node 2, node 3, c κ3 )} κ3

15 / 17 Realizability Transformation: Example Connectivity after realizability transformation: κ 1 : Connect(x, y, u 1), Connect(y, z, u 2) Connect(x, z, f κ1 (u 1, u 2)) κ 2 : Connect(node 1, node 2, c κ2 ) κ 3 : Connect(node 2, node 3, c κ3 ) LP-Struct reduction for Connect(node 1, node 3, u). {Connect(node1, node 3, u)} κ1,[node 1/x,node 3/z,f κ1 (u 1,u 2)/u] {Connect(node 1, node 3, f κ1 (u 1, u 2 ))} κ1 {Connect(node 1, y, u 1 ), Connect(y, node 3, u 2 )} κ2,[c κ2 /u 1,node 1/x,node 2/y,,node 3/z,f κ1 (c κ2,u 2)/u] {Connect(node1, node 2, c κ2 ), Connect(node 2, node 3, u 2 )} κ2 {Connect(node 2, node 3, u 2 )} κ3,[c κ3 /u 2,c κ2 /u 1,node 3/z,node 1/x,node 2/y,f κ1 (c κ2,c κ3 )/u] {Connect(node 2, node 3, c κ3 )} κ3 Answer: f κ1 (c κ2, c κ3 )/u

16 / 17 Results about Realizability Transformation Termination of term-matching reduction For any (Φ, µ 1 ), we have (F(Φ), ν 1 ) Preserve Provability Given axioms Φ, if e : [ x].a B holds with e in normal form, then F(e : [ x].a B) holds for axioms F(Φ) Recording Proof Suppose F(Φ) {A[y]} γ. We have p : x. γa[γy] for F(Φ), where p is in normal form and p = γy Preserve Unification Φ {A} iff F(Φ) {A[y]} Operational Equivalent of LP-Unif and LP-Struct F(Φ) {A[y]} iff F(Φ) {A[y]}( ν 1 ).

17 / 17 Summary and Future Work We define a type system to model LP-TM, LP-Unif and LP-Struct We define a transformation called realizability transformation Realizability transformation preserves proof content We show LP-Unif and LP-Struct are operationally equivalent after the tranformation Future works: Apply LP-TM to analyze type class inference in functional langauges

18 / 17 Future Work In type class inference, proof has computational meaning: class Eq A where eq :: Eq A => A -> A -> Bool instance => Eq Int where.. instance Eq A => Eq (List A) where.. test = eq [] [1] test function will generate a query Eq (List Int) Eq (List Int) ==> Eq Int ==> empty The proof of the query Eq (List Int) will be passed as an input for eq