• Was it worth the wait? [gemini by Google]

    From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Feb 22 16:49:43 2024
    From Newsgroup: comp.lang.prolog

    Interesting, new Google gemini, had a vague notion
    of this algorithm when I asked it. ChatGPT was totally
    clueless. BTW nice video:

    Dijkstra's Hidden Prime Finding Algorithm https://www.youtube.com/watch?v=fwxjMKBMR7s

    DIJKSTRA'S PRIME NUMBER ALGORITHM https://www.heinrichhartmann.com/archive/Dijkstra%27s-Prime-Number-Algorithm.html

    gemini couldn't produce correct Python code though.
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Thu Feb 22 19:11:31 2024
    From Newsgroup: comp.lang.prolog

    Google gemini is nevertheless a complete idiot.
    It just showed me:

    X = (24 + 394479375 * 1) / 36641
    X = 394479403 / 36641
    X = 10769

    LoL

    Mild Shock schrieb:
    Interesting, new Google gemini, had a vague notion
    of this algorithm when I asked it. ChatGPT was totally
    clueless. BTW nice video:

    Dijkstra's Hidden Prime Finding Algorithm https://www.youtube.com/watch?v=fwxjMKBMR7s

    DIJKSTRA'S PRIME NUMBER ALGORITHM https://www.heinrichhartmann.com/archive/Dijkstra%27s-Prime-Number-Algorithm.html


    gemini couldn't produce correct Python code though.

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Tue Feb 27 17:03:59 2024
    From Newsgroup: comp.lang.prolog


    Terence Tao, "Machine Assisted Proof" https://www.youtube.com/watch?v=AayZuuDDKP0

    Mostowski Collapse schrieb:
    Don't buy your Pearls in Honk Kong. They are all fake.

    So what do you prefer, this Haskell monster: https://www.cs.nott.ac.uk/~pszgmh/countdown.pdf
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Mar 16 14:06:47 2024
    From Newsgroup: comp.lang.prolog

    I didn't make all my homework yet.
    For example just fiddling around with CLP(FD), I get:

    ?- maplist(in, Vs, [1\/3..4, 1..2\/4, 1..2\/4,
    1..3, 1..3, 1..6]), all_distinct(Vs).
    false.

    Does Scryer Prolog CLP(Z) have some explanator for that?
    What is exactly the conflict that it fails?

    Mild Shock schrieb:

    Terence Tao, "Machine Assisted Proof" https://www.youtube.com/watch?v=AayZuuDDKP0

    Mostowski Collapse schrieb:
    Don't buy your Pearls in Honk Kong. They are all fake.

    So what do you prefer, this Haskell monster:
    https://www.cs.nott.ac.uk/~pszgmh/countdown.pdf

    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sat Mar 16 14:13:50 2024
    From Newsgroup: comp.lang.prolog


    Or a more striking example, Peter Norvig's impossible
    Sudoku, which he claims took him 1439 seconds
    to show that it is unsolvable:

    /* Peter Norvig */
    problem(9, [[_,_,_,_,_,5,_,8,_],
    [_,_,_,6,_,1,_,4,3],
    [_,_,_,_,_,_,_,_,_],
    [_,1,_,5,_,_,_,_,_],
    [_,_,_,1,_,6,_,_,_],
    [3,_,_,_,_,_,_,_,5],
    [5,3,_,_,_,_,_,6,1],
    [_,_,_,_,_,_,_,_,4],
    [_,_,_,_,_,_,_,_,_]]).

    https://norvig.com/sudoku.html

    whereby SWI-Prolog with all_distinct/1 does
    it in a blink, even without labeling:

    ?- problem(9, M), time(sudoku(M)).
    % 316,054 inferences, 0.016 CPU in 0.020 seconds
    (80% CPU, 20227456 Lips)
    false.

    Pretty cool!

    Mild Shock schrieb:
    I didn't make all my homework yet.
    For example just fiddling around with CLP(FD), I get:

    ?- maplist(in, Vs, [1\/3..4, 1..2\/4, 1..2\/4,
              1..3, 1..3, 1..6]), all_distinct(Vs).
    false.

    Does Scryer Prolog CLP(Z) have some explanator for that?
    What is exactly the conflict that it fails?

    Mild Shock schrieb:

    Terence Tao, "Machine Assisted Proof"
    https://www.youtube.com/watch?v=AayZuuDDKP0

    Mostowski Collapse schrieb:
    Don't buy your Pearls in Honk Kong. They are all fake.

    So what do you prefer, this Haskell monster:
    https://www.cs.nott.ac.uk/~pszgmh/countdown.pdf


    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Mar 24 01:32:42 2024
    From Newsgroup: comp.lang.prolog

    Now I have the feeling there are no difficult 9x9
    Sudokus for the computer. At least not for computers
    running SWI-Prolog and using CLP(FD) with the global
    constraint all_distinct/1.

    I was fishing among the 17-clue Sudokus, and the
    hardest I could find so far was this one:

    /* Gordon Royle #3668 */
    problem(11,[[_,_,_,_,_,_,_,_,_],
    [_,_,_,_,_,_,_,1,2],
    [_,_,3,_,_,4,_,_,_],
    [_,_,_,_,_,_,_,_,3],
    [_,1,_,2,5,_,_,_,_],
    [6,_,_,_,_,_,7,_,_],
    [_,_,_,_,2,_,_,_,_],
    [_,_,7,_,_,_,4,_,_],
    [5,_,_,1,6,_,_,8,_]]).

    But SWI-Prolog still does it in around 3 seconds.
    SWI-Prolog does other 17-clue Sudokus in less than 100ms.

    Are there any 17-clue Sudokus that take more time?

    Mild Shock schrieb:

    Or a more striking example, Peter Norvig's impossible
    Sudoku, which he claims took him 1439 seconds
    to show that it is unsolvable:

    /* Peter Norvig */
    problem(9, [[_,_,_,_,_,5,_,8,_],
                [_,_,_,6,_,1,_,4,3],
                [_,_,_,_,_,_,_,_,_],
                [_,1,_,5,_,_,_,_,_],
                [_,_,_,1,_,6,_,_,_],
                [3,_,_,_,_,_,_,_,5],
                [5,3,_,_,_,_,_,6,1],
                [_,_,_,_,_,_,_,_,4],
                [_,_,_,_,_,_,_,_,_]]).

    https://norvig.com/sudoku.html

    whereby SWI-Prolog with all_distinct/1 does
    it in a blink, even without labeling:

    ?- problem(9, M), time(sudoku(M)).
    % 316,054 inferences, 0.016 CPU in 0.020 seconds
     (80% CPU, 20227456 Lips)
    false.

    Pretty cool!

    Mild Shock schrieb:
    I didn't make all my homework yet.
    For example just fiddling around with CLP(FD), I get:

    ?- maplist(in, Vs, [1\/3..4, 1..2\/4, 1..2\/4,
               1..3, 1..3, 1..6]), all_distinct(Vs).
    false.

    Does Scryer Prolog CLP(Z) have some explanator for that?
    What is exactly the conflict that it fails?

    Mild Shock schrieb:

    Terence Tao, "Machine Assisted Proof"
    https://www.youtube.com/watch?v=AayZuuDDKP0

    Mostowski Collapse schrieb:
    Don't buy your Pearls in Honk Kong. They are all fake.

    So what do you prefer, this Haskell monster:
    https://www.cs.nott.ac.uk/~pszgmh/countdown.pdf



    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mild Shock@janburse@fastmail.fm to comp.lang.prolog on Sun Mar 24 18:26:20 2024
    From Newsgroup: comp.lang.prolog

    Is 3 seconds even enough to generate
    unique Sudokus? How many trials would be
    needed? The uniqueness problem

    seems to have no useful reduction,
    already the question whether a partial
    latin square has a unique solution

    is NP complete?

    Finding Another Solution
    T. Yato & T. Seta - 2002
    https://academic.timwylie.com/17CSCI4341/sudoku.pdf

    Mild Shock schrieb:
    Now I have the feeling there are no difficult 9x9
    Sudokus for the computer. At least not for computers
    running SWI-Prolog and using CLP(FD) with the global
    constraint all_distinct/1.

    I was fishing among the 17-clue Sudokus, and the
    hardest I could find so far was this one:

    /* Gordon Royle #3668 */
    problem(11,[[_,_,_,_,_,_,_,_,_],
                [_,_,_,_,_,_,_,1,2],
                [_,_,3,_,_,4,_,_,_],
                [_,_,_,_,_,_,_,_,3],
                [_,1,_,2,5,_,_,_,_],
                [6,_,_,_,_,_,7,_,_],
                [_,_,_,_,2,_,_,_,_],
                [_,_,7,_,_,_,4,_,_],
                [5,_,_,1,6,_,_,8,_]]).

    But SWI-Prolog still does it in around 3 seconds.
    SWI-Prolog does other 17-clue Sudokus in less than 100ms.

    Are there any 17-clue Sudokus that take more time?
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From Mikko@mikko.levanto@iki.fi to comp.lang.prolog on Mon Mar 25 09:59:19 2024
    From Newsgroup: comp.lang.prolog

    On 2024-03-24 17:26:20 +0000, Mild Shock said:

    https://academic.timwylie.com/17CSCI4341/sudoku.pdf

    For an expamle about what is reasonable to expect see pages
    https://mlevanto.github.io/solver.html
    https://mlevanto.github.io/SudokuV.html
    https://mlevanto.github.io/Latina.html

    The first one is a solver. It also determines whether the
    solution is unique.

    The other two problem generators. They are a bit slow but
    still usable.

    Buttons at the bottom are for saving the problem or solution
    in different file formats.
    --
    Mikko

    --- Synchronet 3.20a-Linux NewsLink 1.114