• (==)/2 is rather trivial (Was: On the order of cyclic terms (Was: Mild

    From Mild Shock@21:1/5 to Mild Shock on Sun Jul 20 19:47:10 2025
    From Dogelog Player:

    % bisim_equals(+Term, +Term)
    bisim_equals(X, Y) :-
    sys_bisim_equals(X, Y, []).

    % sys_bisim_equals(+Term, +Term, +List)
    sys_bisim_equals(X, Y, _) :- primitive(X), !, X == Y.
    sys_bisim_equals(X, Y, _) :- primitive(Y), !, X == Y.
    sys_bisim_equals(X, Y, S) :-
    member(Z-T, S),
    ir_object_equals(X, Z),
    ir_object_equals(Y, T), !.
    sys_bisim_equals(X, Y, _) :-
    functor(X, F, N),
    functor(Y, G, M),
    F/N \== G/M, !, fail.
    sys_bisim_equals(X, Y, S) :-
    X =.. [_|L],
    Y =.. [_|R],
    sys_bisim_equals_list(L, R, [X-Y|S]).

    % sys_bisim_equals_list(+List, +List, +List)
    sys_bisim_equals_list([], [], _).
    sys_bisim_equals_list([X|L], [Y|R], S) :-
    sys_bisim_equals(X, Y, S),
    sys_bisim_equals_list(L, R, S).

    Mild Shock schrieb:

    compare/2 doesn't cover only (==)/2.
    It also covers (@<)/2 and (@>)/2.

    Julio Di Egidio schrieb:
    On 20/07/2025 16:22, Julio Di Egidio wrote:
    On 20/07/2025 16:15, Julio Di Egidio wrote:
    On 20/07/2025 15:13, Mild Shock wrote:

    ;  > Let (H, <) be the standard total oder an the
    ;  > Prolog finite terms. Let R be the set of rational
    ;  > term. H c R. Then there is total order
    ;  > extention (R, <') of (H, <).
    ;
    Is the problem of a compare/3 for rational trees,
    that is a extension of the compare/3 for finite aka
    acyclic terms with the submodel property.

    Your "discourse" implicitly assumes that the
    "extension" is somewhat "trivial" and/or
    "natural".  Which, in turn, I'd think is the
    case (can be done) only if we can *effectively*
    (and, ideally, somewhat "naturally") define
    *canonical form* then *normalization* of
    (Prolog's) cyclic terms...

    P.S.  I have not actually investigated this, but
    if "normalization" is not a problem, then I do not
    see what the problem is...

    Normalise this: `X = f(g(f(g(X))`

    Or, even simpler: `X = f(f(X))`

    (I don't think it gets essentially more complicated
    than that: I might be wrong, but AFAICT, we can only
    construct (rooted) terms with nested cycles...)

    -Julio



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Mild Shock on Sun Jul 20 19:55:11 2025
    Hi,

    bisim_equals/2 is just bisimulation. You can
    also implement bisim_unify/2, extremly trivial as well.

    But all attempts to translate the idea to
    compare_with_stack/3 have failed so far. SWI
    Prolog discourse is full of failed attempts,

    and missing insights as well, why it fails.

    Bye

    From Dogelog Player, unification that can do cyclic
    terms, also extremly trivial:

    % bisim_unify(+Term, +Term)
    bisim_unify(X, Y) :-
    sys_bisim_unify(X, Y, []).

    % sys_bisim_unify(+Term, +Term, +List)
    sys_bisim_unify(X, Y, _) :- primitive(X), !, X = Y.
    sys_bisim_unify(X, Y, _) :- primitive(Y), !, X = Y.
    sys_bisim_unify(X, Y, S) :-
    member(Z-T, S),
    ir_object_equals(X, Z),
    ir_object_equals(Y, T), !.
    sys_bisim_unify(X, Y, _) :-
    functor(X, F, N),
    functor(Y, G, M),
    F/N \== G/M, !, fail.
    sys_bisim_unify(X, Y, S) :-
    X =.. [_|L],
    Y =.. [_|R],
    sys_bisim_unify_list(L, R, [X-Y|S]).

    % sys_bisim_unify_list(+List, +List, +List)
    sys_bisim_unify_list([], [], _).
    sys_bisim_unify_list([X|L], [Y|R], S) :-
    sys_bisim_unify(X, Y, S),
    sys_bisim_unify_list(L, R, S).

    Mild Shock schrieb:
    From Dogelog Player:

    % bisim_equals(+Term, +Term)
    bisim_equals(X, Y) :-
       sys_bisim_equals(X, Y, []).

    % sys_bisim_equals(+Term, +Term, +List)
    sys_bisim_equals(X, Y, _) :- primitive(X), !, X == Y.
    sys_bisim_equals(X, Y, _) :- primitive(Y), !, X == Y.
    sys_bisim_equals(X, Y, S) :-
       member(Z-T, S),
       ir_object_equals(X, Z),
       ir_object_equals(Y, T), !.
    sys_bisim_equals(X, Y, _) :-
       functor(X, F, N),
       functor(Y, G, M),
       F/N \== G/M, !, fail.
    sys_bisim_equals(X, Y, S) :-
       X =.. [_|L],
       Y =.. [_|R],
       sys_bisim_equals_list(L, R, [X-Y|S]).

    % sys_bisim_equals_list(+List, +List, +List)
    sys_bisim_equals_list([], [], _).
    sys_bisim_equals_list([X|L], [Y|R], S) :-
       sys_bisim_equals(X, Y, S),
       sys_bisim_equals_list(L, R, S).

    Mild Shock schrieb:

    compare/2 doesn't cover only (==)/2.
    It also covers (@<)/2 and (@>)/2.

    Julio Di Egidio schrieb:
    On 20/07/2025 16:22, Julio Di Egidio wrote:
    On 20/07/2025 16:15, Julio Di Egidio wrote:
    On 20/07/2025 15:13, Mild Shock wrote:

    ;  > Let (H, <) be the standard total oder an the
    ;  > Prolog finite terms. Let R be the set of rational
    ;  > term. H c R. Then there is total order
    ;  > extention (R, <') of (H, <).
    ;
    Is the problem of a compare/3 for rational trees,
    that is a extension of the compare/3 for finite aka
    acyclic terms with the submodel property.

    Your "discourse" implicitly assumes that the
    "extension" is somewhat "trivial" and/or
    "natural".  Which, in turn, I'd think is the
    case (can be done) only if we can *effectively*
    (and, ideally, somewhat "naturally") define
    *canonical form* then *normalization* of
    (Prolog's) cyclic terms...

    P.S.  I have not actually investigated this, but
    if "normalization" is not a problem, then I do not
    see what the problem is...

    Normalise this: `X = f(g(f(g(X))`

    Or, even simpler: `X = f(f(X))`

    (I don't think it gets essentially more complicated
    than that: I might be wrong, but AFAICT, we can only
    construct (rooted) terms with nested cycles...)

    -Julio




    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mild Shock@21:1/5 to Julio Di Egidio on Sun Jul 20 23:14:01 2025
    Hi,

    Normalise this: `X = f(g(f(g(X))`

    Or, even simpler: `X = f(f(X))`

    (I don't think it gets essentially more complicated
    than that: I might be wrong, but AFAICT, we can on

    This normalization can be done quite trivially with
    bisimulation. Like getting X = f(g(X)), or X = f(X)
    as a normalization solution.

    But bisimulation and or normalization, doesn't give you
    compare/3, which is the subject of "On the order of
    cyclic terms", SWI Prolog discourse is full of failed

    attempts, the most hilarious you find here:

    History dependent semi_lex_compare/3 https://swi-prolog.discourse.group/t/history-dependent-semi-lex-compare-3/6431

    I do not object at explorative prototyping.
    It only confirms what I am saying.

    But all attempts to translate the idea to
    compare_with_stack/3 have failed so far. SWI
    Prolog discourse is full of failed attempts,
    and missing insights as well, why it fails.

    The main problem is some lack of insight why
    something fails, and the same lack to proceed
    from that proactively to create something

    better. Most stuff you find is extremly
    reactive, without some learning, without
    some incremental progress, and recently

    new posts that show a complete lack of learning,
    even fail for the same old examples from 2023.
    Its just complete cringe.

    Julio Di Egidio schrieb:
    On 20/07/2025 19:46, Mild Shock wrote:

    compare/2 doesn't cover only (==)/2.
    It also covers (@<)/2 and (@>)/2.

    Which must be the reason you keep posting code,
    and inscrutable one at that, on bisimulation...
    you complete asshole.

    But all attempts to translate the idea to
    compare_with_stack/3 have failed so far. SWI
    Prolog discourse is full of failed attempts,
    and missing insights as well, why it fails.

    Don't underestimate your own contribution...

    *Plonk*

    -Julio


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