Goal:
if L = [1,2,3] is a list, then the corresponding path used for indexing with discrimination tree is
[Cons_2, Primitive, Cons_2, Primitive, Cons_2, Primitive, Nil_0] where Cons_2 (resp Nil_0) tells that we
are dealing with a constant of name Cons (resp. Nil) of arity 2 (resp. 0)
In this encoding in each list, half of the size of the path is used for Cons_2 and Nil_0.
With this PR, we reduce the size of the path by adding two special marker for the Head and the End of a list and
remove all the Cons_2 and Nil_0.
The path for the list L will be encoded as [ListHead, Primitive, Primitive, Primitive, ListEnd]
Goal: if
L = [1,2,3]
is a list, then the corresponding path used for indexing with discrimination tree is[Cons_2, Primitive, Cons_2, Primitive, Cons_2, Primitive, Nil_0]
whereCons_2
(respNil_0
) tells that we are dealing with a constant of nameCons
(resp.Nil
) of arity2
(resp.0
) In this encoding in each list, half of the size of the path is used forCons_2
andNil_0
. With this PR, we reduce the size of the path by adding two special marker for the Head and the End of a list and remove all the Cons_2 and Nil_0. The path for the list L will be encoded as[ListHead, Primitive, Primitive, Primitive, ListEnd]