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
ed8c2098
Commit
ed8c2098
authored
2 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[language] Some renaming and style rework.
parent
452c4d5d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/language.ml
+5
-5
5 additions, 5 deletions
src/language.ml
src/language.mli
+6
-6
6 additions, 6 deletions
src/language.mli
with
11 additions
and
11 deletions
src/language.ml
+
5
−
5
View file @
ed8c2098
...
@@ -27,14 +27,14 @@ open Base
...
@@ -27,14 +27,14 @@ open Base
(* - NNet and ONNX for neural networks *)
(* - NNet and ONNX for neural networks *)
(* - OVO for for SVM *)
(* - OVO for for SVM *)
type
nnshape
=
{
type
nn
_
shape
=
{
nb_inputs
:
int
;
nb_inputs
:
int
;
nb_outputs
:
int
;
nb_outputs
:
int
;
ty_data
:
Ty
.
ty
;
ty_data
:
Ty
.
ty
;
filename
:
string
;
filename
:
string
;
}
}
type
svmshape
=
{
nb_inputs
:
int
;
nb_classes
:
int
;
filename
:
string
}
type
svm
_
shape
=
{
nb_inputs
:
int
;
nb_classes
:
int
;
filename
:
string
}
let
loaded_nets
=
Term
.
Hls
.
create
10
let
loaded_nets
=
Term
.
Hls
.
create
10
let
loaded_svms
=
Term
.
Hls
.
create
10
let
loaded_svms
=
Term
.
Hls
.
create
10
...
@@ -43,21 +43,21 @@ let lookup_loaded_svms = Term.Hls.find_opt loaded_svms
...
@@ -43,21 +43,21 @@ let lookup_loaded_svms = Term.Hls.find_opt loaded_svms
let
register_nn_as_tuple
nb_inputs
nb_outputs
filename
env
=
let
register_nn_as_tuple
nb_inputs
nb_outputs
filename
env
=
let
net
=
Pmodule
.
read_module
env
[
"caisar"
]
"NN"
in
let
net
=
Pmodule
.
read_module
env
[
"caisar"
]
"NN"
in
let
ioshape_
input_type
=
let
input_type
=
Ty
.
ty_app
Theory
.(
ns_find_ts
net
.
mod_theory
.
th_export
[
"input_type"
])
[]
Ty
.
ty_app
Theory
.(
ns_find_ts
net
.
mod_theory
.
th_export
[
"input_type"
])
[]
in
in
let
id_as_tuple
=
Ident
.
id_fresh
"NNasTuple"
in
let
id_as_tuple
=
Ident
.
id_fresh
"NNasTuple"
in
let
th_uc
=
Pmodule
.
create_module
env
id_as_tuple
in
let
th_uc
=
Pmodule
.
create_module
env
id_as_tuple
in
let
th_uc
=
Pmodule
.
use_export
th_uc
net
in
let
th_uc
=
Pmodule
.
use_export
th_uc
net
in
let
ls_net_apply
=
let
ls_net_apply
=
let
f
_
=
ioshape_
input_type
in
let
f
_
=
input_type
in
Term
.
create_fsymbol
Term
.
create_fsymbol
(
Ident
.
id_fresh
"net_apply"
)
(
Ident
.
id_fresh
"net_apply"
)
(
List
.
init
nb_inputs
~
f
)
(
List
.
init
nb_inputs
~
f
)
(
Ty
.
ty_tuple
(
List
.
init
nb_outputs
~
f
))
(
Ty
.
ty_tuple
(
List
.
init
nb_outputs
~
f
))
in
in
Term
.
Hls
.
add
loaded_nets
ls_net_apply
Term
.
Hls
.
add
loaded_nets
ls_net_apply
{
filename
;
nb_inputs
;
nb_outputs
;
ty_data
=
ioshape_
input_type
};
{
filename
;
nb_inputs
;
nb_outputs
;
ty_data
=
input_type
};
let
th_uc
=
let
th_uc
=
Pmodule
.
add_pdecl
~
vc
:
false
th_uc
Pmodule
.
add_pdecl
~
vc
:
false
th_uc
(
Pdecl
.
create_pure_decl
(
Decl
.
create_param_decl
ls_net_apply
))
(
Pdecl
.
create_pure_decl
(
Decl
.
create_param_decl
ls_net_apply
))
...
...
This diff is collapsed.
Click to expand it.
src/language.mli
+
6
−
6
View file @
ed8c2098
...
@@ -22,20 +22,20 @@
...
@@ -22,20 +22,20 @@
open
Why3
open
Why3
type
nnshape
=
{
type
nn
_
shape
=
{
nb_inputs
:
int
;
nb_inputs
:
int
;
nb_outputs
:
int
;
nb_outputs
:
int
;
ty_data
:
Ty
.
ty
;
ty_data
:
Ty
.
ty
;
filename
:
string
;
filename
:
string
;
}
}
type
svmshape
=
{
nb_inputs
:
int
;
nb_classes
:
int
;
filename
:
string
}
type
svm
_
shape
=
{
nb_inputs
:
int
;
nb_classes
:
int
;
filename
:
string
}
val
lookup_loaded_nets
:
Term
.
lsymbol
->
nnshape
option
val
lookup_loaded_nets
:
Term
.
lsymbol
->
nn
_
shape
option
(** @return the
filenam
e of a nnet Why3 representation. *)
(** @return the
shap
e of a nnet Why3 representation. *)
val
lookup_loaded_svms
:
Why3
.
Term
.
lsymbol
->
svmshape
option
val
lookup_loaded_svms
:
Term
.
lsymbol
->
svm
_
shape
option
(** @return the
svm
shape of a svm Why3 representation. *)
(** @return the shape of a svm Why3 representation. *)
val
register_nnet_support
:
unit
->
unit
val
register_nnet_support
:
unit
->
unit
(** Register NNet parser. *)
(** Register NNet parser. *)
...
...
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