Project

General

Profile

Download (20.1 KB) Statistics
| Branch: | Tag: | Revision:
1
(********************************************************************)
2
(*                                                                  *)
3
(*  The LustreC compiler toolset   /  The LustreC Development Team  *)
4
(*  Copyright 2012 -    --   ONERA - CNRS - INPT                    *)
5
(*                                                                  *)
6
(*  LustreC is free software, distributed WITHOUT ANY WARRANTY      *)
7
(*  under the terms of the GNU Lesser General Public License        *)
8
(*  version 2.1.                                                    *)
9
(*                                                                  *)
10
(********************************************************************)
11

    
12
open Lustre_types
13
open Machine_code_types
14
open Machine_code_common
15
open Spec_types
16
open Spec_common
17
open Corelang
18
open Clocks
19
open Causality
20
open Utils
21

    
22
exception NormalizationError
23

    
24
(* Questions:
25

    
26
   - where are used the mconst. They contain initialization of constant in
27
   nodes. But they do not seem to be used by c_backend *)
28

    
29
(* translate_<foo> : vars -> context -> <foo> -> machine code/expression *)
30
(* the context contains  m : state aka memory variables  *)
31
(*                      si : initialization instructions *)
32
(*                       j : node aka machine instances  *)
33
(*                       d : local variables             *)
34
(*                       s : step instructions           *)
35

    
36
(* Machine processing requires knowledge about variables and local variables.
37
   Local could be memories while other could not. *)
38
type machine_env = { is_local : string -> bool; get_var : string -> var_decl }
39

    
40
let build_env inputs locals outputs =
41
  let all = List.sort_uniq VDeclModule.compare (locals @ inputs @ outputs) in
42
  {
43
    is_local = (fun id -> List.exists (fun v -> v.var_id = id) locals);
44
    get_var =
45
      (fun id ->
46
        try List.find (fun v -> v.var_id = id) all
47
        with Not_found ->
48
          (* Format.eprintf "Impossible to find variable %s in set %a@.@?" * id
49
             * VSet.pp all; *)
50
          raise Not_found);
51
  }
52

    
53
(****************************************************************)
54
(* Basic functions to translate to machine values, instructions *)
55
(****************************************************************)
56

    
57
let translate_ident env id =
58
  (* Format.eprintf "trnaslating ident: %s@." id; *)
59
  (* id is a var that shall be visible here , ie. in vars *)
60
  try
61
    let var_id = env.get_var id in
62
    vdecl_to_val var_id
63
  with Not_found -> (
64
    (* id is a constant *)
65
    try
66
      let vdecl =
67
        Corelang.var_decl_of_const
68
          (const_of_top (Hashtbl.find Corelang.consts_table id))
69
      in
70
      vdecl_to_val vdecl
71
    with Not_found -> (
72
      (* id is a tag, getting its type in the list of declared enums *)
73
      try id_to_tag id
74
      with Not_found ->
75
        Format.eprintf "internal error: Machine_code.translate_ident %s@.@?" id;
76
        assert false))
77

    
78
(* specialize predefined (polymorphic) operators wrt their instances, so that
79
   the C semantics is preserved *)
80
let specialize_to_c expr =
81
  match expr.expr_desc with
82
  | Expr_appl (id, e, r) ->
83
    if
84
      List.exists
85
        (fun e -> Types.is_bool_type e.expr_type)
86
        (expr_list_of_expr e)
87
    then
88
      let id = match id with "=" -> "equi" | "!=" -> "xor" | _ -> id in
89
      { expr with expr_desc = Expr_appl (id, e, r) }
90
    else expr
91
  | _ ->
92
    expr
93

    
94
let specialize_op expr =
95
  match !Options.output with "C" -> specialize_to_c expr | _ -> expr
96

    
97
let rec translate_expr env expr =
98
  let expr = specialize_op expr in
99
  let translate_expr = translate_expr env in
100
  let value_desc =
101
    match expr.expr_desc with
102
    | Expr_const v ->
103
      Cst v
104
    | Expr_ident x ->
105
      (translate_ident env x).value_desc
106
    | Expr_array el ->
107
      Array (List.map translate_expr el)
108
    | Expr_access (t, i) ->
109
      Access (translate_expr t, translate_expr (expr_of_dimension i))
110
    | Expr_power (e, n) ->
111
      Power (translate_expr e, translate_expr (expr_of_dimension n))
