@@ -120,32 +120,35 @@ module type Lattices_mono = sig
120
120
121
121
(* Usual notion of adjunction:
122
122
Given two morphisms [f : A -> B] and [g : B -> A], we require [f a <= b]
123
- iff [a <= g b].
124
-
125
- Our solver accepts a wider notion of adjunction and only requires the same
126
- condition on convex sublattices. To be specific, if [f] and [g] form a
127
- usual adjunction between [A] and [B], and [A] is a convex sublattice of
128
- [A'], and [B] is a convex sublattice of [B'], we say that [f] and [g]
129
- form a partial adjunction between [A'] and [B']. We do not require [f] to
130
- be defined on [A'\A]. Similar for [g].
131
-
132
- Definition of convex sublattice can be found at:
133
- https://en.wikipedia.org/wiki/Lattice_(order)#Sublattices
134
-
135
- For example: Define [A = B = {0, 1, 2}] with total ordering. Define both
136
- [f] and [g] to be the identity function. Obviously [f] and [g] form a usual
137
- adjunction. Now, further define [A'] = [A], and [B'] = [{0, 1, 2, 3}] with
138
- total ordering. Obviously [A] is a convex sublattice of [A'], and [B] of
139
- [B']. Then we say [f] and [g] forms a partial adjunction between [A'] and
140
- [B'].
141
-
142
- The feature allows the user to invoke [f a <= b'], where [a \in A] and [b'
143
- \in B']. Similarly, they can invoke [a' <= g b], where [a' \in A'] and [b
144
- \in B].
145
-
146
- Moreover, if [a' \in A'\A], it is still fine to apply [f] to [a'], but the
147
- result should not be used as a left mode. This is unfortunately not
148
- enforcable by the ocaml type system, and we have to rely on user's caution.
123
+ iff [a <= g b] for all [a \in A] and [b \in B].
124
+
125
+ Our solver accepts a wider notion of adjunction:
126
+ Given two morphisms [f : A -> B] and [g : B -> A], we require [f a <= b]
127
+ iff [a <= g b] for any [a] in the downward closure of [g]'s image.
128
+
129
+ We say [f] is a partial left adjoint of [g], because [f] is only
130
+ constrained on the downward closure of the image of [g]. As a result, [f]
131
+ is not unique, since its valuation out of the required range is not
132
+ constrained.
133
+
134
+ Dually, we can define the concept of partial right adjoint. Since partial
135
+ adjoints are not unique, they don't form a pair: i.e., if a partial left
136
+ joint of a partial right adjoint of [f] is not [f].
137
+
138
+ Concretely, the solver provides/requires the following guarantees
139
+ (continuing the example above):
140
+
141
+ For the user of the [Solvers_polarized].
142
+ - [g] applied to a right mode [m] can be used as a right mode without
143
+ any restriction.
144
+ - [f] applied to to a left mode [m] can be used as a left mode, given that
145
+ the [m] is fully within the downward closure of [g]. This is unfortunately
146
+ not enforcable by the ocaml type system, and we have to rely on user's
147
+ caution.
148
+
149
+ For the supplier of the [Lattices_mono]:
150
+ - The result of [left_adjoint g] is applied only on the downward closure of
151
+ [g]'s image.
149
152
*)
150
153
151
154
(* Note that [left_adjoint] and [right_adjoint] returns a [morph] weaker than
0 commit comments