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