Commit 984313aa authored by Ralf Jung's avatar Ralf Jung

docs: check HOL and BI rules; sync with Coq

parent 6a9642c0
Pipeline #270 passed with stage
...@@ -703,9 +703,10 @@ Proof. ...@@ -703,9 +703,10 @@ Proof.
exists x, x'; split_and?; auto. exists x, x'; split_and?; auto.
eapply uPred_weaken with n x; eauto using cmra_validN_op_l. eapply uPred_weaken with n x; eauto using cmra_validN_op_l.
Qed. Qed.
Lemma wand_elim_l P Q : ((P - Q) P) Q. Lemma wand_elim_l' P Q R : P (Q - R) (P Q) R.
Proof. Proof.
unseal; split; intros n x ? (x1&x2&Hx&HPQ&?); cofe_subst; by apply HPQ. unseal =>HPQR. split; intros n x ? (?&?&?&?&?). cofe_subst.
eapply HPQR; eauto using cmra_validN_op_l.
Qed. Qed.
(* Derived BI Stuff *) (* Derived BI Stuff *)
...@@ -720,7 +721,9 @@ Global Instance sep_flip_mono' : ...@@ -720,7 +721,9 @@ Global Instance sep_flip_mono' :
Proper (flip () ==> flip () ==> flip ()) (@uPred_sep M). Proper (flip () ==> flip () ==> flip ()) (@uPred_sep M).
Proof. by intros P P' HP Q Q' HQ; apply sep_mono. Qed. Proof. by intros P P' HP Q Q' HQ; apply sep_mono. Qed.
Lemma wand_mono P P' Q Q' : Q P P' Q' (P - P') (Q - Q'). Lemma wand_mono P P' Q Q' : Q P P' Q' (P - P') (Q - Q').
Proof. intros HP HQ; apply wand_intro_r; rewrite HP -HQ; apply wand_elim_l. Qed. Proof.
intros HP HQ; apply wand_intro_r. rewrite HP -HQ. by apply wand_elim_l'.
Qed.
Global Instance wand_mono' : Proper (flip () ==> () ==> ()) (@uPred_wand M). Global Instance wand_mono' : Proper (flip () ==> () ==> ()) (@uPred_wand M).
Proof. by intros P P' HP Q Q' HQ; apply wand_mono. Qed. Proof. by intros P P' HP Q Q' HQ; apply wand_mono. Qed.
...@@ -745,10 +748,10 @@ Lemma sep_elim_True_r P Q R : True ⊑ P → (R ★ P) ⊑ Q → R ⊑ Q. ...@@ -745,10 +748,10 @@ Lemma sep_elim_True_r P Q R : True ⊑ P → (R ★ P) ⊑ Q → R ⊑ Q.
Proof. by intros HP; rewrite -HP right_id. Qed. Proof. by intros HP; rewrite -HP right_id. Qed.
Lemma wand_intro_l P Q R : (Q P) R P (Q - R). Lemma wand_intro_l P Q R : (Q P) R P (Q - R).
Proof. rewrite comm; apply wand_intro_r. Qed. Proof. rewrite comm; apply wand_intro_r. Qed.
Lemma wand_elim_l P Q : ((P - Q) P) Q.
Proof. by apply wand_elim_l'. Qed.
Lemma wand_elim_r P Q : (P (P - Q)) Q. Lemma wand_elim_r P Q : (P (P - Q)) Q.
Proof. rewrite (comm _ P); apply wand_elim_l. Qed. Proof. rewrite (comm _ P); apply wand_elim_l. Qed.
Lemma wand_elim_l' P Q R : P (Q - R) (P Q) R.
Proof. intros ->; apply wand_elim_l. Qed.
Lemma wand_elim_r' P Q R : Q (P - R) (P Q) R. Lemma wand_elim_r' P Q R : Q (P - R) (P Q) R.
Proof. intros ->; apply wand_elim_r. Qed. Proof. intros ->; apply wand_elim_r. Qed.
Lemma wand_apply_l P Q Q' R R' : P (Q' - R') R' R Q Q' (P Q) R. Lemma wand_apply_l P Q Q' R R' : P (Q' - R') R' R Q Q' (P Q) R.
......
...@@ -87,14 +87,13 @@ Iris syntax is built up from a signature $\Sig$ and a countably infinite set $\t ...@@ -87,14 +87,13 @@ Iris syntax is built up from a signature $\Sig$ and a countably infinite set $\t
\type \to \type \type \to \type
\\[0.4em] \\[0.4em]
\term, \prop, \pred ::={}& \term, \prop, \pred ::={}&
x \mid \var \mid
\sigfn(\term_1, \dots, \term_n) \mid \sigfn(\term_1, \dots, \term_n) \mid
\unitval \mid \unitval \mid
(\term, \term) \mid (\term, \term) \mid
\pi_i\; \term \mid \pi_i\; \term \mid
\Lam x.\term \mid \Lam \var:\type.\term \mid
\term(\term) \mid \term(\term) \mid
\mzero \mid
\munit \mid \munit \mid
\term \mtimes \term \mid \term \mtimes \term \mid
\\& \\&
...@@ -107,7 +106,7 @@ Iris syntax is built up from a signature $\Sig$ and a countably infinite set $\t ...@@ -107,7 +106,7 @@ Iris syntax is built up from a signature $\Sig$ and a countably infinite set $\t
\prop * \prop \mid \prop * \prop \mid
\prop \wand \prop \mid \prop \wand \prop \mid
\\& \\&
\MU \var. \pred \mid \MU \var:\type. \pred \mid
\Exists \var:\type. \prop \mid \Exists \var:\type. \prop \mid
\All \var:\type. \prop \mid \All \var:\type. \prop \mid
\\& \\&
...@@ -226,10 +225,10 @@ In writing $\vctx, x:\type$, we presuppose that $x$ is not already declared in $ ...@@ -226,10 +225,10 @@ In writing $\vctx, x:\type$, we presuppose that $x$ is not already declared in $
{\vctx \proves \wtt{\prop \wand \propB}{\Prop}} {\vctx \proves \wtt{\prop \wand \propB}{\Prop}}
\and \and
\infer{ \infer{
\vctx, \var:\type\to\Prop \proves \wtt{\pred}{\type\to\Prop} \and \vctx, \var:\type \proves \wtt{\term}{\type} \and
\text{$\var$ is guarded in $\pred$} \text{$\var$ is guarded in $\term$}
}{ }{
\vctx \proves \wtt{\MU \var. \pred}{\type\to\Prop} \vctx \proves \wtt{\MU \var:\type. \term}{\type}
} }
\and \and
\infer{\vctx, x:\type \proves \wtt{\prop}{\Prop}} \infer{\vctx, x:\type \proves \wtt{\prop}{\Prop}}
...@@ -285,24 +284,36 @@ This is a \emph{meta-level} assertions about propositions, defined by the follow ...@@ -285,24 +284,36 @@ This is a \emph{meta-level} assertions about propositions, defined by the follow
\subsection{Proof rules} \subsection{Proof rules}
\ralf{Go on checking below.}
The judgment $\vctx \mid \pfctx \proves \prop$ says that with free variables $\vctx$, proposition $\prop$ holds whenever all assumptions $\pfctx$ hold. The judgment $\vctx \mid \pfctx \proves \prop$ says that with free variables $\vctx$, proposition $\prop$ holds whenever all assumptions $\pfctx$ hold.
We implicitly assume that an arbitrary variable context, $\vctx$, is added to every constituent of the rules. We implicitly assume that an arbitrary variable context, $\vctx$, is added to every constituent of the rules.
Axioms $\prop \Ra \propB$ stand for judgments $\vctx \mid \cdot \proves \prop \Ra \propB$ with no assumptions. Axioms $\prop \Ra \propB$ stand for judgments $\vctx \mid \cdot \proves \prop \Ra \propB$ with no assumptions.
(Bi-implications are analogous.) (Bi-implications are analogous.)
\judgment{}{\vctx \mid \pfctx \proves \prop}
\paragraph{Laws of intuitionistic higher-order logic.} \paragraph{Laws of intuitionistic higher-order logic.}
This is entirely standard. This is entirely standard.
\begin{mathpar} \begin{mathparpagebreakable}
\inferH{Asm} \infer[Asm]
{\prop \in \pfctx} {\prop \in \pfctx}
{\pfctx \proves \prop} {\pfctx \proves \prop}
\and \and
\inferH{Eq} \infer[Eq]
{\pfctx \proves \prop(\term) \\ \pfctx \proves \term = \term'} {\pfctx \proves \prop(\term) \\ \pfctx \proves \term =_\type \term'}
{\pfctx \proves \prop(\term')} {\pfctx \proves \prop(\term')}
\and \and
\infer[Refl]
{}
{\pfctx \proves \term =_\type \term}
\and
\infer[$\bot$E]
{\pfctx \proves \FALSE}
{\pfctx \proves \prop}
\and
\infer[$\top$I]
{}
{\pfctx \proves \TRUE}
\and
\infer[$\wedge$I] \infer[$\wedge$I]
{\pfctx \proves \prop \\ \pfctx \proves \propB} {\pfctx \proves \prop \\ \pfctx \proves \propB}
{\pfctx \proves \prop \wedge \propB} {\pfctx \proves \prop \wedge \propB}
...@@ -315,12 +326,6 @@ This is entirely standard. ...@@ -315,12 +326,6 @@ This is entirely standard.
{\pfctx \proves \prop \wedge \propB} {\pfctx \proves \prop \wedge \propB}
{\pfctx \proves \propB} {\pfctx \proves \propB}
\and \and
\infer[$\vee$E]
{\pfctx \proves \prop \vee \propB \\
\pfctx, \prop \proves \propC \\
\pfctx, \propB \proves \propC}
{\pfctx \proves \propC}
\and
\infer[$\vee$IL] \infer[$\vee$IL]
{\pfctx \proves \prop } {\pfctx \proves \prop }
{\pfctx \proves \prop \vee \propB} {\pfctx \proves \prop \vee \propB}
...@@ -329,6 +334,12 @@ This is entirely standard. ...@@ -329,6 +334,12 @@ This is entirely standard.
{\pfctx \proves \propB} {\pfctx \proves \propB}
{\pfctx \proves \prop \vee \propB} {\pfctx \proves \prop \vee \propB}
\and \and
\infer[$\vee$E]
{\pfctx \proves \prop \vee \propB \\
\pfctx, \prop \proves \propC \\
\pfctx, \propB \proves \propC}
{\pfctx \proves \propC}
\and
\infer[$\Ra$I] \infer[$\Ra$I]
{\pfctx, \prop \proves \propB} {\pfctx, \prop \proves \propB}
{\pfctx \proves \prop \Ra \propB} {\pfctx \proves \prop \Ra \propB}
...@@ -337,82 +348,50 @@ This is entirely standard. ...@@ -337,82 +348,50 @@ This is entirely standard.
{\pfctx \proves \prop \Ra \propB \\ \pfctx \proves \prop} {\pfctx \proves \prop \Ra \propB \\ \pfctx \proves \prop}
{\pfctx \proves \propB} {\pfctx \proves \propB}
\and \and
\infer[$\forall_1$I] \infer[$\forall$I]
{\pfctx, x : \sort \proves \prop} { \vctx,\var : \type\mid\pfctx \proves \prop}
{\pfctx \proves \forall x: \sort.\; \prop} {\vctx\mid\pfctx \proves \forall \var: \type.\; \prop}
\and
\infer[$\forall_1$E]
{\pfctx \proves \forall X \in \sort.\; \prop \\
\pfctx \proves \term: \sort}
{\pfctx \proves \prop[\term/X]}
\and
\infer[$\exists_1$E]
{\pfctx \proves \exists X\in \sort.\; \prop \\
\pfctx, X : \sort, \prop \proves \propB}
{\pfctx \proves \propB}
\and
\infer[$\exists_1$I]
{\pfctx \proves \prop[\term/X] \\
\pfctx \proves \term: \sort}
{\pfctx \proves \exists X: \sort. \prop}
\and
\infer[$\forall_2$I]
{\pfctx, \var: \Pred(\sort) \proves \prop}
{\pfctx \proves \forall \var\in \Pred(\sort).\; \prop}
\and \and
\infer[$\forall_2$E] \infer[$\forall$E]
{\pfctx \proves \forall \var. \prop \\ {\vctx\mid\pfctx \proves \forall \var :\type.\; \prop \\
\pfctx \proves \propB: \Prop} \vctx \proves \wtt\term\type}
{\pfctx \proves \prop[\propB/\var]} {\vctx\mid\pfctx \proves \prop[\term/\var]}
\and \and
\infer[$\exists_2$E] \infer[$\exists$I]
{\pfctx \proves \exists \var \in \Pred(\sort).\prop \\ {\vctx\mid\pfctx \proves \prop[\term/\var] \\
\pfctx, \var : \Pred(\sort), \prop \proves \propB} \vctx \proves \wtt\term\type}
{\pfctx \proves \propB} {\vctx\mid\pfctx \proves \exists \var: \type. \prop}
\and \and
\infer[$\exists_2$I] \infer[$\exists$E]
{\pfctx \proves \prop[\propB/\var] \\ {\vctx\mid\pfctx \proves \exists \var: \type.\; \prop \\
\pfctx \proves \propB: \Prop} \vctx,\var : \type\mid\pfctx , \prop \proves \propB}
{\pfctx \proves \exists \var. \prop} {\vctx\mid\pfctx \proves \propB}
\and \and
\inferB[Elem] \infer[$\lambda$]
{\pfctx \proves \term \in (X \in \sort). \prop} {}
{\pfctx \proves \prop[\term/X]} {\pfctx \proves (\Lam\var: \type. \prop)(\term) =_{\type\to\type'} \prop[\term/\var]}
\and \and
\inferB[Elem-$\mu$] \infer[$\mu$]
{\pfctx \proves \term \in (\mu\var \in \Pred(\sort). \pred)} {}
{\pfctx \proves \term \in \pred[\mu\var \in \Pred(\sort). \pred/\var]} {\pfctx \proves \mu\var: \type. \prop =_{\type} \prop[\mu\var: \type. \prop/\var]}
\end{mathpar} \end{mathparpagebreakable}
\paragraph{Laws of (affine) bunched implications.} \paragraph{Laws of (affine) bunched implications.}
\begin{mathpar} \begin{mathpar}
\begin{array}{rMcMl} \begin{array}{rMcMl}
\TRUE * \prop &\Lra& \prop \\
\prop * \propB &\Lra& \propB * \prop \\ \prop * \propB &\Lra& \propB * \prop \\
(\prop * \propB) * \propC &\Lra& \prop * (\propB * \propC) \\ (\prop * \propB) * \propC &\Lra& \prop * (\propB * \propC)
\prop * \propB &\Ra& \prop
\end{array}
\and
\begin{array}{rMcMl}
(\prop \vee \propB) * \propC &\Lra&
(\prop * \propC) \vee (\propB * \propC) \\
(\prop \wedge \propB) * \propC &\Ra&
(\prop * \propC) \wedge (\propB * \propC) \\
(\Exists x. \prop) * \propB &\Lra& \Exists x. (\prop * \propB) \\
(\All x. \prop) * \propB &\Ra& \All x. (\prop * \propB)
\end{array} \end{array}
\and \and
\infer \infer
{\pfctx, \prop_1 \proves \propB_1 \and {\prop_1 \proves \propB_1 \and
\pfctx, \prop_2 \proves \propB_2} \prop_2 \proves \propB_2}
{\pfctx, \prop_1 * \prop_2 \proves \propB_1 * \propB_2} {\prop_1 * \prop_2 \proves \propB_1 * \propB_2}
\and \and
\infer \inferB
{\pfctx, \prop * \propB \proves \propC} {\prop * \propB \proves \propC}
{\pfctx, \prop \proves \propB \wand \propC} {\prop \proves \propB \wand \propC}
\and
\infer
{\pfctx, \prop \proves \propB \wand \propC}
{\pfctx, \prop * \propB \proves \propC}
\end{mathpar} \end{mathpar}
\paragraph{Laws for ghosts and physical resources.} \paragraph{Laws for ghosts and physical resources.}
...@@ -420,18 +399,18 @@ This is entirely standard. ...@@ -420,18 +399,18 @@ This is entirely standard.
\begin{mathpar} \begin{mathpar}
\begin{array}{rMcMl} \begin{array}{rMcMl}
\ownGGhost{\melt} * \ownGGhost{\meltB} &\Lra& \ownGGhost{\melt \mtimes \meltB} \\ \ownGGhost{\melt} * \ownGGhost{\meltB} &\Lra& \ownGGhost{\melt \mtimes \meltB} \\
\TRUE &\Ra& \ownGGhost{\munit}\\ %\TRUE &\Ra& \ownGGhost{\munit}\\
\ownGGhost{\mzero} &\Ra& \FALSE\\ \ownGGhost{\melt} &\Ra& \melt \in \mval % * \ownGGhost{\melt}
\multicolumn{3}{c}{\timeless{\ownGGhost{\melt}}}
\end{array} \end{array}
\and \and
\begin{array}{c} \begin{array}{c}
\ownPhys{\state} * \ownPhys{\state'} \Ra \FALSE \\ \ownPhys{\state} * \ownPhys{\state'} \Ra \FALSE
\timeless{\ownPhys{\state}}
\end{array} \end{array}
\end{mathpar} \end{mathpar}
\paragraph{Laws for the later modality.} \paragraph{Laws for the later modality.}
~\\\ralf{Go on checking below.}
\begin{mathpar} \begin{mathpar}
\inferH{Mono} \inferH{Mono}
...@@ -466,7 +445,7 @@ This is entirely standard. ...@@ -466,7 +445,7 @@ This is entirely standard.
{\always{\pfctx} \proves \always{\prop}} {\always{\pfctx} \proves \always{\prop}}
\and \and
\begin{array}[b]{rMcMl} \begin{array}[b]{rMcMl}
\always(\term =_\sort \termB) &\Lra& \term=_\sort \termB \\ \always(\term =_\type \termB) &\Lra& \term=_\type \termB \\
\always{\prop} * \propB &\Lra& \always{\prop} \land \propB \\ \always{\prop} * \propB &\Lra& \always{\prop} \land \propB \\
\always{(\prop \Ra \propB)} &\Ra& \always{\prop} \Ra \always{\propB} \\ \always{(\prop \Ra \propB)} &\Ra& \always{\prop} \Ra \always{\propB} \\
\end{array} \end{array}
......
...@@ -260,7 +260,6 @@ ...@@ -260,7 +260,6 @@
\newcommand{\mcar}[1]{|#1|} \newcommand{\mcar}[1]{|#1|}
\newcommand{\mcarp}[1]{\mcar{#1}^{+}} \newcommand{\mcarp}[1]{\mcar{#1}^{+}}
\newcommand{\mzero}{\bot}
\newcommand{\munit}{\mathord{\varepsilon}} \newcommand{\munit}{\mathord{\varepsilon}}
\newcommand{\mtimes}{\mathbin{\cdot}} \newcommand{\mtimes}{\mathbin{\cdot}}
\newcommand{\mdiv}{\mathbin{\div}} \newcommand{\mdiv}{\mathbin{\div}}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment