+*)
+
+(** {2 Memory (persistent key/value storage)} *)
+
+val memory_exists : string -> bool
+ (** [memory_exists key] checks that the named [key] exists in
+ the Memory. It doesn't matter what value it has.
+
+ This is also available as a goal, so you can write
+ [require (memory_exists key)] *)
+
+val memory_set : string -> string -> unit
+ (** Set [key] to [value] in the Memory. *)
+
+val memory_get : string -> string option
+ (** Return the current value of [key] in the Memory. Returns [None]
+ if the key has never been set or was deleted. *)
+
+val memory_delete : string -> unit
+ (** Delete the [key]. If the key doesn't exist, has no effect. *)
+
+(** {2 Publishing goals} *)
+
+val publish : string -> (string list -> unit) -> unit
+ (** Publish the named goal.
+
+ Use this function as in this example:
+
+ {v
+ let goal compiled program sources =
+ ... stuff for building the program from sources ...
+
+ let () = publish "compiled" (
+ fun args ->
+ let program = List.hd args in
+ let sources = List.tl args in
+ require (compiled program sources)
+ )
+ v}
+
+ This could be used as follows:
+
+ {v ./script compiled program main.c utils.c v}
+
+ You will notice you have to write a bit of OCaml code to
+ map the string arguments from the command line on to the
+ goal arguments. In the example it means taking the first
+ string argument as the program name, and the rest of the
+ string arguments as the source filenames. This is also
+ the place to perform string to int conversion, checks, and
+ so on (remember that OCaml is strongly typed). *)
+
+(** {2 Logging script output} *)
+
+val log_program_output : unit -> string
+ (** [log_program_output] should be called at most once, usually at
+ the top-level of the script. It creates a temporary file
+ and redirects stdout and stderr into this file (they are still
+ sent to the ordinary output, so it acts like [tee]). The
+ filename of the temporary file is returned. *)
+
+(** {2 Sending email} *)
+
+val mailto : ?from:string -> subject:string -> ?attach:string list-> string -> unit
+ (** Send email.
+
+ Optional [?from] is the sender email address.
+
+ Required [~subject] is the subject line.
+
+ Optional [?attach] is a list of attachments (filenames).
+
+ The bare argument is the destination email address. *)