01: /**************************************************************************/
02: /* N I C E */
03: /* A high-level object-oriented research language */
04: /* (c) Daniel Bonniot 2004 */
05: /* */
06: /* This program is free software; you can redistribute it and/or modify */
07: /* it under the terms of the GNU General Public License as published by */
08: /* the Free Software Foundation; either version 2 of the License, or */
09: /* (at your option) any later version. */
10: /* */
11: /**************************************************************************/package mlsub.typing.lowlevel;
12:
13: /** Something that knows how to assert constraints on objects of this "Kind"
14: *
15: * (implemented by Variance, Low level constraints... )
16: *
17: * @author Daniel Bonniot
18: */
19: public interface Kind {
20: /** Asserts that two elements are in a certain order
21: *
22: * @exception Unsatisfiable
23: * @param e1 The smaller element
24: * @param e2 The greater element
25: */
26: void leq(Element e1, Element e2) throws Unsatisfiable;
27:
28: void leq(Element e1, Element e2, boolean initial)
29: throws Unsatisfiable;
30:
31: /** Introduce a new Element of this kind
32: *
33: * @param e
34: */
35: void register(Element e);
36:
37: /**
38: Return a fresh monotype of this kind, or null if that does not make sense.
39:
40: This makes a dependancy from mlsub.typing.lowlevel to mlsub.typing,
41: but they are likely to be used together anyway.
42: */
43: mlsub.typing.Monotype freshMonotype(boolean existential);
44: }
|