From 49df4671cf8ca518c81c2b0437d33da29171a6dc Mon Sep 17 00:00:00 2001
From: Graham
Date: Wed, 23 Aug 2023 10:33:19 -0400
Subject: [PATCH] Switch to autorender
Previously we were abusing
and we extend satisfaction (skipping classical connectives \(⊤,⊥,∧, ⇒\)):
-
S ⊨ φ\oplusψ
iff
S=T∪R where T ⊨ φ, R ⊨ ψ
+
\(S ⊨ φ\oplusψ\)
iff
\( S=T∪R\) where \(T ⊨ φ, R ⊨ ψ\)
-
S ⊨ ⊤^\oplus
iff
S=\varnothing
+
\(S ⊨ ⊤^\oplus\)
iff
\( S=\varnothing\)
@@ -124,39 +124,39 @@
Idea for a solution:
Observe:
- S ⊨ φ\oplus ⊤^\oplus just in case S ⊨ φ.
+ \(S ⊨ φ\oplus ⊤^\oplus\) just in case \(S ⊨ φ\).
- ⟨Q⟩C⟨⊤^\oplus⟩ just in case ⟦C⟧^\dagger(Q) = \varnothing
+ \(⟨Q⟩C⟨⊤^\oplus⟩\) just in case \(⟦C⟧^\dagger(Q) = \varnothing\)
- ⟨φ⟩C⟨⊥⟩ just in case ∀S, S\nvDash φ
+ \(⟨φ⟩C⟨⊥⟩\) just in case \(∀S, S\nvDash φ \)
-
Holds just in case given a set of states
- satisfying φ, ⟦C⟧^\dagger produces
- either a set of states satisfying ψ, or the empty
+ satisfying \(φ\), \(⟦C⟧^\dagger\) produces
+ either a set of states satisfying \(ψ\), or the empty
set.
-
⟨φ⟩C⟨p\oplus
- ⊤⟩ expresses under-approximation.
holds just in
- case every set of states satisfying φ
- contains some member that ⟦C⟧ sends to
- a state contained in v(p).
Given a concrete Σ, concrete command language generating
- C, and concrete atoms p, you can
+
Given a concrete \(Σ\), concrete command language generating
+ \(C\), and concrete atoms \(p\), you can
equip OL with a sound proof system to reason about the above.
@@ -167,31 +167,31 @@
Idea for a solution:
Corollary to big theorem:
Nondeterministic OL can falsify HL triples
-
we have \nvDash\{p\}C\{q\} just in case for some φ⇒p where φ is satisfiable, ⟨φ⟩C⟨\bar{q}\oplus ⊤⟩
-
Or anyway, this holds if C is guaranteed to terminate.
+
we have \(\nvDash\{p\}C\{q\}\) just in case for some \(φ⇒p\) where \(φ\) is satisfiable, \(⟨φ⟩C⟨\bar{q}\oplus ⊤⟩\)
+
Or anyway, this holds if \(C\) is guaranteed to terminate.
Generalizing
-
What is ⟦C⟧^\dagger?
-
Intuitively, ⟦C⟧ : Σ → 𝒫(Σ)
-
But, ⟦C⟧^\dagger : 𝒫(Σ) → 𝒫(Σ)
+
What is \(⟦C⟧^\dagger\)?
+
Intuitively, \(⟦C⟧ : Σ → 𝒫(Σ)\)
+
But, \(⟦C⟧^\dagger : 𝒫(Σ) → 𝒫(Σ)\)
So you do the obvious thing:
-
⟦C⟧^\dagger(X) := \bigcup\{⟦C⟧(x) | x ∈ X\}
+
\(⟦C⟧^\dagger(X) := \bigcup\{⟦C⟧(x) | x ∈ X\}\)
which is really a completely general construction:
-
\mathsf{bind}:𝒫(A)→(A→𝒫(B))→𝒫(B)
+
\(\mathsf{bind}:𝒫(A)→(A→𝒫(B))→𝒫(B)\)
-
It turns out that this \mathsf{bind}, along with the singleton constructor for \mathsf{unit}:A→𝒫(A), make 𝒫 a monad.
-
It also has a little bit of extra structure: ∪ and \varnothing make 𝒫(X) a commutative monoid, for any X.
+
It turns out that this \(\mathsf{bind}\), along with the singleton constructor for \(\mathsf{unit}:A→𝒫(A)\), make \(𝒫\) a monad.
+
It also has a little bit of extra structure: \(∪\) and \(\varnothing\) make \(𝒫(X)\) a commutative monoid, for any \(X\).
So, callback to earlier:
-
An execution model is a triple ⟨M,⬦,\mathbf{1}⟩, where M is a Monad, and ⬦,\mathbf{1} are the multiplication and unit providing a (partial, commutative) monoid structure on every M(X)
+
An execution model is a triple \(⟨M,⬦,\mathbf{1}⟩\), where \(M\) is a Monad, and \(⬦,\mathbf{1}\) are the multiplication and unit providing a (partial, commutative) monoid structure on every \(M(X)\)
-
Outcome logic can be made parametric on a choice of monad, M, monoid structure on each M(X), and clause for ⊨p
+
Outcome logic can be made parametric on a choice of monad, \(M\), monoid structure on each \(M(X)\), and clause for \(⊨p\)
The cash value of that fact is that:
You get a principled way of generalizing the semantics
@@ -207,18 +207,18 @@
Generalizing
-
For example, given error states E, the error
- monad is given by \mathsf{Er}_E(X) = E+X, with
- \mathsf{bind}_E propagating error states, and \mathsf{unit}_E just the right-hand inclusion.
+
For example, given error states \(E\), the error
+ monad is given by \(\mathsf{Er}_E(X) = E+X\), with
+ \(\mathsf{bind}_E\) propagating error states, and \(\mathsf{unit}_E\) just the right-hand inclusion.
-
\mathsf{Er}_E has the following nice property: there's a uniform way to
- give M \circ \mathsf{Er}_E a monad structure, for
- any monad M.
+
\(\mathsf{Er}_E\) has the following nice property: there's a uniform way to
+ give \(M \circ \mathsf{Er}_E\) a monad structure, for
+ any monad \(M\).
- So, if ⟨M,⬦,\mathbf{1}⟩ is an execution model, so is ⟨M\circ \mathsf{Er}_E,⬦,\mathbf{1}⟩.
+ So, if \(⟨M,⬦,\mathbf{1}⟩\) is an execution model, so is \(⟨M\circ \mathsf{Er}_E,⬦,\mathbf{1}⟩\).
In particular, we get an execution model for non-determinism with errors, which the authors use for non-deterministic separation logic.
diff --git a/src/deck.mjs b/src/deck.mjs
index b3caab0..d4d5b74 100644
--- a/src/deck.mjs
+++ b/src/deck.mjs
@@ -1,4 +1,5 @@
-import Katex from "https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.mjs"
+import Katex from "https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/katex.mjs";
+import renderMathInElement from "https://cdn.jsdelivr.net/npm/katex@0.16.8/dist/contrib/auto-render.mjs";
const registry = window.customElements
@@ -110,13 +111,7 @@ class RazzleDeck extends HTMLElement {
shadow.appendChild(kclone);
shadow.appendChild(svgDefs);
[...children].map(child => {
- const mathElements = child.querySelectorAll("math")
- for (let element of mathElements) {
- Katex.render(element.textContent, element, {
- throwOnError: false,
- displayMode: [...element.classList].includes("d")
- });
- };
+ renderMathInElement(child)
shadow.appendChild(child)
})