# Lecture 14: The $\bullet ; \bullet ⊢_o \bullet$ Proof System

⊢_O = ⊢_I = ⊢_C \qquad hC ⊆ hH \qquad ⊢_O = ⊢_I

Last time: $⊢_O$

• Standard R-H rules: $Σ: 𝒫 ⊢ G$
• New backchaining rules: $Σ: 𝒫 ⇓ D ⊢ \underbrace{A}_{\text{atomic}}$

e.g.

\cfrac{𝒫 ⊢ G \qquad 𝒫 ⇓ D ⊢ A}{𝒫 ⇓ G ⇒ D ⊢ A}\supseteq L
\cfrac{}{𝒫 ⇓ A ⊢ A}
\text{(contraction) }\cfrac{𝒫 ⇓ D ⊢ A}{𝒫 ⊢ A} \qquad \text{Decide } D ∈ 𝒫
\cfrac{Σ: 𝒫, D ⊢ G}{Σ: 𝒫 ⊢ D ⇒ G}

Dynamics of Proof Search: if $Σ’: 𝒫’ ⊢ A’$ appears inside the proof of $Σ: 𝒫 ⊢ A$

• If $𝒫$ is $hC$, then $Σ = Σ’, \; 𝒫 = 𝒫’$ (in other words, flat)
• If $𝒫$ is $hH$, then $Σ ⊆ Σ’, \; 𝒫 ⊆ 𝒫’$ (program and signature are “stack-based”)
\cfrac{Σ, y: τ: 𝒫 ⊢ G(x)}{Σ: 𝒫 ⊢ ∀ x_τ. G}

Program example:

kind nat type % natural
type z nat % zero
type s nat->nat % successor
kind list type
type :: nat->list->list
type nil list


We don’t have functions, but relations.

Let’s try to show

𝒫 ⊢ max \; L \; \qquad \text{ iff } \qquad L \text{ is a list and } max \; [\,] \; = 0 \\ 𝒫 ⊢ leq \; N \; M \qquad \text{ iff } \qquad N ≤ M \\ 𝒫 ⊢ greater \; N \; M \qquad \text{ iff } \qquad N > M \\
∀ N:nat. leq z N.
∀ N M:nat. leq (s N) (s M) :- leq N M.

greater N M :- leq (s M) N.

% M1
max L M :- maxx L z M. % accumulator
% M2
maxx (X :: L) A M :- leq X A, maxx L A M.
% M3
maxx (X :: L) A M :- greater X A, maxx L X M.
% M4
maxx nil A A.


NB: In Horn clause logic, it’s not possible to make a block (compacting it into one clause) out of $M_1, M_2, M_3$.

But in other logic, it is:

% M5
maxx L M :- (M2 /\ M3 /\ M4) -> maxx L z M.


and then

\infer{\underbrace{𝒫}_{M_5} ⊢ max \; [2, 3, 1] \; 3}{ \infer{𝒫 ⊢ (M_2 ∧ M_3 ∧ M_3) ⇒ maxx \; [2, 3, 1] \; 0 \; 3}{ \infer{𝒫, M_2, M_3, M_3 ⊢ maxx \; [2, 3, 1] \; 0 \; 3}{ & } } }

Another example:

\infer{𝒫_0 ⊢ 𝒫_1 ⇒ \Big(((𝒫_2 ⇒ G_2) ∨ (𝒫_3 ⇒ G_3)) ∨ G_4\Big)}{ \infer{𝒫_0, 𝒫_1, 𝒫_2 ⊢ G_2 }{ & } & \infer{𝒫_0, 𝒫_1, 𝒫_3 ⊢ G_3 }{ & } & \infer{𝒫_0, 𝒫_1 ⊢ G_4 }{ & } }

NB: note that there’s not the intended notion of scope anymore in classical logic, because $((𝒫_2 ⇒ G_2) ∨ (𝒫_3 ⇒ G_3)) \;≡\; ¬ 𝒫_2 ∨ G_2 ∨ ¬ 𝒫_3 ∨ G_3$

