Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
caisar
Commits
8ca73d5f
Commit
8ca73d5f
authored
1 year ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[trans] Better code style.
parent
dd181d55
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/transformations/native_nn_prover.ml
+7
-9
7 additions, 9 deletions
src/transformations/native_nn_prover.ml
with
7 additions
and
9 deletions
src/transformations/native_nn_prover.ml
+
7
−
9
View file @
8ca73d5f
...
...
@@ -42,11 +42,9 @@ let collect_input_vars =
]
)
when
String
.
equal
ls1
.
ls_name
.
id_string
(
Ident
.
op_infix
"@@"
)
->
(
match
(
Language
.
lookup_nn
ls2
,
Language
.
lookup_vector
ls3
)
with
|
Some
{
nn_nb_inputs
;
_
}
,
Some
vector_length
->
(
|
Some
{
nn_nb_inputs
;
_
}
,
Some
vector_length
->
assert
(
nn_nb_inputs
=
vector_length
&&
vector_length
=
List
.
length
tl
);
match
Term
.
Hls
.
find_opt
hls
ls3
with
|
None
->
List
.
foldi
~
init
:
mls
~
f
:
add
tl
|
Some
_
->
mls
)
if
Term
.
Hls
.
mem
hls
ls3
then
mls
else
List
.
foldi
~
init
:
mls
~
f
:
add
tl
|
_
,
_
->
mls
)
|
_
->
Term
.
t_fold
do_collect
mls
term
in
...
...
@@ -66,17 +64,17 @@ let create_output_vars =
|
Term
.
Tapp
(
ls1
(* @@ *)
,
[
{
t_node
=
Tapp
(
ls2
(* nn *)
,
_
);
_
};
_
])
when
String
.
equal
ls1
.
ls_name
.
id_string
(
Ident
.
op_infix
"@@"
)
->
(
match
Language
.
lookup_nn
ls2
with
|
Some
{
nn_nb_outputs
;
nn_ty_elt
;
_
}
->
(
match
Term
.
Mterm
.
find_opt
term
mt
with
|
None
->
|
Some
{
nn_nb_outputs
;
nn_ty_elt
;
_
}
->
if
Term
.
Mterm
.
mem
term
mt
then
mt
else
let
output_vars
=
List
.
init
nn_nb_outputs
~
f
:
(
fun
index
->
(
index
,
Term
.
create_fsymbol
(
Ident
.
id_fresh
"caisar_y"
)
[]
nn_ty_elt
))
in
Term
.
Mterm
.
add
term
output_vars
mt
|
Some
_
->
mt
)
|
_
->
mt
)
|
None
->
mt
)
|
_
->
Term
.
t_fold
do_create
mt
term
in
Trans
.
fold_decl
...
...
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