• Prolog Tribute to Hao Wang

    From Mild Shock@21:1/5 to All on Fri Dec 6 21:16:59 2024
    This code here doesn’t make much sense:

    prove(L --> R):-
    member(A => B,L),
    del(A => B,L,NewL),!,

    One can combine member/2 and del/3 into select/3. select/3
    together with member/2 is part of the Prologue to Prolog:

    *A Prologue for Prolog (working draft)* https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue

    So if I further strip away using a two sided sequent,
    I can implement Hoa Wangs implication fagment:

    P1. Initial rule: if λ, ζ are strings of atomic
    formulae, then λ -> ζ is a theorem if some atomic
    formula occurs an both sides of the arrow.

    P5a. Rule —> => If ζ, φ -> λ, ψ, ρ, then ζ -> λ, φ => ψ, ρ
    P5b. Rule => -> If λ, ψ, ρ -> π and λ, ρ -> π, φ then λ, φ => ψ, ρ -> π

    (Hao Wang. Toward Mechanical Mathematics. IBM
    Journal of Research and Development 4:1 (1960), 15.)

    as follows in 3 lines:

    prove(L) :- select((A->B),L,R), !, prove([-A,B|R]).
    prove(L) :- select(-(A->B),L,R), !, prove([A|R]), prove([-B|R]).
    prove(L) :- select(-A,L,R), member(A,R), !.

    Seems to work, I can prove Peirce Law:

    ?- prove([(((p->q)->p)->p)]).
    true.
    See also:

    *Hao Wang on the formalisation of mathematics*
    Lawrence C. Paulson 26 Jul 2023 https://lawrencecpaulson.github.io/2023/07/26/Wang.html

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Sat Dec 7 23:24:14 2024
    Hi,

    But its funny that people still work on UNSAT,
    because its known that SAT is NP complete.

    But don't worry, I sometimes do the same.
    Imogen seems to chocke on SYJ202:

    SYJ202+1.005.imo Provable. Time: 2.129
    SYJ202+1.006.imo Provable. Time: 3.790
    SYJ202+1.007.imo Provable. Time: 16.222
    SYJ202+1.008.imo Provable. Time: 143.802

    I assume its just the same problem linearly growing,
    but the time is exponential or something.

    BTW: Complexity for intuitionistic propositional logic
    is even worse, its PSPACE complete. Here a recent

    attempt featuring intuitRIL and SuperL

    Implementing Intermediate Logics https://iltp.de/ARQNL-2024/download/proceedings_preli/2_ARQNL_2024_paper_8.pdf

    Have Fun!

    Bye


    Mild Shock schrieb:
    This code here doesn’t make much sense:

    prove(L --> R):-
        member(A => B,L),
        del(A => B,L,NewL),!,

    One can combine member/2 and del/3 into select/3. select/3
    together with member/2 is part of the Prologue to Prolog:

    *A Prologue for Prolog (working draft)* https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue

    So if I further strip away using a two sided sequent,
    I can implement Hoa Wangs implication fagment:

    P1. Initial rule: if λ, ζ are strings of atomic
    formulae, then λ -> ζ is a theorem if some atomic
    formula occurs an both sides of the arrow.

    P5a. Rule —> =>    If ζ, φ -> λ, ψ, ρ, then ζ -> λ, φ => ψ, ρ P5b. Rule => -> If λ, ψ, ρ -> π and λ, ρ -> π, φ then λ, φ => ψ, ρ -> π

    (Hao Wang. Toward Mechanical Mathematics. IBM
    Journal of Research and Development 4:1 (1960), 15.)

    as follows in 3 lines:

    prove(L) :- select((A->B),L,R), !, prove([-A,B|R]).
    prove(L) :- select(-(A->B),L,R), !, prove([A|R]), prove([-B|R]).
    prove(L) :- select(-A,L,R), member(A,R), !.

    Seems to work, I can prove Peirce Law:

    ?- prove([(((p->q)->p)->p)]).
    true.
    See also:

    *Hao Wang on the formalisation of mathematics*
    Lawrence C. Paulson 26 Jul 2023 https://lawrencecpaulson.github.io/2023/07/26/Wang.html




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Fri Mar 14 13:39:02 2025
    Hi,

    Not only $TSLA is on fire sale! Also
    Prolog system have capitualted long ago.
    Scryer Prolog and Trealla Prolog copy

    some old CLP(X) nonsense based on attributed
    variables. SWI-Prolog isn't better off.
    Basically the USA and their ICLP venue

    is dumbing down all of Prolog development,
    so that nonsense such as this is published:

    Automatic Differentiation in Prolog
    Schrijvers Tom et. al - 2023
    https://arxiv.org/pdf/2305.07878

    It has the most stupid conclusion.

    "In future work we plan to explore Prolog’s meta-
    programming facilities (e.g., term expansion) to
    implement partial evaluation of revad/5 calls on
    known expressions. We also wish to develop further
    applications on top of our AD approach, such as
    Prolog-based neural networks and integration with
    existing probabilistic logic programming languages."

    As if term expansion would do anything good
    concerning the evaluation or training of neural
    networks. They are totally clueless!

    Bye

    P.S.: The stupidity is even topped, that people
    have unlearned how to do symbolic algebra
    in Prolog itself. They are not able to code it:

    ?- simplify(x+x+y-y,E).
    E = number(2)*x+y-y

    Simplification is hard (IMO).

    Instead they are now calling Python:

    sym(A * B, S) :-
    !, sym(A, A1),
    sym(B, B1),
    py_call(operator:mul(A1, B1), S).

    mys(S, A * B) :-
    py_call(sympy:'Mul', Mul),
    py_call(isinstance(S, Mul), @(true)),
    !, py_call(S:args, A0-B0),
    mys(A0, A),
    mys(B0, B).

    Etc..

    sympy(A, R) :-
    sym(A, S),
    mys(S, R).

    ?- sympy(x + y + 1 + x + y + -1, S).
    S = 2*x+2*y ;

    This is the final nail in the coffin, the declaration
    of the complete decline of Prolog. Full proof that
    SWI-Prolog Janus is indicative that we have reached

    the valley of idiocracy in Prolog. And that there
    are no more capable Prologers around.

    Mild Shock schrieb:
    Hi,

    But its funny that people still work on UNSAT,
    because its known that SAT is NP complete.

    But don't worry, I sometimes do the same.
    Imogen seems to chocke on SYJ202:

      SYJ202+1.005.imo     Provable.    Time: 2.129
      SYJ202+1.006.imo     Provable.    Time: 3.790
      SYJ202+1.007.imo     Provable.    Time: 16.222
      SYJ202+1.008.imo     Provable.    Time: 143.802

    I assume its just the same problem linearly growing,
    but the time is exponential or something.

    BTW: Complexity for intuitionistic propositional logic
    is even worse, its PSPACE complete. Here a recent

    attempt featuring intuitRIL and SuperL

    Implementing Intermediate Logics https://iltp.de/ARQNL-2024/download/proceedings_preli/2_ARQNL_2024_paper_8.pdf


    Have Fun!

    Bye


    Mild Shock schrieb:
    This code here doesn’t make much sense:

    prove(L --> R):-
         member(A => B,L),
         del(A => B,L,NewL),!,

    One can combine member/2 and del/3 into select/3. select/3
    together with member/2 is part of the Prologue to Prolog:

    *A Prologue for Prolog (working draft)*
    https://www.complang.tuwien.ac.at/ulrich/iso-prolog/prologue

    So if I further strip away using a two sided sequent,
    I can implement Hoa Wangs implication fagment:

    P1. Initial rule: if λ, ζ are strings of atomic
    formulae, then λ -> ζ is a theorem if some atomic
    formula occurs an both sides of the arrow.

    P5a. Rule —> =>    If ζ, φ -> λ, ψ, ρ, then ζ -> λ, φ => ψ, ρ >> P5b. Rule => -> If λ, ψ, ρ -> π and λ, ρ -> π, φ then λ, φ => ψ, ρ -> π

    (Hao Wang. Toward Mechanical Mathematics. IBM
    Journal of Research and Development 4:1 (1960), 15.)

    as follows in 3 lines:

    prove(L) :- select((A->B),L,R), !, prove([-A,B|R]).
    prove(L) :- select(-(A->B),L,R), !, prove([A|R]), prove([-B|R]).
    prove(L) :- select(-A,L,R), member(A,R), !.

    Seems to work, I can prove Peirce Law:

    ?- prove([(((p->q)->p)->p)]).
    true.
    See also:

    *Hao Wang on the formalisation of mathematics*
    Lawrence C. Paulson 26 Jul 2023
    https://lawrencecpaulson.github.io/2023/07/26/Wang.html





    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)