mosel a general extensible modal framework for
play

MoSeL: A General, Extensible Modal Framework for Interactive Proofs - PowerPoint PPT Presentation

MoSeL: A General, Extensible Modal Framework for Interactive Proofs in Separation Logic Robbert Krebbers 1 Jacques-Henri Jourdan 2 Ralf Jung 3 Joseph Tassarotti 4 Jan-Oliver Kaiser 3 Amin Timany 5 eraud 6 Derek Dreyer 3 Arthur Chargu 1 Delft


  1. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Φ x ∨ P ∗ Ψ x 3

  2. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Φ x 3

  3. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Φ x 3

  4. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 2 subgoals P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/2) iLeft. "HP" : P iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P (2/2) "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x 3

  5. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 2 subgoals P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/2) iLeft. "HP" : P iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + P (2/2) "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x 3

  6. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + P 3

  7. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. P 3

  8. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : This subproof is complete , but there are some unfocused goals : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . (1/2) iIntros "[HP H]". "H1" : Φ x iDestruct "H" as (x) "[H1|H2]". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ - iExists x. Φ x iLeft. iSplitL "HP". (2/2) + iAssumption. "HP" : P "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a 3

  9. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : This subproof is complete , but there are some unfocused goals : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . (1/2) iIntros "[HP H]". "H1" : Φ x iDestruct "H" as (x) "[H1|H2]". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ - iExists x. Φ x iLeft. iSplitL "HP". (2/2) + iAssumption. "HP" : P + "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a 3

  10. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "H1" : Φ x iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. Φ x + 3

  11. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "H1" : Φ x iSplitL "HP". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. Φ x + iAssumption. 3

  12. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : This subproof is complete , but there are some unfocused goals : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . (1/1) iIntros "[HP H]". "HP" : P iDestruct "H" as (x) "[H1|H2]". "H2" : Ψ x - iExists x. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ iLeft. ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a iSplitL "HP". + iAssumption. + iAssumption. 3

  13. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : This subproof is complete , but there are some unfocused goals : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . (1/1) iIntros "[HP H]". "HP" : P iDestruct "H" as (x) "[H1|H2]". "H2" : Ψ x - iExists x. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ iLeft. ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a iSplitL "HP". + iAssumption. + iAssumption. - 3

  14. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a - 3

  15. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a - iExists x. 3

  16. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. P ∗ Φ x ∨ P ∗ Ψ x - iExists x. 3

  17. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. P ∗ Φ x ∨ P ∗ Ψ x - iExists x. iRight. 3

  18. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. P ∗ Ψ x - iExists x. iRight. 3

  19. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ iDestruct "H" as (x) "[H1|H2]". x : A - iExists x. (1/1) iLeft. "HP" : P iSplitL "HP". "H2" : Ψ x + iAssumption. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ + iAssumption. P ∗ Ψ x - iExists x. iRight. iSplitL "HP"; iAssumption. 3

  20. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : No more subgoals . P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . iIntros "[HP H]". iDestruct "H" as (x) "[H1|H2]". - iExists x. iLeft. iSplitL "HP". + iAssumption. + iAssumption. - iExists x. iRight. iSplitL "HP"; iAssumption. 3

  21. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : No more subgoals . P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . iIntros "[HP H]". iDestruct "H" as (x) "[H1|H2]". - iExists x. iLeft. iSplitL "HP". + iAssumption. + iAssumption. - iExists x. iRight. iSplitL "HP"; iAssumption. Qed. 3

  22. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : example 1 is defined P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . Proof . iIntros "[HP H]". iDestruct "H" as (x) "[H1|H2]". - iExists x. iLeft. iSplitL "HP". + iAssumption. + iAssumption. - iExists x. iRight. iSplitL "HP"; iAssumption. Qed. 3

  23. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ (1/1) "HP" : P "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a 3

  24. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ (1/1) Logical notations overridden in scope for separation logic "HP" : P "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a 3

  25. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ (1/1) "HP" : P "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a 3

  26. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]". Φ, Ψ : A → iProp Σ Unset Printing Notations. (1/1) "HP" : P "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , P ∗ Φ a ∨ P ∗ Ψ a Notation for deeply embedded context 3

  27. Iris Proof Mode (IPM) demo Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : ofe car ( uPredC ( iResUR Σ)) iIntros "[HP H]". Φ, Ψ : forall : A , ofe car ( uPredC ( iResUR Σ)) Unset Printing Notations. (1/1) @envs entails ( uPredI ( iResUR Σ)) ( @Envs ( uPredI ( iResUR Σ)) ( @Enil ( bi car ( uPredI ( iResUR Σ)))) ( @Esnoc ( bi car ( uPredI ( iResUR Σ))) ( @Esnoc ( bi car ( uPredI ( iResUR Σ))) ( @Enil ( bi car ( uPredI ( iResUR Σ)))) ( INamed ( String ( Ascii . Ascii false false false true false false true false ) ( String ( Ascii . Ascii false false false false true false true false ) EmptyString ))) P ) ( INamed ( String ( Ascii . Ascii false false false true false false true false ) EmptyString )) ( @bi exist ( uPredI ( iResUR Σ)) A ( fun a : A = > @bi or ( uPredI ( iResUR Σ)) (Φ a ) (Ψ a )))) ( xI xH )) ( @bi exist ( uPredI ( iResUR Σ)) A ( fun a : A = > @bi or ( uPredI ( iResUR Σ)) ( @bi sep ( uPredI ( iResUR Σ)) P (Φ a )) 3

  28. The good things of Iris Proof Mode ◮ Proofs have the look and feel of Coq proofs For many Coq tactics tac , it has a variant iTac 4

  29. The good things of Iris Proof Mode ◮ Proofs have the look and feel of Coq proofs For many Coq tactics tac , it has a variant iTac ◮ Support for all features of Iris Higher-order quantification, invariants, ghost state, later ⊲ modality, . . . 4

  30. The good things of Iris Proof Mode ◮ Proofs have the look and feel of Coq proofs For many Coq tactics tac , it has a variant iTac ◮ Support for all features of Iris Higher-order quantification, invariants, ghost state, later ⊲ modality, . . . ◮ Integration with tactics for proving programs Symbolic execution tactics for weakest preconditions 4

  31. The good things of Iris Proof Mode ◮ Proofs have the look and feel of Coq proofs For many Coq tactics tac , it has a variant iTac ◮ Support for all features of Iris Higher-order quantification, invariants, ghost state, later ⊲ modality, . . . ◮ Integration with tactics for proving programs Symbolic execution tactics for weakest preconditions ◮ It scales to non-trivial projects ◮ Safety of Rust and its standard libraries [Jung et. al. , POPL’18] ◮ Encapsulation of the ST monad [Timany et. al. , POPL’18] ◮ A calculus for program refinements [Frumin et. al. , LICS’18] ◮ Verification of object capability patterns [Swasey et. al. , OOPSLA’17] ◮ Soundness of a logic for weak memory [Kaiser et. al. , ECOOP’17] 4

  32. The bad thing of Iris Proof Mode The implementation is tied to Iris 5

  33. The bad thing of Iris Proof Mode The implementation is tied to Iris Iris Proof Mode 5

  34. The bad thing of Iris Proof Mode The implementation is tied to Iris Iris Proof Mode Our contribution: MoSeL: A General, Extensible Modal Framework for Interactive Proofs in Separation Logic ROBBERT KREBBERS, Delft University of Technology, The Netherlands JACQUES-HENRI JOURDAN, LRI, Univ. Paris-Sud, CNRS, Université Paris-Saclay, France RALF JUNG, MPI-SWS, Germany JOSEPH TASSAROTTI, Carnegie Mellon University, USA JAN-OLIVER KAISER, MPI-SWS, Germany AMIN TIMANY, imec-Distrinet, KU Leuven, Belgium ARTHUR CHARGUÉRAUD, Inria & Université de Strasbourg, CNRS, ICube, France DEREK DREYER, MPI-SWS, Germany A number of tools have been developed for carrying out separation-logic proofs mechanically using an interactive proof assistant. One of the most advanced such tools is the Iris Proof Mode (IPM) for Coq, which ofgers a rich set of tactics for making separation-logic proofs look and feel like ordinary Coq proofs. However, IPM is tied to a particular separation logic (namely, Iris), thus limiting its applicability. In this paper, we propose MoSeL, a general and extensible Coq framework that brings the benefjts of IPM to 5

  35. Making IPM independent of Iris (1) [. . . ] we believe that our proof mode is very generic, and can be applied to a variety of different embedded logics [. . . ] [Krebbers et. al. , POPL’17] 6

  36. Making IPM independent of Iris (2) Doing it in a generic fashion turned out to be challenging: ◮ Iris is affine, not all separation logics are affine P ∗ Q ⊢ P (affine) MoSeL supports general and affine separation logics, and mixtures thereof 7

  37. Making IPM independent of Iris (2) Doing it in a generic fashion turned out to be challenging: ◮ Iris is affine, not all separation logics are affine P ∗ Q ⊢ P (affine) MoSeL supports general and affine separation logics, and mixtures thereof ◮ IPM has hard-wired support for Iris’s connectives, but other logics have other bespoke connectives MoSeL is parametric in the connectives/modalities of the logic 7

  38. Making IPM independent of Iris (2) Doing it in a generic fashion turned out to be challenging: ◮ Iris is affine, not all separation logics are affine P ∗ Q ⊢ P (affine) MoSeL supports general and affine separation logics, and mixtures thereof ◮ IPM has hard-wired support for Iris’s connectives, but other logics have other bespoke connectives MoSeL is parametric in the connectives/modalities of the logic ◮ Some separation logics ( e.g. iGPS) are encoded in terms of another ( e.g. Iris), and mix both levels of abstraction MoSeL’s tactics allow reasoning in a mixture of logics 7

  39. Making IPM independent of Iris (2) Doing it in a generic fashion turned out to be challenging: ◮ Iris is affine, not all separation logics are affine P ∗ Q ⊢ P (affine) MoSeL supports general and affine separation logics, and mixtures thereof ◮ IPM has hard-wired support for Iris’s connectives, but other logics have other bespoke connectives MoSeL is parametric in the connectives/modalities of the logic ◮ Some separation logics ( e.g. iGPS) are encoded in terms of another ( e.g. Iris), and mix both levels of abstraction MoSeL’s tactics allow reasoning in a mixture of logics ◮ Lots of Coq engineering to make it actually usable Backwards compatibility with IPM, performance, error messages, . . . 7

  40. Part #1 : Basic tactics in IPM/MoSeL 8

  41. Embedding separation logic entailments into Coq Visible goal (with pretty printing): x : � � φ Variables and pure Coq hypotheses Π Spatial separation logic hypotheses − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −∗ R Separation logic goal 9

  42. Embedding separation logic entailments into Coq Visible goal (with pretty printing): x : � � φ Variables and pure Coq hypotheses Π Spatial separation logic hypotheses − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − −∗ R Separation logic goal Actual Coq goal (without pretty printing): x : � � φ Π � Q Π � Q � ∗ Π ⊢ Q Where: 9

  43. Example: the iSplitL / iSplitR tactic Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]" . Φ, Ψ : A → iProp Σ iDestruct "H" as ( x ) "[H1|H2]" . x : A − iExists x . (1/1) iLeft . "HP" : P "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Φ x 10

  44. Example: the iSplitL / iSplitR tactic Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 1 subgoal P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]" . Φ, Ψ : A → iProp Σ iDestruct "H" as ( x ) "[H1|H2]" . x : A − iExists x . (1/1) iLeft . "HP" : P iSplitL "HP". "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Φ x 10

  45. Example: the iSplitL / iSplitR tactic Lemma example 1 { A } ( P : iProp Σ) (Φ Ψ : A → iProp Σ) : 2 subgoals P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , ( P ∗ Φ a ) ∨ ( P ∗ Ψ a ) . A : Type Proof . P : iProp Σ iIntros "[HP H]" . Φ, Ψ : A → iProp Σ iDestruct "H" as ( x ) "[H1|H2]" . x : A − iExists x . (1/2) iLeft . "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P (2/2) "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x 10

  46. Example: Implementation of the iSplitL / iSplitR tactic Tactics implemented by reflection as mere lemmas: Lemma tac sep split Π Π 1 Π 2 lr js Q 1 Q 2 : Π 1 � Q 1 Π 2 � Q 2 envs split lr js Π = Some (Π 1 ,Π 2 ) → (Π 1 ⊢ Q 1 ) → (Π 2 ⊢ Q 2 ) → Π ⊢ Q 1 ∗ Q 2 . Π 1 , Π 2 � Q 1 ∗ Q 2 11

  47. Example: Implementation of the iSplitL / iSplitR tactic Tactics implemented by reflection as mere lemmas: Lemma tac sep split Π Π 1 Π 2 lr js Q 1 Q 2 : Π 1 � Q 1 Π 2 � Q 2 envs split lr js Π = Some (Π 1 ,Π 2 ) → (Π 1 ⊢ Q 1 ) → (Π 2 ⊢ Q 2 ) → Π ⊢ Q 1 ∗ Q 2 . Π 1 , Π 2 � Q 1 ∗ Q 2 Context splitting implemented as a computable Coq function 11

  48. Example: Implementation of the iSplitL / iSplitR tactic Tactics implemented by reflection as mere lemmas: Lemma tac sep split Π Π 1 Π 2 lr js Q 1 Q 2 : Π 1 � Q 1 Π 2 � Q 2 envs split lr js Π = Some (Π 1 ,Π 2 ) → (Π 1 ⊢ Q 1 ) → (Π 2 ⊢ Q 2 ) → Π ⊢ Q 1 ∗ Q 2 . Π 1 , Π 2 � Q 1 ∗ Q 2 Context splitting implemented as a computable Coq function Ltac wrappers around the reflective tactic: Tactic Notation "iSplitL" constr ( Hs ) := let Hs := words Hs in let Hs := eval vm compute in ( INamed < $ > Hs ) in eapply tac sep split with Left Hs ; [ pm reflexivity | | fail "iSplitL: hypotheses" Hs "not found" | (* goal 1 *) | (* goal 2 *) ] . 11

  49. Example: Implementation of the iSplitL / iSplitR tactic Tactics implemented by reflection as mere lemmas: Lemma tac sep split Π Π 1 Π 2 lr js Q 1 Q 2 : Π 1 � Q 1 Π 2 � Q 2 envs split lr js Π = Some (Π 1 ,Π 2 ) → (Π 1 ⊢ Q 1 ) → (Π 2 ⊢ Q 2 ) → Π ⊢ Q 1 ∗ Q 2 . Π 1 , Π 2 � Q 1 ∗ Q 2 Context splitting implemented as a computable Coq function Ltac wrappers around the reflective tactic: Tactic Notation "iSplitL" constr ( Hs ) := let Hs := words Hs in let Hs := eval vm compute in ( INamed < $ > Hs ) in eapply tac sep split with Left Hs ; [ pm reflexivity | | fail "iSplitL: hypotheses" Hs "not found" | (* goal 1 *) | (* goal 2 *) ] . Report sensible error to the user 11

  50. Making MoSeL separation logic independent First step: Make everything parametric in a BI logic Structure bi := Bi { bi car :> Type; : Prop → bi car; bi pure bi entails : bi car → bi car → Prop; bi forall : ∀ A, (A → bi car) → bi car; bi sep : bi car → bi car → bi car; (* other separation logic operations and axioms *) }. Notation "P ⊢ Q" := (bi entails P Q). 12

  51. Making MoSeL separation logic independent First step: Make everything parametric in a BI logic Structure bi := Bi { bi car :> Type; : Prop → bi car; bi pure bi entails : bi car → bi car → Prop; bi forall : ∀ A, (A → bi car) → bi car; bi sep : bi car → bi car → bi car; (* other separation logic operations and axioms *) }. Notation "P ⊢ Q" := (bi entails P Q). Record envs (PROP : bi) := Envs { env spatial : env PROP; (* the spatial context Π *) env counter : positive (* a counter for fresh name generation *) }. Definition envs entails {PROP} ( ∆ : envs PROP) (Q : PROP) : Prop := � envs wf ∆ � ∧ [ ∗ ] env spatial ∆ ⊢ Q. 12

  52. Making MoSeL separation logic independent First step: Make everything parametric in a BI logic Structure bi := Bi { bi car :> Type; : Prop → bi car; bi pure bi entails : bi car → bi car → Prop; bi forall : ∀ A, (A → bi car) → bi car; bi sep : bi car → bi car → bi car; (* other separation logic operations and axioms *) }. Notation "P ⊢ Q" := (bi entails P Q). Record envs (PROP : bi) := Envs { env spatial : env PROP; (* the spatial context Π *) env counter : positive (* a counter for fresh name generation *) }. Definition envs entails {PROP} ( ∆ : envs PROP) (Q : PROP) : Prop := � envs wf ∆ � ∧ [ ∗ ] env spatial ∆ ⊢ Q. fact: primitive records provide a significant performance boost Useful 12

  53. Part #2 : Affine versus general BI logics P ∗ Q ⊢ P 13

  54. Affinety in IPM tactics Problem: many IPM tactics relied on affinety of Iris P ∗ Q ⊢ P (affine) For example: iClear iAssumption Π � Q Π , P � P Π , P � Q 14

  55. Affinety in IPM tactics Problem: many IPM tactics relied on affinety of Iris P ∗ Q ⊢ P (affine) For example: iClear iAssumption Π � Q Π , P � P Π , P � Q Many logics ( e.g. CFML and CHL) are not affine, MoSeL should support them 14

  56. What to do with these tactics? We cannot remove these tactics: ◮ That destroys backwards compatibility with IPM 15

  57. What to do with these tactics? We cannot remove these tactics: ◮ That destroys backwards compatibility with IPM We cannot include these tactics just for affine logics: ◮ Some logics use a mixture of affine and linear resources For example: Fairis [Tassarotti et. al., ESOP’17] 15

  58. What to do with these tactics? We cannot remove these tactics: ◮ That destroys backwards compatibility with IPM We cannot include these tactics just for affine logics: ◮ Some logics use a mixture of affine and linear resources For example: Fairis [Tassarotti et. al., ESOP’17] Better solution: add precise side-conditions to these tactics 15

  59. Affine and absorbing propositions Two classes of propositions: affine( P ) � P ⊢ emp (propositions that can be “thrown away”) absorbing( Q ) � Q ∗ True ⊢ Q (propositions that can “suck up others”) The new tactics: iAssumption iClear Π � Q affine( P ) or absorbing( Q ) affine(Π) or absorbing( Q ) Π , P � Q Π , Q � Q 16

  60. Affine and absorbing propositions Two classes of propositions: affine( P ) � P ⊢ emp (propositions that can be “thrown away”) absorbing( Q ) � Q ∗ True ⊢ Q (propositions that can “suck up others”) The new tactics: iAssumption iClear Π � Q affine( P ) or absorbing( Q ) affine(Π) or absorbing( Q ) Π , P � Q Π , Q � Q Key features: ◮ Full backwards compatibility with Iris: all Iris propositions are affine and absorbing because emp � True in Iris ◮ Provides support for logics with both linear and affine resources 16

  61. Affine and absorbing propositions in Coq Type classes: Class Affine {PROP : bi} (Q : PROP) := affine : Q ⊢ emp. Class Absorbing {PROP : bi} (P : PROP) := absorbing : <absorb> P ⊢ P. (* where <absorb> P := P ∗ True *) Instances: ◮ To capture that both classes are closed under most connectives ◮ To allow logics to tell MoSeL that their bespoke connectives are affine/absorbing Tactics are parameterized by said type classes: Lemma tac clear ∆ ∆ ’ i p P Q : envs lookup delete true i ∆ = Some (p,P, ∆ ’) → (if p then TCTrue else TCOr (Affine P) (Absorbing Q)) → envs entails ∆ ’ Q → envs entails ∆ Q. 17

  62. Part #3 : Intuitionistic propositions � P ⊢ � P ∗ � P 18

  63. Classes of separation logic propositions in MoSeL Kind # of times it should be used Arbitrary proposition 1 times Affine proposition 0-1 times 19

  64. Classes of separation logic propositions in MoSeL Kind # of times it should be used Arbitrary proposition 1 times Affine proposition 0-1 times Persistent proposition 1- n times 19

  65. Classes of separation logic propositions in MoSeL Kind # of times it should be used Arbitrary proposition 1 times Affine proposition 0-1 times Persistent proposition 1- n times Intuitionistic proposition 0- n times (= affine & persistent) 19

  66. Classes of separation logic propositions in MoSeL Kind # of times it should be used Arbitrary proposition 1 times Affine proposition 0-1 times Persistent proposition 1- n times Intuitionistic proposition 0- n times (= affine & persistent) Persistent/intuitionistic propositions are common (especially in Iris derivatives) ⇒ MoSeL needs special support for them 19

  67. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP Persistent0 : Persistent P Affine0 : Affine P Φ, Ψ : A → PROP (1/1) P ∗ ( ∃ a : A , Φ a ∨ Ψ a ) − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  68. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P Affine0 : Affine P Φ, Ψ : A → PROP (1/1) P ∗ ( ∃ a : A , Φ a ∨ Ψ a ) − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  69. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P Affine0 : Affine P Φ, Ψ : A → PROP (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  70. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P Φ, Ψ : A → PROP (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H" : ∃ a : A , Φ a ∨ Ψ a − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  71. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 2 subgoals ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P Φ, Ψ : A → PROP x : A (1/2) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a (2/2) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  72. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 2 subgoals ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - Φ, Ψ : A → PROP x : A (1/2) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a (2/2) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  73. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - Φ, Ψ : A → PROP x : A (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  74. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP x : A (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  75. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP x : A (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x ∨ P ∗ P ∗ Ψ x 20

  76. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x ∨ P ∗ P ∗ Ψ x 20

  77. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x 20

  78. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H1" : Φ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x 20

  79. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) This subproof is complete , but there are some unfocused goals : ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . (1/1) Proof . "HP" : P iIntros "[#HP H]". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � iDestruct "H" as (x) "[H1|H2]". "H2" : Ψ x - iExists x. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ iLeft. ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a iAssumption. 20

  80. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) This subproof is complete , but there are some unfocused goals : ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . (1/1) Proof . "HP" : P iIntros "[#HP H]". − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � iDestruct "H" as (x) "[H1|H2]". "H2" : Ψ x - iExists x. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ iLeft. ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a iAssumption. - 20

  81. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  82. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - iExists x. "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ ∃ a : A , Φ a ∨ P ∗ P ∗ Ψ a 20

  83. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - iExists x. "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x ∨ P ∗ P ∗ Ψ x 20

  84. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - iExists x. "HP" : P iRight. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ Φ x ∨ P ∗ P ∗ Ψ x 20

  85. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - iExists x. "HP" : P iRight. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ P ∗ Ψ x 20

  86. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 1 subgoal ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/1) - iExists x. "HP" : P iRight. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � iSplitR. "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ P ∗ Ψ x 20

  87. Intuitionistic propositions in action Lemma example 3 { PROP : bi } { A } ( P : PROP ) 2 subgoals ‘ { ! Persistent P , ! Affine P } (Φ Ψ : A → PROP ) : PROP : bi P ∗ ( ∃ a , Φ a ∨ Ψ a ) − ∗ ∃ a , Φ a ∨ ( P ∗ P ∗ Ψ a ) . A : Type Proof . P : PROP iIntros "[#HP H]". Persistent0 : Persistent P iDestruct "H" as (x) "[H1|H2]". Affine0 : Affine P - iExists x. Φ, Ψ : A → PROP iLeft. x : A iAssumption. (1/2) - iExists x. "HP" : P iRight. − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � iSplitR. P (2/2) "HP" : P − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − � "H2" : Ψ x − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − − ∗ P ∗ Ψ x 20

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend