Skip to content
Snippets Groups Projects
Commit 2089a6d2 authored by Michele Alberti's avatar Michele Alberti
Browse files

Merge branch 'doc/julien/acas-xu' into 'master'

[DOC] CAISAR by Examples

Closes #12

See merge request laiser/caisar!53
parents 032e30d8 5684a139
No related branches found
No related tags found
No related merge requests found
Showing with 178 additions and 44 deletions
theory ACAS_XU_P1
theory ACASXU_P1
use ACASXU_1_1.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P1_1_1: forall x0 x1 x2 x3 x4.
(0.5999999999999999777955395074968691915273666381835937500000000000:t) .<= x0 .<= (0.6798577687000000313588543576770462095737457275390625000000000000:t) ->
(-0.5:t) .<= x1 .<= (0.5:t) ->
(-0.5:t) .<= x2 .<= (0.5:t) ->
(0.4500000000000000111022302462515654042363166809082031250000000000:t) .<= x3 .<= (0.5:t) ->
(-0.5:t) .<= x4 .<= (-0.4500000000000000111022302462515654042363166809082031250000000000:t) ->
let (y0, _, _, _, _) = nn_apply x0 x1 x2 x3 x4 in
y0 .< (3.9911256458999999630066213285317644476890563964843750000000000000:t)
y0 .<= (3.9911256458999999630066213285317644476890563964843750000000000000:t)
end
theory ACAS_XU_P10
theory ACASXU_P10
use ACASXU_4_5.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P10_4_5: forall x0 x1 x2 x3 x4.
(0.2689779999999999948734341614908771589398384094238281250000000000:t) .<= x0 .<= (0.6798579999999999623483404320722911506891250610351562500000000000:t) ->
(0.1114079999999999931459271351741335820406675338745117187500000000:t) .<= x1 .<= (0.5:t) ->
(-0.5:t) .<= x2 .<= (-0.4933803236000000036476365039561642333865165710449218750000000000:t) ->
(0.2272730000000000027959856652159942314028739929199218750000000000:t) .<= x3 .<= (0.5:t) ->
(0.0:t) .<= x4 .<= (0.5:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y0 .< y1 /\ y0 .< y2 /\ y0 .< y3 /\ y0 .< y4
y0 .<= y1 /\ y0 .<= y2 /\ y0 .<= y3 /\ y0 .<= y4
end
theory ACAS_XU_P2
theory ACASXU_P2
use ACASXU_2_2.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P2_2_2: forall x0 x1 x2 x3 x4.
(0.5999999999999999777955395074968691915273666381835937500000000000:t) .<= x0 .<= (0.6798577687000000313588543576770462095737457275390625000000000000:t) ->
(-0.5:t) .<= x1 .<= (0.5:t) ->
(-0.5:t) .<= x2 .<= (0.5:t) ->
(0.4500000000000000111022302462515654042363166809082031250000000000:t) .<= x3 .<= (0.5:t) ->
(-0.5:t) .<= x4 .<= (-0.4500000000000000111022302462515654042363166809082031250000000000:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y0 .< y1 \/ y0 .< y2 \/ y0 .< y3 \/ y0 .< y4
y0 .<= y1 \/ y0 .<= y2 \/ y0 .<= y3 \/ y0 .<= y4
end
theory ACAS_XU_P3
use ACASXU_1_1.AsTuple
theory ACASXU_P3
use ACASXU_1_1.AsTuple as N11
use ACASXU_2_7.AsTuple as N27
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
(-0.3035311560999999769272506000561406835913658142089843750000000000:t) .<= x0 .<= (-0.2985528118999999924731980627257144078612327575683593750000000000:t) ->
(-0.0095492965999999998572000947660853853449225425720214843750000000:t) .<= x1 .<= (0.0095492965999999998572000947660853853449225425720214843750000000:t) ->
(0.4933803236000000036476365039561642333865165710449218750000000000:t) .<= x2 .<= (0.5:t) ->
(0.2999999999999999888977697537484345957636833190917968750000000000:t) .<= x3 .<= (0.5:t) ->
(0.2999999999999999888977697537484345957636833190917968750000000000:t) .<= x4 .<= (0.5:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y0 .> y1 \/ y0 .> y2 \/ y0 .> y3 \/ y0 .> y4
constant x0:t
constant x1:t
constant x2:t
constant x3:t
constant x4:t
axiom H0:
(-0.3035311560999999769272506000561406835913658142089843750000000000:t) .<= x0 .<= (-0.2985528118999999924731980627257144078612327575683593750000000000:t)
axiom H1:
(-0.0095492965999999998572000947660853853449225425720214843750000000:t) .<= x1 .<= (0.0095492965999999998572000947660853853449225425720214843750000000:t)
axiom H2:
(0.4933803236000000036476365039561642333865165710449218750000000000:t) .<= x2 .<= (0.5:t)
axiom H3:
(0.2999999999999999888977697537484345957636833190917968750000000000:t) .<= x3 .<= (0.5:t)
axiom H4:
(0.2999999999999999888977697537484345957636833190917968750000000000:t) .<= x4 .<= (0.5:t)
goal P3_1_1:
let (y0, y1, y2, y3, y4) = N11.nn_apply x0 x1 x2 x3 x4 in
y0 .>= y1 \/ y0 .>= y2 \/ y0 .>= y3 \/ y0 .>= y4
goal P3_2_7:
let (y0, y1, y2, y3, y4) = N27.nn_apply x0 x1 x2 x3 x4 in
y0 .>= y1 \/ y0 .>= y2 \/ y0 .>= y3 \/ y0 .>= y4
end
theory ACAS_XU_P4
theory ACASXU_P4
use ACASXU_1_1.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P4_1_1: forall x0 x1 x2 x3 x4.
(-0.3035311560999999769272506000561406835913658142089843750000000000:t) .<= x0 .<= (-0.2985528118999999924731980627257144078612327575683593750000000000:t) ->
(-0.0095492965999999998572000947660853853449225425720214843750000000:t) .<= x1 .<= (0.0095492965999999998572000947660853853449225425720214843750000000:t) ->
(0.0:t) .<= x2 .<= (0.0:t) ->
(0.3181818182000000216902435568044893443584442138671875000000000000:t) .<= x3 .<= (0.5:t) ->
(0.0833333333000000064938461719066253863275051116943359375000000000:t) .<= x4 .<= (0.1666666666999999935061538280933746136724948883056640625000000000:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y0 .> y1 \/ y0 .> y2 \/ y0 .> y3 \/ y0 .> y4
y0 .>= y1 \/ y0 .>= y2 \/ y0 .>= y3 \/ y0 .>= y4
end
theory ACAS_XU_P5
theory ACASXU_P5
use ACASXU_1_1.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P5_1_1: forall x0 x1 x2 x3 x4.
(-0.3242740000000000066826544298237422481179237365722656250000000000:t) .<= x0 .<= (-0.3217849999999999877076106713502667844295501708984375000000000000:t) ->
(0.0318309999999999981845633101329440250992774963378906250000000000:t) .<= x1 .<= (0.0636619999999999963691266202658880501985549926757812500000000000:t) ->
(-0.5:t) .<= x2 .<= (-0.4992039999999999810853523740661330521106719970703125000000000000:t) ->
(-0.5:t) .<= x3 .<= (-0.2272730000000000027959856652159942314028739929199218750000000000:t) ->
(-0.5:t) .<= x4 .<= (-0.1666670000000000095852215054037515074014663696289062500000000000:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y4 .< y1 \/ y4 .< y2 \/ y4 .< y3 \/ y4 .< y0
y4 .<= y1 \/ y4 .<= y2 \/ y4 .<= y3 \/ y4 .<= y0
end
theory ACAS_XU_P6
theory ACASXU_P6
use ACASXU_1_1.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P6_1_1: forall x0 x1 x2 x3 x4.
(-0.1292889999999999872670741751790046691894531250000000000000000000:t) .<= x0 .<= (0.7004349250000000415283807342348154634237289428710937500000000000:t) ->
(-0.5:t) .<= x1 .<= (-0.1114079999999999931459271351741335820406675338745117187500000000:t)
\/
......@@ -11,5 +11,5 @@ theory ACAS_XU_P6
(-0.5:t) .<= x3 .<= (0.5:t) ->
(-0.5:t) .<= x4 .<= (0.5:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y0 .< y1 /\ y0 .< y2 /\ y0 .< y3 /\ y0 .< y4
y0 .<= y1 /\ y0 .<= y2 /\ y0 .<= y3 /\ y0 .<= y4
end
theory ACAS_XU_P7
theory ACASXU_P7
use ACASXU_1_9.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P7_1_9: forall x0 x1 x2 x3 x4.
(-0.3284230000000000204707362172484863549470901489257812500000000000:t) .<= x0 .<= (0.6798579999999999623483404320722911506891250610351562500000000000:t) ->
(-0.5:t) .<= x1 .<= (0.5:t) ->
(-0.5:t) .<= x2 .<= (0.5:t) ->
(-0.5:t) .<= x3 .<= (0.5:t) ->
(-0.5:t) .<= x4 .<= (0.5:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
(y4 .> y1 \/ y4 .> y2 \/ y4 .> y3 \/ y4 .> y0) /\ (y3 .> y1 \/ y3 .> y2 \/ y3 .> y0 \/ y3 .> y4)
(y4 .>= y1 \/ y4 .>= y2 \/ y4 .>= y3 \/ y4 .>= y0) /\ (y3 .>= y1 \/ y3 .>= y2 \/ y3 .>= y0 \/ y3 .>= y4)
end
theory ACAS_XU_P8
theory ACASXU_P8
use ACASXU_2_9.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P8_2_9: forall x0 x1 x2 x3 x4.
(-0.3284230000000000204707362172484863549470901489257812500000000000:t) .<= x0 .<= (0.6798579999999999623483404320722911506891250610351562500000000000:t) ->
(-0.5:t) .<= x1 .<= (0.375:t) ->
(-0.0159149999999999985922372047753015067428350448608398437500000000:t) .<= x2 .<= (0.0159149999999999985922372047753015067428350448608398437500000000:t) ->
(-0.0454550000000000023470114740575809264555573463439941406250000000:t) .<= x3 .<= (0.5:t) ->
(0.0:t) .<= x4 .<= (0.5:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
(y1 .< y0 /\ y1 .< y2 /\ y1 .< y3 /\ y1 .< y4) \/ (y0 .< y1 /\ y0 .< y2 /\ y0 .< y3 /\ y0 .< y4)
(y1 .<= y0 /\ y1 .<= y2 /\ y1 .<= y3 /\ y1 .<= y4) \/ (y0 .<= y1 /\ y0 .<= y2 /\ y0 .<= y3 /\ y0 .<= y4)
end
theory ACAS_XU_P9
theory ACASXU_P9
use ACASXU_3_3.AsTuple
use ieee_float.Float64
goal G: forall x0 x1 x2 x3 x4.
goal P9_3_3: forall x0 x1 x2 x3 x4.
(-0.2952339158000000240988924815610516816377639770507812500000000000:t) .<= x0 .<= (-0.2122615123999999908743774312824825756251811981201171875000000000:t) ->
(-0.0636619771999999972678097037714906036853790283203125000000000000:t) .<= x1 .<= (-0.0222816919999999987767047571196599164977669715881347656250000000:t) ->
(-0.4999998959999999992298569395643426105380058288574218750000000000:t) .<= x2 .<= (-0.4984083464999999879552206039079464972019195556640625000000000000:t) ->
(-0.5:t) .<= x3 .<= (-0.4545454545000000012855423392466036602854728698730468750000000000:t) ->
(-0.5:t) .<= x4 .<= (-0.375:t) ->
let (y0, y1, y2, y3, y4) = nn_apply x0 x1 x2 x3 x4 in
y3 .< y1 /\ y3 .< y2 /\ y3 .< y0 /\ y3 .< y4
y3 .<= y1 /\ y3 .<= y2 /\ y3 .<= y0 /\ y3 .<= y4
end
This diff is collapsed.
5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,18,18,18,126,136,175,26,166,255,247,127,0,0,0,0,0,0,0,0,0,0,0,0,30,36,94,154,170,253,253,253,253,253,225,172,253,242,195,64,0,0,0,0,0,0,0,0,0,0,0,49,238,253,253,253,253,253,253,253,253,251,93,82,82,56,39,0,0,0,0,0,0,0,0,0,0,0,0,18,219,253,253,253,253,253,198,182,247,241,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,80,156,107,253,253,205,11,0,43,154,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,14,1,154,253,90,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,253,190,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,190,253,70,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,241,225,160,108,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,81,240,253,253,119,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,45,186,253,253,150,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,93,252,253,187,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,249,253,249,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,46,130,183,253,253,207,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,148,229,253,253,253,250,182,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,114,221,253,253,253,253,201,78,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,23,66,213,253,253,253,253,198,81,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,171,219,253,253,253,253,195,80,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,172,226,253,253,253,253,244,133,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,136,253,253,253,212,135,132,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
File added
theory MNIST
use MNIST_256_2.AsArray
use ieee_float.Float64
use caisar.DataSetClassification
use caisar.DataSetProps
goal robustness:
let normalized_dataset = min_max_scale true (0.0:t) (1.0:t) dataset in
robust model normalized_dataset (0.0100000000000000002081668171172168513294309377670288085937500000:t)
end
......@@ -26,13 +26,13 @@ theory DataSetClassification
use array.Array
type features = array t
type class = int
type label_ = int
type datum = (features, class)
type datum = (features, label_)
type dataset = {
nb_features: int;
nb_classes: int;
nb_label_s: int;
data: array datum
}
......@@ -51,7 +51,7 @@ theory Model
nb_outputs: int;
}
function predict_class: model -> features -> class
function predict: model -> features -> label_
end
theory DataSetProps
......@@ -67,13 +67,13 @@ theory DataSetProps
predicate correct_at (m: model) (d: datum) =
let (x, y) = d in
y = predict_class m x
y = predict m x
predicate robust_at (m: model) (d: datum) (eps: t) =
forall x': features.
let (x, _) = d in
linfty_distance x x' eps ->
predict_class m x = predict_class m x'
predict m x = predict m x'
predicate cond_robust_at (m: model) (d: datum) (eps: t) =
correct_at m d /\ robust_at m d eps
......
......@@ -42,13 +42,15 @@ Test autodetect
<autodetect>Found prover Marabou version 1.0.+, OK.
<autodetect>Found prover PyRAT version 1.1, OK.
<autodetect>Found prover PyRAT version 1.1 (alternative: VNNLIB)
<autodetect>Found prover PyRAT version 1.1 (alternative: ACAS)
<autodetect>Found prover nnenum version dummy, OK.
<autodetect>Found prover SAVer version v1.0, OK.
<autodetect>7 prover(s) added
<autodetect>8 prover(s) added
[caisar] Alt-Ergo 2.4.0
CVC5 1.0.2
Marabou 1.0.+
PyRAT 1.1
PyRAT 1.1 (ACAS)
PyRAT 1.1 (VNNLIB)
SAVer v1.0
nnenum dummy
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment