Newer
Older
(* Time-stamp: <modified the 09/05/2019 (at 21:52) by Erwan Jahier> *)
module Dico = Map.Make(String)
open Algo
type t = local_env Dico.t
let (get: t -> string -> string -> value) =
fun e pid v ->
try ((Dico.find pid e) v)
with _ -> failwith (Printf.sprintf "Unknown value: %s.%s" pid v)
let rec (copy_value : value -> value) =
fun v ->
match v with
| I _ | F _ | B _ | E _ | S _ | N _ -> v
| A a -> A (Array.copy (Array.map copy_value a))
let (get_copy: t -> string -> string -> value) =
fun e pid v ->
copy_value (get e pid v)