112
    | Expr_when (e1, _, _) ->
113
      (translate_expr e1).value_desc
114
    | Expr_appl (id, e, _) when Basic_library.is_expr_internal_fun expr ->
115
      let nd = node_from_name id in
116
      Fun (node_name nd, List.map translate_expr (expr_list_of_expr e))
117
    | Expr_ite (g, t, e) when Backends.is_functional () ->
118
      (* special treatment depending on the active backend. For functional ones,
119
         like horn backend, ite are preserved in expression. While they are
120
         removed for C or Java backends. *)
121
      Fun ("ite", [ translate_expr g; translate_expr t; translate_expr e ])
122
    | _ ->
123
      Format.eprintf "Normalization error for backend %s: %a@." !Options.output
124
        Printers.pp_expr expr;
125
      raise NormalizationError
126
  in
127
  mk_val value_desc expr.expr_type
128

    
129
let translate_guard env expr =
130
  match expr.expr_desc with
131
  | Expr_ident x ->
132
    translate_ident env x
133
  | _ ->
134
    Format.eprintf "internal error: translate_guard %a@." Printers.pp_expr expr;
135
    assert false
136

    
137
let rec translate_act env (y, expr) =
138
  let translate_act = translate_act env in
139
  let translate_guard = translate_guard env in
140
  (* let translate_ident = translate_ident env in *)
141
  let translate_expr = translate_expr env in
142
  let lustre_eq = Corelang.mkeq Location.dummy_loc ([ y.var_id ], expr) in
143
  match expr.expr_desc with
144
  | Expr_ite (c, t, e) ->
145
    let c = translate_guard c in
146
    let t, spec_t = translate_act (y, t) in
147
    let e, spec_e = translate_act (y, e) in
148
    mk_conditional ~lustre_eq c [ t ] [ e ], mk_conditional_tr c spec_t spec_e
149
  | Expr_merge (x, hl) ->
150
    let var_x = env.get_var x in
151
    let hl, spec_hl =
152
      List.(
153
        split
154
          (map
155
             (fun (t, h) ->
156
               let h, spec_h = translate_act (y, h) in
157
               (t, [ h ]), (t, spec_h))
158
             hl))
159
    in
160
    mk_branch' ~lustre_eq var_x hl, mk_branch_tr var_x spec_hl
161
  | _ ->
162
    let e = translate_expr expr in
163
    mk_assign ~lustre_eq y e, mk_assign_tr y e
164

    
165
let get_memory env mems eq =
166
  match eq.eq_lhs, eq.eq_rhs.expr_desc with
167
  | ([ x ], Expr_pre _ | [ x ], Expr_fby _) when env.is_local x ->
168
    let var_x = env.get_var x in
169
    VSet.add var_x mems
170
  | _ ->
171
    mems
172

    
173
let get_memories env = List.fold_left (get_memory env) VSet.empty
174

    
175
(* Datastructure updated while visiting equations *)
176
type machine_ctx = {
177
  (* memories *)
178
  m : ISet.t;
179
  (* Reset instructions *)
180
  si : instr_t list;
181
  (* Instances *)
182
  j : (Lustre_types.top_decl * Dimension.dim_expr list) IMap.t;
183
  (* Step instructions *)
184
  s : instr_t list;
185
  (* Memory pack spec *)
186
  mp : mc_formula_t list;
187
  (* Transition spec *)
188
  t :
189
    (var_decl list
190
    (* inputs *)
191
    * var_decl list
192
    (* locals *)
193
    * var_decl list
194
    (* outputs *)
195
    * ISet.t (* memory footprint *)
196
    * mc_formula_t)
197
    (* formula *)
198
    list;
199
}
200

    
201
let ctx_init =
202
  { m = ISet.empty; si = []; j = IMap.empty; s = []; mp = []; t = [] }
203

    
204
(****************************************************************)
205
(* Main function to translate equations into this machine context we are
206
   building *)
207
(****************************************************************)
208

    
209
let mk_control v l inst = mkinstr (MBranch (vdecl_to_val v, [ l, [ inst ] ]))
210

    
211
let control_on_clock env ck inst =
212
  let rec aux ((fspec, inst) as acc) ck =
213
    match (Clocks.repr ck).cdesc with
214
    | Con (ck, cr, l) ->
215
      let id = Clocks.const_of_carrier cr in
