Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,29 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## v0.4.1 (2026-06-21)

### Fixed

- **C1**: Corrected moduledoc and `rule/2` docstring to state that **uppercase** identifiers are logic variables (was incorrectly documented as lowercase). Updated moduledoc examples, `rule/2` docstring, README, and article 01 to use uppercase variables consistently.
- **C2**: Aggregate syntax (`agg(...)`) now raises `ExDatalog.DSL.CompileError` with a clear message in both head and body positions, instead of crashing with `CompileError` or `FunctionClauseError`. Updated CHANGELOG, article 05, and moduledoc to reflect reality.
- **H1**: Replaced meaningless aggregate struct-literal tests with real end-to-end compile-time tests that exercise `agg(...)` DSL syntax in both head and body positions.
- **H2**: Query without a `where` clause now raises `ExDatalog.DSL.CompileError` with a readable message instead of an opaque `Protocol.UndefinedError`.
- **M1**: Query `find` variables that are not present in the `where` pattern now raise `ExDatalog.DSL.CompileError` at compile time instead of silently returning wrong results.
- **M2**: Unrecognized expressions inside `relation` and `facts` blocks now raise `ExDatalog.DSL.CompileError` instead of being silently dropped.
- **L1**: All DSL authoring errors now raise `ExDatalog.DSL.CompileError` (was a mix of `CompileError` and `ArgumentError`).
- **L2**: README test count updated to 792 (was stale at 751, then 786).
- **L3**: Dropped unused `_program` parameter from `validate_rules!/1`.
- **L4**: Removed duplicate `eq` constraint test from `SchemaCoverageTest`.
- **L5**: Fixed moduledoc reference from `materialize/0` to `materialize/0,1`.
- **L6**: Deleted `livebooks/examples.md` (521-line unreferenced LLM-generated artifact).

### Changed

- Version bumped from 0.4.0 to 0.4.1
- All DSL error messages now go through `ExDatalog.DSL.CompileError` for uniform catch/rescue
- `ExDatalog.UnsupportedFeature` struct retained for future use but no longer produced at runtime

## v0.4.0 (2026-06-20)

### Added
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ It continues to influence modern databases, compilers, static analysis tools, kn
- **Provenance / derivation explain** (`explain: true`)
- **Telemetry** integration (`:telemetry` events for query lifecycle)
- **Deterministic**: same program + same facts = same result regardless of backend
- 786 tests, 0 failures, credo clean
- 792 tests, 0 failures, credo clean

## Installation

Expand All @@ -52,7 +52,7 @@ Add `ex_datalog` to your dependencies in `mix.exs`:
```elixir
def deps do
[
{:ex_datalog, "~> 0.4.0"}
{:ex_datalog, "~> 0.4.1"}
]
end
```
Expand Down Expand Up @@ -421,7 +421,8 @@ The following references are highly recommended for understanding both the theor
| Version | Description |
|---|---|
| v0.3.0 | Tuple shorthand for rules (`add_rule/3`, `add_rule/4`), `Term.from/1`, `ExDatalog.Atom.from_tuple/1`, `Constraint.from_tuple/1`; renamed `Result` → `Knowledge`, `query` → `materialize` |
| v0.4.0 | Schema DSL (`use ExDatalog.Schema`), `relation`, `fact`, `rule`, `query` macros, `not_` negation, constraint DSL, post-materialization queries, aggregate syntax preview |
| v0.4.0 | Schema DSL (`use ExDatalog.Schema`), `relation`, `fact`, `rule`, `query` macros, `not_` negation, constraint DSL, post-materialization queries |
| v0.4.1 | DSL review fixes: correct uppercase-variable docs, clean aggregate error, query/find validation, unified `DSL.CompileError`, 792 tests |
| v0.5.0 | Magic sets / demand-driven evaluation, general predicates as BEAM callbacks |
| v1.0.0 | Stable public API, hardened production semantics |

Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule ExDatalog.MixProject do
use Mix.Project

@version "0.4.0"
@version "0.4.1"
@source_url "https://github.com/thanos/ex_datalog"

def project do
Expand Down
Loading