Skip to content
/ nola Public

Nola: Later-Free Ghost State for Verifying Termination in Iris

License

Notifications You must be signed in to change notification settings

hopv/nola

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nola: Later-Free Ghost State for Verifying Termination in Iris

Nola is a framework for later-free higher-order ghost state, enabling termination verification in the presence of advanced features such as Rust's ownership types.

It is fully mechanized in Rocq (formerly known as Coq) as a library of the Iris separation logic framework.

The name Nola comes from 'No later' and the nickname for New Orleans, Louisiana, USA, in memory of POPL 2020 held in that city.

Publications

  • Yusuke Matsushita and Takeshi Tsukada. Nola: Later-Free Ghost State for Verifying Termination in Iris.
    ACM PLDI 2025. June 2025.
  • Yusuke Matsushita. Non-Step-Indexed Separation Logic with Invariants and Rust-Style Borrows.
    Ph.D. Dissertation, University of Tokyo. Dec 6, 2023. Paper, Talk slides.
    • Yusuke Matsushita. Non-Step-Indexed Separation Logic with Invariants and Rust-Style Borrows.
      Bulletin of Ph.D. Dissertations in AY 2023 Recommended by SIGs, Information Processing Society of Japan. Aug 15, 2024. HTML (Japanese).

Getting Started

Now we explain how to get started.

Setting Up Opam

We use opam ver 2.* for package management. To install opam, you can refer to the official installation guide.

To create a new opam switch named for_nola (you can choose any name), run:

opam switch create for_nola 4.14.2 # Choose any OCaml version you like

To activate the opam switch for_nola just globally, run:

opam switch set for_nola

Or, to activate the opam switch for_nola locally in the directory NOLA_DIR where this README.md is located, run:

opam switch link for_nola NOLA_DIR

To enable installing a development version of Iris for the active opam switch, run:

opam repo add iris-dev https://gitlab.mpi-sws.org/iris/opam.git

Building Nola

First, go to the directory NOLA_DIR where this README.md is located:

cd NOLA_DIR

To fix the development dependencies and install them, run:

make devdep

To build Nola's Rocq code locally, run:

make -j16 # Choose a job number

Or, to install Nola as an opam library, run:

opam install .

To generate and browse a document for Nola's Rocq code, run:

make viewdoc

Connection with the PLDI 2025 Paper

To check statements of the PLDI 2025 paper, you can refer to the following parts of our Rocq mechanization.

Paradoxes

  • Paradoxes: nola.bi.paradox.
    • Paradoxes of the naive later-free invariant.
      • For the program logic based on Landin's knot: inv_landin.
      • Purely logically for view shifts: inv_vs.
    • Paradox of the step-indexed total Hoare triple: twp.
    • Paradoxes of unbounded later weakening.
      • Under finite step-indexing: exist_laterN.
      • Under transfinite step-indexing: exist_laterOrd.

Later-Free Ghost State

All the proof rules are proved to be sound with respect to the semantic model.

  • Nola's later-free invariant: nola.iris.inv.
    • INV-PERSIST: inv_tok_persistent, INV-ALLOC: inv_tok_alloc, INV-ACC: inv_tok_acc_vs, THOARE-INV: inv_tok_acc_twp, WINV-CREATE: inv_wsat_alloc.
  • Nola's later-free borrow.
    • Lifetime: nola.iris.lft
      • LFT-ALLOC: lft_alloc, LFT-END: lft_end.
    • Borrow: nola.iris.borrow
      • BOR-LEND-NEW: bor_lend_tok_new, LEND-BACK: lend_tok_retrieve, BOR-OPEN: bor_tok_open, OBOR-CLOSE: obor_tok_close, WBOR-CREATE: borrow_wsat_alloc.
    • Prophetic borrow: nola.iris.pborrow

View Shifts and Hoare Triples

Modular Construction of Formula Syntax

Magic Derivability

  • Magic derivability: nola.bi.deriv.
    • DER-SOUND: der_sound, DER-DERIV: der_Deriv, DERIV-MAP: Deriv_mapl.

Examples and RustHalt

Overview of the Rocq Code

The Rocq code is all in nola/ and is structured as follows:

  • prelude : Prelude
  • util/ : General-purpose utilities, extending std++
  • bi/ : Libraries for bunched implication logic
    • util (Utilities)
    • internal (Internal equality)
    • gmap (On gmap), plist (On plist)
    • order (Order theory), deriv (Magic derivability)
    • mod (Modality classes), modw (Modality with a custom world satisfaction), wpw (Weakest precondition with a custom world satisfaction)
    • judg (Judgments)
    • paradox (Paradoxes)
  • iris/ : Libraries for Iris base logic
    • iprop (Utility for iProp), own (Utility for own)
    • list (On lists), option (On option), agree (On agree), csum (On csum)
    • sinv (Simple invariants)
    • inv (Invariants), inv_deriv (Invariants relaxed with derivability), na_inv (Non-atomic invariants), na_inv_deriv (Non-atomic invariants relaxed with derivability)
    • dinv (Direct invariants), dinv_deriv (Direct invariants relaxed with derivability), store (Stored propositions), store_deriv (Stored propositions relaxed with derivability)
    • lft (Lifetime), borrow (Borrows), borrow_deriv (Borrows relaxed with derivability), fborrow (Fractured borrows)
    • proph (Prophecy), proph_ag (Prophetic agreement), pborrow (Prophetic borrows), pborrow_deriv (Prophetic borrows relaxed with derivability)
    • cif (Modular construction of coinductive-inductive formulas)
    • paradox (Paradox)
  • heap_lang/ : Variant of Iris HeapLang, supporting program logic with custom world satisfactions for Nola
  • lrust/ : Variant of λRust, RustBelt's core language, supporting program logic with custom world satisfactions for Nola
    • lang (Language), notation (Notation for the language), tactics (Tactics for the language)
    • races (Race freedom guarantee of the language)
    • heap (Ghost state for the heap), lifting (Program logic), proofmode (Proof mode utility for the program logic)
    • adequacy (Adequacy of the program logic)
  • examples/ : Examples
    • xty (Syntactic type), con (Constructors)
    • cfml (Demonstration of how our program logic can emulate CFML), basic (Basic examples), ilist (Infinite list), borrow (Borrow), mutex (Mutex), deriv (Derivability)
    • rust_halt/ : RustHalt, a semantic foundation for total correctness verification of Rust programs
      • base (Basics), type (Type model)
      • core (Core features)
      • num (Numeric types), uninit (Uninitialized data type)
      • prod (Product type), sum (Sum type)
      • rec (Recursive type), mod (Modification type)
      • ptr (Utility for pointer types), box (Box pointer type), shrref (Shared reference type), mutref (Mutable reference type)
      • ptrs_more (More on basic pointer types), prod_more (More on the product type), sum_more (More on the sum type)
      • adequacy (Adequacy)
      • verify/ : Verification examples
        • util (Utility)
        • ack (Ackermann function)
        • list (Singly linked list type), list_more (More on the list type)
        • mutlist (Singly linked list over a mutable reference), mutlist_more (More on the mutlist type)

About

Nola: Later-Free Ghost State for Verifying Termination in Iris

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published