216
      let v = env.get_var id in
217
      aux
218
        ( (fun spec -> Imply (Equal (Var v, Tag l), fspec spec)),
219
          mk_control v l inst )
220
        ck
221
    | _ ->
222
      acc
223
  in
224
  let fspec, inst = aux ((fun spec -> spec), inst) ck in
225
  fspec, inst
226

    
227
let reset_instance env i r c =
228
  match r with
229
  | Some r ->
230
    let r = translate_guard env r in
231
    let _, inst =
232
      control_on_clock env c
233
        (mk_conditional r [ mkinstr (MSetReset i) ] [ mkinstr (MNoReset i) ])
234
    in
235
    Some r, [ inst ]
236
  | None ->
237
    None, []
238

    
239
let translate_eq env ctx nd inputs locals outputs i eq =
240
  let id = nd.node_id in
241
  let translate_expr = translate_expr env in
242
  let translate_act = translate_act env in
243
  let locals_pi = Lustre_live.inter_live_i_with id (i - 1) locals in
244
  let outputs_pi = Lustre_live.inter_live_i_with id (i - 1) outputs in
245
  let locals_i = Lustre_live.inter_live_i_with id i locals in
246
  let outputs_i = Lustre_live.inter_live_i_with id i outputs in
247
  let pred_mp ctx a = And [ mk_memory_pack ~i:(i - 1) id; a ] :: ctx.mp in
248
  let pred_t ctx a =
249
    ( inputs,
250
      locals_i,
251
      outputs_i,
252
      ctx.m,
253
      Exists
254
        ( Lustre_live.existential_vars id i eq (locals @ outputs),
255
          And
256
            [
257
              mk_transition ~i:(i - 1) id (vdecls_to_vals inputs)
258
                (vdecls_to_vals locals_pi)
259
                (vdecls_to_vals outputs_pi);
260
              a;
261
            ] ) )
262
    :: ctx.t
263
  in
264
  let control_on_clock ck inst spec_mp spec_t ctx =
265
    let fspec, inst = control_on_clock env ck inst in
266
    {
267
      ctx with
268
      s =
269
        {
270
          inst with
271
          instr_spec =
272
            (if fst (get_stateless_status_node nd) then []
273
            else [ mk_memory_pack ~i id ])
274
            @ [
275
                mk_transition ~i id (vdecls_to_vals inputs)
276
                  (vdecls_to_vals locals_i) (vdecls_to_vals outputs_i);
277
              ];
278
        }
279
        :: ctx.s;
280
      mp = pred_mp ctx spec_mp;
281
      t = pred_t ctx (fspec spec_t);
282
    }
283
  in
284
  let reset_instance = reset_instance env in
285
  let mkinstr' = mkinstr ~lustre_eq:eq in
286
  let ctl ?(ck = eq.eq_rhs.expr_clock) instr =
287
    control_on_clock ck (mkinstr' instr)
288
  in
289

    
290
  (* Format.eprintf "translate_eq %a with clock %a@." Printers.pp_node_eq eq
291
     Clocks.print_ck eq.eq_rhs.expr_clock; *)
292
  match eq.eq_lhs, eq.eq_rhs.expr_desc with
293
  | [ x ], Expr_arrow (e1, e2) ->
294
    let var_x = env.get_var x in
295
    let td = Arrow.arrow_top_decl () in
296
    let inst = new_instance td eq.eq_rhs.expr_tag in
297
    let c1 = translate_expr e1 in
298
    let c2 = translate_expr e2 in
299
    assert (c1.value_desc = Cst (Const_tag "true"));
300
    assert (c2.value_desc = Cst (Const_tag "false"));
301
    let ctx =
302
      ctl
303
        (MStep ([ var_x ], inst, [ c1; c2 ]))
304
        (mk_memory_pack ~inst (node_name td))
305
        (mk_transition ~inst (node_name td) [] [] [ vdecl_to_val var_x ])
306
        ctx
307
    in
308
    {
309
      ctx with
310
      si = mkinstr (MSetReset inst) :: ctx.si;
311
      j = IMap.add inst (td, []) ctx.j;
312
    }
313
  | [ x ], Expr_pre e when env.is_local x ->
314
    let var_x = env.get_var x in
315
    let e = translate_expr e in
316
    ctl
317
      (MStateAssign (var_x, e))
318
      (mk_state_variable_pack var_x)
319
      (mk_state_assign_tr var_x e)
320
      { ctx with m = ISet.add x ctx.m }
321
  | [ x ], Expr_fby (e1, e2) when env.is_local x ->
322
    let var_x = env.get_var x in
323
    let e2 = translate_expr e2 in
324
    let ctx =
325
      ctl
326
        (MStateAssign (var_x, e2))
327
        (mk_state_variable_pack var_x)
328
        (mk_state_assign_tr var_x e2)
329
        { ctx with m = ISet.add x ctx.m }
330
    in
331
    {
332
      ctx with
333
      si = mkinstr' (MStateAssign (var_x, translate_expr e1)) :: ctx.si;
334
    }
335
  | p, Expr_appl (f, arg, r)
336
    when not (Basic_library.is_expr_internal_fun eq.eq_rhs) ->
337
    let var_p = List.map (fun v -> env.get_var v) p in
338
    let el = expr_list_of_expr arg in
339
    let vl = List.map translate_expr el in
340
    let node_f = node_from_name f in
341
    let call_f = node_f, NodeDep.filter_static_inputs (node_inputs node_f) el in
342
    let inst = new_instance node_f eq.eq_rhs.expr_tag in
343
    let env_cks =
344
      List.fold_right
345
        (fun arg cks -> arg.expr_clock :: cks)
346
        el [ eq.eq_rhs.expr_clock ]
347
    in
348
    let call_ck =
349
      Clock_calculus.compute_root_clock (Clock_predef.ck_tuple env_cks)
350
    in
351
    let r, reset_inst = reset_instance inst r call_ck in
352
    let ctx =
353
      ctl ~ck:call_ck
354
        (MStep (var_p, inst, vl))
355
        (mk_memory_pack ~inst (node_name node_f))
356
        (mk_transition ?r ~inst (node_name node_f) vl [] (vdecls_to_vals var_p))
357
        ctx
358
    in
359
    (*Clocks.new_var true in Clock_calculus.unify_imported_clock (Some call_ck)
360
      eq.eq_rhs.expr_clock eq.eq_rhs.expr_loc; Format.eprintf "call %a: %a:
361
      %a@," Printers.pp_expr eq.eq_rhs Clocks.print_ck (Clock_predef.ck_tuple
362
      env_cks) Clocks.print_ck call_ck;*)
363
    {
364
      ctx with
365
      si =
366
        (if Stateless.check_node node_f then ctx.si
367
        else mkinstr (MSetReset inst) :: ctx.si);
368
      j = IMap.add inst call_f ctx.j;
369
      s = (if Stateless.check_node node_f then [] else reset_inst) @ ctx.s;
370
    }
371
  | [ x ], _ ->
372
    let var_x = env.get_var x in
373
    let instr, spec = translate_act (var_x, eq.eq_rhs) in
374
    control_on_clock eq.eq_rhs.expr_clock instr True spec ctx
375
  | _ ->
376
    Format.eprintf "internal error: Machine_code.translate_eq %a@?"
377
      Printers.pp_node_eq eq;
378
    assert false
379

    
380
let constant_equations locals =
381
  List.fold_left
382
    (fun eqs vdecl ->
383
      if vdecl.var_dec_const then
384
        {
385
          eq_lhs = [ vdecl.var_id ];
386
          eq_rhs = desome vdecl.var_dec_value;
387
          eq_loc = vdecl.var_loc;
388
        }
389
        :: eqs
390
      else eqs)
391
    [] locals
392

    
393
let translate_eqs env ctx nd inputs locals outputs eqs =
394
  List.fold_left
395
    (fun (ctx, i) eq ->
396
      let ctx = translate_eq env ctx nd inputs locals outputs i eq in
397
      ctx, i + 1)
398
    (ctx, 1) eqs
399
  |> fst
400

    
401
(****************************************************************)
402
(* Processing nodes *)
403
(****************************************************************)
404

    
405
let process_asserts nd =
406
  let exprl = List.map (fun assert_ -> assert_.assert_expr) nd.node_asserts in
407
  if Backends.is_functional () then [], [], exprl
408
  else
409
    (* Each assert(e) is associated to a fresh variable v and declared as v=e;
410
       assert (v); *)
411
    let _, vars, eql, assertl =
412
      List.fold_left
