Discussion:
[m-dev.] Partial instantiation example in the reference manual.
Paul Bone
2014-11-04 00:27:56 UTC
Permalink
Evan on stackoverflow.com tried the partial instantiation example from the
reference manual but found that it didn't work. I tried the same program
and got the same error. Is this (part of) the known issue with partial
instantiation or a seperate bug? If it is part of the same issue should we
use a different example in the reference manual or add a note that this
isn't actually supported by the current implementation?

http://stackoverflow.com/questions/26684020/why-does-this-variable-have-an-instantiatedness-of-free

Thanks.
--
Paul Bone
Julien Fischer
2014-11-05 23:40:51 UTC
Permalink
Hi Paul,
Post by Paul Bone
Evan on stackoverflow.com tried the partial instantiation example from the
reference manual but found that it didn't work. I tried the same program
and got the same error. Is this (part of) the known issue with partial
instantiation or a seperate bug? If it is part of the same issue should we
use a different example in the reference manual or add a note that this
isn't actually supported by the current implementation?
The language supports it, but the current implementation doesn't due to a
lack of support for aliasing in the mode checker. Section 3 of this
paper:

Constraint-based mode analysis of Mercury
David Overton, Zoltan Somogyi and Peter Stuckey. PPDP'02, Pittsburgh.

has an explanation of *why* the existing mode checker cannot handle that
example.

Cheers,
Julien.
Mark Brown
2014-11-06 01:21:58 UTC
Permalink
Post by Julien Fischer
Hi Paul,
Post by Paul Bone
Evan on stackoverflow.com tried the partial instantiation example from the
reference manual but found that it didn't work. I tried the same program
and got the same error. Is this (part of) the known issue with partial
instantiation or a seperate bug? If it is part of the same issue should we
use a different example in the reference manual or add a note that this
isn't actually supported by the current implementation?
There is already such a note in the first section Evan refers to.

A better example for this section might be to show some instantiation
subtyping, for example a list of non-empty lists. This would
illustrate the tree-like structure of insts, which is what that part
of the reference manual is discussing.

If there is going to be a theoretical example of partial
instantiatedness at all, then perhaps it should be fleshed out a bit
in a separate section to demonstrate more of its practical purpose? If
partial instantiatedness had its own section, it could also be made
clearer that the current implementation does not support it.
Post by Julien Fischer
The language supports it, but the current implementation doesn't due to a
lack of support for aliasing in the mode checker. Section 3 of this
Constraint-based mode analysis of Mercury
David Overton, Zoltan Somogyi and Peter Stuckey. PPDP'02, Pittsburgh.
has an explanation of *why* the existing mode checker cannot handle that
example.
It's also due to problems that delay_partial_inst.m is trying to resolve.

Cheers,
Mark.

Loading...