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
d7990428
Commit
d7990428
authored
1 year ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[interpretation] CSV dataset types comply with the particular CSV dataset format.
parent
9b38a9fb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/interpretation.ml
+3
-2
3 additions, 2 deletions
src/interpretation.ml
src/language.ml
+1
-1
1 addition, 1 deletion
src/language.ml
tests/interpretation_dataset.t
+2
-3
2 additions, 3 deletions
tests/interpretation_dataset.t
with
6 additions
and
6 deletions
src/interpretation.ml
+
3
−
2
View file @
d7990428
...
@@ -127,6 +127,7 @@ let caisar_builtins : caisar_env CRE.built_in_theories list =
...
@@ -127,6 +127,7 @@ let caisar_builtins : caisar_env CRE.built_in_theories list =
let
error_message
ls
=
let
error_message
ls
=
Fmt
.
str
"Invalid arguments for '%a'"
Pretty
.
print_ls
ls
Fmt
.
str
"Invalid arguments for '%a'"
Pretty
.
print_ls
ls
in
in
(* Vector *)
(* Vector *)
let
vget
:
_
CRE
.
builtin
=
let
vget
:
_
CRE
.
builtin
=
fun
engine
ls
vl
ty
->
fun
engine
ls
vl
ty
->
...
@@ -146,14 +147,14 @@ let caisar_builtins : caisar_env CRE.built_in_theories list =
...
@@ -146,14 +147,14 @@ let caisar_builtins : caisar_env CRE.built_in_theories list =
in
in
let
ty_features
=
let
ty_features
=
match
ty
with
match
ty
with
|
Some
{
ty_node
=
Tyapp
(
_
,
[
ty
;
_
]);
_
}
->
Some
ty
|
Some
{
ty_node
=
Tyapp
(
_
,
[
_
;
ty
]);
_
}
->
Some
ty
|
_
->
assert
false
|
_
->
assert
false
in
in
let
t_features
,
t_label
=
let
t_features
,
t_label
=
(
term_of_caisar_op
engine
(
Data
(
D_csv
features
))
ty_features
,
(
term_of_caisar_op
engine
(
Data
(
D_csv
features
))
ty_features
,
Term
.
t_int_const
(
BigInt
.
of_int
(
Int
.
of_string
label
))
)
Term
.
t_int_const
(
BigInt
.
of_int
(
Int
.
of_string
label
))
)
in
in
value_term
(
Term
.
t_tuple
[
t_
features
;
t_label
])
value_term
(
Term
.
t_tuple
[
t_
label
;
t_features
])
|
Vector
v
->
|
Vector
v
->
let
n
=
Option
.
value_exn
(
Language
.
lookup_vector
v
)
in
let
n
=
Option
.
value_exn
(
Language
.
lookup_vector
v
)
in
assert
(
List
.
length
tl1
=
n
&&
i
<=
n
);
assert
(
List
.
length
tl1
=
n
&&
i
<=
n
);
...
...
This diff is collapsed.
Click to expand it.
src/language.ml
+
1
−
1
View file @
d7990428
...
@@ -272,7 +272,7 @@ let fresh_dataset_csv_ls env name =
...
@@ -272,7 +272,7 @@ let fresh_dataset_csv_ls env name =
let
th
=
Env
.
read_theory
env
[
"interpretation"
]
"Dataset"
in
let
th
=
Env
.
read_theory
env
[
"interpretation"
]
"Dataset"
in
Ty
.
ty_app
Ty
.
ty_app
(
Theory
.
ns_find_ts
th
.
th_export
[
"dataset"
])
(
Theory
.
ns_find_ts
th
.
th_export
[
"dataset"
])
[
ty_elt
;
Ty
.
ty_int
]
[
Ty
.
ty_in
t
;
ty_el
t
]
in
in
let
id
=
Ident
.
id_fresh
name
in
let
id
=
Ident
.
id_fresh
name
in
Term
.
create_fsymbol
id
[]
ty
Term
.
create_fsymbol
id
[]
ty
...
...
This diff is collapsed.
Click to expand it.
tests/interpretation_dataset.t
+
2
−
3
View file @
d7990428
...
@@ -14,7 +14,6 @@ Test interpret on dataset
...
@@ -14,7 +14,6 @@ Test interpret on dataset
$
caisar
verify
--
format
whyml
--
prover
Marabou
--
ltag
=
ProverSpec
-
2
>&
1
<<
EOF
|
./
filter_tmpdir
.
sh
$
caisar
verify
--
format
whyml
--
prover
Marabou
--
ltag
=
ProverSpec
-
2
>&
1
<<
EOF
|
./
filter_tmpdir
.
sh
>
theory
T
>
theory
T
>
use
ieee_float
.
Float64
>
use
ieee_float
.
Float64
>
use
bool
.
Bool
>
use
int
.
Int
>
use
int
.
Int
>
use
interpretation
.
Vector
>
use
interpretation
.
Vector
>
use
interpretation
.
NeuralNetwork
>
use
interpretation
.
NeuralNetwork
...
@@ -35,7 +34,7 @@ Test interpret on dataset
...
@@ -35,7 +34,7 @@ Test interpret on dataset
>
predicate
bounded_by_epsilon
(
i:
image
)
(
eps:
t
)
=
>
predicate
bounded_by_epsilon
(
i:
image
)
(
eps:
t
)
=
>
forall
v:
index
.
valid_index
i
v
->
.-
eps
.<=
i
[
v
]
.<=
eps
>
forall
v:
index
.
valid_index
i
v
->
.-
eps
.<=
i
[
v
]
.<=
eps
>
>
>
predicate
robust_around
(
n:
nn
)
(
eps:
t
)
(
i
:
image
)
(
l
:
label_
)
=
>
predicate
robust_around
(
n:
nn
)
(
eps:
t
)
(
l
:
label_
)
(
i
:
image
)
=
>
forall
perturbed_image:
image
.
>
forall
perturbed_image:
image
.
>
has_length
perturbed_image
(
length
i
)
->
>
has_length
perturbed_image
(
length
i
)
->
>
valid_image
perturbed_image
->
>
valid_image
perturbed_image
->
...
@@ -43,7 +42,7 @@ Test interpret on dataset
...
@@ -43,7 +42,7 @@ Test interpret on dataset
>
bounded_by_epsilon
perturbation
eps
->
>
bounded_by_epsilon
perturbation
eps
->
>
advises
n
perturbed_image
l
>
advises
n
perturbed_image
l
>
>
>
predicate
robust
(
n:
nn
)
(
d:
dataset
image
label_
)
(
eps:
t
)
=
>
predicate
robust
(
n:
nn
)
(
d:
dataset
label_
image
)
(
eps:
t
)
=
>
Dataset
.
forall_
d
(
robust_around
n
eps
)
>
Dataset
.
forall_
d
(
robust_around
n
eps
)
>
>
>
goal
G:
>
goal
G:
...
...
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