Classical BI (A logic for reasoning about dualising resource) James - - PowerPoint PPT Presentation

classical bi a logic for reasoning about dualising
SMART_READER_LITE
LIVE PREVIEW

Classical BI (A logic for reasoning about dualising resource) James - - PowerPoint PPT Presentation

Classical BI (A logic for reasoning about dualising resource) James Brotherston Cristiano Calcagno Imperial College, London Me British Logic Colloquium Nottingham, 4 Sept 2008 The logic of bunched implications (OHearn and Pym


slide-1
SLIDE 1

Classical BI (A logic for reasoning about dualising resource)

James Brotherston∗ Cristiano Calcagno

Imperial College, London

∗Me

British Logic Colloquium Nottingham, 4 Sept 2008

slide-2
SLIDE 2

The logic of bunched implications (O’Hearn and Pym ’99)

  • A substructural logic for reasoning about resource.
  • Boolean BI (BBI) has the following connectives:

Additive: ⊤ ⊥ ¬ ∧ ∨ → Multiplicative: ⊤∗ ∗ — ∗

  • Additives are classical, multiplicatives are intuitionistic.
  • Models of BBI are partial commutative monoids R, ◦, e.
  • Famous instance: separation logic model based on heaps

(◦ is disjoint union, e is empty heap)

slide-3
SLIDE 3

Our contribution: classical BI (CBI)

  • We obtain CBI by adding the missing connectives to BBI:

Additive: ⊤ ⊥ ¬ ∧ ∨ → Multiplicative: ⊤∗ ⊥

∼ ∗ ⊕ — ∗ and considering both families to behave classically.

  • What are the models of CBI? (Are there any at all?)
  • What do the new connectives mean?
  • Are there nice proof systems for reasoning in CBI?
  • Is the extension of BBI to CBI conservative?
slide-4
SLIDE 4

Dualising resource models of CBI

  • A CBI-model is given by a tuple R, ◦, e, −, ∞, where:
  • R, ◦, e is a partial commutative monoid;
  • ∞ ∈ R and −: R → R;
  • for all r ∈ R, −

r is the unique solution to r ◦− r = ∞.

  • Natural interpretation: models of dualising resources.
  • Clearly CBI-models are (special) BBI-models.
  • Every Abelian group is a CBI-model (with ∞ = e).
slide-5
SLIDE 5

Interpreting the CBI connectives

  • An environment for R, ◦, e, −, ∞ is a map ρ : V → R.
  • The satisfaction relation r |

= F extends that for BBI:

r | = P ⇔ r ∈ ρ(P) r | = F1 ∧ F2 ⇔ r | = F1 and r | = F2 . . . r | = ⊤∗ ⇔ r = e r | = F1 ∗ F2 ⇔ r = r1 ◦ r2 and r1 | = F1 and r2 | = F2 r | = F1 — ∗ F2 ⇔ ∀r′. r ◦ r′ defined and r′ | = F1 implies r ◦ r′ | = F2 r | = ⊥

⇔ r = ∞ r | = ∼F ⇔ − r | = F r | = F1 ⊕ F2 ⇔ ∀r1, r2. −r ∈ r1 ◦ r2 implies − r1 | = F1 or − r2 | = F2

  • A formula F is CBI-valid iff, in every CBI-model M, r |

= F for all r ∈ R and all environments for M.

slide-6
SLIDE 6

Some semantic equivalences of CBI

∼⊤ ⇔ ⊥ ∼⊤∗ ⇔ ⊥

∼∼F ⇔ F ¬∼F ⇔ ∼¬F F ⊕ G ⇔ ∼( ∼F ∗ ∼G) F — ∗ G ⇔ ∼F ⊕ G F — ∗ G ⇔ ∼G — ∗ ∼F F — ∗ ⊥

⇔ ∼F F ⊕ ⊥

⇔ F Proposition CBI is a non-conservative extension of BBI. That is, there are formulas of BBI that are CBI-valid but not BBI-valid.

slide-7
SLIDE 7

Example: Personal finance

  • Let Z, +, 0, − be the Abelian group of integers.
  • View integers as money (£): positive integers are credit

and negative integers are debt.

  • m |

= F means “£m is enough to make F true”.

  • Let C be the formula “I’ve enough money to buy cigarettes

(£5)” and W be “I’ve enough to buy whisky (£20)”. So: m | = C ⇔ m ≥ 5 m | = W ⇔ m ≥ 20

slide-8
SLIDE 8

Example contd.: Personal finance

  • m |

= C ∧ W ⇔ m | = C and m | = W ⇔ m ≥ 20 “I have enough to buy cigarettes and also to buy whisky”

  • m |

= C ∗ W ⇔ m = m1 + m2 and m1 | = C and m2 | = W ⇔ m ≥ 25 “I have enough to buy both cigarettes and whisky”

  • m |

= C — ∗ W ⇔ ∀m′. m′ | = C implies m + m′ | = W ⇔ m ≥ 15 “if I acquire enough money to buy cigarettes then, in total, I have enough to buy whisky”

slide-9
SLIDE 9

Example contd.: Personal finance

  • m |

= ⊥

⇔ m = 0 “I am either in credit or in debt”

  • m |

= ∼C ⇔ − m | = C ⇔ m > −5 “I owe less than the price of a pack of cigarettes”

  • m |

= C ⊕ W ⇔ ∀m1, m2. −m = m1 + m2 implies −m1 | = C or −m2 | = W ⇔ m ≥ 24 Note that C ⊕ W ⇔ ∼C — ∗ W ⇔ ∼W — ∗ C, i.e.: “if I spend less than the price of a pack of cigarettes, then I will still have enough money to buy whisky (and vice versa!)”

slide-10
SLIDE 10

DLCBI: a display logic proof system for CBI

  • An instance of Belnap’s general display logic.
  • Write consecutions X ⊢ Y , where X, Y are structures:

X ::= F | ∅ | ∅ | ♯X | ♭X | X; X | X, X Positive positions Negative positions ∅ ⊤ ⊥ ∅ ⊤∗ ⊥

♯ ¬ ¬ ♭ ∼ ∼ ; ∧ ∨ , ∗ ⊕

slide-11
SLIDE 11

Proof rules for DLCBI

Three types of proof rules:

  • 1. display postulates allowing structures to be shuffled:

X; Y ⊢ Z = = = = = = = = X ⊢ ♯Y ; Z X ⊢ Y = = = = = = ♯Y ⊢ ♯X

  • 2. left- and right-introduction rules for each logical connective:

X ⊢ F G ⊢ Y (— ∗L) F — ∗ G ⊢ ♭X, Y X, F ⊢ G (— ∗R) X ⊢ F — ∗ G

  • 3. structural rules governing the structural connectives:

W; (X; Y ) ⊢ Z = = = = = = = = = = = (AAL) (W; X); Y ⊢ Z X ⊢ Z (WkR) X ⊢ Y ; Z X ⊢ Y, ∅ = = = = = = = (MIR) X ⊢ Y

slide-12
SLIDE 12

Some proof-theoretic results about CBI

Easy consequence of the fact that DLCBI is a display calculus: Theorem (Cut-elimination) Any DLCBI proof of X ⊢ Y can be transformed into a cut-free proof of X ⊢ Y . Main technical results: Theorem (Soundness) Any DLCBI-derivable consecution is valid. Theorem (Completeness) Any valid consecution is DLCBI-derivable. (NB. Validity extends easily to consecutions.)

slide-13
SLIDE 13

Conclusions

  • CBI is a non-conservative extension of Boolean BI.
  • CBI can be interpreted in models of dualising resource.
  • CBI has firm logical foundations: a general class of models,

plus a sound and complete cut-free proof theory.

  • Potential for applications in program analysis . . .
  • . . . but it is very early days!
slide-14
SLIDE 14

Endnotes

James Brotherston and Cristiano Calcagno. Classical BI (a logic for reasoning about dualising resource). Submitted, 2008. Available from www.doc.ic.ac.uk/~jbrother/ James Brotherston and Cristiano Calcagno. Algebraic models and complete proof calculi for classical BI. Imperial College London technical report, 2008. Available from www.doc.ic.ac.uk/~jbrother/ Peter O’Hearn and David Pym. The logic of bunched implications. In Bulletin of Symbolic Logic, June 1999.