Newsgroups: comp.lang.prolog
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!news.mathworks.com!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!lee
From: lee@munta.cs.mu.OZ.AU (Lee Naish)
Subject: Re: If-Then-Else (was: Re: Otherwise?)
Message-ID: <9507917.20891@mulga.cs.mu.OZ.AU>
Sender: news@cs.mu.OZ.AU (CS-Usenet)
Organization: Department of Computer Sci, University of Melbourne
References: <9505704.23884@mulga.cs.mu.OZ.AU> <D4q1yK.ALK@info.bris.ac.uk> <SVERKER.95Mar7210543@goodyear.sics.se>
Date: Mon, 20 Mar 1995 06:08:46 GMT
Lines: 48

In article <SVERKER.95Mar7210543@goodyear.sics.se> sverker@sics.se (Sverker Janson) writes:
>For the if-then-else to be quite sound in a language such as AKL, it
>is only necessary that the condition is executed quietly, i.e.,
>without binding non-local variables.  It is very, very cheap to check
>that no such bindings have been produced (by examining the trail).
>Couldn't this also be applied to (suitably generalised versions of)
>Goedel and NU-Prolog?

That is essentially what the original IC-Prolog did.  There are two
problems: 1) what do you do if variables were bound (IC-Prolog aborted the
execution) and 2) what do you do if the negated call has an infinite
number of solutions.  Some options were discussed (and more or less
rejected) in my thesis:

@book{naish:thesis:86,
        author =        {Lee Naish},
        title  =        {Negation and control in {Prolog}},
        series =        {Lecture Notes in Computer Science},
        publisher =     {Springer-Verlag},
        address =       {New York},
        number =        {238},
        year   =        {1986},
        pages  =        {119},
        comment = {Technical report 85/12, Department of Computer Science,
                University of Melbourne}
}


>No language should require analysis for correct execution.

Here is a little program in a great language which requires no analysis
for correct execution:

1100111101001000001101001001011010101001
00100101110010010011101010101l1010101010
0010011111001001001110010010011100100100

Yes, its machine code.

OOPS!  I MADE A MISTAKE!

The lexical analyser tells me there is an illegal token, 'l', in my
program.

The point is languages *do* require analysis.  Some languages require
only very simple analysis and some require very complicated analysis.

	lee
