cek-mercury: Demonstrative Prolog/Mercury relational engine for CEK machines

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

An educational and demonstrative reference engine showcasing Prolog and Mercury relational unification, Warren Abstract Machine (WAM) conditional trailing, and nondeterministic search over unrolled KontStack choice points.

Notice: This package is provided primarily as an executable architectural example and documentation case study within the cek ecosystem.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.1.0.2
Change log CHANGELOG.md
Dependencies base (>=4.18 && <5), cek-core (>=0.1.0.0 && <0.2), cek-pykinos (>=0.1.0.0 && <0.2), ghc-prim (>=0.10 && <0.14), primitive (>=0.9 && <0.10), pykinos-core (>=0.1.0.0 && <0.2) [details]
License EUPL-1.2
Author Nadia Yvette Chambers
Maintainer nadia.yvette.chambers@ik.me
Category Language, Compilers/Interpreters
Home page https://github.com/NadiaYvette/cek
Bug tracker https://github.com/NadiaYvette/cek/issues
Source repo head: git clone https://github.com/NadiaYvette/cek(packages/cek-mercury)
Uploaded by nyc at 2026-11-18T14:50:17Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for cek-mercury-0.1.0.0

[back to package description]

cek-mercury

Important Notice: This package is an educational and demonstrative reference implementation showcasing relational unification, Warren Abstract Machine (WAM) conditional trailing, and nondeterministic search over KontStack choice points. It is provided primarily as an executable architectural example within the cek ecosystem documentation.

Overview

cek-mercury implements a high-performance relational unification and search engine inspired by the Warren Abstract Machine (WAM) and Mercury's deterministic execution models, executing entirely over unboxed CEK data structures:

  1. Term Allocation Heap: Mapped onto the 4096-cell chunked SoAStore.
  2. Clause Dispatch Stack: Mapped onto the unrolled 32-frame KontStack.
  3. WAM Conditional Trailing: Bound variables allocate trail entries only if their address precedes the most recent choice point watermark (heapWatermark), bypassing trail overhead for transient intra-clause bindings.
  4. Delimited Commits (semidet): Mercury's deterministic commits (GOnce) prune intermediate choice points instantaneously by resetting the choice point watermark.

Module Structure

Building and Testing

cabal build cek-mercury
cabal test cek-mercury:tests

License

EUPL-1.2.