## Monotonicity property

Let’s say we have an abstract “container” $𝒜$:

𝒜, 𝒫 ⊢ maxa \; M \qquad \text{ if } 𝒜 = \lbrace a(n_1), …, a(n_m)\rbrace \text{ where } m ≥ 1 \text{ and } M = \max \lbrace n_1, …, n_m \rbrace

E.g.:

it’s not possible to prove that, because of the monotonicity property:

\text{ If } 𝒫 ⊆ 𝒫' \text{ and } 𝒫 ⊢ G \text{ then } 𝒫' ⊢ G

So if

a(1), a(2), 𝒫 ⊢ maxa \; 5\\ \text{ then } a(3), a(1), a(2), 𝒫 ⊢ maxa \; 5\\

### Pumping Lemma

adj ...
path ...
disconnected :- ...


⟹ not possible to prove either, because of the monotonicity property (you can add edges until something disconnected becomes connected).

# Back to Linear Logic

We will only care about the linear implication $⊸$

Recall that hH (hereditary Harrop formulas) make use of $⊤, \&, ∀, ⇒$ (no resort to $∨, ∃$).

B ⇒ C \; ≝ \; (!B) ⊸ C \;≡\; ?B^⊥ ⅋ C

When it comes to LL, we will only consider the connectives:

⊥, ⅋, ⊤, \&, ∀, ⇒, ⊸

This set of connectives is complete: all the others can be expressed in terms of these.

B^⊤ = B ⊸ ⊥\\ B ⊗ C = (B^⊥ ⅋ C^⊥)^⊥\\ !B = (B ⇒ ⊥) ⇒ ⊥\\ ?B = (B ⊸ ⊥) ⇒ ⊥ = (!(B^⊥))^⊥

But it is redundant, the par is not actually needed:

B \,⅋\, C = (B^⊥) ⊸ C = (B ⊸ ⊥) ⊸ C

### Polarity of connectives

Positives vs. Negatives

NB: $B \;≡\; C$ means $⊢ (B ⊸ C) \& (C ⊸ B)$ (or equivalently: with the tensor, as the context is empty)

What does it mean for a connective to be positive:

Assume $B \,\;≡\;\, !B \text{ and } C \,\;≡\;\, !C \\ \text{ then } \\ \begin{cases} B ⊗ C \;≡\; !(B ⊗ C) \\ B ⊕ C \;≡\; !(B ⊕ C) \\ !B \;≡\; !!B\\ 1 \;≡\; !1\\ 0 \;≡\; !0\\ \end{cases}$

It is very important because of promotion:

\cfrac{!Γ ⊢ B}{!Γ ⊢ !B} \quad\text{prom}

If $!C ⊕ !B ∈ Γ$ is not stricto sensu promotable, it is in a way promotable, since

!C ⊕ !D \;≡\; !(!C ⊕ !D)

As for negatives:

Assume $% $

(cf. Fig. 7.5 (p76) in Dale Miller’s lecture notes)

\underbrace{B_1, …, B_n}_{\text{unbounded/classical zone}} \quad ; \quad \underbrace{C_1, …, C_n}_{\text{bounded/linear zone}} ⊢ E

where the intended meaning is

!B_1, …, !B_n\; ; \; C_1, …, C_n ⊢ E

but we rule the bang $!$ out from the syntax.

Here are the connectives we consider:

𝒩_1 = \lbrace ⊤, \&, ⊸, ⇒, ∀ \rbrace

How do the rules differ?

\cfrac{Σ: Γ \quad ; \quad Δ, B ⊢ C}{Σ: Γ; Δ ⊢ B ⊸ C} ⊸R

⟹ the classical zone is treated additively, whereas the linear zone is treated multiplicatively

because we implicitely resort to promotion on $B$.

