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
68ebd47f
Commit
68ebd47f
authored
1 year ago
by
Julien Girard-Satabin
Committed by
Michele Alberti
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
More consistant logging
parent
1e821ab2
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/language.ml
+1
-2
1 addition, 2 deletions
src/language.ml
src/logging.ml
+3
-0
3 additions, 0 deletions
src/logging.ml
src/logging.mli
+3
-0
3 additions, 0 deletions
src/logging.mli
src/verification.ml
+3
-4
3 additions, 4 deletions
src/verification.ml
tests/nier_to_onnx.t
+3
-1
3 additions, 1 deletion
tests/nier_to_onnx.t
with
13 additions
and
7 deletions
src/language.ml
+
1
−
2
View file @
68ebd47f
...
@@ -244,8 +244,7 @@ let create_nn_onnx =
...
@@ -244,8 +244,7 @@ let create_nn_onnx =
Logs
.
warn
(
fun
m
->
Logs
.
warn
(
fun
m
->
m
"Cannot build network intermediate representation:@ %s"
msg
);
m
"Cannot build network intermediate representation:@ %s"
msg
);
None
None
|
Ok
nier
->
|
Ok
nier
->
Some
nier
Some
nier
in
in
{
{
nn_nb_inputs
=
n_inputs
;
nn_nb_inputs
=
n_inputs
;
...
...
This diff is collapsed.
Click to expand it.
src/logging.ml
+
3
−
0
View file @
68ebd47f
...
@@ -81,6 +81,9 @@ let code_error ?src f =
...
@@ -81,6 +81,9 @@ let code_error ?src f =
exception
User_error
exception
User_error
let
info
?
src
f
=
Logs
.
info
?
src
f
let
user_error
?
src
f
=
let
user_error
?
src
f
=
Logs
.
err
?
src
f
;
Logs
.
err
?
src
f
;
raise
User_error
raise
User_error
...
...
This diff is collapsed.
Click to expand it.
src/logging.mli
+
3
−
0
View file @
68ebd47f
...
@@ -38,6 +38,9 @@ val setup :
...
@@ -38,6 +38,9 @@ val setup :
val
is_debug_level
:
Logs
.
src
->
bool
val
is_debug_level
:
Logs
.
src
->
bool
val
info
:
?
src
:
Logs
.
src
->
(
_
,
unit
)
Logs
.
msgf
->
unit
(** Log a message to the user and continue the execution. *)
val
code_error
:
?
src
:
Logs
.
src
->
(
_
,
unit
)
Logs
.
msgf
->
'
b
val
code_error
:
?
src
:
Logs
.
src
->
(
_
,
unit
)
Logs
.
msgf
->
'
b
(** Terminate execution with a [code error] message. *)
(** Terminate execution with a [code error] message. *)
...
...
This diff is collapsed.
Click to expand it.
src/verification.ml
+
3
−
4
View file @
68ebd47f
...
@@ -261,11 +261,10 @@ let answer_generic limit config prover config_prover driver ~proof_strategy
...
@@ -261,11 +261,10 @@ let answer_generic limit config prover config_prover driver ~proof_strategy
|
Some
{
nn_nier
=
Some
g
;
_
}
->
(
|
Some
{
nn_nier
=
Some
g
;
_
}
->
(
try
try
Onnx
.
write
g
f
;
Onnx
.
write
g
f
;
Log
s
.
info
(
fun
m
->
m
"@[Wrote ONNX file at '%s'@]"
f
)
Log
ging
.
info
(
fun
m
->
m
"@[Wrote ONNX file at '%s'@]"
f
)
with
Sys_error
msg
->
with
Sys_error
msg
->
Logs
.
err
(
fun
m
->
Logging
.
user_error
(
fun
m
->
m
"@[System error: tried to write ONNX file a '%s', got '%s'@]"
m
"@[Tried to write ONNX file at '%s', got '%s'@]"
f
msg
))
f
msg
))
|
None
->
()
|
None
->
()
|
_
->
()
|
_
->
()
in
in
...
...
This diff is collapsed.
Click to expand it.
tests/nier_to_onnx.t
+
3
−
1
View file @
68ebd47f
...
@@ -4,7 +4,7 @@ Test verify
...
@@ -4,7 +4,7 @@ Test verify
$
bin
/
pyrat
.
py
--
version
$
bin
/
pyrat
.
py
--
version
PyRAT
1.1
PyRAT
1.1
$
caisar
verify
--
format
whyml
--
prover
=
PyRAT
--
onnx
-
out
-
file
=
"
out.onnx
"
-
2
>&
1
<<
EOF
|
./
filter_tmpdir
.
sh
$
caisar
verify
--
format
whyml
--
prover
=
PyRAT
-
v
--
onnx
-
out
-
file
=
"
out.onnx
"
-
2
>&
1
<<
EOF
|
./
filter_tmpdir
.
sh
>
theory
NIER_to_ONNX
>
theory
NIER_to_ONNX
>
use
ieee_float
.
Float64
>
use
ieee_float
.
Float64
>
use
bool
.
Bool
>
use
bool
.
Bool
...
@@ -21,6 +21,8 @@ Test verify
...
@@ -21,6 +21,8 @@ Test verify
>
(
0.5
:
t
)
.<
(
nn@@i
)[
0
]
.<
(
0.5
:
t
)
>
(
0.5
:
t
)
.<
(
nn@@i
)[
0
]
.<
(
0.5
:
t
)
>
end
>
end
>
EOF
>
EOF
[
INFO
]
Wrote
ONNX
file
at
'
out.onnx
'
[
INFO
]
Verification
results
for
theory
'
NIER_to_ONNX
'
Goal
G:
Unknown
()
Goal
G:
Unknown
()
Data
should
be
0.135
Data
should
be
0.135
...
...
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