Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Feature drawn back in new 1.06 version.
@ 1997-11-21 14:44 Francisco Valverde
  1997-11-24 16:27 ` Jerome Vouillon
  0 siblings, 1 reply; 2+ messages in thread
From: Francisco Valverde @ 1997-11-21 14:44 UTC (permalink / raw)
  To: Caml List

Salut, Caml listers:

(Resum'e en francais: Il n'y a plus de la possibilit'e de faire des
types recursifs qui ne includent point d'objects. C'est une restrictions
assez forte pour un type special de recherche imbriqu'ee dans deux
domaines que je 'etais en train de faire. Des programmes suivent a la
fin.)

I was using the possibity of defining recursive types for developing a
rather convoluted search in two coupled domains, but now I find that I
cannot anymore... Has anybody found a(n elegant, concise) way of
circumventing it... Please note that the type recursion is ended by
inserting appropriate non-recursive variants... Maybe I abused the type
system! (Note also that a recursion at the level of structures would be
heaven sent!)

--------------------------------------------------------------------

module type HALF =
  sig
    type score
    type ('a, 'b) h_label = | Lexicalized of 'a | Built of 'b
    type ('a, 'b) h_unit = ('a, 'b) h_label option
    type ('a, 'b, 'c) node =
      { mutable parent: ('a, 'b, 'c) node option;
        mutable forest: ('a, 'b, 'c) node list;
        mutable state: 'b;
        mutable unit: ('a, 'c) h_unit;
        mutable depth: int;
        mutable f: score;
        mutable g: score }
    val leq_cost : ('a, 'b, 'c) node -> ('a, 'b, 'c) node -> bool
  end

# module type PRE =
  sig
    include HALF

    type p_state
    and s_state
    and p_label
    and s_label

    and p = (p_label, p_state, s) node
    and s = (s_label, s_state, p) node
	(* abbreviations for the real dual nodes *)

    val leq_p_cost : p -> p -> bool
      (* cost functions for exploring paradigmatical nodes *)
    val leq_s_cost : s -> s -> bool
      (* cost functions for exploring sintagmatical nodes *)

    val p_block : p -> unit
      (* pretty printer for paradigmatical nodes *)
    val s_block : s -> unit
      (* pretty printer for sintagmatical nodes *)

  end;;

                                              Characters 115-146:
The type abbreviation p is cyclic
#
--------------------------------------------------------------------

Thanks for any suggestion,
 
--------------------------------------------------------------------
Francisco J. Valverde-Albacete	- Ayudante de Universidad
e-mail: fva@tsc.uc3m.es |tel: +34-1-6249952 |fax: +34-1-6249430
Dpto. de Tecnolog'ias de las Comunicaciones - Univ Carlos III Madrid
c/Butarque, s/n | Leganes 28911 | SPAIN
---------------------------------------------------------------------






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

end of thread, other threads:[~1997-11-24 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-21 14:44 Feature drawn back in new 1.06 version Francisco Valverde
1997-11-24 16:27 ` Jerome Vouillon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox