Project

General

Profile

Revision 81229f63 src/corelang.ml

View differences:

src/corelang.ml
1335 1335
let rec push_negations ?(neg=false) e =
1336 1336
  let res =
1337 1337
    let pn = push_negations in
1338
    let map desc = { e with expr_desc = desc } in
1338
    let map desc = mkexpr e.expr_loc desc in
1339 1339
    match e.expr_desc with
1340 1340
    | Expr_ite (g,t,e) ->
1341 1341
       if neg then
......
1383 1383
  in
1384 1384
  res
1385 1385

  
1386
    
1386
let rec add_pre_expr vars e =
1387
  let ap = add_pre_expr vars in
1388
  let desc =
1389
    match e.expr_desc with
1390
    | Expr_ite (g,t,e) ->
1391
       Expr_ite (ap g, ap t,ap e)
1392
    | Expr_tuple t ->
1393
       Expr_tuple (List.map ap t)
1394
    | Expr_arrow (e1, e2) ->
1395
       Expr_arrow (ap e1, ap e2) 
1396
    | Expr_fby (e1, e2) ->
1397
       Expr_fby (ap e1, ap e2)
1398
    | Expr_pre e ->
1399
       Expr_pre (ap e)
1400
    | Expr_appl (op, e, opt) ->
1401
       Expr_appl (op, ap e, opt)
1402
    | Expr_const _ -> e.expr_desc 
1403
    | Expr_ident id ->
1404
       if List.mem id vars then
1405
         Expr_pre e
1406
       else
1407
         e.expr_desc
1408
    | _ -> assert false (* no array, array access, power or merge/when yet *)
1409
  in
1410
  mkexpr e.expr_loc desc
1411
   
1387 1412
    (* Local Variables: *)
1388 1413
    (* compile-command:"make -C .." *)
1389 1414
    (* End: *)

Also available in: Unified diff