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
2 changes: 1 addition & 1 deletion cl-cli.asd
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
;; `cl-cli/demo` belongs to the PORTABLE half: it depends on nothing but
;; `cl-cli`, so t/demo-test.lisp runs under the ECL gate too -- which is the
;; only thing that would notice the demo growing an SBCL-only form.
:depends-on ("cl-cli" "cl-cli/demo" "cl-weave" "cl-prolog/weave" "cl-json-kit"
:depends-on ("cl-cli" "cl-cli/demo" "cl-weave" "cl-prolog-kit/weave" "cl-json-kit"
#+sbcl "cl-cli/concurrent")
:serial t
:components ((:file "t/package")
Expand Down
4 changes: 2 additions & 2 deletions docs/src/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ git clone https://github.com/nerima-lisp/cl-cli ~/common-lisp/cl-cli

=== "Nix (recommended for development)"

The flake wires up [`cl-prolog`](https://github.com/nerima-lisp/cl-prolog),
The flake wires up [`cl-prolog-kit`](https://github.com/nerima-lisp/cl-prolog-kit),
[`cl-weave`](https://github.com/nerima-lisp/cl-weave),
[`cl-process-kit`](https://github.com/nerima-lisp/cl-process-kit) (plus its
own [`cl-boundary-kit`](https://github.com/nerima-lisp/cl-boundary-kit) /
Expand Down Expand Up @@ -48,7 +48,7 @@ git clone https://github.com/nerima-lisp/cl-cli ~/common-lisp/cl-cli

=== "Running the test suite without Nix"

Clone `cl-prolog`, `cl-weave`, and `cl-json-kit` where ASDF can find
Clone `cl-prolog-kit`, `cl-weave`, and `cl-json-kit` where ASDF can find
them, the same way as `cl-cli` above, then run `run-tests.lisp` at the
repository root:

Expand Down
16 changes: 8 additions & 8 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# `apps.default` pair and the devShell -- is the single `mkPackageFlake`
# call below. PACKAGE_STANDARD.md distributes that shape as a *template*
# copied by hand into 21 repositories, and the copies drift: cl-weave and
# cl-prolog have already converged on the preset, and this file's 357 hand-
# cl-prolog-kit have already converged on the preset, and this file's 357 hand-
# written lines were the last copy in the set still re-deriving all of it.
#
# Pinned to a release TAG like every other input: a bare
Expand Down Expand Up @@ -72,8 +72,8 @@
flake = false;
};

cl-prolog = {
url = "github:nerima-lisp/cl-prolog/v1.4.3";
cl-prolog-kit = {
url = "github:nerima-lisp/cl-prolog-kit/v1.5.0";
flake = false;
};

Expand Down Expand Up @@ -154,7 +154,7 @@
cl-nix-forge,
paredit-cli,
cl-weave,
cl-prolog,
cl-prolog-kit,
cl-process-kit,
cl-boundary-kit,
cl-log-kit,
Expand Down Expand Up @@ -257,18 +257,18 @@
lisp = ctx.pkgs.sbcl;
};

# `cl-prolog/weave` is one of four systems cl-prolog.asd defines, and its
# `:depends-on` names both `cl-prolog` (resolved out of that same file, so
# `cl-prolog-kit/weave` is one of four systems cl-prolog-kit.asd defines, and its
# `:depends-on` names both `cl-prolog-kit` (resolved out of that same file, so
# nothing to pass) and `cl-weave` (which is not, so it is passed). The
# ASDF system name carries a slash; `pname` cannot, since it becomes a
# store path component.
clPrologWeaveSystem =
ctx: lisp:
siblingSystem ctx {
pname = "cl-prolog-weave";
source = cl-prolog;
asdName = "cl-prolog.asd";
lispSystem = "cl-prolog/weave";
pname = "cl-prolog-kit-weave";
source = cl-prolog-kit;
asdName = "cl-prolog-kit.asd";
lispSystem = "cl-prolog-kit/weave";
inherit lisp;
lispDependencies = [ (clWeaveSystem ctx lisp) ];
};
Expand Down
6 changes: 3 additions & 3 deletions run-tests.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
(list :env "CL_HOST_KIT_SOURCE_DIR"
:local (merge-pathnames #P"cl-host-kit/" dependency-parent)
:asd #P"cl-host-kit.asd")
(list :env "CL_PROLOG_SOURCE_DIR"
:local (merge-pathnames #P"cl-prolog/" dependency-parent)
:asd #P"cl-prolog.asd")
(list :env "CL_PROLOG_KIT_SOURCE_DIR"
:local (merge-pathnames #P"cl-prolog-kit/" dependency-parent)
:asd #P"cl-prolog-kit.asd")
(list :env "CL_JSON_KIT_SOURCE_DIR"
:local (merge-pathnames #P"cl-json-kit/" dependency-parent)
:asd #P"cl-json-kit.asd")
Expand Down
14 changes: 7 additions & 7 deletions t/helpers-prolog.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(defparameter *prolog-atom-package* (find-package :cl-cli/test)
"Fixed package for interning Prolog atoms.

Predicate and atom identity in cl-prolog is symbol identity, so facts must be
Predicate and atom identity in cl-prolog-kit is symbol identity, so facts must be
interned into the same package the query literals in the test files are read
into (CL-CLI/TESTS). Interning into the volatile *PACKAGE* makes rulebases
non-reproducible: under the CL-USER runtime the suite uses, derived predicates
Expand All @@ -49,7 +49,7 @@ would land in the wrong package and the engine would raise EXISTENCE_ERROR.")
(integer value)))

(defun prolog-fact (&rest term)
(cl-prolog:make-clause term))
(cl-prolog-kit:make-clause term))

(defun option-atom (option)
(prolog-atom (option-key option)))
Expand Down Expand Up @@ -184,28 +184,28 @@ would land in the wrong package and the engine would raise EXISTENCE_ERROR.")
"The full (predicate . arity) vocabulary the consumer-migration contracts query.

Kept as an explicit list so the contract surface is documented in one place and
so absent facts fail cleanly instead of raising cl-prolog's existence_error.")
so absent facts fail cleanly instead of raising cl-prolog-kit's existence_error.")

(defun consumer-migration-schema-clauses ()
"Declare every contract predicate with a never-succeeding guard clause.

cl-prolog raises the ISO existence_error(procedure, Name/Arity) for a query
cl-prolog-kit raises the ISO existence_error(procedure, Name/Arity) for a query
whose predicate has no clauses at all. A :fails contract such as
\"nshell script stays optional\" (app-positional-required has zero facts when no
positional is required) would therefore error instead of failing. Seeding a
`Head :- fail.' guard per predicate makes each one known-but-empty, which
mirrors how src/option-relations.lisp declares :requires/:conflicts. The guard
adds no solutions, so :succeeds and :set contracts are unaffected."
(loop for (name arity) in *consumer-migration-contract-predicates*
collect (cl-prolog:make-clause
collect (cl-prolog-kit:make-clause
(cons (prolog-atom (symbol-name name))
(loop for index below arity
collect (intern (format nil "?G~D" index)
*prolog-atom-package*)))
(list (list 'cl-prolog:fail)))))
(list (list 'cl-prolog-kit:fail)))))

(defun consumer-migration-rulebase ()
(cl-prolog:make-rulebase
(cl-prolog-kit:make-rulebase
:clauses
(append (consumer-migration-schema-clauses)
(mapcan #'app->prolog-clauses
Expand Down
4 changes: 2 additions & 2 deletions t/package.lisp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
(defpackage #:cl-cli/test
(:use #:cl #:cl-cli)
(:import-from #:cl-prolog
(:import-from #:cl-prolog-kit
#:assertz
#:make-rulebase
#:query-prolog)
(:import-from #:cl-prolog/weave
(:import-from #:cl-prolog-kit/weave
#:deftest-queries)
(:import-from #:cl-weave
#:assert-mutation-score
Expand Down