Project

General

Profile

Revision 355b543d src/machine_code.ml

View differences:

src/machine_code.ml
587 587
  | Fun (f, args)                                 -> Dimension.mkdim_appl  Location.dummy_loc f (List.map dimension_of_value args)
588 588
  | _                                             -> assert false
589 589

  
590
(* We assume that valuemap is normalized *)
591
let rec partial_eval valuemap value =
592
  let pe = partial_eval valuemap in
593
  match value with
594
  | Cst _ -> value
595
  | LocalVar v | StateVar v -> if List.mem_assoc v valuemap then List.assoc v valuemap else value
596
  | Fun (f, args) -> Fun (f, List.map pe args)
597
  | Array vl -> Array (List.map pe vl)
598
  | Access (v1, v2) -> Access(pe v1, pe v2)
599
  | Power (v1, v2) -> Power (pe v1, pe v2)
600

  
590 601
(* Local Variables: *)
591 602
(* compile-command:"make -C .." *)
592 603
(* End: *)

Also available in: Unified diff