413
        (fun (i, vars, eqlist, assertlist) expr ->
414
          let loc = expr.expr_loc in
415
          let var_id = nd.node_id ^ "_assert_" ^ string_of_int i in
416
          let assert_var =
417
            mkvar_decl loc ~orig:false
418
              (* fresh var *)
419
              ( var_id,
420
                mktyp loc Tydec_bool,
421
                mkclock loc Ckdec_any,
422
                false,
423
                (* not a constant *)
424
                None,
425
                (* no default value *)
426
                Some nd.node_id )
427
          in
428
          assert_var.var_type <- Type_predef.type_bool
429
          (* Types.new_ty (Types.Tbool) *);
430
          let eq = mkeq loc ([ var_id ], expr) in
431
          ( i + 1,
432
            assert_var :: vars,
433
            eq :: eqlist,
434
            { expr with expr_desc = Expr_ident var_id } :: assertlist ))
435
        (1, [], [], []) exprl
436
    in
437
    vars, eql, assertl
438

    
439
let translate_core env nd sorted_eqs inputs locals outputs =
440
  let constant_eqs = constant_equations locals in
441

    
442
  (* Compute constants' instructions *)
443
  let ctx0 = translate_eqs env ctx_init nd inputs locals outputs constant_eqs in
444
  assert (ctx0.si = []);
445
  assert (IMap.is_empty ctx0.j);
446

    
447
  (* Compute ctx for all eqs *)
448
  let ctx = translate_eqs env ctx_init nd inputs locals outputs sorted_eqs in
449

    
450
  ctx, ctx0.s
451

    
452
let zero = mk_val (Cst (Const_int 0)) Type_predef.type_int
453

    
454
let memory_pack_0 nd =
455
  {
456
    mpname = nd;
457
    mpindex = Some 0;
458
    mpformula =
459
      And [ StateVarPack ResetFlag; Equal (Memory ResetFlag, Val zero) ];
460
  }
461

    
462
let memory_pack_toplevel nd i =
463
  {
464
    mpname = nd;
465
    mpindex = None;
466
    mpformula =
467
      Ternary
468
        (Memory ResetFlag, StateVarPack ResetFlag, mk_memory_pack ~i nd.node_id);
469
  }
470

    
471
let transition_0 nd =
472
  {
473
    tname = nd;
474
    tindex = Some 0;
475
    tinputs = nd.node_inputs;
476
    tlocals = [];
477
    toutputs = [];
478
    tformula = True;
479
    tfootprint = ISet.empty;
480
  }
481

    
482
let transition_toplevel nd i =
483
  let tr =
484
    mk_transition nd.node_id ~i
485
      (vdecls_to_vals nd.node_inputs)
486
      []
487
      (vdecls_to_vals nd.node_outputs)
488
  in
489
  {
490
    tname = nd;
491
    tindex = None;
492
    tinputs = nd.node_inputs;
493
    tlocals = [];
494
    toutputs = nd.node_outputs;
495
    tformula =
496
      (if fst (get_stateless_status_node nd) then tr
497
      else ExistsMem (nd.node_id, Predicate (ResetCleared nd.node_id), tr));
498
    tfootprint = ISet.empty;
499
  }
500

    
501
let translate_decl nd sch =
502
  (* Format.eprintf "Translating node %s@." nd.node_id; *)
503
  (* Extracting eqs, variables ..  *)
504
  let eqs, auts = get_node_eqs nd in
505
  assert (auts = []);
506

    
507
  (* Automata should be expanded by now *)
508

    
509
  (* In case of non functional backend (eg. C), additional local variables have
510
     to be declared for each assert *)
511
  let new_locals, assert_instrs, nd_node_asserts = process_asserts nd in
512

    
513
  (* Build the env: variables visible in the current scope *)
514
  let locals = nd.node_locals @ new_locals in
515
  (* let locals = VSet.of_list locals_list in *)
516
  (* let inout_vars = nd.node_inputs @ nd.node_outputs in *)
517
  let env = build_env nd.node_inputs locals nd.node_outputs in
518

    
519
  (* Format.eprintf "Node content is %a@." Printers.pp_node nd; *)
520

    
521
  (* Computing main content *)
522
  (* Format.eprintf "ok1@.@?"; *)
523
  let schedule = sch.Scheduling_type.schedule in
524
  (* Format.eprintf "ok2@.@?"; *)
525
  let sorted_eqs, unused =
526
    Scheduling.sort_equations_from_schedule eqs schedule
527
  in
528

    
529
  (* Format.eprintf "ok3@.locals=%a@.inout:%a@?"
530
   *   VSet.pp locals
531
   *   VSet.pp inout_vars
532
   * ; *)
533
  let equations = assert_instrs @ sorted_eqs in
534
  let mems = get_memories env equations in
535
  (* Removing computed memories from locals. We also removed unused variables. *)
536
  let locals =
537
    List.filter
538
      (fun v -> (not (VSet.mem v mems)) && not (List.mem v.var_id unused))
539
      locals
540
  in
541
  (* Compute live sets for spec *)
542
  Lustre_live.set_live_of nd.node_id nd.node_outputs locals equations;
543

    
544
  (* Translate equations *)
545
  let ctx, ctx0_s =
546
    translate_core env nd equations nd.node_inputs locals nd.node_outputs
547
  in
548

    
549
  (* Format.eprintf "ok4@.@?"; *)
550

    
551
  (* Build the machine *)
552
  let mmap = IMap.bindings ctx.j in
553
  let mmemory_packs =
554
    memory_pack_0 nd
555
    ::
556
    List.mapi
557
      (fun i f -> { mpname = nd; mpindex = Some (i + 1); mpformula = red f })
558
      (List.rev ctx.mp)
559
    @ [ memory_pack_toplevel nd (List.length ctx.mp) ]
560
  in
561
  let mtransitions =
562
    transition_0 nd
563
    ::
564
    List.mapi
565
      (fun i (tinputs, tlocals, toutputs, tfootprint, f) ->
566
        {
567
          tname = nd;
568
          tindex = Some (i + 1);
569
          tinputs;
570
          tlocals;
571
          toutputs;
572
          tformula = red f;
573
          tfootprint;
574
        })
575
      (List.rev ctx.t)
576
    @ [ transition_toplevel nd (List.length ctx.t) ]
577
  in
578
  let clear_reset =
579
    mkinstr
580
      ~instr_spec:
581
        ((if fst (get_stateless_status_node nd) then []
582
         else [ mk_memory_pack ~i:0 nd.node_id ])
583
        @ [
584
            mk_transition ~i:0 nd.node_id (vdecls_to_vals nd.node_inputs) [] [];
585
          ])
586
      MClearReset
587
  in
588
  {
589
    mname = nd;
590
    mmemory = VSet.elements mems;
591
    mcalls = mmap;
592
    minstances =
593
      List.filter (fun (_, (n, _)) -> not (Stateless.check_node n)) mmap;
594
    minit = List.rev ctx.si;
595
    mconst = List.rev ctx0_s;
596
    mstatic = List.filter (fun v -> v.var_dec_const) nd.node_inputs;
597
    mstep =
598
      {
599
        step_inputs = nd.node_inputs;
600
        step_outputs = nd.node_outputs;
601
        step_locals = locals;
602
        step_checks =
603
          List.map
604
            (fun d ->
605
              d.Dimension.dim_loc, translate_expr env (expr_of_dimension d))
606
            nd.node_checks;
607
        step_instrs =
608
          clear_reset
609
          ::
610
          (* special treatment depending on the active backend. For horn
611
             backend, common branches are not merged while they are in C or Java
612
             backends. *)
613
          (if !Backends.join_guards then join_guards_list (List.rev ctx.s)
614
          else List.rev ctx.s);
615
        step_asserts = List.map (translate_expr env) nd_node_asserts;
616
      };
617
    (* Processing spec: there is no processing performed here. Contract have
618
       been processed already. Either one of the other machine is a cocospec
619
       node, or the current one is a cocospec node. Contract do not contain any
620
       statement or import. *)
621
    mspec = { mnode_spec = nd.node_spec; mtransitions; mmemory_packs };
622
    mannot = nd.node_annot;
623
    msch = Some sch;
624
  }
625

    
626
(** takes the global declarations and the scheduling associated to each node *)
627
let translate_prog decls node_schs =
628
  let nodes = get_nodes decls in
629
  let machines =
630
    List.map
631
      (fun decl ->
632
        let node = node_of_top decl in
633
        let sch = IMap.find node.node_id node_schs in
634
        translate_decl node sch)
635
      nodes
636
  in
637
  machines
638

    
639
(* Local Variables: *)
640
(* compile-command:"make -C .." *)
641
(* End: *)
(31-31/66)