Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: reichel@tcs.inf.tu-dresden.de (Horst Reichel)
To: caml-list@pauillac.inria.fr
Subject: Caml semantics
Date: Thu, 12 Sep 1996 14:24:06 +0200	[thread overview]
Message-ID: <9609121224.AA01164@ithif17.ithi> (raw)


Hi,

can somebody give me a reference which deals with the following 
questions?

What is the formal semantics of recursive data types in Caml and Ocaml?

Since recursive values like d and e defined by
   let rec d = 3 :: e  and e = 5 :: d ;;
are typed as "int list" values the semantics of recursive type definitions
ist not the initial algebra of least fixpoint semantics (as in SML).

What are the values of "int list"? 

If we take all finite and infinite lists, one would take the
terminal co--algebra or greatest fixpoint semantics. In that case I would
expect lazy evaluation to get a value also for
     head(merge(d,e));;
with
let rec merge = function ([],l) -> l | (l,[]) -> l
                       | (x :: l1,l) -> x :: merge(l,l1) ;;
The present implementations get out of memory during evaluation.


The present implementations seem to make no difference between
inductive data types and co--inductive data types, which are
distinguished in CHARITY. In CHARITY  is  co-induction the tool to 
define functions on values of co-data types. How I can define
functions in Caml or Ocaml which manipulates recursive types like
d and e above. A reference to streams is not a satisfying answer, since
in the more general situation given by 

type 'a tree = Node of ('a * 'a tree) list ;;
let rec a = Node([(1,b);(2,c)]) and
        b = Node([(2,c);(3,Node[])]) and
        c = Node([(3,a);(4;Node[])]) ;;

one gets a, b c of type "int tree" and the "stream" module does not help
any more. Recursive values of type "'a tree" allow the representation
of infinite computation trees used in CCS. How one can define the
process composing operations of process algebras in Caml for these
infinite computation trees?


Thanks for help!

Horst







             reply	other threads:[~1996-09-12 15:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-09-12 12:24 Horst Reichel [this message]
1996-09-13  9:02 ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9609121224.AA01164@ithif17.ithi \
    --to=reichel@tcs.inf.tu-dresden.de \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox