There seem to be some cases where the LKB does not fully expand type constraints, e.g. compiling the following as the entire grammar:
list := *top*. cons := list & [ FIRST *top*, REST list ]. 0-1-list := list. 1-list := 0-1-list & cons & [ REST null ]. null := 0-1-list. 1-plus-list := cons & [ REST cons ]. list-wrapper := *top* & [ LIST list ]. diff-list := list-wrapper & [ LAST list ]. wrapped-list-with-diff-list := list-wrapper & [ LIST list-with-diff-list ]. list-with-diff-list := list & [ RESULT diff-list ]. cons-with-diff-list := cons & list-with-diff-list & [ FIRST #first, REST list-with-diff-list & [ RESULT [ LIST #rest, LAST #end ]], RESULT [ LIST [ FIRST #first, REST #rest ], LAST #end ]]. 0-1-list-with-diff-list := 0-1-list & list-with-diff-list. null-with-diff-list := null & 0-1-list-with-diff-list & [ RESULT [ LIST #end, LAST #end ]]. 1-list-with-diff-list := 1-list & 0-1-list-with-diff-list & cons-with-diff-list. 1-plus-list-with-diff-list := 1-plus-list & cons-with-diff-list. test := *top* & [ TEST wrapped-list-with-diff-list & [ LIST null ]].
The type constraints for
null-with-diff-list include a re-entrancy. However, in the type
test, this re-entrancy is lost.
Strangely, commenting out the definition of
1-list-with-diff-list recovers the re-entrancy, even though this type does not appear in the feature structure. Similarly, commenting out the constraints on
cons-with-diff-list also recovers the re-entrancy, even though again this type does not appear in the feature structure.
I’m not 100% sure what the conditions are which cause this bug, but they must be quite specific, given the above behaviour, and given that the LKB can handle much larger and more complicated type constraint expansions.
I’ve tested this with the most recent release of LKB-FOS (as well as an older release).