Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
colibrics
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
colibrics
Commits
926a0c24
Commit
926a0c24
authored
3 years ago
by
François Bobot
Browse files
Options
Downloads
Patches
Plain Diff
[Boolean] Some cleanup
parent
6a72a13c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!13
Improve doc, a simplify daemons
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src_colibri2/theories/bool/boolean.ml
+3
-33
3 additions, 33 deletions
src_colibri2/theories/bool/boolean.ml
with
3 additions
and
33 deletions
src_colibri2/theories/bool/boolean.ml
+
3
−
33
View file @
926a0c24
...
...
@@ -260,9 +260,6 @@ module TwoWatchLiteral = struct
let
create
=
Daemon
.
create
end
let
wait_for_this_node_get_a_value
d
n
=
Daemon
.
attach_value
d
n
BoolValue
.
key
let
converter
d
(
f
:
Ground
.
t
)
=
let
res
=
Ground
.
node
f
in
let
reg_args
args
=
IArray
.
iter
~
f
:
(
Egraph
.
register
d
)
args
in
...
...
@@ -294,12 +291,12 @@ let converter d (f:Ground.t) =
if
v
then
set_bool
d
res
true
else
if
is_true
d
res
then
set_bool
d
a
false
in
List
.
iter
(
fun
n
->
wait_for_this_node_get_a_value
d
n
wait
)
[
a
;
b
;
res
]
List
.
iter
(
fun
n
->
Daemon
.
attach_value
d
n
BoolValue
.
key
wait
)
[
a
;
b
;
res
]
|
{
app
=
{
builtin
=
Expr
.
Neg
};
tyargs
=
[]
;
args
;
_
}
->
let
a
=
IArray
.
extract1_exn
args
in
reg_args
args
;
wait_for_this_node_get_a_value
d
a
(
fun
d
_
v
->
set_bool
d
res
(
not
(
BoolValue
.
value
v
)));
wait_for_this_node_get_a_value
d
res
(
fun
d
_
v
->
set_bool
d
a
(
not
(
BoolValue
.
value
v
)))
Daemon
.
attach_value
d
a
BoolValue
.
key
(
fun
d
_
v
->
set_bool
d
res
(
not
(
BoolValue
.
value
v
)));
Daemon
.
attach_value
d
res
BoolValue
.
key
(
fun
d
_
v
->
set_bool
d
a
(
not
(
BoolValue
.
value
v
)))
|
{
app
=
{
builtin
=
Expr
.
True
};
tyargs
=
[]
;
args
;
_
}
->
assert
(
IArray
.
is_empty
args
);
reg
_true
...
...
@@ -351,30 +348,3 @@ let th_register env =
()
let
()
=
Egraph
.
add_default_theory
th_register
(** {2 Interpretations} *)
(* let () =
* let interp ~interp t =
* let v =
* IArray.fold (fun acc (n,b) ->
* acc ||
* let v = BoolValue.value (BoolValue.coerce_nodevalue (interp n)) in
* if b then not v else v
* ) false t.T.lits
* in
* let v = if t.T.topnot then not v else v in
* BoolValue.nodevalue (if v then value_true else value_false)
* in
* Interp.Register.thterm sem interp *)
let
default_value
=
true
(* let () =
* Interp.Register.model ty (fun d n ->
* let v = is d n in
* let v = Colibri2_popop_lib.Opt.get_def default_value v in
* let v = if v then values_true else values_false in
* v) *)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment