I previously implemented a keword in which would mark a parameter as "input only" and prevent an existential variable from being declared inside that parameter. The original intention was to ensure that a value is ground, i.e. contains no unbound variables. This isn't actually adequate. I propose two changes:
Change the keword from in to ground for clarity.
Reimplement "groundness" tracking using compile-time abstract interpretation.
The abstract interpretation should work by disregarding specific values and considering only whether they are ground or not. A value is ground if:
it is a literal value (e.g. int or string)
it is a constructor and all of its arguments are ground values
it is a variable that has been unified with a ground value
I previously implemented a keword
in
which would mark a parameter as "input only" and prevent an existential variable from being declared inside that parameter. The original intention was to ensure that a value is ground, i.e. contains no unbound variables. This isn't actually adequate. I propose two changes:in
toground
for clarity.The abstract interpretation should work by disregarding specific values and considering only whether they are ground or not. A value is ground if: