Skip to content

Commit

Permalink
Bump version 0.2 => 0.3 and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
GeoffChurch committed Jan 22, 2023
1 parent 5b67869 commit cbf554a
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
19 changes: 16 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,30 @@ G = f(_A, _B),
X subsumes _A,
Y subsumes _B.
?- f(X, Y) subsumes X. % Example with induced cyclic data.
X = f(X, Y).
?- f(X) subsumes Y, Y subsumes X. % Example with induced cyclic data.
X = Y, Y = f(Y).
?- X subsumes Y, X = g(_).
X = g(_A),
Y = g(_B),
_A subsumes _B.
```

See the unit tests in [`prolog/subsumes.plt`](prolog/subsumes.plt) for more examples.
See the unit tests in [`test/subsumes.plt`](test/subsumes.plt) for more examples.

Executing the following goal from the top-level `subsumes` directory should run all the tests:
```prolog
?- expand_file_name("test/**.plt", Tests), maplist(consult, Tests), run_tests.
```

Note that this conflicts with the deprecated [`terms:subsumes/2`](https://www.swi-prolog.org/pldoc/doc_for?object=subsumes/2).

TODO: make ISO-compatible.

(Note to self) To publish a new version:
1. update `pack.pl`
2. do GitHub release with new tag matching the pack.pl version
3. execute:
```prolog
?- make_directory(potato), pack_install(subsumes, [url('http://github.com/GeoffChurch/subsumes/archive/13.17.zip'), package_directory(potato)]).
```
2 changes: 1 addition & 1 deletion pack.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name(subsumes).
version('0.2').
version('0.3').
title('Relational term subsumption. subsumes/2 is intended as a relational drop-in replacement for subsumes_term/2. Note that this conflicts with the deprecated predicate terms:subsumes/2.').
author('Geoffrey Churchill', 'geoffrey.a.churchill@gmail.com').
home('https://github.com/GeoffChurch/subsumes').
4 changes: 2 additions & 2 deletions test/subsumes.plt
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ test(subsume_then_unify_leaves_loop) :-
% because compact_lbs/1 is called by attribute_goals//1.
check_lbs(X, [X]).

:- end_tests(subsumes).

%%% UTILS %%%

get_lbs(G, LBs) :- get_attr(G, subsumes, LBs), !.
Expand All @@ -68,3 +66,5 @@ check_lbs(G, Expected) :-
get_lbs(G, Actual),
msort(Expected, X),
msort(Actual, X).

:- end_tests(subsumes).
10 changes: 0 additions & 10 deletions test/subsumes_chk.plt
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,3 @@ test(permavar_subsumes_anything) :-
subsumes_chk(X, 3).

:- end_tests(subsumes_chk).

%%% UTILS %%%

get_lbs(G, LBs) :- get_attr(G, subsumes, LBs), !.
get_lbs(_, []).

check_lbs(G, Expected) :-
get_lbs(G, Actual),
msort(Expected, X),
msort(Actual, X).

0 comments on commit cbf554a

Please sign in to comment.