LogtalkDotOrg / logtalk3

Logtalk - declarative object-oriented logic programming language
https://logtalk.org
Apache License 2.0
425 stars 31 forks source link

fCube doesn't run on Ciao Prolog #151

Closed Jean-Luc-Picard-2021 closed 2 years ago

Jean-Luc-Picard-2021 commented 2 years ago

One offending and not test covered code is:

rule(swff(t, ((A => B) => C)), S, NEWS, jumpbranch, IdxNewAtom) :-
    !,
    messageOnClosedSet([swff(t, ((A => B) => C))|S]),
    write('Left branch of T->->,'),
    partecerta(S, SCERTO),
    !,
    atom_concat(newAt, IdxNewAtom, NewAtom),
    semplificazione([swff(t, A)],
        [swff(t, A), swff(f, NewAtom), swff(t, (B => NewAtom)),
                swff(t, (NewAtom => C))|SCERTO], NEWS).

I guess it should use atomic_concat/3 or atom_number/2.

Test Case:

:- decide((~ (~ ( p_1
   <=> ( p_2
     <=> ( p_3
        <=> ( p_1
           <=> ( p_2
              <=> ( p_3
 ) ) ) ) ) ) ) ) ).
pmoura commented 2 years ago

Fixed in 7233292e5079ba38d322c293a802b3033a6aeb31. All tests (including the one above) pass on Ciao Prolog (and other supported backends).