I will take on to introduce attributed variables (see swi prolog) to minikanren. My hypothesis is that apart from the pure logical
constructs conde fresh and == all defined predicates can be constructed with the attribute framework with no need to add extra stacks.
The idea is to maintain only two stacks S,A e.g. the normal variable stack S and attributed stack A. All is mapping from variables
to values, for the attributed case there is no variable pointing to variables, but resetting of values will be done and attributed value
is an assoc of type ((id1 . data1) ...) id1 contain a custom unification predicate f : (f u v lam) that will execute before the unification of
u and v, and lam will be bound to either #f or a predicate to be executed after the unification. The basic interface is simple. You have
(put-attr id var val) will put a new value val in attribute data for identity id and variable var, if the attribute does not exist create a
new one first
(put-attr-last id var val) the same but in case a new attribute id will be put last (use this for attributes that does not change values, this
is a bit more gc friendly for attribute values that is created and then never change
(get-attr id var valout) fetch the attribute data for identity id and variable var, if not an attributed variable of id, fail.
There will need to be a custom printer as well in order to have a nice printout so there need to be a little framework for that. So from this
the plan is to make all other predicates needed to construct evalo.
The nice thing about this is that attributed variables is a way to customize condition on variables. So one does not need to proliferate the number
of stacks. But I tend to agree that the minikanren sources are really minimalistic and probably the use of attributed variables will make the
code much more verbose. This will be my potluck contribution.