min predicate not defined

View: New views
5 Messages — Rating Filter:   Alert me  

min predicate not defined

by schemelab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Re: http://www.swi-prolog.org/pldoc/doc_for?object=section%282%2c%20%272.9%27%2c%20swi%28%27%2fdoc%2fManual%2fdebugoverview.html%27%29%29

the docs show an example of tracing min/2 but no such predicate is found in the Cygwin swi-prolog distro.

What can I do to load it?

Re: min predicate not defined

by Nicolas Pelletier-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

On Sat, Oct 24, 2009 at 3:30 AM, metaperl.j <metaperl.j@...> wrote:
>
> Re:
> http://www.swi-prolog.org/pldoc/doc_for?object=section%282%2c%20%272.9%27%2c%20swi%28%27%2fdoc%2fManual%2fdebugoverview.html%27%29%29
>
> the docs show an example of tracing min/2 but no such predicate is found in
> the Cygwin swi-prolog distro.
>
> What can I do to load it?

The documentation seems a bit outdated. try min_list/2 instead:

?- trace, min_list([3, 2], X).
   Call: (8) lists:min_list([3, 2], _G244) ? creep
   Exit: (8) lists:min_list([3, 2], 2) ? creep
X = 2.

--
Nicolas
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: min predicate not defined

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks.  Updated the example.

        --- Jan

On Tuesday 27 October 2009 12:54:45 am Nicolas Pelletier wrote:

> Hello,
>
> On Sat, Oct 24, 2009 at 3:30 AM, metaperl.j <metaperl.j@...> wrote:
> > Re:
> > http://www.swi-prolog.org/pldoc/doc_for?object=section%282%2c%20%272.9%27
> >%2c%20swi%28%27%2fdoc%2fManual%2fdebugoverview.html%27%29%29
> >
> > the docs show an example of tracing min/2 but no such predicate is found
> > in the Cygwin swi-prolog distro.
> >
> > What can I do to load it?
>
> The documentation seems a bit outdated. try min_list/2 instead:
>
> ?- trace, min_list([3, 2], X).
>    Call: (8) lists:min_list([3, 2], _G244) ? creep
>    Exit: (8) lists:min_list([3, 2], 2) ? creep
> X = 2.

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: min predicate not defined

by schemelab :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Tue, Oct 27, 2009 at 4:27 AM, Jan Wielemaker <J.Wielemaker@...> wrote:
> Thanks.  Updated the example.

um, you're welcome but min_list doesnt exist for me either:

?- trace, min([3, 2], X).

ERROR: Undefined procedure: min/2
?- trace, min_list([3, 2], X).
ERROR: Undefined procedure: min_list/2
?-


Here is my Cygwin SWI Prolog version;
Welcome to SWI-Prolog (Multi-threaded, Version 5.6.36)

I am starting Prolog via the prolog.el mode that is non-standard and
available here:
http://bruda.ca/emacs-prolog/
_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog

Re: min predicate not defined

by Jan Wielemaker-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 02 November 2009 03:05:52 pm Terrence Brannon wrote:
> On Tue, Oct 27, 2009 at 4:27 AM, Jan Wielemaker <J.Wielemaker@...>
wrote:

> > Thanks.  Updated the example.
>
> um, you're welcome but min_list doesnt exist for me either:
>
> ?- trace, min([3, 2], X).
>
> ERROR: Undefined procedure: min/2
> ?- trace, min_list([3, 2], X).
> ERROR: Undefined procedure: min_list/2
> ?-
>
>
> Here is my Cygwin SWI Prolog version;
> Welcome to SWI-Prolog (Multi-threaded, Version 5.6.36)

From my records, that is 2 years old.  Maybe it wasn't there then.
Using 5.8.0 should `fix' that.  B.t.w., the new docs no longer rely
on the libraries but give a bit of source to load and trace.  min_list/2
is in library(lists) and modern versions load this library with internal
debugging disabled; so you only see the first call and final exit in the
trace.

        --- Jan

_______________________________________________
SWI-Prolog mailing list
SWI-Prolog@...
https://mailbox.iai.uni-bonn.de/mailman/listinfo.cgi/swi-prolog