source: driver/extracted/blocks.ml @ 3106

Last change on this file since 3106 was 2951, checked in by sacerdot, 7 years ago

New extraction. Novely: a pre-main is used in the back-end. Initialization
of global data is performed in LINToASM.

Note: the cost-emission of the initialization costlabel in the front-end is
virtual, but not performed in the traces I generate and print. To be fixed
(how?)

File size: 2.5 KB
Line 
1open Preamble
2
3open Extra_bool
4
5open Coqlib
6
7open Values
8
9open FrontEndVal
10
11open GenMem
12
13open FrontEndMem
14
15open Globalenvs
16
17open String
18
19open Sets
20
21open Listb
22
23open LabelledObjects
24
25open BitVectorTrie
26
27open Graphs
28
29open I8051
30
31open Order
32
33open Registers
34
35open CostLabel
36
37open Hide
38
39open Proper
40
41open PositiveMap
42
43open Deqsets
44
45open ErrorMessages
46
47open PreIdentifiers
48
49open Errors
50
51open Extralib
52
53open Lists
54
55open Identifiers
56
57open Integers
58
59open AST
60
61open Division
62
63open Exp
64
65open Arithmetic
66
67open Setoids
68
69open Monad
70
71open Option
72
73open Extranat
74
75open Vector
76
77open Div_and_mod
78
79open Jmeq
80
81open Russell
82
83open List
84
85open Util
86
87open FoldStuff
88
89open BitVector
90
91open Types
92
93open Bool
94
95open Relations
96
97open Nat
98
99open Hints_declaration
100
101open Core_notation
102
103open Pts
104
105open Logic
106
107open Positive
108
109open Z
110
111open BitVectorZ
112
113open Pointers
114
115open ByteValues
116
117open BackEndOps
118
119open Joint
120
121open State
122
123open Bind_new
124
125open BindLists
126
127(** val bindNewP : Monad.monadPred **)
128let bindNewP =
129  Monad.Mk_MonadPred
130
131(** val split_on_last :
132    'a1 List.list -> ('a1 List.list, 'a1) Types.prod Types.option **)
133let split_on_last x =
134  List.foldr (fun el acc ->
135    match acc with
136    | Types.None -> Types.Some { Types.fst = List.Nil; Types.snd = el }
137    | Types.Some pr ->
138      Types.Some { Types.fst = (List.Cons (el, pr.Types.fst)); Types.snd =
139        pr.Types.snd }) Types.None x
140
141type step_block =
142  (((__ -> Joint.joint_seq) List.list, __ -> Joint.joint_step) Types.prod,
143  Joint.joint_seq List.list) Types.prod
144
145type fin_block = (Joint.joint_seq List.list, Joint.joint_fin_step) Types.prod
146
147type bind_step_block = (Registers.register, step_block) Bind_new.bind_new
148
149type bind_fin_block = (Registers.register, fin_block) Bind_new.bind_new
150
151type bind_seq_list =
152  (Registers.register, Joint.joint_seq List.list) Bind_new.bind_new
153
154(** val add_dummy_variance : 'a2 List.list -> ('a1 -> 'a2) List.list **)
155let add_dummy_variance x =
156  List.map (fun x0 x1 -> x0) x
157
158(** val ensure_step_block :
159    Joint.params -> AST.ident List.list -> Joint.joint_seq List.list ->
160    step_block **)
161let ensure_step_block p g = function
162| List.Nil ->
163  { Types.fst = { Types.fst = List.Nil; Types.snd = (fun x -> Joint.Step_seq
164    (Joint.nOOP (Joint.stmt_pars__o__uns_pars__o__u_pars p) g)) };
165    Types.snd = List.Nil }
166| List.Cons (hd, tl) ->
167  { Types.fst = { Types.fst = List.Nil; Types.snd = (fun x -> Joint.Step_seq
168    hd) }; Types.snd = tl }
169
170(** val map_eval : ('a1 -> 'a2) List.list -> 'a1 -> 'a2 List.list **)
171let map_eval l x =
172  List.map (fun f -> f x) l
173
Note: See TracBrowser for help on using the repository browser.