Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!cornell!travelers.mail.cornell.edu!news.tc.cornell.edu!news.cac.psu.edu!howland.reston.ans.net!news.sprintlink.net!uunet!in1.uu.net!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!conway
From: conway@munta.cs.mu.OZ.AU (Thomas Charles CONWAY)
Subject: Re: Otherwise?
Message-ID: <9505610.7443@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Computer Science, University of Melbourne, Australia
References: <D3x65E.JED@uceng.uc.edu> <3i1888$q7c@goanna.cs.rmit.edu.au> <9505502.26941@mulga.cs.mu.OZ.AU> <3ijuvd$fqi@goanna.cs.rmit.edu.au> <3ikadr$a95@news.irisa.fr>
Date: Fri, 24 Feb 1995 23:22:11 GMT
Lines: 20

ridoux@calypso.irisa.fr (Olivier Ridoux) writes:

>
>Still, I am not happy with the standard Prolog meaning for (C->A).  Seeing
>no logic in (C->A;B) I would like to read it as a conditional statement as 
>in a procedural language (if C then A else B).  In these languages, 
>(if C then A) usually means (if C then A else skip).  It seems to me that 
>'skip' is simply much more close to 'true' than to 'false'.  So (C->A) should
>denote (C->A;true).
>

Indeed (C -> A; B) should have the same behaviour as (C,A ; \+C,B) for
it to do otherwise it pretty marginal in terms of semantics. Of course,
when you write the ->; notation, the compiler should optimise the execution
of course (using a SOFT cut not a HARD cut as *standard* Prolog does).

NU-Prolog has (if C then A else B) which has this more defensible
behaviour as well as (C -> A; B) which has the usual behaviour.

Thomas
