[m-users.] Program questions and inquiry
Julien Fischer
jfischer at opturion.com
Tue May 7 10:58:13 AEST 2013
Hi,
On Mon, 6 May 2013, Mark Green wrote:
> Thanks for the correction - slapping my forehead here, I'm not sure
> how I let that slip..
>
> One thing I would like to know is if there's a way in Mercury of
> making the doMove method more deterministic. In VP it had to be nondet
> because the indexer couldn't allow for the "not" predicates at the
> start of each line but I wonder if there's a better way of doing it in
> Mercury.
You can get rid of the the negated goals by switching on the object
(see below). That won't change the determinsim though, since you're
also calling list.delete/3 in one of its nondet modes.
doMove(State0, Object, State) :-
State0 = state(Left0, Right0, Side0),
(
Object = nothing,
(
Side0 = left,
Side = right
;
Side0 = right,
Side = left
),
Left = Left0,
Right = Right0
;
( Object = grain
; Object = chicken
; Object = fox
),
(
Side0 = left,
delete(Left0, Item, Left),
sort([Item | Right0], Right),
Side = right
;
Side0 = right,
delete(Right0, Item, Right),
sort([Item | Left0], Left),
Side = left
)
),
State = state(Left, Right, Side).
> I'm really glad to hear it's going on well, I think Mercury has huge
> potential, although a canned binary distribution for Windows _would_
> be nice :)
I intend to release binary packages (targetted at the MinGW and MinGW64
ports of GCC) for 13.05 release. In general, building (and thus
packaging) Mercury for Windows, depends on what you want. For example,
(1) Do you want to use GCC, clang, or MSVC as the C compiler?
(Actually, things differ between versions of MSVC, so that
really should be do you want to us VS2008, VS2010, VS2012?)
(2) Will the Mercury compiler be running under cmd.exe, MSYS,
Cygwin, Powershell? (Most of these things are not entirely
consistent across different versions of Windows either.)
(3) If you include the C# grade, do you use the Microsoft .NET
or Mono?
(4) If you include the Java grade, which Java compiler etc
do you want to use?
Cheers,
Julien.
More information about the users
mailing list