Re: dicts and feature structures

Jan Wielemaker <[email protected]>
Newsgroups gmane.comp.ai.prolog.swi
Message-ID <[email protected]>
On 01/30/2014 09:53 PM, Michael Hendricks wrote:
> I'd like to see dicts behave as feature structures or LIFE psi-terms under
> unification.  There was an extensive discussion on the mailing list about
> unification semantics shortly after dicts were announced.  As I recall, Jan
> was open to the possibility of something like your proposal but wants dicts
> to simmer for a while before deciding for sure.

Yes. For now, they should simply be seen as a compound with named rather
than positional arguments and a flexible rather than a fixed number of
arguments.

I guess it makes sense to add a

	unify_dict(+Dict1, +Dict2, -Dict)

that succeeds if the values associated to the common keys can be unified
(Dict1 >:< Dict2) and in which Dict contains the union of all keys in
Dict1 and Dict2.

A dict with ground values however is a ground term. It would be a bit
strange if we can do a unification to a ground term that changes this
term, no? If the above is there, you can already get quite near
psi-terms by placing the dict in a variable attribute and define
attr_unify_hook to unify the dicts as above if two variables are unified
that have a dict and (I guess) fail otherwise.  You can hide some of this
stuff from the user, but not all :-(

If psi-terms see light, it might be done as above, but then more low
level integrated into the attributed variable system and hidden from
the user.

Then the question arises whether all dicts should be psi-terms or there
are two types of dicts.  We could for example define Type{{Attributes}}
to be a psi-term.

	Cheers --- Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.