[m-rev.] for post-commit review: delete obsolete predicates from set modules
Julien Fischer
jfischer at opturion.com
Wed Apr 13 19:52:22 AEST 2022
Delete obsolete predicates from set modules.
library/diet.m:
library/fat_sparse_bitset.m:
library/set.m:
library/set_bbbtree.m:
library/set_ctree234.m:
library/set_ordlist.m:
library/set_tree234.m:
library/set_unordlist.m:
library/sparse_bitset.m:
library/tree_bitset.m:
Delete predicates and functions that have been marked as obsolete
since at least 2019.
NEWS:
Announce the deletions.
Julien.
diff --git a/NEWS b/NEWS
index 8f44d30..f58be41 100644
--- a/NEWS
+++ b/NEWS
@@ -62,6 +62,18 @@ Changes to the Mercury standard library
- func `promise_only_solution/1`
- pred `promise_only_solution_io/4`
+### Changes to the `diet` module
+
+* The following obsolete predicate has been removed:
+
+ - pred `empty/1`
+
+### Changes to the `fat_sparse_bitset` module
+
+* The following obsolete predicate has been removed:
+
+ - pred `empty/1`
+
### Changes to the `hash_table` module
* The following obsolete predicates have been removed:
@@ -239,6 +251,61 @@ As a result, the following predicates have been removed:
- pred `permutation/4`
(replacement: `random.shuffle_list/4` or `random.shuffle_list/5`)
+### Changes to the `set` module
+
+* The following obsolete predicates and function have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+ - func `set/1`
+
+### Changes to the `set_bbbtree` module
+
+* The following obsolete predicates have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+
+### Changes to the `set_ctree234` module
+
+* The following obsolete predicates have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+
+### Changes to the `set_ordlist` module
+
+* The following obsolete predicates have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+
+### Changes to the `set_tree234` module
+
+* The following obsolete predicates have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+
+### Changes to the `set_unordlist` module
+
+* The following obsolete predicates have been removed:
+
+ - pred `empty/1`
+ - pred `non_empty/1`
+
+### Changes to the `sparse_bitset` module
+
+* The following obsolete predicates has been removed:
+
+ - pred `empty/1`
+
+### Changes to the `tree_bitset` module
+
+* The following obsolete predicates has been removed:
+
+ - pred `empty/1`
+
### Changes to the `string` module
* The following obsolete modes have been removed from the following predicates:
diff --git a/library/diet.m b/library/diet.m
index 5eedd0e..c492999 100644
--- a/library/diet.m
+++ b/library/diet.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2012-2014 YesLogic Pty. Ltd.
-% Copyright (C) 2014-2015, 2017-2018 The Mercury team.
+% Copyright (C) 2014-2015, 2017-2018, 2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -70,11 +70,6 @@
% Emptiness and singleton-ness tests.
%
-:- pred empty(diet(T)).
-:- mode empty(in) is semidet.
-:- mode empty(out) is det.
-:- pragma obsolete(pred(empty/1), [init/0, init/1, is_empty/1]).
-
:- pred is_empty(diet(T)::in) is semidet.
:- pred is_non_empty(diet(T)::in) is semidet.
@@ -755,8 +750,6 @@ make_interval_set(X, Y) = T :-
%---------------------------------------------------------------------------%
-empty(empty).
-
is_empty(empty).
is_non_empty(node(_, _, _, _)).
diff --git a/library/fat_sparse_bitset.m b/library/fat_sparse_bitset.m
index 2ef2458..5d117c7 100644
--- a/library/fat_sparse_bitset.m
+++ b/library/fat_sparse_bitset.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2011-2012 The University of Melbourne.
-% Copyright (C) 2014, 2016-2018 The Mercury team.
+% Copyright (C) 2014, 2016-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -80,11 +80,6 @@
% Emptiness and singleton-ness tests.
%
-:- pred empty(fat_sparse_bitset(T)).
-:- mode empty(in) is semidet.
-:- mode empty(out) is det.
-:- pragma obsolete(pred(empty/1), [init/0, is_empty/1]).
-
:- pred is_empty(fat_sparse_bitset(T)::in) is semidet.
:- pred is_non_empty(fat_sparse_bitset(T)::in) is semidet.
@@ -556,8 +551,6 @@ make_singleton_set(A) = insert(init, A).
%---------------------------------------------------------------------------%
-empty(fat_sparse_bitset(bitset_nil)).
-
is_empty(fat_sparse_bitset(bitset_nil)).
is_non_empty(fat_sparse_bitset(bitset_cons(_, _, _))).
diff --git a/library/set.m b/library/set.m
index 34f3747..ec7e1c9 100644
--- a/library/set.m
+++ b/library/set.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 1994-1997, 1999-2012 The University of Melbourne.
-% Copyright (C) 2014-2016, 2018 The Mercury team.
+% Copyright (C) 2014-2016, 2018-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -51,19 +51,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym for `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set(T)::in) is semidet.
:- pred is_empty(set(T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym for `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set(T)::in) is semidet.
:- pred is_non_empty(set(T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set(T)::in, T::out) is semidet.
@@ -268,8 +262,6 @@
% Synonyms for list_to_set/1.
%
:- func from_list(list(T)) = set(T).
-:- func set(list(T)) = set(T).
-:- pragma obsolete(func(set/1), [list_to_set/1]).
% sorted_list_to_set(List, Set) is true iff Set is the set
% containing only the members of List. List must be sorted
@@ -623,15 +615,9 @@ make_singleton_set(T) = S :-
%---------------------------------------------------------------------------%
-empty(Set) :-
- set_ordlist.is_empty(Set).
-
is_empty(Set) :-
set_ordlist.is_empty(Set).
-non_empty(Set) :-
- set_ordlist.is_non_empty(Set).
-
is_non_empty(Set) :-
set_ordlist.is_non_empty(Set).
@@ -774,8 +760,6 @@ list_to_set(List, Set) :-
from_list(List) = set_ordlist.from_list(List).
-set(List) = set_ordlist.from_list(List).
-
sorted_list_to_set(List) = Set :-
set.sorted_list_to_set(List, Set).
diff --git a/library/set_bbbtree.m b/library/set_bbbtree.m
index a34f3b6..bc71c1d 100644
--- a/library/set_bbbtree.m
+++ b/library/set_bbbtree.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 1995-1997, 1999-2006, 2010-2012 The University of Melbourne.
-% Copyright (C) 2014-2015, 2018 The Mercury team.
+% Copyright (C) 2014-2015, 2018-2019, 2021-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -50,19 +50,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym for `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set_bbbtree(T)::in) is semidet.
:- pred is_empty(set_bbbtree(T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym for `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set_bbbtree(T)::in) is semidet.
:- pred is_non_empty(set_bbbtree(T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set_bbbtree(T)::in, T::out) is semidet.
@@ -517,10 +511,8 @@ make_singleton_set(T) = S :-
%---------------------------------------------------------------------------%
-empty(empty).
is_empty(empty).
-non_empty(tree(_, _, _, _)).
is_non_empty(tree(_, _, _, _)).
is_singleton(tree(V, 1, empty, empty), V).
diff --git a/library/set_ctree234.m b/library/set_ctree234.m
index 3f4ecae..4fa23a2 100644
--- a/library/set_ctree234.m
+++ b/library/set_ctree234.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2005-2006, 2010-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury team.
+% Copyright (C) 2014-2019, 2021-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -57,19 +57,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym for `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set_ctree234(_T)::in) is semidet.
:- pred is_empty(set_ctree234(_T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym for `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set_ctree234(T)::in) is semidet.
:- pred is_non_empty(set_ctree234(T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set_ctree234(T)::in, T::out) is semidet.
@@ -533,10 +527,8 @@ make_singleton_set(X) = ct(1, two(X, empty, empty)).
%---------------------------------------------------------------------------%
-empty(ct(0, _)).
is_empty(ct(0, _)).
-non_empty(ct(N, _)) :- N \= 0.
is_non_empty(ct(N, _)) :- N \= 0.
is_singleton(ct(1, two(X, empty, empty)), X).
diff --git a/library/set_ordlist.m b/library/set_ordlist.m
index 3686f0a..ffc8cc3 100644
--- a/library/set_ordlist.m
+++ b/library/set_ordlist.m
@@ -2,7 +2,7 @@
% vim: ft=mercury ts=4 sw=4 et
%---------------------------------------------------------------------------%
% Copyright (C) 1996-1997,1999-2002, 2004-2006, 2008-2012 The University of Melbourne.
-% Copyright (C) 2014-2015, 2018 The Mercury team.
+% Copyright (C) 2014-2015, 2018-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -50,19 +50,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym for `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set_ordlist(_T)::in) is semidet.
:- pred is_empty(set_ordlist(T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym for `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set_ordlist(T)::in) is semidet.
:- pred is_non_empty(set_ordlist(T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set_ordlist(T)::in, T::out) is semidet.
@@ -609,10 +603,8 @@ make_singleton_set(T) = S :-
%---------------------------------------------------------------------------%
-empty(sol([])).
is_empty(sol([])).
-non_empty(sol([_ | _])).
is_non_empty(sol([_ | _])).
is_singleton(sol([X]), X).
diff --git a/library/set_tree234.m b/library/set_tree234.m
index a7518f8..1ddf6da 100644
--- a/library/set_tree234.m
+++ b/library/set_tree234.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2005-2006, 2009-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury team.
+% Copyright (C) 2014-2019, 2021-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -49,19 +49,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym for `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set_tree234(_T)::in) is semidet.
:- pred is_empty(set_tree234(_T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym for `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set_tree234(T)::in) is semidet.
:- pred is_non_empty(set_tree234(T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set_tree234(T)::in, T::out) is semidet.
@@ -654,14 +648,8 @@ make_singleton_set(X) = two(X, empty, empty).
%---------------------------------------------------------------------------%
-empty(empty).
-
is_empty(empty).
-non_empty(two(_, _, _)).
-non_empty(three(_, _, _, _, _)).
-non_empty(four(_, _, _, _, _, _, _)).
-
is_non_empty(two(_, _, _)).
is_non_empty(three(_, _, _, _, _)).
is_non_empty(four(_, _, _, _, _, _, _)).
diff --git a/library/set_unordlist.m b/library/set_unordlist.m
index e60f81c..668846e 100644
--- a/library/set_unordlist.m
+++ b/library/set_unordlist.m
@@ -2,7 +2,7 @@
% vim: ft=mercury ts=4 sw=4 et
%---------------------------------------------------------------------------%
% Copyright (C) 1995-1997,1999-2002, 2004-2006, 2010-2012 The University of Melbourne.
-% Copyright (C) 2014-2015, 2018 The Mercury team.
+% Copyright (C) 2014-2015, 2018-2019, 2021-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -51,19 +51,13 @@
% Emptiness and singleton-ness tests.
%
- % empty(Set) is true iff Set is an empty set.
- % `is_empty' is a synonym of `empty'.
+ % is_empty(Set) is true iff Set is an empty set.
%
-:- pred empty(set_unordlist(_T)::in) is semidet.
:- pred is_empty(set_unordlist(_T)::in) is semidet.
-:- pragma obsolete(pred(empty/1), [is_empty/1]).
- % non_empty(Set) is true iff Set is not an empty set.
- % `is_non_empty' is a synonym of `non_empty'.
+ % is_non_empty(Set) is true iff Set is not an empty set.
%
-:- pred non_empty(set_unordlist(_T)::in) is semidet.
:- pred is_non_empty(set_unordlist(_T)::in) is semidet.
-:- pragma obsolete(pred(non_empty/1), [is_non_empty/1]).
:- pred is_singleton(set_unordlist(T)::in, T::out) is semidet.
@@ -456,10 +450,8 @@ make_singleton_set(T) = S :-
%---------------------------------------------------------------------------%
-empty(sul([])).
is_empty(sul([])).
-non_empty(sul([_ | _])).
is_non_empty(sul([_ | _])).
is_singleton(sul(Xs), X) :-
diff --git a/library/sparse_bitset.m b/library/sparse_bitset.m
index 71f4d66..71296c3 100644
--- a/library/sparse_bitset.m
+++ b/library/sparse_bitset.m
@@ -2,7 +2,7 @@
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
% Copyright (C) 2000-2007, 2011-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury team.
+% Copyright (C) 2014-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -78,11 +78,6 @@
% Emptiness and singleton-ness tests.
%
-:- pred empty(sparse_bitset(T)).
-:- mode empty(in) is semidet.
-:- mode empty(out) is det.
-:- pragma obsolete(pred(empty/1), [init/0, is_empty/1]).
-
:- pred is_empty(sparse_bitset(T)::in) is semidet.
:- pred is_non_empty(sparse_bitset(T)::in) is semidet.
@@ -541,8 +536,6 @@ make_singleton_set(A) = insert(init, A).
%---------------------------------------------------------------------------%
-empty(sparse_bitset([])).
-
is_empty(sparse_bitset([])).
is_non_empty(sparse_bitset([_ | _])).
diff --git a/library/tree_bitset.m b/library/tree_bitset.m
index 6a076cd..116afb3 100644
--- a/library/tree_bitset.m
+++ b/library/tree_bitset.m
@@ -2,7 +2,7 @@
% vim: ft=mercury ts=4 sw=4 et
%---------------------------------------------------------------------------%
% Copyright (C) 2006, 2009-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury team.
+% Copyright (C) 2014-2018, 2021-2022 The Mercury team.
% This file is distributed under the terms specified in COPYING.LIB.
%---------------------------------------------------------------------------%
%
@@ -65,11 +65,6 @@
% Emptiness and singleton-ness tests.
%
-:- pred empty(tree_bitset(T)).
-:- mode empty(in) is semidet.
-:- mode empty(out) is det.
-:- pragma obsolete(pred(empty/1), [init/0, is_empty/1]).
-
:- pred is_empty(tree_bitset(T)::in) is semidet.
:- pred is_non_empty(tree_bitset(T)::in) is semidet.
@@ -968,8 +963,6 @@ make_singleton_set(A) = insert(init, A).
%---------------------------------------------------------------------------%
-empty(init).
-
is_empty(init).
is_non_empty(Set) :-
More information about the reviews
mailing list