Probabilistic Applicative Bisimulation L M { L/x } N { L/x } λx.M R λx.N R L eval � M � � M � ( E ) M R N � N � eval
Probabilistic Applicative Bisimulation L M { L/x } N { L/x } λx.M R λx.N R L eval � M � � M � ( E ) � N � ( E ) M R N � N � eval
Probabilistic Applicative Bisimulation L M { L/x } N { L/x } λx.M R λx.N R L eval � M � = � M � ( E ) � N � ( E ) M R N � N � eval
Applicative Bisimilarity vs. Context Equivalence ◮ Bisimilarity : the union ∼ of all bisimulation relations. ◮ Is it that ∼ is included in ≡ ? How to prove it? ◮ Natural strategy: is ∼ a congruence? ◮ If this is the case: � � M ∼ N = ⇒ C [ M ] ∼ C [ N ] = ⇒ � C [ M ] � = � C [ N ] � = ⇒ M ≡ N. ◮ This is a necessary sanity check anyway. ◮ The naïve proof by induction fails , due to application: from M ∼ N , one cannot directly conclude that LM ∼ LN .
Howe’s Technique R H R
Howe’s Technique ⊆ R H R
Howe’s Technique R H is a Congruence whenever R is an equivalence ⊆ R H R
Howe’s Technique ∼ H is a Congruence ⊆ ∼ ∼ H
Howe’s Technique ∼ H is a Congruence ⊆ ∼ ∼ H ⊇ Key Lemma
Our Neighborhood ◮ Λ , where we observe convergence ∼ ⊆ ≡ ≡ ⊆ ∼ CBN � � CBV � � [Abramsky1990, Howe1993] ◮ Λ ⊕ with nondeterministic semantics, where we observe convergence , in its may or must flavors. ∼ ⊆ ≡ ≡ ⊆ ∼ × CBN � CBV × � [Ong1993, Lassen1998]
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. ∼ ⊆ ≡ ≡ ⊆ ∼ × CBN � CBV � �
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. ∼ ⊆ ≡ ≡ ⊆ ∼ × CBN � CBV � � ◮ Counterexample for CBN: ( λx.I ) ⊕ ( λx. Ω) �∼ λx.I ⊕ Ω ◮ Where these discrepancies come from?
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. ∼ ⊆ ≡ ≡ ⊆ ∼ × CBN � CBV � � ◮ Counterexample for CBN: ( λx.I ) ⊕ ( λx. Ω) �∼ λx.I ⊕ Ω ◮ Where these discrepancies come from? ◮ From testing !
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. ∼ ⊆ ≡ ≡ ⊆ ∼ × CBN � CBV � � ◮ Counterexample for CBN: ( λx.I ) ⊕ ( λx. Ω) �∼ λx.I ⊕ Ω ◮ Where these discrepancies come from? ◮ From testing ! ◮ Bisimulation can be characterized by testing equivalence as follows: Calculus Testing T ::= ω | a · T Λ T ::= ω | a · T | � T, T � P Λ ⊕ T ::= ω | a · T | ∧ i ∈ I T i | . . . N Λ ⊕
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. � ⊆ ≤ ≤ ⊆ � × CBN � × CBV �
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. � ⊆ ≤ ≤ ⊆ � × CBN � × CBV � ◮ Probabilistic simulation can be characterized by testing as follows: T ::= ω | a · T | � T, T � | T ∨ T
The Probabilistic Case ◮ Λ ⊕ with probabilistic semantics. � ⊆ ≤ ≤ ⊆ � × CBN � × CBV � ◮ Probabilistic simulation can be characterized by testing as follows: T ::= ω | a · T | � T, T � | T ∨ T ◮ Full abstraction can be recovered if endowing Λ ⊕ with parallel disjunction [CDLSV2015]. � ⊆ ≤ ≤ ⊆ � × CBN � CBV � �
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first.
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ;
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M .
x, Γ ⊢ M Context Distance: the Affine Case [CDL2015] Γ ⊢ M ∆ ⊢ N Γ ⊢ M Γ ⊢ N Γ , x ⊢ x Γ , ∆ ⊢ MN Γ ⊢ M ⊕ N Γ ⊢ λx.M ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M .
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M . ◮ Behavioural Distance δ b . ◮ The metric analogue to bisimilarity.
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M . ◮ Behavioural Distance δ b . ◮ The metric analogue to bisimilarity. ◮ Trace Distance δ t . ◮ The maximum distance induced by traces, i.e., sequences of actions: δ t ( M, N ) = sup T | Pr ( M, T ) − Pr ( N, T ) | .
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M . ◮ Behavioural Distance δ b . ◮ The metric analogue to bisimilarity. ◮ Trace Distance δ t . ◮ The maximum distance induced by traces, i.e., sequences of actions: δ t ( M, N ) = sup T | Pr ( M, T ) − Pr ( N, T ) | . ◮ Soundness and Completeness Results: δ b ≤ δ c δ c ≤ δ b δ t ≤ δ c δ c ≤ δ t × � � �
Context Distance: the Affine Case [CDL2015] ◮ Let us consider a simple fragment of Λ ⊕ , first. ◮ Preterms : M, N ::= x | λx.M | MM | M ⊕ M | Ω ; ◮ Terms : any preterm M such that Γ ⊢ M . ◮ Behavioural Distance δ b . ◮ The metric analogue to bisimilarity. ◮ Trace Distance δ t . ◮ The maximum distance induced by traces, i.e., sequences of actions: δ t ( M, N ) = sup T | Pr ( M, T ) − Pr ( N, T ) | . ◮ Soundness and Completeness Results: δ b ≤ δ c δ c ≤ δ b δ t ≤ δ c δ c ≤ δ t × � � � ◮ Example : δ t ( I, I ⊕ Ω) = δ t ( I ⊕ Ω , Ω) = 1 2 .
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . .
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying.
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying. ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms.
Context Distance: the General Case [CDL2016] x, Γ ⊢ M ! x, Γ ⊢ M ◮ The LMC we have have worked so far with induces !Γ , x ⊢ x !Γ , ! x ⊢ x Γ ⊢ λx.M Γ ⊢ λ ! x.M unsound metrics for Λ ⊕ . . . Γ , !Θ ⊢ M ∆ , !Θ ⊢ N !Γ ⊢ M Γ ⊢ M Γ ⊢ N ◮ . . . because it does not adequately model copying. !Γ ⊢ ! M Γ ⊢ M ⊕ N Γ , ∆ , Θ ⊢ MN ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms.
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying. ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms. ◮ Soundness and Completeness Results: δ t ≤ δ c δ c ≤ δ t � �
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying. ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms. ◮ Soundness and Completeness Results: δ t ≤ δ c δ c ≤ δ t � � ◮ Examples : δ t (!( I ⊕ Ω) , !Ω) = 1 δ t (!( I ⊕ Ω) , ! I ) = 1 . 2
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying. ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms. ◮ Soundness and Completeness Results: δ t ≤ δ c δ c ≤ δ t � � ◮ Examples : δ t (!( I ⊕ Ω) , !Ω) = 1 δ t (!( I ⊕ Ω) , ! I ) = 1 . 2 ◮ Trivialisation : the context distance collapses to an equivalence in strongly normalising fragments or in presence of parellel disjuction .
Context Distance: the General Case [CDL2016] ◮ The LMC we have have worked so far with induces unsound metrics for Λ ⊕ . . . ◮ . . . because it does not adequately model copying. ◮ A Tuple LMC . ◮ Preterms : M ::= x | λx.M | λ ! x.M | MM | M ⊕ M | ! M ◮ Terms : any preterm M such that Γ ⊢ M . ◮ States : sequences of terms, rather than terms. ◮ Actions not only model parameter passing, but also copying of terms. What would a sensible notion of ◮ Soundness and Completeness Results: distance look like? δ t ≤ δ c δ c ≤ δ t � � ◮ Examples : δ t (!( I ⊕ Ω) , !Ω) = 1 δ t (!( I ⊕ Ω) , ! I ) = 1 . 2 ◮ Trivialisation : the context distance collapses to an equivalence in strongly normalising fragments or in presence of parellel disjuction .
Part II Bayesian Functional Programming
Recommend
More recommend