Skip to content

Commit 4dd1c54

Browse files
committed
Add equal method to TimeStampList
1 parent ed6b886 commit 4dd1c54

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/data.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ and type t = (clause * int) list = struct
181181
type t = elt list [@@deriving show]
182182

183183
let get_time_stamp = snd
184+
let equal a b = a = b
184185
end
185186

186187
module DT = Discrimination_tree.Make(TreeIndexable)(MyListClause)

src/discrimination_tree.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ module type TimeStampList = sig
5656
include Elpi_util.Util.Show with type t := t
5757

5858
val get_time_stamp : elt -> int
59+
val equal : elt -> elt -> bool
5960
end
6061

6162
module Make (K : IndexableTerm) (D : TimeStampList) :
@@ -93,7 +94,7 @@ module Make (K : IndexableTerm) (D : TimeStampList) :
9394

9495
let remove_index tree ps info =
9596
try
96-
let ps_set = List.filter (( = ) info) (Trie.find ps tree) in
97+
let ps_set = List.filter (D.equal info) (Trie.find ps tree) in
9798
if ps_set = [] then Trie.remove ps tree else Trie.add ps ps_set tree
9899
with Not_found -> tree
99100

0 commit comments

Comments
 (0)