\cfrac{Γ, B \quad;\quad Δ, B ⊢ C}{Γ, B \quad;\quad Δ ⊢ C} \text{ absorb (from top to bottom: } B \text{ is absorbed)}

NB: the classical initial rule can be derived:

## $\bullet ; \bullet ⊢_o \bullet$ proof system

Recall $⊢_o$ (uniform proof + backchaining): for $⊤, \&, ⇒, ∀$. How do we handle $⊸$ on top of that?

Negative connectives have invertible right-intro rules

$Γ \quad;\quad Δ ⊢ B \& C$ is provable iff $Γ \quad;\quad Δ ⊢ B$ and $Γ \quad;\quad Δ ⊢ C$ are.

Akin to

𝒫 ⊢ A \text{ becoming } 𝒫 ⇓ D ⊢ A

## Embed C+I into LL

Girard’s Translation:

But Girard’s translation doesn’t allow us to expand and properly integrate linear contexts into our sequents.

Instead: Positive/Negative mapping: to bang half as many formulas:

Therefore:

A_1 ∧ ⋯ ∧ A_n ⇒ A_0 \text{ is negatively translated into } A_1 ⊗ ⋯ ⊗ A_n ⊸ A_0
A_0 :- A_1, …, A_n


Th:

prove (A -> B) :- (prove A ⇒ prove B)

% translated into
(prove A ⇒ prove B) ⊸ prove (A -> B)


In a way:

\infer[⊸]{A → B}{ \infer{B}{ \infer{\vdots ⇒}{A} } }

### Switch example, or how to defeat monotonicity

toggle G :- on, off ⊸ G.
toggle G :- off, on ⊸ G.


where $on, off$ are constants of type $o$ (propositional symbols).

D_2: \qquad ∀ G \; (on ⊗ (off ⊸ G) ⊸ toggle \; G)\\ D_1: \qquad ∀ G \; (off ⊗ (on ⊸ G) ⊸ toggle \; G)\\

NB: non-logical symbol at toplevel ⟶ seen as atomic

How to prove:

### Register

Other example:

inc \; G ⊢ \underbrace{reg \; N}_{\text{read + delete}} ⊗ (\underbrace{reg \; (N+1)}_{\text{write}} ⊸ G)

### Multi-set rewriting

Or even:

p :- a ⊗ a ⊗ b ⊗ (c ⊗ a ⊸ q)


### Computing permutations

p :- perm L K

load nil K :- unload K.
perm L K :- load L K.


Problem: if you have already something in the context at the beginning, it fails at the end:

Workaround:

whence the critical use of the tensor!

### Reverse lists

Idea:

⊢ rv [] [3, 2, 1]
⊢ rv [3] [2, 1]
⊢ rv [2, 3] [1]
⊢ rv [1, 2, 3] []


In Prolog, scheme:

reverse ⊢ rv ⟹ (rv ⊢ rv) ⟹ rv
reverse L K :- ∀ rv, (rv [] K ⇒ (∀ X, L, K. (rv (X::L) K :- rv L (X::K))) ⇒ rv L [])

\infer{⊢ reverse \; [1, 2, 3] \; [3, 2, 1]}{ \infer{rv \; [] \; [3, 2, 1], ∀(rv ⊢ rv) ⊢ rv \; [1, 2, 3] \; []}{ \infer{⊢ rv \; [1, 2, 3] \; []}{ \vdots} } }

NB: We actually have

reverse \overbrace{⊢}^{⊸} rv \overbrace{⊸}^{⟹} (rv \underbrace{⊢}_{⊸} rv) \overbrace{⊸}^{⟹} rv

because the base case (contrary to the recursive case) is used exactly once.

Property we want to ensure:

𝒫 ⊢ reverse \; L \; K ⟹ 𝒫 ⊢ reverse \; K \; L
p ⊸ q \; ≡ \; q^⊥ ⊸ p^⊥

Tags:

Updated: