[m-dev.] semantics with any insts

Ralph Becket rafe at cs.mu.OZ.AU
Wed Mar 29 17:16:23 AEDT 2006


An idea just occurred to me: 

For a procedure whose headvars are all ground or free on exit:
- operational failure is definite semantic failure
- operational success is definite semantic success

For a procedure whose headvars may have inst any on exit:
- operational failure is definite semantic failure
- operational success is *possible* semantic success

It should be an error for a procedure of the first kind to have local
inst any vars without enclosing that code in a promise_consistent scope.

For example:

main(!IO) :-
	( if
		promise_consistent (
			set_up_solver_problem,
			search_for_solution,
			final_check_to_ensure_consistency
		)
	  then
		io.print("the answer is...", !IO),
		...
	  else
	  	io.print("no solution", !IO)
	).

I think this is a reasonable solution to the existentially-quantified-
solver-vars problem.

-- Ralph
--------------------------------------------------------------------------
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