Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type values=[
- | `Int of int
- | `Sym of string
- ]
- type rvalues=[
- values
- | `PairVal of values * values
- ]
- type arrays=[
- `ConcArray of values array
- | `SymArray of string * int
- ]
- type rarrays=[
- arrays
- | `PairArray of arrays * arrays
- ]
- type side= Left | Right
- type codmem=
- [ rvalues
- | rarrays
- ]
- type mem=(string, codmem) Hashtbl.t
- let proj_mem (m:mem) s=
- let proj:mem=Hashtbl.create (Hashtbl.length m) in
- let _=Hashtbl.iter (fun a->fun b->
- match b with
- | `Int(_) | `Sym(_) -> Hashtbl.add proj a b;
- | `PairVal(v1, v2) -> if s=Left then ((Hashtbl.add proj a v1);) else Hashtbl.add proj a v2;
- | `ConcArray(_) | `SymArray(_, _) -> Hashtbl.add proj a b;
- | `PairArray(v1,v2) -> if s=Left then ((Hashtbl.add proj a v1);) else Hashtbl.add proj a v2;
- ) m
- in proj
Advertisement
Add Comment
Please, Sign In to add comment