caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Undecidability of OCaml type checking
@ 1999-07-12 17:20 Andreas Rossberg
  1999-07-13 17:59 ` irritability of structure name conflicts Dave Mason
  1999-07-14 15:32 ` Undecidability of OCaml type checking Xavier Leroy
  0 siblings, 2 replies; 5+ messages in thread
From: Andreas Rossberg @ 1999-07-12 17:20 UTC (permalink / raw)
  To: caml-list

I have been working through Mark Lillibridge's thesis on
translucent sums [1] recently. One main result of his work is
the undecidability (semi-decidability) of subtyping in his
system. Since the module system in OCaml is in many aspects
very similar to his system, I tried to code one of his
undecidable examples in OCaml. And it was indeed possible, the
following input will send the type checker into an infinite
loop:

     module type I =
     sig
       module type A
       module F :
	 functor(X :
	 sig
	   module type A = A
	   module F : functor(X : A) -> sig end
	 end) -> sig end
     end

     module type J =
     sig
       module type A = I
       module F : functor(X : I) -> sig end
     end

     (* Try to check J <= I *)

     module Loop(X : J) = (X : I)

I am sure that Xavier and the other Caml developers are aware of
this. I do not think this behaviour is really a problem, as the
example is really contrived -- nobody would write such code.
Thus I find this property of the language perfectly
acceptable. However, IMHO you should at least document the
fact that type checking is incomplete and compilation may not
terminate due to this.

Best regards,

	- Andreas
	

[1] Mark Lillibridge
    "Translucent Sums: A Foundation for Higher-Order Modules",
    PhD Thesis, CMU, 1997




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-07-14 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-12 17:20 Undecidability of OCaml type checking Andreas Rossberg
1999-07-13 17:59 ` irritability of structure name conflicts Dave Mason
1999-07-14  3:04   ` John Skaller
1999-07-14 15:43   ` Xavier Leroy
1999-07-14 15:32 ` Undecidability of OCaml type checking Xavier Leroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).