Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!munnari.oz.au!lee
From: lee@munnari.oz.au (Lee Naish)
Newsgroups: comp.lang.prolog
Subject: Re: logic programs -> procedural lang?
Keywords: Prolog, typing, compiler efficiency
Message-ID: <2202@munnari.oz.au>
Date: 27 Sep 89 07:04:17 GMT
References: <27335@shemp.CS.UCLA.EDU> <869@gamera.cs.utexas.edu> <10822@eerie.acsu.Buffalo.EDU> <1503@irisa.irisa.fr>
Sender: news@cs.mu.oz.au
Reply-To: lee@munmurra.UUCP (Lee Naish)
Organization: Comp Sci, University of Melbourne
Lines: 38

In article <1503@irisa.irisa.fr> picart@irisa.irisa.fr (Marc Picart) writes:
>to separate the logic specification, which is the responsability of the 
>programmer, from the implementation which is the responsability of
>the compiler.

I agree with Jose Alberto, that types can be part of the specification
(even if they are missing from the program).  For example, in the
natural specification of append, all arguments are lists.  This
information is missing in the program.  Check out the following
reference if you are interested (unfortunately it has some technical
errors - I'll produce a revised version some day hopefully).

%A Lee Naish
%T Specification = program + types
%J Proceedings of 7th Conference on Foundations of Software Technology
and Theoretical Computer Science
%C Pune, India
%D December, 1987
%O Published in LNCS 287 by Springer Verlag

I would also like to make some comments about Richard O'Keefe's remarks
concerning complexity.  Obviously complexity is an important issue.  It
is of vital importance when type checking is always done (eg, in a
strictly typed language or with a smart Prolog compiler which attempts
to infer types to improve efficiency).  However, if a type checker is
used simply as a programming aid to locate (some) bugs, then complexity
is less important.  It is possible to have a very useful debugging tool 
whose complexty is exponential in the worst case (the Mycroft O'Keefe
type checker is a case in point).

If I had a linear complexity type checker which failed to find the bug
in my program, I would certainly resort to a worst case non-linear
complexity type checker which might find the bug (even if I had to put
the job in background, and maybe kill it when the paging on my Sun 3/50
got too bad:-).  The great thing about finding bugs by static analysis
is that no programmer intervention is required.

	lee