Skip to content

Commit

Permalink
Merge pull request #5 from codex-semantics-library/mdx
Browse files Browse the repository at this point in the history
Mdx
  • Loading branch information
mlemerre authored May 21, 2024
2 parents a702db3 + e34bde0 commit 0e01de4
Show file tree
Hide file tree
Showing 9 changed files with 307 additions and 185 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ocaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,14 @@ jobs:
matrix:
os:
- ubuntu-latest
# - macos-latest
- macos-latest
# - windows-latest
ocaml-compiler:
- 4.14.x
- 5.1.x
exclude:
- os: "ubuntu-latest"
ocaml-compiler: 4.14.x

runs-on: ${{ matrix.os }}

Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Main changes

- Added hash-consed nodes and functors to build hash-consed maps and sets
- Added hash-consed nodes and functors to build hash-consed maps and sets.
- Added new functions `fold_on_nonequal_inter` and `fold_on_nonequal_union` to maps.
- Now support using negative keys, removed `zarith` dependency.
- Fixed some bugs

Expand Down Expand Up @@ -31,13 +32,16 @@
- Now support using negative keys. Trees are built using the bitwise representation
of integer, meaning they effectively use an unsigned order. Negative keys are
considered bigger than positive keys, `0` is the minimal number and `-1` the maximal one.
- Added new functions `fold_on_nonequal_inter` and `fold_on_nonequal_union` to maps.

**Bug fixes:**
- Fixed a bug where `NodeWithId` wasn't incrementing ids properly
- `zarith` is no longer a dependency, used GCC's `__builtin_clz` as a faster
method of finding an integer's highest bit.
- Fixed a bug where `pop_minimum` and `pop_maximum` could throw a private exception
`Dissappeared` when using `WeakNode`.
- Fixed a possible assertion error when using `idempotent_subset_domain_forall2`
with `WeakNode`.

# v0.9.0 - 2024-04-18

Expand Down
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Patricia Tree

[![Latest version](https://img.shields.io/badge/version-0.9.0-yellow)](https://github.com/codex-semantics-library/patricia-tree/releases)
[![Latest version](https://img.shields.io/badge/version-0.10.0-yellow)](https://github.com/codex-semantics-library/patricia-tree/releases)
[![OCaml Version](https://img.shields.io/badge/OCaml-4.14_--_5.x-blue?logo=ocaml&logoColor=white)](https://github.com/codex-semantics-library/patricia-tree/blob/main/dune-project)
[![GitHub License](https://img.shields.io/github/license/codex-semantics-library/patricia-tree)](https://github.com/codex-semantics-library/patricia-tree/blob/main/LICENSE)
[![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codex-semantics-library/patricia-tree/ocaml.yml)](https://github.com/codex-semantics-library/patricia-tree/actions/workflows/ocaml.yml)
Expand Down Expand Up @@ -46,10 +46,10 @@ Alternatively, you can clone the source repository and install with [dune](https
git clone [email protected]:codex-semantics-library/patricia-tree.git
cd patricia-tree
opan install . --deps-only
dune build
dune build -p patricia-tree
dune install
# To build documentation
opam install odoc
opam install . --deps-only --with-doc
dune build @doc
```

Expand Down Expand Up @@ -124,8 +124,7 @@ module MakeHeterogeneousMap(Key: HETEROGENEOUS_KEY)(Value: HETEROGENEOUS_VALUE)
There are also [hash-consed](https://en.wikipedia.org/wiki/Hash_consing) versions
of these four functors: `MakeHashconsedMap`, `MakeHashconsedSet`,
`MakeHashconsedHeterogeneousMap` and `MakeHashconsedHeterogeneousSet`.
These uniquely number their nodes, and ensure nodes with the same contents are
always physically equal. With this unique numbering:
These uniquely number their nodes, which means:
- `equal` and `compare` become constant time operations;
- two maps with the same bindings (where keys are compared by `KEY.to_int` and
values by `HASHED_VALUE.polyeq`) will always be physically equal;
Expand Down
4 changes: 4 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
(documentation
(package patricia-tree))

(mdx
(files *.mld *.mli)
(libraries patricia-tree))

;; For test purposes only.

(library
Expand Down
12 changes: 9 additions & 3 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.7)
(lang dune 3.0)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; This file is part of the Codex semantics library ;;
Expand All @@ -25,6 +25,8 @@

(version 0.10.0)

(using mdx 0.2)

(maintainers "Dorian Lesbre <[email protected]>")

(authors
Expand All @@ -36,9 +38,9 @@
(bug_reports
"https://github.com/codex-semantics-library/patricia-tree/issues")

(homepage "https://codex.top/patricia-tree/")
(homepage "https://codex.top/api/patricia-tree/")

(documentation "https://codex.top/patricia-tree/")
(documentation "https://codex.top/api/patricia-tree/")

(source
(github "codex-semantics-library/patricia-tree"))
Expand All @@ -61,6 +63,10 @@
(and
(>= "v0.16.0")
:with-test))
(mdx
(and
(>= "2.4.1")
:with-test))
(odoc
(and
(>= "2.4.0")
Expand Down
Loading

0 comments on commit 0e01de4

Please sign in to comment.