[m-dev.] semantics with any insts

schachte at csse.unimelb.edu.au schachte at csse.unimelb.edu.au
Thu Mar 30 11:34:34 AEDT 2006


On Wed, Mar 29, 2006 at 05:46:39PM +1100, Mark Brown wrote:
> I can see the advantages of the declarative reading, namely that more
> powerful reasoning can be done about Mercury programs.  Presumably this
> is the motivation for your earlier stated view.

To me, the advantage of the declarative reading is that it makes
sense.  Saying that X<Y has at most one solution (X and Y not ground)
doesn't.  Another advantage is that it will remain correct with a
different implementation of Mercury, while the operational semantics
may change.  Similarly, developers may want to change the operational
aspects of a solver implementation.  It would be a shame if they were
discouraged from making such improvements because they knew that every
module that used that type would need significant modification to
compile.

> Remember "Algorithm = Logic + Control".  The user doesn't want to know
> about these details for the logic part

Exactly.  Some Mercury CLP programmers may want Mercury to check the
logical aspects of their mode and determinism declarations, but not
want to worry about the efficiency issues.  I expect in a great many
cases, they'll just use a straight constrain-and-generate paradigm and
really not want to bother about the operational stuff.  It's so
straightforward in those cases, why should they?

> but they are crucial for the control part.

OK, so give the programmer a way to assert that a particular
operational behaviour is expected, but don't encourage programmers to
make such assertions, since they restrict the developer of the solver.

Bottom line:  before any insts, putting mode and determinism
declarations improved the reliability of your code, so they are to be
encouraged.  With any insts, they really don't help correctness, they
only ensure you understand (a little bit about) the performance
characteristics of the program.  Moreover, they straightjacket solver
implementors.  So they should be discouraged.

At the very least, please use better terminology.  This isn't about
determinism at all, in the logical sense of the word.  It's just about
backtracking.

-- 
Peter Schachte              The government of the United States does not, in
schachte at cs.mu.OZ.AU        its policies, express the decency of its people.
www.cs.mu.oz.au/~schachte/      -- Jerry Fresia 
Phone: +61 3 8344 1338      
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list