Project

General

Profile

Revision fc886259 src/dimension.ml

View differences:

src/dimension.ml
339 339
  in unif dim1 dim2
340 340

  
341 341
let rec expr_replace_var fvar e = 
342
 { e with dim_desc = expr_replace_desc fvar e.dim_desc }
343
and expr_replace_desc fvar e =
342
 { e with dim_desc = expr_replace_var_desc fvar e.dim_desc }
343
and expr_replace_var_desc fvar e =
344 344
  let re = expr_replace_var fvar in
345 345
  match e with
346 346
  | Dvar
......
351 351
  | Dappl (id, el) -> Dappl (id, List.map re el)
352 352
  | Dite (g,t,e) -> Dite (re g, re t, re e)
353 353
  | Dlink e -> Dlink (re e)
354

  
355
let rec expr_replace_expr fvar e = 
356
 { e with dim_desc = expr_replace_expr_desc fvar e.dim_desc }
357
and expr_replace_expr_desc fvar e =
358
  let re = expr_replace_expr fvar in
359
  match e with
360
  | Dvar
361
  | Dunivar
362
  | Dbool _
363
  | Dint _ -> e
364
  | Dident v -> (fvar v).dim_desc
365
  | Dappl (id, el) -> Dappl (id, List.map re el)
366
  | Dite (g,t,e) -> Dite (re g, re t, re e)
367
  | Dlink e -> Dlink (re e)

Also available in: Unified diff