aboutsummaryrefslogtreecommitdiffstats
path: root/lib/vm.mli
diff options
context:
space:
mode:
authorMarcos Magueta <maguetamarcos@gmail.com>2026-07-11 22:12:53 -0300
committerMarcos Magueta <maguetamarcos@gmail.com>2026-07-11 22:12:53 -0300
commit0886f3c71cf8551e4f8b3726654003a4f29645f0 (patch)
tree884176834dc4f20b0af2cf4ab72c48b945203107 /lib/vm.mli
parentf22834d3aaed2b2dd2c5d4203e937fc8fb4b5507 (diff)
downloadSOL-0886f3c71cf8551e4f8b3726654003a4f29645f0.tar.gz
SOL-0886f3c71cf8551e4f8b3726654003a4f29645f0.zip
residuation: open membership returns residual constraints
Diffstat (limited to '')
-rw-r--r--lib/vm.mli25
1 files changed, 19 insertions, 6 deletions
diff --git a/lib/vm.mli b/lib/vm.mli
index 6ce3f93..4c91be2 100644
--- a/lib/vm.mli
+++ b/lib/vm.mli
@@ -15,15 +15,28 @@
type error =
| Non_total_plan of string list
- (** No remaining goal is decidable; the relation names of the
- stuck goals, for the message. *)
+ (** No remaining goal is decidable or residuatable; the
+ relation names of the stuck goals, for the message. *)
val pp_error : Format.formatter -> error -> unit
-(** One answer: each free variable of the query, resolved. Ground in
- the common case; open exactly when the query admits any value
- there. *)
-type solution = (string * Pattern.t) list
+(** A residual constraint: a membership goal that stayed
+ underdetermined. It is decidable the moment its variables are
+ ground; returning it is the honest answer to a satisfiable but
+ open query. Only builtin membership residuates; searches never
+ do. *)
+type residual = string * Pattern.t Label.Map.t
+
+val pp_residual : Format.formatter -> residual -> unit
+(** Prints the constraint as the proposition it is, [[Rel l: t ...]]. *)
+
+(** One answer: each free variable of the query resolved, plus the
+ residual constraints the answer is conditioned on. Ground and
+ residue-free in the common case. *)
+type solution = {
+ bindings : (string * Pattern.t) list;
+ residue : residual list;
+}
module Make (W : World.WORLD) : sig
val solve : W.t -> World.expr -> (solution list, error) result