Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.prolog > #13713

Re: Autum Challenge, 42 is the Answer

From Markus Triska <triska@logic.at>
Newsgroups comp.lang.prolog
Subject Re: Autum Challenge, 42 is the Answer
Organization man
References (4 earlier) <3a23c78d-d4a1-472a-a460-776a5ca7d3een@googlegroups.com> <e945e9c8-e72f-41a2-bb06-473d275396c0n@googlegroups.com> <030ed934-efa4-4a1e-96b4-96f9c5214a6en@googlegroups.com> <db4b30f2-2c33-42f6-9630-2828418aa146n@googlegroups.com> <868d4f75-c293-4929-83b7-e319f4dba451n@googlegroups.com>
Message-ID <m2r0njgghs.fsf@logic.at> (permalink)
Date 2023-08-31 21:26 +0200

Show all headers | View raw


Mostowski Collapse <bursejan@gmail.com> writes:

> /* Scryer Prolog CLP(Z) */
> ?- time(([X,Y,Z] ins 0..239, X^3+Y^3+9 #= Z^3, label([X,Y,Z]), fail; true)).
>    % CPU time: 75.667s
>    true.
>
With the newly release Scryer Prolog version 0.9.2, I now get:

    ?- time(([X,Y,Z] ins 0..239, X^3+Y^3+9 #= Z^3, label([X,Y,Z]), fail; true)).
       % CPU time: 41.658s
       true.

On my machine, that's within a factor of 6 of SWI. That's quite
comparable to many other applications when it comes to time performance:
At the current state of Scryer Prolog development, its performance tends
to be within an order of magnitude of SWI's.

One neat feature of the Scryer Prolog toplevel is that we can press "a"
to obtain *all* solutions, one after the other. In this case:

    ?- time(([X,Y,Z] ins 0..239, X^3+Y^3+9 #= Z^3, label([X,Y,Z]))).
       % CPU time: 16.080s
       X = 52, Y = 216, Z = 217
    ;  % CPU time: 25.942s
       X = 216, Y = 52, Z = 217
    ;  % CPU time: 0.250s
       false.

It's often nice to get the Prolog system to enumerate all solutions
automatically. The GNU Prolog toplevel also has this feature, and I
highly recommend adding it in system where it is not yet available.

All the best,
Markus

-- 
comp.lang.prolog FAQ: http://www.logic.at/prolog/faq/
The Power of Prolog:  https://www.metalevel.at/prolog

Back to comp.lang.prolog | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-08-31 07:23 -0700
  Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-09 10:42 -0700
    Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-09 11:30 -0700
      Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 05:07 -0700
        Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 11:28 -0700
          Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 11:30 -0700
            Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 11:58 -0700
              Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 12:13 -0700
                Re: Autum Challenge, 42 is the Answer Mostowski Collapse <bursejan@gmail.com> - 2022-09-20 17:49 -0700
                Re: Autum Challenge, 42 is the Answer Markus Triska <triska@logic.at> - 2023-08-31 21:26 +0200
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2023-09-01 11:47 -0700
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2023-09-01 14:38 -0700
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2023-09-04 04:31 -0700
                Re: Autum Challenge, 42 is the Answer Markus Triska <triska@logic.at> - 2023-09-04 19:48 +0200
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2023-09-04 12:46 -0700
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2023-09-04 12:51 -0700
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2024-01-05 14:07 -0800
                Re: Autum Challenge, 42 is the Answer Mild Shock <bursejan@gmail.com> - 2024-01-06 01:53 -0800

csiph-web