Menu

#1 Semantic type declarations for categories

open
None
5
2007-12-06
2007-12-06
No

Sometimes it would be nice to be able to assert that the semantics of a certain category *must* be of a certain type, e.g. an atom, a list or an f-v list.

My suggestion is to add a declaration, e.g. semtype/2:

% semtype(?Regulus category, ?Semantic type)
semtype(object, atom).
semtype(predicate, list).
semtype(sentence, fvlist).
semtype(size, integer).

The types can be fixed to the above four. An alternative is to declare the types in the category/2 declaration:

category(object, [sem(atom), ...]).
category(predicate, [sem(list), ...]).

Alternatively:

category(object, [sem:atom, ...]).
category(predicate, [sem:list, ...]).

The compiler should of course check that all rules comply to the declarations, but that's hopefullt not too difficult.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.