[m-users.] Why can't `det` be used where `multi` is expected.

Philip White philipwhite at cedarville.edu
Tue Aug 6 12:09:34 AEST 2019


Quoting Julien Fischer (2019-08-05 21:10:20)
> 
> On Mon, 5 Aug 2019, Philip White wrote:
> 
> > Quoting Julian Fondren (2019-08-05 01:46:30)
> >> On 2019-08-04 23:02, Philip White wrote:
> >> mds.m:022:   in argument 1 of call to predicate 
> >> `getopt.process_options'/4:
> >> mds.m:022:   mode error: variable `OptionOps' has instantiatedness
> >> mds.m:022:     unique(
> >> mds.m:022:       option_ops_multi(
> >> mds.m:022:         /* unique */ (pred(in, out) is semidet),
> >> mds.m:022:         /* unique */ (pred(in, out) is semidet),
> >> mds.m:022:         /* unique */ (pred(out, out) is det)
> >> mds.m:022:       )
> >> mds.m:022:     ),
> >
> > Wow, the formatting really helps a lot; I'll make sure to reformat
> > errors in the future. Maybe I'm getting errors wrong, but for me,
> > mds.err has both the expected and actual instantiatedness one the same
> > one line (well, multiple lines due to line wrapping). Errors don't get
> > logged by default for me, so I've been passing the -E flag.
> >
> > Is there a way to have errors get pretty-printed?
> 
> They *should* be formatted by default; you'll have to provide us with a
> bit more information.
> 
> Julien.

Below is my terminal session; and no, my email client didn't wrap the
text. mmc is version 14.0.1 - OS is NixOS, which is a pretty nonstandard
distribution, so maybe it has something to do with some weird patch. I
can't think of anything that my dotfile would be doing to
make these errors get reflowed.

λ>mmc --make mds -E
Making Mercury/cs/mds.c
mds.m:055: In clause for `main(di, uo)':
mds.m:055:   mode error in conjunction. The next 5 error messages indicate
mds.m:055:   possible causes of this error.
mds.m:050:   In clause for `main(di, uo)':
mds.m:050:   in argument 1 of call to predicate `getopt.process_options'/4:
mds.m:050:   mode error: variable `OptionOps' has instantiatedness
mds.m:050:   `unique(getopt.option_ops_multi(/* unique */(pred((ground >>
mds.m:050:   ground), (free >> ground)) is semidet), /* unique */(pred((ground
mds.m:050:   >> ground), (free >> ground)) is semidet), /* unique */(pred((free
mds.m:050:   >> ground), (free >> ground)) is det)))',
mds.m:050:   expected instantiatedness was
mds.m:050:   `bound(getopt.option_ops((pred((ground >> ground), (free >>
mds.m:050:   ground)) is semidet), (pred((ground >> ground), (free >> ground))
mds.m:050:   is semidet), (pred((free >> ground), (free >> ground)) is nondet))
mds.m:050:   ; getopt.option_ops((pred((ground >> ground), (free >> ground)) is
... error log truncated, see `mds.err' for the complete log.
** Error making `Mercury/cs/mds.c'.

λ>cat mds.err
mds.m:055: In clause for `main(di, uo)':
mds.m:055:   mode error in conjunction. The next 5 error messages indicate
mds.m:055:   possible causes of this error.
mds.m:050:   In clause for `main(di, uo)':
mds.m:050:   in argument 1 of call to predicate `getopt.process_options'/4:
mds.m:050:   mode error: variable `OptionOps' has instantiatedness
mds.m:050:   `unique(getopt.option_ops_multi(/* unique */(pred((ground >>
mds.m:050:   ground), (free >> ground)) is semidet), /* unique */(pred((ground
mds.m:050:   >> ground), (free >> ground)) is semidet), /* unique */(pred((free
mds.m:050:   >> ground), (free >> ground)) is det)))',
mds.m:050:   expected instantiatedness was
mds.m:050:   `bound(getopt.option_ops((pred((ground >> ground), (free >>
mds.m:050:   ground)) is semidet), (pred((ground >> ground), (free >> ground))
mds.m:050:   is semidet), (pred((free >> ground), (free >> ground)) is nondet))
mds.m:050:   ; getopt.option_ops((pred((ground >> ground), (free >> ground)) is
mds.m:050:   semidet), (pred((ground >> ground), (free >> ground)) is semidet),
mds.m:050:   (pred((free >> ground), (free >> ground)) is nondet),
mds.m:050:   (pred((ground >> ground), (ground >> ground), (ground >> ground),
mds.m:050:   (free >> ground)) is semidet)) ;
mds.m:050:   getopt.option_ops_multi((pred((ground >> ground), (free >>
mds.m:050:   ground)) is semidet), (pred((ground >> ground), (free >> ground))
mds.m:050:   is semidet), (pred((free >> ground), (free >> ground)) is multi))
mds.m:050:   ; getopt.option_ops_multi((pred((ground >> ground), (free >>
mds.m:050:   ground)) is semidet), (pred((ground >> ground), (free >> ground))
mds.m:050:   is semidet), (pred((free >> ground), (free >> ground)) is multi),
mds.m:050:   (pred((ground >> ground), (ground >> ground), (ground >> ground),
mds.m:050:   (free >> ground)) is semidet)))'.
mds.m:052:   In clause for `main(di, uo)':
mds.m:052:   in argument 1 of call to predicate `io.write'/3:
mds.m:052:   mode error: variable `Options' has instantiatedness `free',
mds.m:052:   expected instantiatedness was `ground'.
mds.m:053:   In clause for `main(di, uo)':
mds.m:053:   in argument 2 of call to predicate `io.write'/3:
mds.m:053:   unique-mode error: the called procedure would clobber its
mds.m:053:   argument, but variable `STATE_VARIABLE_IO_15' is still live.
mds.m:054:   In clause for `main(di, uo)':
mds.m:054:   in argument 1 of call to predicate `io.nl'/2:
mds.m:054:   unique-mode error: the called procedure would clobber its
mds.m:054:   argument, but variable `STATE_VARIABLE_IO_16' is still live.
mds.m:055:   In clause for `main(di, uo)':
mds.m:055:   in argument 2 of call to predicate `io.write_string'/3:
mds.m:055:   unique-mode error: the called procedure would clobber its
mds.m:055:   argument, but variable `STATE_VARIABLE_IO_17' is still live.

Philip.


More information about the users mailing list