Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.prolog > #14884
| From | Mild Shock <janburse@fastmail.fm> |
|---|---|
| Newsgroups | comp.lang.prolog |
| Subject | Why false/0 should be avoided (Was: User @false is exaggerating as usual) |
| Date | 2025-10-07 10:32 +0200 |
| Message-ID | <10c2j6p$ll2d$2@solani.org> (permalink) |
| References | <10c2j2b$ll2d$1@solani.org> |
Hi,
Because Prolog has no false/0. It
only has fail/0, everything else is
Negation as Failure interpretation:
\+ P If the goal P has a solution, fail,
otherwise succeed. This is not real negation
("P is false"), but a kind of pseudo-negation
meaning "P is not provable". It is defined as if by
\+(P) :- P, !, fail.
\+(_).
https://userweb.fct.unl.pt/~lmp/publications/online-papers/DECsystem-10%20PROLOG%20USER%27S%20MANUAL.pdf
Bye
Mild Shock schrieb:
> Hi,
>
> UWN wrote:
>
> ?- call((!,false->true;true)).
> false, unexpected.
> true. % expected, but not found. Works in 14 other systems.
>
> Nope, I get:
>
> /* Dogelog Player */
> ?- call((!,false->true;true)).
> 🚨 Fehler: Prädikat false/0 undefiniert.
> user auf 1
>
> But this here works:
>
> /* Dogelog Player */
> ?- call((!,fail->true;true)).
> true.
>
> LoL
>
> Bye
Back to comp.lang.prolog | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
User @false is exaggerating as usual Mild Shock <janburse@fastmail.fm> - 2025-10-07 10:30 +0200
Why false/0 should be avoided (Was: User @false is exaggerating as usual) Mild Shock <janburse@fastmail.fm> - 2025-10-07 10:32 +0200
Putins payed troll is facing the final boss [Julio Di Egidio] (Was: Why false/0 should be avoided) Mild Shock <janburse@fastmail.fm> - 2025-10-07 19:06 +0200
csiph-web