GaeBlogX Arista Networks, Software-Defined Networking

Computational Interpretations

Here we will talk about computational interpretations by the example of lax logic. Hope from the example we can have sense of how logic and PL are connected.

Lax and Monand

Some notations:

means $E$ as a computational evidence might not terminate. It might not give me $A$ at the end. Think of it like a “possibility” that $E$ will give me $A$.

a suspended computation of $E$.

is a kind of substitution of $E$ for $x$ in $F$. It is an operration on proof/computation. Will talk about it later.

So we have the following structural rules or judgemental rules about $lax$:



We now introduce a new proposition $\bigcirc A$ Monad:

Introduction rule ($I$):

Elimination rules ($E$):

Summarize local reduction and local expansion:

So because $E$ is type of $A\ lax$, according to the second structural rules about $lax$: , it could be comming from two places:

  1. The first structural rules about $lax$: . So $E$ is $M$.

  2. The elimination rules of $\bigcirc A$: . (Note: Here $F$ and $C$ could be anything). So $E$ is

So we write:

For the elimination rule case, we can see $\Gamma\vdash M:\bigcirc A\ true$. For something have type $\bigcirc A$, according to the Introduction rule of $\bigcirc A$, it could be that $M={E}$

Therefore, $M$ is everything as before plus one possibility:

We write:

Then we can define $<E/x>F$:

Let’s Write Some Proofs/Programs

For which is uncurrying, we have the proof:

For which is currying, we have the proof:

For monad in functional programming we have two requirements to satisfy:

such that

To proof $return$:

we have:

To proof $bind$:

we have:

To proof

we have:

Similar Posts

下一篇 Sequent Calculus