This looks like an error in dict handling:

Hi guys. I think the tag of a dict is restricted to atoms and “small integers” (really, integers of up to 7 byte on my machine), but:

Here I use is_dict/2 to set the tag of a dict to another dict:

?- A=X{},is_dict(A,k{}),format("~q\n",A).
k{}{}
A = k{}{},
X = k{}.

That doesn’t sound right?

You can indeed create dicts that have any tag. read/1 can only read dicts that have an atom or variable as tag. There is little that can be done against that. The only thing that is theoretically possible is to use an attributed variable instead of a plain variable. That seems a big overkill for a small mostly theoretical problem

So the problem is wild unification involving the tag (and the unification algorithm not doing typing/sorting).

And yes, this is unlikely to be encountered.

1 Like