deriva 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +12 -0
- package/docs/assets/deriva-logo-v1.png +0 -0
- package/docs/assets/deriva-logo.png +0 -0
- package/docs/guide.md +14 -7
- package/docs/language-reference.md +3 -1
- package/package.json +1 -1
- package/playground.html +1 -0
package/LICENSE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MIT License
|
|
2
2
|
|
|
3
|
-
### Copyright 2021-2026 Jos De Roo
|
|
3
|
+
### Copyright 2021-2026 Jos De Roo, KNoWS office of IDLab, Ghent University - imec
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
6
|
|
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Deriva
|
|
2
2
|
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="docs/assets/deriva-logo.png" alt="Deriva logo" width="180">
|
|
5
|
+
</p>
|
|
6
|
+
|
|
3
7
|
[](https://www.npmjs.com/package/deriva)
|
|
4
8
|
|
|
5
9
|
Deriva is a small reasoning language for turning facts and rules into answers and proofs.
|
|
@@ -12,6 +16,14 @@ and tabled automatically.
|
|
|
12
16
|
|
|
13
17
|
## Install and run
|
|
14
18
|
|
|
19
|
+
Install the published CLI globally:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install --global deriva
|
|
23
|
+
deriva --version
|
|
24
|
+
printf 'works(stdin, true) :- eq(ok, ok).\n' | deriva -
|
|
25
|
+
```
|
|
26
|
+
|
|
15
27
|
Deriva has no runtime npm dependencies and no build step. From a source checkout, run the CLI directly with Node.js 18 or newer:
|
|
16
28
|
|
|
17
29
|
```bash
|
|
Binary file
|
|
Binary file
|
package/docs/guide.md
CHANGED
|
@@ -38,6 +38,13 @@ node bin/deriva.js facts.pl rules.pl
|
|
|
38
38
|
printf 'works(stdin, true) :- eq(ok, ok).\n' | node bin/deriva.js -
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
+
To install the published CLI instead, use:
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npm install --global deriva
|
|
45
|
+
deriva --version
|
|
46
|
+
```
|
|
47
|
+
|
|
41
48
|
You can also use npm's local package-bin runner from the checkout:
|
|
42
49
|
|
|
43
50
|
```sh
|
|
@@ -554,12 +561,12 @@ deriva -s examples/observability-log-correlation.pl > /dev/null
|
|
|
554
561
|
|
|
555
562
|
For a release:
|
|
556
563
|
|
|
557
|
-
1. update `
|
|
558
|
-
2.
|
|
559
|
-
3.
|
|
560
|
-
4.
|
|
561
|
-
|
|
562
|
-
|
|
564
|
+
1. update `README.md` and the language reference when behavior or public guidance changed;
|
|
565
|
+
2. regenerate golden outputs if behavior changed;
|
|
566
|
+
3. execute `npm test`;
|
|
567
|
+
4. execute npm version with `patch` (or `minor`/`major` as appropriate).
|
|
568
|
+
|
|
569
|
+
The `preversion` script reruns the full test suite and refreshes [`conformance-report.md`](../conformance-report.md). The version command updates `package.json`, creates the release commit and `v*` tag, and the `postversion` script pushes the commit and tag. The tag triggers the GitHub Release and trusted npm publishing workflows. A push to `main` also deploys the browser playground through GitHub Pages.
|
|
563
570
|
|
|
564
571
|
## Relationship to Eyeling
|
|
565
572
|
|
|
@@ -578,7 +585,7 @@ A useful rule of thumb:
|
|
|
578
585
|
| Human-auditable derivations | Either | Both can emit proof explanations when requested. |
|
|
579
586
|
| Large generated Horn-clause workloads | deriva | The engine specializes in predicate/arity indexing, scalar argument indexes, fast fact paths, and materialized output goals. |
|
|
580
587
|
|
|
581
|
-
On local smoke benchmarks, deriva is substantially faster on large generated Horn-clause and recursion-heavy workloads. These numbers are 5-run medians with stdout redirected to `/dev/null`, using Node.js `v22.16.0`, deriva from this checkout, and Eyeling package version `1.34.6` with its default output mode. The ratio is `Eyeling median / deriva median`, so larger numbers
|
|
588
|
+
On local smoke benchmarks, deriva is substantially faster on large generated Horn-clause and recursion-heavy workloads. These numbers are 5-run medians with stdout redirected to `/dev/null`, using Node.js `v22.16.0`, deriva from this checkout, and Eyeling package version `1.34.6` with its default output mode. The ratio is `Eyeling median / deriva median`, so larger numbers mean deriva was faster.
|
|
582
589
|
|
|
583
590
|
| Example | deriva median | Eyeling median | Ratio |
|
|
584
591
|
| --- | ---: | ---: | ---: |
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
- [8.2 Equality, identity, and unification](#82-equality-identity-and-unification)
|
|
34
34
|
- [8.3 Goal-directed execution versus model-theoretic meaning](#83-goal-directed-execution-versus-model-theoretic-meaning)
|
|
35
35
|
- [8.4 Built-ins and operational extensions](#84-built-ins-and-operational-extensions)
|
|
36
|
+
- [8.5 Stratified negation](#85-stratified-negation)
|
|
36
37
|
- [9. Standard built-in predicates](#9-standard-built-in-predicates)
|
|
37
38
|
- [9.1 Equality and unification](#91-equality-and-unification)
|
|
38
39
|
- [9.2 Arithmetic](#92-arithmetic)
|
|
@@ -48,6 +49,7 @@
|
|
|
48
49
|
- [11. Declarations](#11-declarations)
|
|
49
50
|
- [11.1 Automatic hybrid reasoning](#111-automatic-hybrid-reasoning)
|
|
50
51
|
- [11.2 Default-output materialization](#112-default-output-materialization)
|
|
52
|
+
- [11.3 Advisory modes and determinism](#113-advisory-modes-and-determinism)
|
|
51
53
|
- [12. deriva Sockets](#12-deriva-sockets)
|
|
52
54
|
- [12.1 Socket vocabulary](#121-socket-vocabulary)
|
|
53
55
|
- [12.2 Socket example](#122-socket-example)
|
|
@@ -802,7 +804,7 @@ A conforming deriva implementation supports the standard language described abov
|
|
|
802
804
|
|
|
803
805
|
Browser execution, package layout, CLI URL loading, and any implementation-specific built-ins described in host documentation are outside this conformance surface unless separately standardized.
|
|
804
806
|
|
|
805
|
-
Conformance cases live in the repository under `test/conformance/`. They are run by `npm test` before the example suite, and can be run alone with `node test/run-conformance.mjs`. Positive cases have input programs under `conformance/cases/` and exact expected standard-output files under `conformance/expected/`; both use `.pl` so expected output remains deriva-readable. Expected-error cases live under `conformance/errors/` with exact messages under `conformance/expected-errors/`. Expected-warning cases live under `conformance/warnings/` with exact `--warnings` stdout and stderr files under `conformance/expected-warnings/`. The corpus is grouped by language area, including arithmetic, strings, lists, terms, atoms, variables, negation, declarations, materialization, rules, syntax, and errors.
|
|
807
|
+
Conformance cases live in the repository under `test/conformance/`. They are run by `npm test` before the example suite, and can be run alone with `node test/run-conformance.mjs`. Positive cases have input programs under `test/conformance/cases/` and exact expected standard-output files under `test/conformance/expected/`; both use `.pl` so expected output remains deriva-readable. Expected-error cases live under `test/conformance/errors/` with exact messages under `test/conformance/expected-errors/`. Expected-warning cases live under `test/conformance/warnings/` with exact `--warnings` stdout and stderr files under `test/conformance/expected-warnings/`. Proof cases live under `test/conformance/proofs/` with exact explanation output under `test/conformance/expected-proofs/`. The corpus is grouped by language area, including arithmetic, strings, lists, terms, atoms, variables, negation, declarations, materialization, rules, syntax, and errors.
|
|
806
808
|
|
|
807
809
|
## 15. Relationship to ISO Prolog
|
|
808
810
|
|
package/package.json
CHANGED