Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Feature drawn back in new 1.06 version.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1997-11-21 (16:30)
From: Francisco Valverde <fva@t...>
Subject: Feature drawn back in new 1.06 version.
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

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 =
    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

# module type PRE =
    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 *)


                                              Characters 115-146:
The type abbreviation p is cyclic

Thanks for any suggestion,
Francisco J. Valverde-Albacete	- Ayudante de Universidad
e-mail: |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