In the hierarchy depicted in Figure 3.19, there are
no t objects with identically typed F and G
values as in the following feature structures:
TRALE does not accept such undefined combinations
of feature values as valid. However, if TRALE detects that
only one subtype's product of values is consistent with a
feature structure's product of values, it will
promote the product to that consistent subtype's product.
Thus, in our example, a feature structure:
will be promoted automatically to the following. Note
that the type itself will not be promoted to t.
This section shows how subtype covering is handled in TRALE. Types whose feature values are not exhaustively covered by their subtypes' feature values (such as t in the above example) are called deranged types.
At the highest level, TRALE performs the following steps during signature compilation in order to compute subtype covering.
compile_deranged_assert :- !,findall(Super-Sub,(non_a_type(Super), imm_sub_type(Super,Sub)),SubGEdges), vertices_edges_to_ugraph([],SubGEdges,SubG), top_sort(SubG,RevSortedTypes), reverse(RevSortedTypes,SortedTypes), compute_maxcount(SortedTypes,SubG), compute_deranged(SortedTypes,SubG).Here we focus on the last two steps, namely,
compute_maxcount/2
and
compute_deranged/2
.
a_/1
atoms is 1.
The of a non-maximal type t is the cardinality of the
union of the sets of maximal subtypes covered by the immediate subtypes
of t, as given by the base subsumption graph. For example, in the
type signature of Figure 3.20, the of d,
e, and f is 1 because they are maximal types. The
of b and c is 2 as they cover d, e, and
e, f respectively. The of a, then,
will be {d, e}{e, f}{d,
e, f}.
[User's Manual]
[Code--MaxCount Map]
Types are classified in two categories: normal, and deranged.
Normal types are non-deranged types that can be treated as maximal (even
if they are not) when checking a potentially deranged supertype. All
maximal types are normal. Atoms, because they are downward-closed, are
not deranged. We do not add an entry for atoms (including a_
atoms)
to the database.
As mentioned above, a deranged type is one whose map of appropriate value restrictions is not exhaustively covered by the maps of appropriate value restrictions of its maximally specific subtypes. When checking potentially deranged supertypes, these types must be replaced by a minimal covering of normal subtypes. The predicate deranged/2 indicates the status of every type for the purpose of classifying deranged types.
A map is a product of types, such as that found in a set of appropriate features. counts the number of maximal maps subsumed by every map. A maximal map is one that has a maximal type in every dimension (i.e., feature). of a map is the product of the of every dimension. For example, type t in Figure 3.19 will have a of four corresponding its four possible subtypes, only two of which are present as designated subtypes of t.
[Code--MaxCountMap]
Then we need to identify which one of the maps cover a_
atoms,
and delete those from the root map. This is because the a_
atoms
have infinite subtypes.
[Code--Atomic Prune]
We then replace all deranged types with their non-deranged subtype
covers with normalise_cover/2
.