239
239
module Flat = FlatConf (Printable. DefaultConf )
240
240
241
241
242
- module LiftConf (Conf : Printable.LiftConf ) (Base : S ) =
242
+ module LiftConf (Conf : Printable.LiftConf ) (Base : PO ) =
243
243
struct
244
244
include Printable. LiftConf (Conf ) (Base )
245
245
@@ -270,7 +270,7 @@ struct
270
270
| (x , `Bot) -> x
271
271
| (`Lifted x , `Lifted y ) ->
272
272
try `Lifted (Base. join x y)
273
- with TopValue -> `Top
273
+ with TopValue | Uncomparable -> `Top
274
274
275
275
let meet x y =
276
276
match (x,y) with
@@ -280,14 +280,14 @@ struct
280
280
| (x , `Top) -> x
281
281
| (`Lifted x , `Lifted y ) ->
282
282
try `Lifted (Base. meet x y)
283
- with BotValue -> `Bot
283
+ with BotValue | Uncomparable -> `Bot
284
284
285
285
let widen x y =
286
286
match (x,y) with
287
287
| (`Lifted x , `Lifted y ) ->
288
288
begin
289
289
try `Lifted (Base. widen x y)
290
- with TopValue -> `Top
290
+ with TopValue | Uncomparable -> `Top
291
291
end
292
292
| _ -> y
293
293
@@ -296,7 +296,7 @@ struct
296
296
| (`Lifted x , `Lifted y ) ->
297
297
begin
298
298
try `Lifted (Base. narrow x y)
299
- with BotValue -> `Bot
299
+ with BotValue | Uncomparable -> `Bot
300
300
end
301
301
| (_ , `Bot) -> `Bot
302
302
| (`Top, y ) -> y
305
305
306
306
module Lift = LiftConf (Printable. DefaultConf )
307
307
308
- module LiftPO (Conf : Printable.LiftConf ) (Base : PO ) =
309
- struct
310
- include Printable. LiftConf (Conf ) (Base )
311
-
312
- let bot () = `Bot
313
- let is_bot x = x = `Bot
314
- let top () = `Top
315
- let is_top x = x = `Top
316
-
317
- let leq x y =
318
- match (x,y) with
319
- | (_ , `Top) -> true
320
- | (`Top, _ ) -> false
321
- | (`Bot, _ ) -> true
322
- | (_ , `Bot) -> false
323
- | (`Lifted x , `Lifted y ) -> Base. leq x y
324
-
325
- let pretty_diff () ((x :t ),(y :t )): Pretty.doc =
326
- match (x,y) with
327
- | (`Lifted x , `Lifted y ) -> Base. pretty_diff () (x,y)
328
- | _ -> if leq x y then Pretty. text " No Changes" else
329
- Pretty. dprintf " %a instead of %a" pretty x pretty y
330
-
331
- let join x y =
332
- match (x,y) with
333
- | (`Top, _ ) -> `Top
334
- | (_ , `Top) -> `Top
335
- | (`Bot, x ) -> x
336
- | (x , `Bot) -> x
337
- | (`Lifted x , `Lifted y ) ->
338
- try `Lifted (Base. join x y)
339
- with Uncomparable | TopValue -> `Top
340
-
341
- let meet x y =
342
- match (x,y) with
343
- | (`Bot, _ ) -> `Bot
344
- | (_ , `Bot) -> `Bot
345
- | (`Top, x ) -> x
346
- | (x , `Top) -> x
347
- | (`Lifted x , `Lifted y ) ->
348
- try `Lifted (Base. meet x y)
349
- with Uncomparable | BotValue -> `Bot
350
-
351
- let widen x y =
352
- match (x,y) with
353
- | (`Lifted x , `Lifted y ) ->
354
- begin
355
- try `Lifted (Base. widen x y)
356
- with Uncomparable | TopValue -> `Top
357
- end
358
- | _ -> y
359
-
360
- let narrow x y =
361
- match (x,y) with
362
- | (`Lifted x , `Lifted y ) ->
363
- begin
364
- try `Lifted (Base. narrow x y)
365
- with Uncomparable | BotValue -> `Bot
366
- end
367
- | (_ , `Bot) -> `Bot
368
- | (`Top, y ) -> y
369
- | _ -> x
370
- end
371
-
372
- module Lift2Conf (Conf : Printable.Lift2Conf ) (Base1 : S ) (Base2 : S ) =
308
+ module Lift2Conf (Conf : Printable.Lift2Conf ) (Base1 : PO ) (Base2 : PO ) =
373
309
struct
374
310
include Printable. Lift2Conf (Conf ) (Base1 ) (Base2 )
375
311
0 commit comments