Topology / ALM-Compiler

A Java implementation of the ALM language that compiles to the SPARC variant of Answer Set Programming (ASP).
Apache License 2.0
0 stars 1 forks source link

Should the restriction that source sorts must be leaves in the sort hierarchy be relaxed? #1

Closed Topology closed 6 years ago

Topology commented 7 years ago

There are two meanings of the words "source" in "source sort". One is the "source" that stems from directed a-cyclic graphs. A source node in a DAG is a node which only has out-going edges. This may have been the original usage of the concept of a "source sort" but there is some overlap with the idea that a sort is a "source sort" if it related to an object constant through the is_a(X,Y) relation. In essence the "source sort" is the "source" of an object constant in the hierarchy.

Since constants declare object instances for sorts within a module, we come to the following situation.

Module A declares sort S1 with constant C1. (S1 is the source sort for C1) . Module B declares sort S2 to be a sub-sort of S1 and it has constant C2 declared for it.
In this situation, S1 is no longer a source sort in the sense of a DAG. But it remains the source of constant C1.

Is the requirement that is_a(X,Y) relation only hold when Y is a source sort in the DAG sense needed? What breaks by allowing arbitrary non-pre-defined sorts to participate in is_a(X,Y)?

Topology commented 6 years ago

The restriction has been lifted, especially with respect to constants being members of sorts higher in the hierarchy.

Topology commented 6 years ago

Closing this issue.