From fce3b4a3d4c35cff6d747ecb1b1efb9cab658902 Mon Sep 17 00:00:00 2001 From: Marcel Moosbrugger Date: Tue, 18 Jun 2024 16:11:52 +0200 Subject: [PATCH] added benchmarks --- benchmarks/defense/defective.prob | 6 +++++ benchmarks/defense/geometric.prob | 8 +++++++ benchmarks/defense/illustrating.prob | 14 +++++++++++ benchmarks/defense/multiply.prob | 6 +++++ benchmarks/defense/non_admissible.prob | 9 ++++++++ benchmarks/defense/polar.prob | 10 ++++++++ benchmarks/defense/turning_vehicle.prob | 23 +++++++++++++++++++ benchmarks/defense/turning_vehicle_param.prob | 22 ++++++++++++++++++ benchmarks/defense/two-rw.prob | 5 ++++ 9 files changed, 103 insertions(+) create mode 100644 benchmarks/defense/defective.prob create mode 100644 benchmarks/defense/geometric.prob create mode 100644 benchmarks/defense/illustrating.prob create mode 100644 benchmarks/defense/multiply.prob create mode 100644 benchmarks/defense/non_admissible.prob create mode 100644 benchmarks/defense/polar.prob create mode 100644 benchmarks/defense/turning_vehicle.prob create mode 100644 benchmarks/defense/turning_vehicle_param.prob create mode 100644 benchmarks/defense/two-rw.prob diff --git a/benchmarks/defense/defective.prob b/benchmarks/defense/defective.prob new file mode 100644 index 0000000..6d4a8e3 --- /dev/null +++ b/benchmarks/defense/defective.prob @@ -0,0 +1,6 @@ +z = 0 +while true: + z = 1-z + x = 2*x+y**2+z + y = 2*y-y**2+2*z +end diff --git a/benchmarks/defense/geometric.prob b/benchmarks/defense/geometric.prob new file mode 100644 index 0000000..ffdcc0b --- /dev/null +++ b/benchmarks/defense/geometric.prob @@ -0,0 +1,8 @@ +stop = 0 +x = 1 +runtime = 1 +while stop == 0: + stop = Bernoulli(1/2) + x = 2*x + runtime = runtime + 1 +end diff --git a/benchmarks/defense/illustrating.prob b/benchmarks/defense/illustrating.prob new file mode 100644 index 0000000..3be4ee3 --- /dev/null +++ b/benchmarks/defense/illustrating.prob @@ -0,0 +1,14 @@ + +toggle, sum, x, y, z = 0, 0, 1, 1, 1 +while true: + toggle = 1 - toggle + if toggle == 0: + x = x + 1 {1/2} x + 2 + y = y + z + x**2 {1/3} y - z - x + z = z + y {1/4} z - y + end + l, g = Laplace(x + y, 1), Normal(0, 1) + if g < 1/2: + sum = sum + x + end +end diff --git a/benchmarks/defense/multiply.prob b/benchmarks/defense/multiply.prob new file mode 100644 index 0000000..71416e1 --- /dev/null +++ b/benchmarks/defense/multiply.prob @@ -0,0 +1,6 @@ +z = 0 +i = y +while true: + i = i - 1 + z = z + x +end diff --git a/benchmarks/defense/non_admissible.prob b/benchmarks/defense/non_admissible.prob new file mode 100644 index 0000000..1d3a794 --- /dev/null +++ b/benchmarks/defense/non_admissible.prob @@ -0,0 +1,9 @@ +u,w,x,y,z = 0,1,2,3,4 + +while true: + z = z+p**2 {1/2} z+p + y = y - 5*p*z + w = 5*w + x**2 + x = 5+w+x + u = x+p*z*y +end diff --git a/benchmarks/defense/polar.prob b/benchmarks/defense/polar.prob new file mode 100644 index 0000000..c5fecfa --- /dev/null +++ b/benchmarks/defense/polar.prob @@ -0,0 +1,10 @@ +x,y = 1,0 +while true: + c1 = Bernoulli(1/2) + c2 = Bernoulli(1/2) + if c1 + c2 < 2: + y = y+1 {1/2} y-2 + g = Normal(y,1) + x = x + g**2 + end +end diff --git a/benchmarks/defense/turning_vehicle.prob b/benchmarks/defense/turning_vehicle.prob new file mode 100644 index 0000000..ffde8e4 --- /dev/null +++ b/benchmarks/defense/turning_vehicle.prob @@ -0,0 +1,23 @@ +v0 = 10 +t = 0.1 +q = -0.5 +psi = Normal(0, 0.01) +cos_psi = Cos(psi) +sin_psi = Sin(psi) +v = Uniform(6.5, 8.0) +x = Uniform(-.1, .1) +y = Uniform(-.5, -.3) +while true: + + w1 = Uniform(-0.1, 0.1) + w2 = Normal(0, 0.01) + cos_w2 = Cos(w2) + sin_w2 = Sin(w2) + + x = x + t * v * cos_psi + y = y + t * v * sin_psi + + v = v + t*(q*(v - v0) + w1) + psi = psi + w2 + cos_psi, sin_psi = cos_psi*cos_w2 - sin_psi*sin_w2, sin_psi*cos_w2 + cos_psi*sin_w2 +end diff --git a/benchmarks/defense/turning_vehicle_param.prob b/benchmarks/defense/turning_vehicle_param.prob new file mode 100644 index 0000000..70e79c8 --- /dev/null +++ b/benchmarks/defense/turning_vehicle_param.prob @@ -0,0 +1,22 @@ +t = 0.1 +q = -0.5 +psi = Normal(0, 0.01) +cos_psi = Cos(psi) +sin_psi = Sin(psi) +v = Uniform(6.5, 8.0) +x = Uniform(-.1, .1) +y = Uniform(-.5, -.3) +while true: + + w1 = Uniform(-0.1, 0.1) + w2 = Normal(0, 0.01) + cos_w2 = Cos(w2) + sin_w2 = Sin(w2) + + x = x + t * v * cos_psi + y = y + t * v * sin_psi + + v = v + t*(q*(v - v0) + w1) + psi = psi + w2 + cos_psi, sin_psi = cos_psi*cos_w2 - sin_psi*sin_w2, sin_psi*cos_w2 + cos_psi*sin_w2 +end diff --git a/benchmarks/defense/two-rw.prob b/benchmarks/defense/two-rw.prob new file mode 100644 index 0000000..a6f5bdd --- /dev/null +++ b/benchmarks/defense/two-rw.prob @@ -0,0 +1,5 @@ +x,y = 0,0 +while true: + x = x+1 {1/2} x-2 + y = y-1 {1/2} y+2 +end