diff options
| author | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 02:52:11 -0300 |
|---|---|---|
| committer | Marcos Magueta <maguetamarcos@gmail.com> | 2026-10-31 02:52:11 -0300 |
| commit | dc7d355dbc581c2595a2bba4c377cacb6c2ff696 (patch) | |
| tree | d53f300d79817fb0bfbdd2b6fbabc59746b112d6 /lib | |
| parent | 55dd8ebfdd2629f97388e52953fe5bbd52733745 (diff) | |
| download | RNT-dc7d355dbc581c2595a2bba4c377cacb6c2ff696.tar.gz RNT-dc7d355dbc581c2595a2bba4c377cacb6c2ff696.zip | |
where modes drop only the attribute its index reads
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/concepts/Mode.ml | 4 | ||||
| -rw-r--r-- | lib/concepts/Mode.mli | 2 | ||||
| -rw-r--r-- | lib/evaluators/FOL.ml | 6 |
3 files changed, 7 insertions, 5 deletions
diff --git a/lib/concepts/Mode.ml b/lib/concepts/Mode.ml index b3031fc..9c5daa9 100644 --- a/lib/concepts/Mode.ml +++ b/lib/concepts/Mode.ml @@ -17,5 +17,5 @@ let exhaustible modes bound = let project attributes = List.filter (fun {bound; _} -> BatSet.String.subset bound attributes) -let given attributes = - List.map (fun {bound; yields} -> {bound= BatSet.String.diff bound attributes; yields}) +let given attribute = + List.map (fun {bound; yields} -> {bound= BatSet.String.remove attribute bound; yields}) diff --git a/lib/concepts/Mode.mli b/lib/concepts/Mode.mli index ba1a04a..0518bca 100644 --- a/lib/concepts/Mode.mli +++ b/lib/concepts/Mode.mli @@ -13,4 +13,4 @@ val exhaustible : t -> attributes -> bool (** the modes still usable when only [attributes] can be bound. *) val project : attributes -> t -> t -val given : attributes -> t -> t +val given : string -> t -> t diff --git a/lib/evaluators/FOL.ml b/lib/evaluators/FOL.ml index 1064c74..60cc89f 100644 --- a/lib/evaluators/FOL.ml +++ b/lib/evaluators/FOL.ml @@ -171,8 +171,10 @@ let rec modes = | Where (plan, binding) -> ( let* modes = modes plan in match plan with - | Base relation when Option.is_some (index_for relation binding) -> - Ok (Concepts.Mode.given (bound binding) modes) + | Base relation -> ( + match index_for relation binding with + | Some (_, attribute) -> Ok (Concepts.Mode.given attribute modes) + | None -> Ok modes ) | _ -> Ok modes ) let project description relation = |
