package archetype

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file opt_model.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Model
open Gen_transform

let remove_operations_nil (model : model) : model =
  let rec aux ctx (mt : mterm) : mterm =
    match mt.node with
    | Massign(ValueAssign, _, Avarstore {pldesc = "operations"}, { node = (Mlitlist []) }) -> seq []
    | _ -> map_mterm (aux ctx) mt
  in
  map_mterm_model aux model

let optimize (model, env : model * 'a) =
  let model =
    model
    |> remove_operations_nil
    |> flat_sequence
  in
  model, env