| 1 | (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh |
| 2 | * Jagannathan, and Stephen Weeks. |
| 3 | * Copyright (C) 1997-2000 NEC Research Institute. |
| 4 | * |
| 5 | * MLton is released under a BSD-style license. |
| 6 | * See the file MLton-LICENSE for details. |
| 7 | *) |
| 8 | |
| 9 | functor ThreePointLattice(S: THREE_POINT_LATTICE_STRUCTS): THREE_POINT_LATTICE = |
| 10 | struct |
| 11 | |
| 12 | open S |
| 13 | |
| 14 | structure L = NPointLattice(val names = [bottom, mid, top]) |
| 15 | open L |
| 16 | |
| 17 | val isBottom = fn x => isN (x, 0) |
| 18 | val isMid = fn x => isN (x, 1) |
| 19 | val isTop = fn x => isN (x, 2) |
| 20 | val makeMid = fn x => makeN (x, 1) |
| 21 | val makeTop = fn x => makeN (x, 2) |
| 22 | val whenMid = fn (x, h) => whenN (x, 1, h) |
| 23 | val whenTop = fn (x, h) => whenN (x, 2, h) |
| 24 | end |