Previous Contents Next

Chapter 4   The core library

This chapter describes the basic types and functions of the join-calculus. They are provided by a special module called sys. This module is automatically ``opened'' when a compilation starts. Hence, it is possible to use unqualified identifiers to refer to the functions provided by the sys module, without adding a open sys directive.

Conventions

The declarations from the signature of the sys module are printed one by one in typewriter font, preceded by its nature (type, value, external or primitive) and sometimes followed by a short comment.

Most of these declarations are imported from the Objective Caml system, with the same name. Please refer to the Ocaml manual for more detailed documentation about them.

4.1   Module sys: Atomic types, basic operators and primitives.

Integers

type int
external + : <int * int> -> <int>
external - : <int * int> -> <int>
external * : <int * int> -> <int>
external / : <int * int> -> <int>
external % : <int * int> -> <int>

Strings

type string
external ^ : <string * string>  -> <string>

Booleans

type bool
external || : <bool * bool > -> <bool>
external && :  <bool * bool > -> <bool>
external not : <bool> -> <bool>

Comparisons

external = :  <'a * 'a> -> <bool>
external <> :  <'a * 'a> -> <bool>
external < :  <'a * 'a> -> <bool>
external > :  <'a * 'a> -> <bool>
external <= :  <'a * 'a> -> <bool>
external >= :  <'a * 'a> -> <bool>

Basic IO

external print_string : <string> -> <>
external print : <int> -> <>
external read : <> -> <int>
external print_newline : <> -> <>
external sys_print : <'a> -> <>

Locations, Mobility and Failures

type location
primitive null : <>
primitive halt : <>
primitive go : <location> -> <>
primitive fail : <location> -> <>
primitive exit : <> -> <>
external failwith : <string> -> 'a

Mostly for debugging purposes

external dump_locations : <> -> <>
external dump_state : <> -> <>
external dump_sites : <> -> <>

Previous Contents Next