Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.prolog Subject: Re: A question on semantics and program transformation Message-ID: <380@quintus.UUCP> Date: 12 Sep 88 01:02:54 GMT References: <26045@ucbvax.BERKELEY.EDU> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 15 In article <26045@ucbvax.BERKELEY.EDU> vanroy@ji.Berkeley.EDU (Peter Van Roy) writes: >Is it allowable for a program transformation to change the >procedural semantics of a program while retaining the >declarative semantics? It is if and only if the person using the program transformation says it is. For example, in NU Prolog, the ":- pure" declaration is a statement by the programmer that s/he only cares about the declarative semantics. A "recursion editor" such as Alan Bundy proposes (or even my little unfolding toy) would (does) work solely at the declarative level, so would be (is) allowed to do anything that preserves declarative semantics. But an optimising compiler would not be allowed to change the operational semantics (in the absence of :- pure declarations). This is a problem in other languages as well. (For example, "lazy" evaluation is *very* sensitive to the syntactic form of programs.)