Menu

#172 pu_attr does not work as expected.

open
nobody
Other (40)
5
2009-02-10
2009-02-10
No

As the 1st reply was not expected, I tried with second one.
I'm trying to implement constructive intensinal negation, and this could reduce a lot the main problem.

| ?- put_attr(X,_,X\==s(0)), p(X).

X = 0;

X = s(0);

X = s(s(0));

X = s(s(s(0)));

X = s(s(s(s(0))))

yes
| ?- put_attr(X,_,X=s(0)), p(X).

X = s(0);

no
| ?-

Regards,

Victor

Discussion

  • Victor Pablos Ceruelo

    put_attr, sorry.

     
  • Victor Pablos Ceruelo

    And the original program is this ...

    p(0).
    p(s(X)) :- p(X).

     
  • Nobody/Anonymous

    Maybe I should detail it a little more:

    | ?- put_attr(X,_,X=0), p(X).

    X = 0;

    no
    | ?- put_attr(X,_,X=s(0)), p(X).

    X = s(0);

    no
    | ?- put_attr(X,_,X\==0), p(X).

    X = s(0);

    X = s(s(0));

    X = s(s(s(0)));

    X = s(s(s(s(0))))

    yes
    | ?- put_attr(X,_,X\==s(0)), p(X).

    X = 0;

    X = s(0);

    X = s(s(0))

    yes
    | ?-

     

Log in to post a comment.