Oz and Mozart Users Mailing List

Re: Type checking


From: Denys Duchier (Denys.Duchier@ps.uni-sb.de)
Date: Tue Feb 26 2002 - 11:36:54 CET


d.carter@2020speech.com (David Carter) writes:

> I posted my original question about whether any work has been done on type
> checking in Oz/Mozart, and after a week nobody has mentioned any...so I
> guess the answer is that nothing has been done on this? If that's correct,
> then putting such an (optional) facility into the compiler would certainly
> have my "vote" as something that would enhance the software development
> process!

There is already some amount of type inference/checking in the
compiler: it is performed by the static analysis phase. I did some
work on extracting interfaces from functors to help with cross-module
static analysis, but indeed this would require support from the
compiler and manpower was not available to implement it.

You should be aware however that "type checking" in a language with
logic variables and constraints suffers from the problem that dataflow
is a dynamic property, not a static one like in functional languages.
Thus, for example, the notion of functional type is not applicable
(the same parameter of a procedure can sometimes be an input,
sometimes an output, and sometimes both simultaneously). Thus, also,
traditional functional subtyping (covariant in the output and
contravariant in the inputs) becomes inapplicable. Type-checking in
such a language needs a rather different approach. On this subject,
see for example, Martin Müller's PhD thesis:

 "Set-based Failure Diagnosis for Concurrent Constraint Programming"

      http://www.ps.uni-sb.de/Papers/abstracts/Diss-Mueller.html

Dataflow and type information/requirements is known for the system's
builtin primitives, and static analysis uses this information for type
inference/checking.

Cheers,

-- 
Dr. Denys Duchier			Denys.Duchier@ps.uni-sb.de
Forschungsbereich Programmiersysteme	(Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45	http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50			Phone: +49 681 302 5618
66041 Saarbruecken, Germany		Fax:   +49 681 302 5615
-
Please send submissions to users@mozart-oz.org
and administriva mail to users-request@mozart-oz.org.
The Mozart Oz web site is at http://www.mozart-oz.org/.



This archive was generated by hypermail 2b29.