From 7d73cb14e55319e9f76706da4d9093bc39e3d894 Mon Sep 17 00:00:00 2001 From: jaloyan Date: Thu, 18 Jun 2015 10:36:20 -0400 Subject: [PATCH] added --- example1/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example1/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example1/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example1/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example1/Makefile | 17 + example1/cabal.sandbox.config | 25 + example1/copilot-sbv-codegen/Makefile | 47 + example1/copilot-sbv-codegen/README | 11 + example1/copilot-sbv-codegen/copilot.h | 28 + example1/copilot-sbv-codegen/copilot.mk | 6 + example1/copilot-sbv-codegen/driver.c | 122 + example1/copilot-sbv-codegen/ext_arr_e3.c | 31 + example1/copilot-sbv-codegen/ext_ff_1_arg0.c | 30 + example1/copilot-sbv-codegen/internal.h | 50 + .../copilot-sbv-codegen/trigger_guard_trig1.c | 24 + .../copilot-sbv-codegen/trigger_trig1_arg_0.c | 32 + .../copilot-sbv-codegen/trigger_trig1_arg_1.c | 34 + .../copilot-sbv-codegen/trigger_trig1_arg_2.c | 31 + example1/copilot-sbv-codegen/update_state_0.c | 25 + example1/copilot-sbv-codegen/update_state_1.c | 31 + example1/copilot-sbv-codegen/update_state_2.c | 47 + example1/main.hs | 46 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example10/Makefile | 17 + example10/cabal.sandbox.config | 25 + example10/copilot-sbv-codegen/Makefile | 65 + example10/copilot-sbv-codegen/README | 11 + example10/copilot-sbv-codegen/copilot.h | 27 + example10/copilot-sbv-codegen/copilot.mk | 6 + example10/copilot-sbv-codegen/driver.c | 125 + .../copilot-sbv-codegen/ext_func0_1_arg0.c | 22 + .../copilot-sbv-codegen/ext_func0_1_arg1.c | 31 + .../copilot-sbv-codegen/ext_func0_3_arg0.c | 21 + .../copilot-sbv-codegen/ext_func0_3_arg1.c | 21 + .../copilot-sbv-codegen/ext_func0_4_arg0.c | 22 + .../copilot-sbv-codegen/ext_func0_4_arg1.c | 31 + .../copilot-sbv-codegen/ext_func0_5_arg0.c | 22 + .../copilot-sbv-codegen/ext_func0_5_arg1.c | 31 + example10/copilot-sbv-codegen/internal.h | 56 + .../trigger_guard_trigger.c | 21 + .../trigger_trigger_arg_0.c | 27 + .../trigger_trigger_arg_1.c | 22 + .../trigger_trigger_arg_2.c | 22 + .../trigger_trigger_arg_3.c | 31 + .../copilot-sbv-codegen/update_state_0.c | 31 + .../copilot-sbv-codegen/update_state_1.c | 24 + example10/main.hs | 55 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example11/Makefile | 17 + example11/cabal.sandbox.config | 25 + example11/main.hs | 148 ++ .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example12/Makefile | 17 + example12/cabal.sandbox.config | 25 + example12/copilot-sbv-codegen/Makefile | 29 + example12/copilot-sbv-codegen/README | 11 + example12/copilot-sbv-codegen/copilot.h | 24 + example12/copilot-sbv-codegen/copilot.mk | 6 + example12/copilot-sbv-codegen/driver.c | 75 + example12/copilot-sbv-codegen/internal.h | 38 + .../copilot-sbv-codegen/trigger_guard_strm.c | 21 + .../copilot-sbv-codegen/trigger_strm_arg_0.c | 28 + .../copilot-sbv-codegen/update_state_1.c | 25 + example12/main.hs | 43 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example13/Makefile | 17 + example13/cabal.sandbox.config | 25 + example13/copilot-sbv-codegen/Makefile | 80 + example13/copilot-sbv-codegen/README | 11 + example13/copilot-sbv-codegen/copilot.h | 29 + example13/copilot-sbv-codegen/copilot.mk | 6 + example13/copilot-sbv-codegen/driver.c | 183 ++ example13/copilot-sbv-codegen/internal.h | 60 + .../trigger_guard_testAlways1.c | 21 + .../trigger_guard_testAlways2.c | 21 + .../trigger_guard_testFuture.c | 21 + .../trigger_guard_testNext.c | 21 + .../trigger_guard_testRelease.c | 21 + .../trigger_guard_testUntil.c | 21 + .../trigger_testAlways1_arg_0.c | 24 + .../trigger_testAlways2_arg_0.c | 39 + .../trigger_testFuture_arg_0.c | 82 + .../trigger_testNext_arg_0.c | 33 + .../trigger_testRelease_arg_0.c | 78 + .../trigger_testUntil_arg_0.c | 75 + .../copilot-sbv-codegen/update_state_0.c | 21 + .../copilot-sbv-codegen/update_state_1.c | 21 + .../copilot-sbv-codegen/update_state_2.c | 21 + .../copilot-sbv-codegen/update_state_3.c | 21 + .../copilot-sbv-codegen/update_state_4.c | 21 + .../copilot-sbv-codegen/update_state_5.c | 31 + .../copilot-sbv-codegen/update_state_6.c | 21 + .../copilot-sbv-codegen/update_state_7.c | 21 + example13/main.hs | 55 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example14/Makefile | 17 + example14/cabal.sandbox.config | 25 + example14/copilot-sbv-codegen/Makefile | 38 + example14/copilot-sbv-codegen/README | 11 + example14/copilot-sbv-codegen/copilot.h | 24 + example14/copilot-sbv-codegen/copilot.mk | 6 + example14/copilot-sbv-codegen/driver.c | 130 + example14/copilot-sbv-codegen/internal.h | 45 + .../copilot-sbv-codegen/observer_sinceTest.c | 43 + .../copilot-sbv-codegen/update_state_0.c | 35 + .../copilot-sbv-codegen/update_state_1.c | 35 + .../copilot-sbv-codegen/update_state_2.c | 28 + .../copilot-sbv-codegen/update_state_3.c | 21 + .../copilot-sbv-codegen/update_state_4.c | 43 + example14/main.hs | 76 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example15/Makefile | 17 + example15/cabal.sandbox.config | 25 + example15/copilot-sbv-codegen/Makefile | 164 ++ example15/copilot-sbv-codegen/README | 11 + example15/copilot-sbv-codegen/copilot.h | 27 + example15/copilot-sbv-codegen/copilot.mk | 6 + example15/copilot-sbv-codegen/driver.c | 699 +++++ example15/copilot-sbv-codegen/internal.h | 196 ++ .../copilot-sbv-codegen/observer_reset.c | 23 + .../copilot-sbv-codegen/observer_test1.c | 93 + .../copilot-sbv-codegen/observer_test2.c | 90 + .../copilot-sbv-codegen/update_state_0.c | 32 + .../copilot-sbv-codegen/update_state_1.c | 32 + .../copilot-sbv-codegen/update_state_10.c | 38 + .../copilot-sbv-codegen/update_state_11.c | 38 + .../copilot-sbv-codegen/update_state_12.c | 38 + .../copilot-sbv-codegen/update_state_13.c | 38 + .../copilot-sbv-codegen/update_state_14.c | 38 + .../copilot-sbv-codegen/update_state_15.c | 38 + .../copilot-sbv-codegen/update_state_16.c | 38 + .../copilot-sbv-codegen/update_state_17.c | 38 + .../copilot-sbv-codegen/update_state_18.c | 38 + .../copilot-sbv-codegen/update_state_19.c | 38 + .../copilot-sbv-codegen/update_state_2.c | 21 + .../copilot-sbv-codegen/update_state_20.c | 38 + .../copilot-sbv-codegen/update_state_21.c | 78 + .../copilot-sbv-codegen/update_state_22.c | 78 + .../copilot-sbv-codegen/update_state_23.c | 78 + .../copilot-sbv-codegen/update_state_24.c | 78 + .../copilot-sbv-codegen/update_state_25.c | 78 + .../copilot-sbv-codegen/update_state_26.c | 78 + .../copilot-sbv-codegen/update_state_27.c | 24 + .../copilot-sbv-codegen/update_state_28.c | 28 + .../copilot-sbv-codegen/update_state_29.c | 24 + .../copilot-sbv-codegen/update_state_3.c | 38 + .../copilot-sbv-codegen/update_state_30.c | 38 + .../copilot-sbv-codegen/update_state_31.c | 24 + .../copilot-sbv-codegen/update_state_32.c | 45 + .../copilot-sbv-codegen/update_state_33.c | 21 + .../copilot-sbv-codegen/update_state_34.c | 41 + .../copilot-sbv-codegen/update_state_35.c | 21 + .../copilot-sbv-codegen/update_state_36.c | 56 + .../copilot-sbv-codegen/update_state_37.c | 21 + .../copilot-sbv-codegen/update_state_38.c | 49 + .../copilot-sbv-codegen/update_state_39.c | 24 + .../copilot-sbv-codegen/update_state_4.c | 34 + .../copilot-sbv-codegen/update_state_40.c | 28 + .../copilot-sbv-codegen/update_state_41.c | 24 + .../copilot-sbv-codegen/update_state_42.c | 38 + .../copilot-sbv-codegen/update_state_43.c | 21 + .../copilot-sbv-codegen/update_state_44.c | 41 + .../copilot-sbv-codegen/update_state_5.c | 34 + .../copilot-sbv-codegen/update_state_6.c | 34 + .../copilot-sbv-codegen/update_state_7.c | 34 + .../copilot-sbv-codegen/update_state_8.c | 34 + .../copilot-sbv-codegen/update_state_9.c | 34 + example15/main.hs | 61 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example16/Makefile | 17 + example16/cabal.sandbox.config | 25 + example16/copilot-sbv-codegen/Makefile | 59 + example16/copilot-sbv-codegen/README | 11 + example16/copilot-sbv-codegen/copilot.h | 28 + example16/copilot-sbv-codegen/copilot.mk | 6 + example16/copilot-sbv-codegen/driver.c | 184 ++ example16/copilot-sbv-codegen/internal.h | 50 + example16/copilot-sbv-codegen/observer_done.c | 25 + example16/copilot-sbv-codegen/observer_obs0.c | 36 + example16/copilot-sbv-codegen/observer_obs1.c | 32 + example16/copilot-sbv-codegen/observer_obs2.c | 30 + example16/copilot-sbv-codegen/observer_sat.c | 23 + .../copilot-sbv-codegen/update_state_0.c | 30 + .../copilot-sbv-codegen/update_state_1.c | 32 + .../copilot-sbv-codegen/update_state_2.c | 36 + .../copilot-sbv-codegen/update_state_3.c | 25 + .../copilot-sbv-codegen/update_state_4.c | 62 + .../copilot-sbv-codegen/update_state_5.c | 36 + .../copilot-sbv-codegen/update_state_6.c | 32 + .../copilot-sbv-codegen/update_state_7.c | 30 + example16/main.hs | 70 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example17/Makefile | 17 + example17/cabal.sandbox.config | 25 + example17/copilot-sbv-codegen/Makefile | 32 + example17/copilot-sbv-codegen/README | 11 + example17/copilot-sbv-codegen/copilot.h | 26 + example17/copilot-sbv-codegen/copilot.mk | 6 + example17/copilot-sbv-codegen/driver.c | 109 + example17/copilot-sbv-codegen/internal.h | 43 + .../observer_sinceExtTest.c | 35 + .../copilot-sbv-codegen/update_state_0.c | 22 + .../copilot-sbv-codegen/update_state_1.c | 28 + .../copilot-sbv-codegen/update_state_2.c | 35 + example17/main.hs | 76 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example18/Makefile | 17 + example18/cabal.sandbox.config | 25 + example18/copilot-sbv-codegen/Makefile | 29 + example18/copilot-sbv-codegen/README | 11 + example18/copilot-sbv-codegen/copilot.h | 24 + example18/copilot-sbv-codegen/copilot.mk | 6 + example18/copilot-sbv-codegen/driver.c | 88 + example18/copilot-sbv-codegen/internal.h | 39 + .../observer_eventuallyPrevTest.c | 39 + .../copilot-sbv-codegen/update_state_0.c | 35 + .../copilot-sbv-codegen/update_state_1.c | 39 + example18/main.hs | 76 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example19/Makefile | 17 + example19/cabal.sandbox.config | 25 + example19/copilot-sbv-codegen/Makefile | 29 + example19/copilot-sbv-codegen/README | 11 + example19/copilot-sbv-codegen/copilot.h | 24 + example19/copilot-sbv-codegen/copilot.mk | 6 + example19/copilot-sbv-codegen/driver.c | 88 + example19/copilot-sbv-codegen/internal.h | 39 + .../observer_testAlwaysBeen.c | 40 + .../copilot-sbv-codegen/update_state_0.c | 36 + .../copilot-sbv-codegen/update_state_1.c | 40 + example19/main.hs | 76 + example2/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example2/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example2/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example2/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example2/Makefile | 17 + example2/cabal.sandbox.config | 25 + example2/copilot-sbv-codegen/Makefile | 26 + example2/copilot-sbv-codegen/README | 11 + example2/copilot-sbv-codegen/copilot.h | 24 + example2/copilot-sbv-codegen/copilot.mk | 6 + example2/copilot-sbv-codegen/driver.c | 63 + example2/copilot-sbv-codegen/internal.h | 36 + .../copilot-sbv-codegen/trigger_f_arg_0.c | 21 + .../copilot-sbv-codegen/trigger_guard_f.c | 21 + example2/main.hs | 30 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example20/Makefile | 17 + example20/cabal.sandbox.config | 25 + example20/copilot-sbv-codegen/Makefile | 29 + example20/copilot-sbv-codegen/README | 11 + example20/copilot-sbv-codegen/copilot.h | 24 + example20/copilot-sbv-codegen/copilot.mk | 6 + example20/copilot-sbv-codegen/driver.c | 88 + example20/copilot-sbv-codegen/internal.h | 38 + .../observer_previousTest.c | 24 + .../copilot-sbv-codegen/update_state_0.c | 30 + .../copilot-sbv-codegen/update_state_1.c | 30 + example20/main.hs | 76 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example21/Makefile | 17 + example21/cabal.sandbox.config | 25 + example21/copilot-sbv-codegen/Makefile | 113 + example21/copilot-sbv-codegen/README | 11 + example21/copilot-sbv-codegen/copilot.h | 34 + example21/copilot-sbv-codegen/copilot.mk | 6 + example21/copilot-sbv-codegen/driver.c | 370 +++ example21/copilot-sbv-codegen/internal.h | 72 + example21/copilot-sbv-codegen/observer_done.c | 25 + example21/copilot-sbv-codegen/observer_obs0.c | 586 +++++ example21/copilot-sbv-codegen/observer_obs1.c | 307 +++ example21/copilot-sbv-codegen/observer_obs2.c | 167 ++ example21/copilot-sbv-codegen/observer_obs3.c | 96 + example21/copilot-sbv-codegen/observer_obs4.c | 62 + example21/copilot-sbv-codegen/observer_obs5.c | 45 + example21/copilot-sbv-codegen/observer_obs6.c | 36 + example21/copilot-sbv-codegen/observer_obs7.c | 32 + example21/copilot-sbv-codegen/observer_obs8.c | 30 + example21/copilot-sbv-codegen/observer_sat.c | 23 + .../copilot-sbv-codegen/update_state_0.c | 30 + .../copilot-sbv-codegen/update_state_1.c | 32 + .../copilot-sbv-codegen/update_state_10.c | 1206 +++++++++ .../copilot-sbv-codegen/update_state_11.c | 586 +++++ .../copilot-sbv-codegen/update_state_12.c | 307 +++ .../copilot-sbv-codegen/update_state_13.c | 167 ++ .../copilot-sbv-codegen/update_state_14.c | 96 + .../copilot-sbv-codegen/update_state_15.c | 62 + .../copilot-sbv-codegen/update_state_16.c | 45 + .../copilot-sbv-codegen/update_state_17.c | 36 + .../copilot-sbv-codegen/update_state_18.c | 32 + .../copilot-sbv-codegen/update_state_19.c | 30 + .../copilot-sbv-codegen/update_state_2.c | 36 + .../copilot-sbv-codegen/update_state_3.c | 45 + .../copilot-sbv-codegen/update_state_4.c | 62 + .../copilot-sbv-codegen/update_state_5.c | 96 + .../copilot-sbv-codegen/update_state_6.c | 167 ++ .../copilot-sbv-codegen/update_state_7.c | 307 +++ .../copilot-sbv-codegen/update_state_8.c | 586 +++++ .../copilot-sbv-codegen/update_state_9.c | 25 + example21/main.hs | 70 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example22/Makefile | 17 + example22/cabal.sandbox.config | 25 + example22/copilot-sbv-codegen/Makefile | 47 + example22/copilot-sbv-codegen/README | 11 + example22/copilot-sbv-codegen/copilot.h | 24 + example22/copilot-sbv-codegen/copilot.mk | 6 + example22/copilot-sbv-codegen/driver.c | 172 ++ example22/copilot-sbv-codegen/internal.h | 59 + .../copilot-sbv-codegen/observer_stack.c | 23 + .../copilot-sbv-codegen/update_state_0.c | 62 + .../copilot-sbv-codegen/update_state_1.c | 21 + .../copilot-sbv-codegen/update_state_2.c | 62 + .../copilot-sbv-codegen/update_state_3.c | 62 + .../copilot-sbv-codegen/update_state_4.c | 62 + .../copilot-sbv-codegen/update_state_5.c | 59 + .../copilot-sbv-codegen/update_state_6.c | 21 + .../copilot-sbv-codegen/update_state_7.c | 25 + example22/main.hs | 43 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example23/Makefile | 17 + example23/cabal.sandbox.config | 25 + example23/main.hs | 50 + .../--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 .../--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes .../.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 .../.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example24/Makefile | 17 + example24/cabal.sandbox.config | 25 + example24/copilot-sbv-codegen/Makefile | 110 + example24/copilot-sbv-codegen/README | 11 + example24/copilot-sbv-codegen/copilot.h | 25 + example24/copilot-sbv-codegen/copilot.mk | 6 + example24/copilot-sbv-codegen/driver.c | 427 +++ example24/copilot-sbv-codegen/internal.h | 140 + .../copilot-sbv-codegen/trigger_aMaj_arg_0.c | 2319 +++++++++++++++++ .../copilot-sbv-codegen/trigger_guard_aMaj.c | 21 + .../copilot-sbv-codegen/trigger_guard_maj.c | 21 + .../copilot-sbv-codegen/trigger_maj_arg_0.c | 339 +++ .../copilot-sbv-codegen/update_state_1.c | 25 + .../copilot-sbv-codegen/update_state_100.c | 26 + .../copilot-sbv-codegen/update_state_12.c | 26 + .../copilot-sbv-codegen/update_state_16.c | 26 + .../copilot-sbv-codegen/update_state_20.c | 26 + .../copilot-sbv-codegen/update_state_24.c | 26 + .../copilot-sbv-codegen/update_state_28.c | 26 + .../copilot-sbv-codegen/update_state_32.c | 26 + .../copilot-sbv-codegen/update_state_36.c | 26 + .../copilot-sbv-codegen/update_state_4.c | 25 + .../copilot-sbv-codegen/update_state_40.c | 26 + .../copilot-sbv-codegen/update_state_44.c | 26 + .../copilot-sbv-codegen/update_state_48.c | 26 + .../copilot-sbv-codegen/update_state_52.c | 26 + .../copilot-sbv-codegen/update_state_56.c | 26 + .../copilot-sbv-codegen/update_state_60.c | 26 + .../copilot-sbv-codegen/update_state_64.c | 26 + .../copilot-sbv-codegen/update_state_68.c | 26 + .../copilot-sbv-codegen/update_state_72.c | 26 + .../copilot-sbv-codegen/update_state_76.c | 26 + .../copilot-sbv-codegen/update_state_8.c | 25 + .../copilot-sbv-codegen/update_state_80.c | 26 + .../copilot-sbv-codegen/update_state_84.c | 26 + .../copilot-sbv-codegen/update_state_88.c | 26 + .../copilot-sbv-codegen/update_state_92.c | 26 + .../copilot-sbv-codegen/update_state_96.c | 26 + example24/main.hs | 63 + example3/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example3/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example3/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example3/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example3/Makefile | 17 + example3/cabal.sandbox.config | 25 + example3/copilot-sbv-codegen/Makefile | 44 + example3/copilot-sbv-codegen/README | 11 + example3/copilot-sbv-codegen/copilot.h | 28 + example3/copilot-sbv-codegen/copilot.mk | 6 + example3/copilot-sbv-codegen/driver.c | 99 + example3/copilot-sbv-codegen/ext_arr_arr1.c | 23 + example3/copilot-sbv-codegen/ext_arr_arr2.c | 24 + example3/copilot-sbv-codegen/internal.h | 43 + .../trigger_guard_trigger.c | 21 + .../trigger_trigger_arg_0.c | 22 + .../trigger_trigger_arg_1.c | 22 + .../trigger_trigger_arg_2.c | 22 + example3/copilot-sbv-codegen/update_state_0.c | 26 + example3/main.hs | 44 + example4/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example4/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example4/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example4/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example4/Makefile | 17 + example4/cabal.sandbox.config | 25 + example4/main.hs | 35 + example5/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example5/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example5/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example5/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example5/Makefile | 17 + example5/cabal.sandbox.config | 25 + example5/copilot-sbv-codegen/Makefile | 32 + example5/copilot-sbv-codegen/README | 11 + example5/copilot-sbv-codegen/copilot.h | 25 + example5/copilot-sbv-codegen/copilot.mk | 6 + example5/copilot-sbv-codegen/driver.c | 91 + example5/copilot-sbv-codegen/internal.h | 38 + example5/copilot-sbv-codegen/observer_clk.c | 33 + example5/copilot-sbv-codegen/observer_clk1.c | 25 + example5/copilot-sbv-codegen/update_state_0.c | 27 + example5/copilot-sbv-codegen/update_state_1.c | 33 + example5/main.hs | 35 + example6/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example6/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example6/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example6/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example6/Makefile | 17 + example6/cabal.sandbox.config | 25 + example6/copilot-sbv-codegen/Makefile | 44 + example6/copilot-sbv-codegen/README | 11 + example6/copilot-sbv-codegen/copilot.h | 25 + example6/copilot-sbv-codegen/copilot.mk | 6 + example6/copilot-sbv-codegen/driver.c | 100 + .../copilot-sbv-codegen/ext_crc_sbv_0_arg0.c | 24 + .../copilot-sbv-codegen/ext_crc_sbv_1_arg0.c | 24 + example6/copilot-sbv-codegen/internal.h | 50 + .../trigger_chksum_arg_0.c | 24 + .../trigger_chksum_arg_1.c | 25 + .../trigger_chksum_arg_2.c | 24 + .../trigger_guard_chksum.c | 21 + example6/copilot-sbv-codegen/update_state_0.c | 25 + example6/copilot-sbv-codegen/update_state_1.c | 30 + example6/main.hs | 52 + example7/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example7/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example7/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example7/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example7/Makefile | 17 + example7/cabal.sandbox.config | 25 + example7/copilot-sbv-codegen/Makefile | 29 + example7/copilot-sbv-codegen/README | 11 + example7/copilot-sbv-codegen/copilot.h | 28 + example7/copilot-sbv-codegen/copilot.mk | 6 + example7/copilot-sbv-codegen/driver.c | 90 + example7/copilot-sbv-codegen/internal.h | 44 + .../trigger_guard_shutoff.c | 80 + .../trigger_shutoff_arg_0.c | 39 + .../copilot-sbv-codegen/update_state_27.c | 79 + example7/main.hs | 41 + example8/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example8/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example8/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example8/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example8/Makefile | 17 + example8/cabal.sandbox.config | 25 + example8/copilot-sbv-codegen/Makefile | 80 + example8/copilot-sbv-codegen/README | 11 + example8/copilot-sbv-codegen/copilot.h | 31 + example8/copilot-sbv-codegen/copilot.mk | 6 + example8/copilot-sbv-codegen/driver.c | 181 ++ example8/copilot-sbv-codegen/internal.h | 66 + example8/copilot-sbv-codegen/observer_i.c | 27 + .../copilot-sbv-codegen/trigger_e_arg_0.c | 31 + .../copilot-sbv-codegen/trigger_e_arg_1.c | 24 + .../copilot-sbv-codegen/trigger_e_arg_2.c | 25 + .../copilot-sbv-codegen/trigger_e_arg_3.c | 42 + .../copilot-sbv-codegen/trigger_f_arg_0.c | 31 + .../copilot-sbv-codegen/trigger_f_arg_1.c | 25 + .../copilot-sbv-codegen/trigger_g_arg_0.c | 31 + .../copilot-sbv-codegen/trigger_guard_e.c | 21 + .../copilot-sbv-codegen/trigger_guard_f.c | 31 + .../copilot-sbv-codegen/trigger_guard_g.c | 23 + .../copilot-sbv-codegen/trigger_guard_h.c | 33 + .../copilot-sbv-codegen/trigger_h_arg_0.c | 21 + example8/copilot-sbv-codegen/update_state_0.c | 34 + example8/copilot-sbv-codegen/update_state_1.c | 36 + example8/copilot-sbv-codegen/update_state_2.c | 31 + example8/copilot-sbv-codegen/update_state_3.c | 25 + example8/copilot-sbv-codegen/update_state_4.c | 25 + example8/copilot-sbv-codegen/update_state_5.c | 31 + example8/copilot-sbv-codegen/update_state_6.c | 31 + example8/main.hs | 94 + example9/--list-options/add-source-timestamps | 1 + .../--list-options/packages/00-index.cache | 0 example9/--list-options/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 40 bytes .../package.cache | Bin 0 -> 8 bytes .../package.cache | Bin 0 -> 8 bytes example9/.cabal-sandbox/add-source-timestamps | 1 + .../.cabal-sandbox/packages/00-index.cache | 0 example9/.cabal-sandbox/packages/00-index.tar | Bin 0 -> 10240 bytes .../package.cache | Bin 0 -> 8 bytes example9/Makefile | 17 + example9/cabal.sandbox.config | 25 + example9/copilot-sbv-codegen/Makefile | 41 + example9/copilot-sbv-codegen/README | 11 + example9/copilot-sbv-codegen/copilot.h | 26 + example9/copilot-sbv-codegen/copilot.mk | 6 + example9/copilot-sbv-codegen/driver.c | 112 + example9/copilot-sbv-codegen/internal.h | 46 + .../copilot-sbv-codegen/trigger_guard_trig1.c | 24 + .../copilot-sbv-codegen/trigger_trig1_arg_0.c | 26 + .../copilot-sbv-codegen/trigger_trig1_arg_1.c | 27 + .../copilot-sbv-codegen/trigger_trig1_arg_2.c | 31 + example9/copilot-sbv-codegen/update_state_0.c | 25 + example9/copilot-sbv-codegen/update_state_1.c | 25 + example9/copilot-sbv-codegen/update_state_2.c | 34 + example9/main.hs | 45 + 686 files changed, 24483 insertions(+) create mode 100644 example1/--list-options/add-source-timestamps create mode 100644 example1/--list-options/packages/00-index.cache create mode 100644 example1/--list-options/packages/00-index.tar create mode 100644 example1/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example1/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example1/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example1/.cabal-sandbox/add-source-timestamps create mode 100644 example1/.cabal-sandbox/packages/00-index.cache create mode 100644 example1/.cabal-sandbox/packages/00-index.tar create mode 100644 example1/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example1/Makefile create mode 100644 example1/cabal.sandbox.config create mode 100644 example1/copilot-sbv-codegen/Makefile create mode 100644 example1/copilot-sbv-codegen/README create mode 100644 example1/copilot-sbv-codegen/copilot.h create mode 100644 example1/copilot-sbv-codegen/copilot.mk create mode 100644 example1/copilot-sbv-codegen/driver.c create mode 100644 example1/copilot-sbv-codegen/ext_arr_e3.c create mode 100644 example1/copilot-sbv-codegen/ext_ff_1_arg0.c create mode 100644 example1/copilot-sbv-codegen/internal.h create mode 100644 example1/copilot-sbv-codegen/trigger_guard_trig1.c create mode 100644 example1/copilot-sbv-codegen/trigger_trig1_arg_0.c create mode 100644 example1/copilot-sbv-codegen/trigger_trig1_arg_1.c create mode 100644 example1/copilot-sbv-codegen/trigger_trig1_arg_2.c create mode 100644 example1/copilot-sbv-codegen/update_state_0.c create mode 100644 example1/copilot-sbv-codegen/update_state_1.c create mode 100644 example1/copilot-sbv-codegen/update_state_2.c create mode 100644 example1/main.hs create mode 100644 example10/--list-options/add-source-timestamps create mode 100644 example10/--list-options/packages/00-index.cache create mode 100644 example10/--list-options/packages/00-index.tar create mode 100644 example10/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example10/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example10/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example10/.cabal-sandbox/add-source-timestamps create mode 100644 example10/.cabal-sandbox/packages/00-index.cache create mode 100644 example10/.cabal-sandbox/packages/00-index.tar create mode 100644 example10/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example10/Makefile create mode 100644 example10/cabal.sandbox.config create mode 100644 example10/copilot-sbv-codegen/Makefile create mode 100644 example10/copilot-sbv-codegen/README create mode 100644 example10/copilot-sbv-codegen/copilot.h create mode 100644 example10/copilot-sbv-codegen/copilot.mk create mode 100644 example10/copilot-sbv-codegen/driver.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_1_arg0.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_1_arg1.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_3_arg0.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_3_arg1.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_4_arg0.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_4_arg1.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_5_arg0.c create mode 100644 example10/copilot-sbv-codegen/ext_func0_5_arg1.c create mode 100644 example10/copilot-sbv-codegen/internal.h create mode 100644 example10/copilot-sbv-codegen/trigger_guard_trigger.c create mode 100644 example10/copilot-sbv-codegen/trigger_trigger_arg_0.c create mode 100644 example10/copilot-sbv-codegen/trigger_trigger_arg_1.c create mode 100644 example10/copilot-sbv-codegen/trigger_trigger_arg_2.c create mode 100644 example10/copilot-sbv-codegen/trigger_trigger_arg_3.c create mode 100644 example10/copilot-sbv-codegen/update_state_0.c create mode 100644 example10/copilot-sbv-codegen/update_state_1.c create mode 100644 example10/main.hs create mode 100644 example11/--list-options/add-source-timestamps create mode 100644 example11/--list-options/packages/00-index.cache create mode 100644 example11/--list-options/packages/00-index.tar create mode 100644 example11/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example11/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example11/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example11/.cabal-sandbox/add-source-timestamps create mode 100644 example11/.cabal-sandbox/packages/00-index.cache create mode 100644 example11/.cabal-sandbox/packages/00-index.tar create mode 100644 example11/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example11/Makefile create mode 100644 example11/cabal.sandbox.config create mode 100644 example11/main.hs create mode 100644 example12/--list-options/add-source-timestamps create mode 100644 example12/--list-options/packages/00-index.cache create mode 100644 example12/--list-options/packages/00-index.tar create mode 100644 example12/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example12/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example12/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example12/.cabal-sandbox/add-source-timestamps create mode 100644 example12/.cabal-sandbox/packages/00-index.cache create mode 100644 example12/.cabal-sandbox/packages/00-index.tar create mode 100644 example12/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example12/Makefile create mode 100644 example12/cabal.sandbox.config create mode 100644 example12/copilot-sbv-codegen/Makefile create mode 100644 example12/copilot-sbv-codegen/README create mode 100644 example12/copilot-sbv-codegen/copilot.h create mode 100644 example12/copilot-sbv-codegen/copilot.mk create mode 100644 example12/copilot-sbv-codegen/driver.c create mode 100644 example12/copilot-sbv-codegen/internal.h create mode 100644 example12/copilot-sbv-codegen/trigger_guard_strm.c create mode 100644 example12/copilot-sbv-codegen/trigger_strm_arg_0.c create mode 100644 example12/copilot-sbv-codegen/update_state_1.c create mode 100644 example12/main.hs create mode 100644 example13/--list-options/add-source-timestamps create mode 100644 example13/--list-options/packages/00-index.cache create mode 100644 example13/--list-options/packages/00-index.tar create mode 100644 example13/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example13/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example13/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example13/.cabal-sandbox/add-source-timestamps create mode 100644 example13/.cabal-sandbox/packages/00-index.cache create mode 100644 example13/.cabal-sandbox/packages/00-index.tar create mode 100644 example13/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example13/Makefile create mode 100644 example13/cabal.sandbox.config create mode 100644 example13/copilot-sbv-codegen/Makefile create mode 100644 example13/copilot-sbv-codegen/README create mode 100644 example13/copilot-sbv-codegen/copilot.h create mode 100644 example13/copilot-sbv-codegen/copilot.mk create mode 100644 example13/copilot-sbv-codegen/driver.c create mode 100644 example13/copilot-sbv-codegen/internal.h create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testAlways1.c create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testAlways2.c create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testFuture.c create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testNext.c create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testRelease.c create mode 100644 example13/copilot-sbv-codegen/trigger_guard_testUntil.c create mode 100644 example13/copilot-sbv-codegen/trigger_testAlways1_arg_0.c create mode 100644 example13/copilot-sbv-codegen/trigger_testAlways2_arg_0.c create mode 100644 example13/copilot-sbv-codegen/trigger_testFuture_arg_0.c create mode 100644 example13/copilot-sbv-codegen/trigger_testNext_arg_0.c create mode 100644 example13/copilot-sbv-codegen/trigger_testRelease_arg_0.c create mode 100644 example13/copilot-sbv-codegen/trigger_testUntil_arg_0.c create mode 100644 example13/copilot-sbv-codegen/update_state_0.c create mode 100644 example13/copilot-sbv-codegen/update_state_1.c create mode 100644 example13/copilot-sbv-codegen/update_state_2.c create mode 100644 example13/copilot-sbv-codegen/update_state_3.c create mode 100644 example13/copilot-sbv-codegen/update_state_4.c create mode 100644 example13/copilot-sbv-codegen/update_state_5.c create mode 100644 example13/copilot-sbv-codegen/update_state_6.c create mode 100644 example13/copilot-sbv-codegen/update_state_7.c create mode 100644 example13/main.hs create mode 100644 example14/--list-options/add-source-timestamps create mode 100644 example14/--list-options/packages/00-index.cache create mode 100644 example14/--list-options/packages/00-index.tar create mode 100644 example14/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example14/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example14/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example14/.cabal-sandbox/add-source-timestamps create mode 100644 example14/.cabal-sandbox/packages/00-index.cache create mode 100644 example14/.cabal-sandbox/packages/00-index.tar create mode 100644 example14/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example14/Makefile create mode 100644 example14/cabal.sandbox.config create mode 100644 example14/copilot-sbv-codegen/Makefile create mode 100644 example14/copilot-sbv-codegen/README create mode 100644 example14/copilot-sbv-codegen/copilot.h create mode 100644 example14/copilot-sbv-codegen/copilot.mk create mode 100644 example14/copilot-sbv-codegen/driver.c create mode 100644 example14/copilot-sbv-codegen/internal.h create mode 100644 example14/copilot-sbv-codegen/observer_sinceTest.c create mode 100644 example14/copilot-sbv-codegen/update_state_0.c create mode 100644 example14/copilot-sbv-codegen/update_state_1.c create mode 100644 example14/copilot-sbv-codegen/update_state_2.c create mode 100644 example14/copilot-sbv-codegen/update_state_3.c create mode 100644 example14/copilot-sbv-codegen/update_state_4.c create mode 100644 example14/main.hs create mode 100644 example15/--list-options/add-source-timestamps create mode 100644 example15/--list-options/packages/00-index.cache create mode 100644 example15/--list-options/packages/00-index.tar create mode 100644 example15/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example15/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example15/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example15/.cabal-sandbox/add-source-timestamps create mode 100644 example15/.cabal-sandbox/packages/00-index.cache create mode 100644 example15/.cabal-sandbox/packages/00-index.tar create mode 100644 example15/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example15/Makefile create mode 100644 example15/cabal.sandbox.config create mode 100644 example15/copilot-sbv-codegen/Makefile create mode 100644 example15/copilot-sbv-codegen/README create mode 100644 example15/copilot-sbv-codegen/copilot.h create mode 100644 example15/copilot-sbv-codegen/copilot.mk create mode 100644 example15/copilot-sbv-codegen/driver.c create mode 100644 example15/copilot-sbv-codegen/internal.h create mode 100644 example15/copilot-sbv-codegen/observer_reset.c create mode 100644 example15/copilot-sbv-codegen/observer_test1.c create mode 100644 example15/copilot-sbv-codegen/observer_test2.c create mode 100644 example15/copilot-sbv-codegen/update_state_0.c create mode 100644 example15/copilot-sbv-codegen/update_state_1.c create mode 100644 example15/copilot-sbv-codegen/update_state_10.c create mode 100644 example15/copilot-sbv-codegen/update_state_11.c create mode 100644 example15/copilot-sbv-codegen/update_state_12.c create mode 100644 example15/copilot-sbv-codegen/update_state_13.c create mode 100644 example15/copilot-sbv-codegen/update_state_14.c create mode 100644 example15/copilot-sbv-codegen/update_state_15.c create mode 100644 example15/copilot-sbv-codegen/update_state_16.c create mode 100644 example15/copilot-sbv-codegen/update_state_17.c create mode 100644 example15/copilot-sbv-codegen/update_state_18.c create mode 100644 example15/copilot-sbv-codegen/update_state_19.c create mode 100644 example15/copilot-sbv-codegen/update_state_2.c create mode 100644 example15/copilot-sbv-codegen/update_state_20.c create mode 100644 example15/copilot-sbv-codegen/update_state_21.c create mode 100644 example15/copilot-sbv-codegen/update_state_22.c create mode 100644 example15/copilot-sbv-codegen/update_state_23.c create mode 100644 example15/copilot-sbv-codegen/update_state_24.c create mode 100644 example15/copilot-sbv-codegen/update_state_25.c create mode 100644 example15/copilot-sbv-codegen/update_state_26.c create mode 100644 example15/copilot-sbv-codegen/update_state_27.c create mode 100644 example15/copilot-sbv-codegen/update_state_28.c create mode 100644 example15/copilot-sbv-codegen/update_state_29.c create mode 100644 example15/copilot-sbv-codegen/update_state_3.c create mode 100644 example15/copilot-sbv-codegen/update_state_30.c create mode 100644 example15/copilot-sbv-codegen/update_state_31.c create mode 100644 example15/copilot-sbv-codegen/update_state_32.c create mode 100644 example15/copilot-sbv-codegen/update_state_33.c create mode 100644 example15/copilot-sbv-codegen/update_state_34.c create mode 100644 example15/copilot-sbv-codegen/update_state_35.c create mode 100644 example15/copilot-sbv-codegen/update_state_36.c create mode 100644 example15/copilot-sbv-codegen/update_state_37.c create mode 100644 example15/copilot-sbv-codegen/update_state_38.c create mode 100644 example15/copilot-sbv-codegen/update_state_39.c create mode 100644 example15/copilot-sbv-codegen/update_state_4.c create mode 100644 example15/copilot-sbv-codegen/update_state_40.c create mode 100644 example15/copilot-sbv-codegen/update_state_41.c create mode 100644 example15/copilot-sbv-codegen/update_state_42.c create mode 100644 example15/copilot-sbv-codegen/update_state_43.c create mode 100644 example15/copilot-sbv-codegen/update_state_44.c create mode 100644 example15/copilot-sbv-codegen/update_state_5.c create mode 100644 example15/copilot-sbv-codegen/update_state_6.c create mode 100644 example15/copilot-sbv-codegen/update_state_7.c create mode 100644 example15/copilot-sbv-codegen/update_state_8.c create mode 100644 example15/copilot-sbv-codegen/update_state_9.c create mode 100644 example15/main.hs create mode 100644 example16/--list-options/add-source-timestamps create mode 100644 example16/--list-options/packages/00-index.cache create mode 100644 example16/--list-options/packages/00-index.tar create mode 100644 example16/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example16/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example16/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example16/.cabal-sandbox/add-source-timestamps create mode 100644 example16/.cabal-sandbox/packages/00-index.cache create mode 100644 example16/.cabal-sandbox/packages/00-index.tar create mode 100644 example16/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example16/Makefile create mode 100644 example16/cabal.sandbox.config create mode 100644 example16/copilot-sbv-codegen/Makefile create mode 100644 example16/copilot-sbv-codegen/README create mode 100644 example16/copilot-sbv-codegen/copilot.h create mode 100644 example16/copilot-sbv-codegen/copilot.mk create mode 100644 example16/copilot-sbv-codegen/driver.c create mode 100644 example16/copilot-sbv-codegen/internal.h create mode 100644 example16/copilot-sbv-codegen/observer_done.c create mode 100644 example16/copilot-sbv-codegen/observer_obs0.c create mode 100644 example16/copilot-sbv-codegen/observer_obs1.c create mode 100644 example16/copilot-sbv-codegen/observer_obs2.c create mode 100644 example16/copilot-sbv-codegen/observer_sat.c create mode 100644 example16/copilot-sbv-codegen/update_state_0.c create mode 100644 example16/copilot-sbv-codegen/update_state_1.c create mode 100644 example16/copilot-sbv-codegen/update_state_2.c create mode 100644 example16/copilot-sbv-codegen/update_state_3.c create mode 100644 example16/copilot-sbv-codegen/update_state_4.c create mode 100644 example16/copilot-sbv-codegen/update_state_5.c create mode 100644 example16/copilot-sbv-codegen/update_state_6.c create mode 100644 example16/copilot-sbv-codegen/update_state_7.c create mode 100644 example16/main.hs create mode 100644 example17/--list-options/add-source-timestamps create mode 100644 example17/--list-options/packages/00-index.cache create mode 100644 example17/--list-options/packages/00-index.tar create mode 100644 example17/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example17/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example17/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example17/.cabal-sandbox/add-source-timestamps create mode 100644 example17/.cabal-sandbox/packages/00-index.cache create mode 100644 example17/.cabal-sandbox/packages/00-index.tar create mode 100644 example17/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example17/Makefile create mode 100644 example17/cabal.sandbox.config create mode 100644 example17/copilot-sbv-codegen/Makefile create mode 100644 example17/copilot-sbv-codegen/README create mode 100644 example17/copilot-sbv-codegen/copilot.h create mode 100644 example17/copilot-sbv-codegen/copilot.mk create mode 100644 example17/copilot-sbv-codegen/driver.c create mode 100644 example17/copilot-sbv-codegen/internal.h create mode 100644 example17/copilot-sbv-codegen/observer_sinceExtTest.c create mode 100644 example17/copilot-sbv-codegen/update_state_0.c create mode 100644 example17/copilot-sbv-codegen/update_state_1.c create mode 100644 example17/copilot-sbv-codegen/update_state_2.c create mode 100644 example17/main.hs create mode 100644 example18/--list-options/add-source-timestamps create mode 100644 example18/--list-options/packages/00-index.cache create mode 100644 example18/--list-options/packages/00-index.tar create mode 100644 example18/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example18/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example18/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example18/.cabal-sandbox/add-source-timestamps create mode 100644 example18/.cabal-sandbox/packages/00-index.cache create mode 100644 example18/.cabal-sandbox/packages/00-index.tar create mode 100644 example18/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example18/Makefile create mode 100644 example18/cabal.sandbox.config create mode 100644 example18/copilot-sbv-codegen/Makefile create mode 100644 example18/copilot-sbv-codegen/README create mode 100644 example18/copilot-sbv-codegen/copilot.h create mode 100644 example18/copilot-sbv-codegen/copilot.mk create mode 100644 example18/copilot-sbv-codegen/driver.c create mode 100644 example18/copilot-sbv-codegen/internal.h create mode 100644 example18/copilot-sbv-codegen/observer_eventuallyPrevTest.c create mode 100644 example18/copilot-sbv-codegen/update_state_0.c create mode 100644 example18/copilot-sbv-codegen/update_state_1.c create mode 100644 example18/main.hs create mode 100644 example19/--list-options/add-source-timestamps create mode 100644 example19/--list-options/packages/00-index.cache create mode 100644 example19/--list-options/packages/00-index.tar create mode 100644 example19/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example19/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example19/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example19/.cabal-sandbox/add-source-timestamps create mode 100644 example19/.cabal-sandbox/packages/00-index.cache create mode 100644 example19/.cabal-sandbox/packages/00-index.tar create mode 100644 example19/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example19/Makefile create mode 100644 example19/cabal.sandbox.config create mode 100644 example19/copilot-sbv-codegen/Makefile create mode 100644 example19/copilot-sbv-codegen/README create mode 100644 example19/copilot-sbv-codegen/copilot.h create mode 100644 example19/copilot-sbv-codegen/copilot.mk create mode 100644 example19/copilot-sbv-codegen/driver.c create mode 100644 example19/copilot-sbv-codegen/internal.h create mode 100644 example19/copilot-sbv-codegen/observer_testAlwaysBeen.c create mode 100644 example19/copilot-sbv-codegen/update_state_0.c create mode 100644 example19/copilot-sbv-codegen/update_state_1.c create mode 100644 example19/main.hs create mode 100644 example2/--list-options/add-source-timestamps create mode 100644 example2/--list-options/packages/00-index.cache create mode 100644 example2/--list-options/packages/00-index.tar create mode 100644 example2/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example2/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example2/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example2/.cabal-sandbox/add-source-timestamps create mode 100644 example2/.cabal-sandbox/packages/00-index.cache create mode 100644 example2/.cabal-sandbox/packages/00-index.tar create mode 100644 example2/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example2/Makefile create mode 100644 example2/cabal.sandbox.config create mode 100644 example2/copilot-sbv-codegen/Makefile create mode 100644 example2/copilot-sbv-codegen/README create mode 100644 example2/copilot-sbv-codegen/copilot.h create mode 100644 example2/copilot-sbv-codegen/copilot.mk create mode 100644 example2/copilot-sbv-codegen/driver.c create mode 100644 example2/copilot-sbv-codegen/internal.h create mode 100644 example2/copilot-sbv-codegen/trigger_f_arg_0.c create mode 100644 example2/copilot-sbv-codegen/trigger_guard_f.c create mode 100644 example2/main.hs create mode 100644 example20/--list-options/add-source-timestamps create mode 100644 example20/--list-options/packages/00-index.cache create mode 100644 example20/--list-options/packages/00-index.tar create mode 100644 example20/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example20/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example20/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example20/.cabal-sandbox/add-source-timestamps create mode 100644 example20/.cabal-sandbox/packages/00-index.cache create mode 100644 example20/.cabal-sandbox/packages/00-index.tar create mode 100644 example20/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example20/Makefile create mode 100644 example20/cabal.sandbox.config create mode 100644 example20/copilot-sbv-codegen/Makefile create mode 100644 example20/copilot-sbv-codegen/README create mode 100644 example20/copilot-sbv-codegen/copilot.h create mode 100644 example20/copilot-sbv-codegen/copilot.mk create mode 100644 example20/copilot-sbv-codegen/driver.c create mode 100644 example20/copilot-sbv-codegen/internal.h create mode 100644 example20/copilot-sbv-codegen/observer_previousTest.c create mode 100644 example20/copilot-sbv-codegen/update_state_0.c create mode 100644 example20/copilot-sbv-codegen/update_state_1.c create mode 100644 example20/main.hs create mode 100644 example21/--list-options/add-source-timestamps create mode 100644 example21/--list-options/packages/00-index.cache create mode 100644 example21/--list-options/packages/00-index.tar create mode 100644 example21/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example21/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example21/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example21/.cabal-sandbox/add-source-timestamps create mode 100644 example21/.cabal-sandbox/packages/00-index.cache create mode 100644 example21/.cabal-sandbox/packages/00-index.tar create mode 100644 example21/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example21/Makefile create mode 100644 example21/cabal.sandbox.config create mode 100644 example21/copilot-sbv-codegen/Makefile create mode 100644 example21/copilot-sbv-codegen/README create mode 100644 example21/copilot-sbv-codegen/copilot.h create mode 100644 example21/copilot-sbv-codegen/copilot.mk create mode 100644 example21/copilot-sbv-codegen/driver.c create mode 100644 example21/copilot-sbv-codegen/internal.h create mode 100644 example21/copilot-sbv-codegen/observer_done.c create mode 100644 example21/copilot-sbv-codegen/observer_obs0.c create mode 100644 example21/copilot-sbv-codegen/observer_obs1.c create mode 100644 example21/copilot-sbv-codegen/observer_obs2.c create mode 100644 example21/copilot-sbv-codegen/observer_obs3.c create mode 100644 example21/copilot-sbv-codegen/observer_obs4.c create mode 100644 example21/copilot-sbv-codegen/observer_obs5.c create mode 100644 example21/copilot-sbv-codegen/observer_obs6.c create mode 100644 example21/copilot-sbv-codegen/observer_obs7.c create mode 100644 example21/copilot-sbv-codegen/observer_obs8.c create mode 100644 example21/copilot-sbv-codegen/observer_sat.c create mode 100644 example21/copilot-sbv-codegen/update_state_0.c create mode 100644 example21/copilot-sbv-codegen/update_state_1.c create mode 100644 example21/copilot-sbv-codegen/update_state_10.c create mode 100644 example21/copilot-sbv-codegen/update_state_11.c create mode 100644 example21/copilot-sbv-codegen/update_state_12.c create mode 100644 example21/copilot-sbv-codegen/update_state_13.c create mode 100644 example21/copilot-sbv-codegen/update_state_14.c create mode 100644 example21/copilot-sbv-codegen/update_state_15.c create mode 100644 example21/copilot-sbv-codegen/update_state_16.c create mode 100644 example21/copilot-sbv-codegen/update_state_17.c create mode 100644 example21/copilot-sbv-codegen/update_state_18.c create mode 100644 example21/copilot-sbv-codegen/update_state_19.c create mode 100644 example21/copilot-sbv-codegen/update_state_2.c create mode 100644 example21/copilot-sbv-codegen/update_state_3.c create mode 100644 example21/copilot-sbv-codegen/update_state_4.c create mode 100644 example21/copilot-sbv-codegen/update_state_5.c create mode 100644 example21/copilot-sbv-codegen/update_state_6.c create mode 100644 example21/copilot-sbv-codegen/update_state_7.c create mode 100644 example21/copilot-sbv-codegen/update_state_8.c create mode 100644 example21/copilot-sbv-codegen/update_state_9.c create mode 100644 example21/main.hs create mode 100644 example22/--list-options/add-source-timestamps create mode 100644 example22/--list-options/packages/00-index.cache create mode 100644 example22/--list-options/packages/00-index.tar create mode 100644 example22/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example22/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example22/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example22/.cabal-sandbox/add-source-timestamps create mode 100644 example22/.cabal-sandbox/packages/00-index.cache create mode 100644 example22/.cabal-sandbox/packages/00-index.tar create mode 100644 example22/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example22/Makefile create mode 100644 example22/cabal.sandbox.config create mode 100644 example22/copilot-sbv-codegen/Makefile create mode 100644 example22/copilot-sbv-codegen/README create mode 100644 example22/copilot-sbv-codegen/copilot.h create mode 100644 example22/copilot-sbv-codegen/copilot.mk create mode 100644 example22/copilot-sbv-codegen/driver.c create mode 100644 example22/copilot-sbv-codegen/internal.h create mode 100644 example22/copilot-sbv-codegen/observer_stack.c create mode 100644 example22/copilot-sbv-codegen/update_state_0.c create mode 100644 example22/copilot-sbv-codegen/update_state_1.c create mode 100644 example22/copilot-sbv-codegen/update_state_2.c create mode 100644 example22/copilot-sbv-codegen/update_state_3.c create mode 100644 example22/copilot-sbv-codegen/update_state_4.c create mode 100644 example22/copilot-sbv-codegen/update_state_5.c create mode 100644 example22/copilot-sbv-codegen/update_state_6.c create mode 100644 example22/copilot-sbv-codegen/update_state_7.c create mode 100644 example22/main.hs create mode 100644 example23/--list-options/add-source-timestamps create mode 100644 example23/--list-options/packages/00-index.cache create mode 100644 example23/--list-options/packages/00-index.tar create mode 100644 example23/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example23/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example23/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example23/.cabal-sandbox/add-source-timestamps create mode 100644 example23/.cabal-sandbox/packages/00-index.cache create mode 100644 example23/.cabal-sandbox/packages/00-index.tar create mode 100644 example23/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example23/Makefile create mode 100644 example23/cabal.sandbox.config create mode 100644 example23/main.hs create mode 100644 example24/--list-options/add-source-timestamps create mode 100644 example24/--list-options/packages/00-index.cache create mode 100644 example24/--list-options/packages/00-index.tar create mode 100644 example24/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example24/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example24/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example24/.cabal-sandbox/add-source-timestamps create mode 100644 example24/.cabal-sandbox/packages/00-index.cache create mode 100644 example24/.cabal-sandbox/packages/00-index.tar create mode 100644 example24/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example24/Makefile create mode 100644 example24/cabal.sandbox.config create mode 100644 example24/copilot-sbv-codegen/Makefile create mode 100644 example24/copilot-sbv-codegen/README create mode 100644 example24/copilot-sbv-codegen/copilot.h create mode 100644 example24/copilot-sbv-codegen/copilot.mk create mode 100644 example24/copilot-sbv-codegen/driver.c create mode 100644 example24/copilot-sbv-codegen/internal.h create mode 100644 example24/copilot-sbv-codegen/trigger_aMaj_arg_0.c create mode 100644 example24/copilot-sbv-codegen/trigger_guard_aMaj.c create mode 100644 example24/copilot-sbv-codegen/trigger_guard_maj.c create mode 100644 example24/copilot-sbv-codegen/trigger_maj_arg_0.c create mode 100644 example24/copilot-sbv-codegen/update_state_1.c create mode 100644 example24/copilot-sbv-codegen/update_state_100.c create mode 100644 example24/copilot-sbv-codegen/update_state_12.c create mode 100644 example24/copilot-sbv-codegen/update_state_16.c create mode 100644 example24/copilot-sbv-codegen/update_state_20.c create mode 100644 example24/copilot-sbv-codegen/update_state_24.c create mode 100644 example24/copilot-sbv-codegen/update_state_28.c create mode 100644 example24/copilot-sbv-codegen/update_state_32.c create mode 100644 example24/copilot-sbv-codegen/update_state_36.c create mode 100644 example24/copilot-sbv-codegen/update_state_4.c create mode 100644 example24/copilot-sbv-codegen/update_state_40.c create mode 100644 example24/copilot-sbv-codegen/update_state_44.c create mode 100644 example24/copilot-sbv-codegen/update_state_48.c create mode 100644 example24/copilot-sbv-codegen/update_state_52.c create mode 100644 example24/copilot-sbv-codegen/update_state_56.c create mode 100644 example24/copilot-sbv-codegen/update_state_60.c create mode 100644 example24/copilot-sbv-codegen/update_state_64.c create mode 100644 example24/copilot-sbv-codegen/update_state_68.c create mode 100644 example24/copilot-sbv-codegen/update_state_72.c create mode 100644 example24/copilot-sbv-codegen/update_state_76.c create mode 100644 example24/copilot-sbv-codegen/update_state_8.c create mode 100644 example24/copilot-sbv-codegen/update_state_80.c create mode 100644 example24/copilot-sbv-codegen/update_state_84.c create mode 100644 example24/copilot-sbv-codegen/update_state_88.c create mode 100644 example24/copilot-sbv-codegen/update_state_92.c create mode 100644 example24/copilot-sbv-codegen/update_state_96.c create mode 100644 example24/main.hs create mode 100644 example3/--list-options/add-source-timestamps create mode 100644 example3/--list-options/packages/00-index.cache create mode 100644 example3/--list-options/packages/00-index.tar create mode 100644 example3/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example3/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example3/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example3/.cabal-sandbox/add-source-timestamps create mode 100644 example3/.cabal-sandbox/packages/00-index.cache create mode 100644 example3/.cabal-sandbox/packages/00-index.tar create mode 100644 example3/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example3/Makefile create mode 100644 example3/cabal.sandbox.config create mode 100644 example3/copilot-sbv-codegen/Makefile create mode 100644 example3/copilot-sbv-codegen/README create mode 100644 example3/copilot-sbv-codegen/copilot.h create mode 100644 example3/copilot-sbv-codegen/copilot.mk create mode 100644 example3/copilot-sbv-codegen/driver.c create mode 100644 example3/copilot-sbv-codegen/ext_arr_arr1.c create mode 100644 example3/copilot-sbv-codegen/ext_arr_arr2.c create mode 100644 example3/copilot-sbv-codegen/internal.h create mode 100644 example3/copilot-sbv-codegen/trigger_guard_trigger.c create mode 100644 example3/copilot-sbv-codegen/trigger_trigger_arg_0.c create mode 100644 example3/copilot-sbv-codegen/trigger_trigger_arg_1.c create mode 100644 example3/copilot-sbv-codegen/trigger_trigger_arg_2.c create mode 100644 example3/copilot-sbv-codegen/update_state_0.c create mode 100644 example3/main.hs create mode 100644 example4/--list-options/add-source-timestamps create mode 100644 example4/--list-options/packages/00-index.cache create mode 100644 example4/--list-options/packages/00-index.tar create mode 100644 example4/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example4/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example4/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example4/.cabal-sandbox/add-source-timestamps create mode 100644 example4/.cabal-sandbox/packages/00-index.cache create mode 100644 example4/.cabal-sandbox/packages/00-index.tar create mode 100644 example4/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example4/Makefile create mode 100644 example4/cabal.sandbox.config create mode 100644 example4/main.hs create mode 100644 example5/--list-options/add-source-timestamps create mode 100644 example5/--list-options/packages/00-index.cache create mode 100644 example5/--list-options/packages/00-index.tar create mode 100644 example5/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example5/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example5/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example5/.cabal-sandbox/add-source-timestamps create mode 100644 example5/.cabal-sandbox/packages/00-index.cache create mode 100644 example5/.cabal-sandbox/packages/00-index.tar create mode 100644 example5/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example5/Makefile create mode 100644 example5/cabal.sandbox.config create mode 100644 example5/copilot-sbv-codegen/Makefile create mode 100644 example5/copilot-sbv-codegen/README create mode 100644 example5/copilot-sbv-codegen/copilot.h create mode 100644 example5/copilot-sbv-codegen/copilot.mk create mode 100644 example5/copilot-sbv-codegen/driver.c create mode 100644 example5/copilot-sbv-codegen/internal.h create mode 100644 example5/copilot-sbv-codegen/observer_clk.c create mode 100644 example5/copilot-sbv-codegen/observer_clk1.c create mode 100644 example5/copilot-sbv-codegen/update_state_0.c create mode 100644 example5/copilot-sbv-codegen/update_state_1.c create mode 100644 example5/main.hs create mode 100644 example6/--list-options/add-source-timestamps create mode 100644 example6/--list-options/packages/00-index.cache create mode 100644 example6/--list-options/packages/00-index.tar create mode 100644 example6/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example6/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example6/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example6/.cabal-sandbox/add-source-timestamps create mode 100644 example6/.cabal-sandbox/packages/00-index.cache create mode 100644 example6/.cabal-sandbox/packages/00-index.tar create mode 100644 example6/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example6/Makefile create mode 100644 example6/cabal.sandbox.config create mode 100644 example6/copilot-sbv-codegen/Makefile create mode 100644 example6/copilot-sbv-codegen/README create mode 100644 example6/copilot-sbv-codegen/copilot.h create mode 100644 example6/copilot-sbv-codegen/copilot.mk create mode 100644 example6/copilot-sbv-codegen/driver.c create mode 100644 example6/copilot-sbv-codegen/ext_crc_sbv_0_arg0.c create mode 100644 example6/copilot-sbv-codegen/ext_crc_sbv_1_arg0.c create mode 100644 example6/copilot-sbv-codegen/internal.h create mode 100644 example6/copilot-sbv-codegen/trigger_chksum_arg_0.c create mode 100644 example6/copilot-sbv-codegen/trigger_chksum_arg_1.c create mode 100644 example6/copilot-sbv-codegen/trigger_chksum_arg_2.c create mode 100644 example6/copilot-sbv-codegen/trigger_guard_chksum.c create mode 100644 example6/copilot-sbv-codegen/update_state_0.c create mode 100644 example6/copilot-sbv-codegen/update_state_1.c create mode 100644 example6/main.hs create mode 100644 example7/--list-options/add-source-timestamps create mode 100644 example7/--list-options/packages/00-index.cache create mode 100644 example7/--list-options/packages/00-index.tar create mode 100644 example7/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example7/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example7/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example7/.cabal-sandbox/add-source-timestamps create mode 100644 example7/.cabal-sandbox/packages/00-index.cache create mode 100644 example7/.cabal-sandbox/packages/00-index.tar create mode 100644 example7/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example7/Makefile create mode 100644 example7/cabal.sandbox.config create mode 100644 example7/copilot-sbv-codegen/Makefile create mode 100644 example7/copilot-sbv-codegen/README create mode 100644 example7/copilot-sbv-codegen/copilot.h create mode 100644 example7/copilot-sbv-codegen/copilot.mk create mode 100644 example7/copilot-sbv-codegen/driver.c create mode 100644 example7/copilot-sbv-codegen/internal.h create mode 100644 example7/copilot-sbv-codegen/trigger_guard_shutoff.c create mode 100644 example7/copilot-sbv-codegen/trigger_shutoff_arg_0.c create mode 100644 example7/copilot-sbv-codegen/update_state_27.c create mode 100644 example7/main.hs create mode 100644 example8/--list-options/add-source-timestamps create mode 100644 example8/--list-options/packages/00-index.cache create mode 100644 example8/--list-options/packages/00-index.tar create mode 100644 example8/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example8/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example8/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example8/.cabal-sandbox/add-source-timestamps create mode 100644 example8/.cabal-sandbox/packages/00-index.cache create mode 100644 example8/.cabal-sandbox/packages/00-index.tar create mode 100644 example8/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example8/Makefile create mode 100644 example8/cabal.sandbox.config create mode 100644 example8/copilot-sbv-codegen/Makefile create mode 100644 example8/copilot-sbv-codegen/README create mode 100644 example8/copilot-sbv-codegen/copilot.h create mode 100644 example8/copilot-sbv-codegen/copilot.mk create mode 100644 example8/copilot-sbv-codegen/driver.c create mode 100644 example8/copilot-sbv-codegen/internal.h create mode 100644 example8/copilot-sbv-codegen/observer_i.c create mode 100644 example8/copilot-sbv-codegen/trigger_e_arg_0.c create mode 100644 example8/copilot-sbv-codegen/trigger_e_arg_1.c create mode 100644 example8/copilot-sbv-codegen/trigger_e_arg_2.c create mode 100644 example8/copilot-sbv-codegen/trigger_e_arg_3.c create mode 100644 example8/copilot-sbv-codegen/trigger_f_arg_0.c create mode 100644 example8/copilot-sbv-codegen/trigger_f_arg_1.c create mode 100644 example8/copilot-sbv-codegen/trigger_g_arg_0.c create mode 100644 example8/copilot-sbv-codegen/trigger_guard_e.c create mode 100644 example8/copilot-sbv-codegen/trigger_guard_f.c create mode 100644 example8/copilot-sbv-codegen/trigger_guard_g.c create mode 100644 example8/copilot-sbv-codegen/trigger_guard_h.c create mode 100644 example8/copilot-sbv-codegen/trigger_h_arg_0.c create mode 100644 example8/copilot-sbv-codegen/update_state_0.c create mode 100644 example8/copilot-sbv-codegen/update_state_1.c create mode 100644 example8/copilot-sbv-codegen/update_state_2.c create mode 100644 example8/copilot-sbv-codegen/update_state_3.c create mode 100644 example8/copilot-sbv-codegen/update_state_4.c create mode 100644 example8/copilot-sbv-codegen/update_state_5.c create mode 100644 example8/copilot-sbv-codegen/update_state_6.c create mode 100644 example8/main.hs create mode 100644 example9/--list-options/add-source-timestamps create mode 100644 example9/--list-options/packages/00-index.cache create mode 100644 example9/--list-options/packages/00-index.tar create mode 100644 example9/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache create mode 100644 example9/--list-options/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example9/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache create mode 100644 example9/.cabal-sandbox/add-source-timestamps create mode 100644 example9/.cabal-sandbox/packages/00-index.cache create mode 100644 example9/.cabal-sandbox/packages/00-index.tar create mode 100644 example9/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache create mode 100644 example9/Makefile create mode 100644 example9/cabal.sandbox.config create mode 100644 example9/copilot-sbv-codegen/Makefile create mode 100644 example9/copilot-sbv-codegen/README create mode 100644 example9/copilot-sbv-codegen/copilot.h create mode 100644 example9/copilot-sbv-codegen/copilot.mk create mode 100644 example9/copilot-sbv-codegen/driver.c create mode 100644 example9/copilot-sbv-codegen/internal.h create mode 100644 example9/copilot-sbv-codegen/trigger_guard_trig1.c create mode 100644 example9/copilot-sbv-codegen/trigger_trig1_arg_0.c create mode 100644 example9/copilot-sbv-codegen/trigger_trig1_arg_1.c create mode 100644 example9/copilot-sbv-codegen/trigger_trig1_arg_2.c create mode 100644 example9/copilot-sbv-codegen/update_state_0.c create mode 100644 example9/copilot-sbv-codegen/update_state_1.c create mode 100644 example9/copilot-sbv-codegen/update_state_2.c create mode 100644 example9/main.hs diff --git a/example1/--list-options/add-source-timestamps b/example1/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example1/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example1/--list-options/packages/00-index.cache b/example1/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example1/--list-options/packages/00-index.tar b/example1/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example1/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example1/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example1/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example1/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example1/.cabal-sandbox/add-source-timestamps b/example1/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example1/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example1/.cabal-sandbox/packages/00-index.cache b/example1/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example1/.cabal-sandbox/packages/00-index.tar b/example1/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example1/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example1/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example1/Makefile b/example1/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example1/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example1/cabal.sandbox.config b/example1/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example1/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example1/copilot-sbv-codegen/Makefile b/example1/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..e5418c62 --- /dev/null +++ b/example1/copilot-sbv-codegen/Makefile @@ -0,0 +1,47 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o trigger_guard_trig1.o trigger_trig1_arg_0.o trigger_trig1_arg_1.o trigger_trig1_arg_2.o ext_arr_e3.o ext_ff_1_arg0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_trig1.o: trigger_guard_trig1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_0.o: trigger_trig1_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_1.o: trigger_trig1_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_2.o: trigger_trig1_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_arr_e3.o: ext_arr_e3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_ff_1_arg0.o: ext_ff_1_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example1/copilot-sbv-codegen/README b/example1/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example1/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example1/copilot-sbv-codegen/copilot.h b/example1/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..3063db6a --- /dev/null +++ b/example1/copilot-sbv-codegen/copilot.h @@ -0,0 +1,28 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void trig1(bool, uint64_t, bool); + +/* External variables (must be defined by user): */ + +extern uint64_t e1; +extern uint64_t e2; + +/* External arrays (must be defined by user): */ + +extern uint64_t e3[256]; + +/* External functions (must be defined by user): */ + +uint64_t ff(uint8_t); + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example1/copilot-sbv-codegen/copilot.mk b/example1/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example1/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example1/copilot-sbv-codegen/driver.c b/example1/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..b652501a --- /dev/null +++ b/example1/copilot-sbv-codegen/driver.c @@ -0,0 +1,122 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SBool tmp_0 = true; +SWord8 tmp_1 = 0; +SBool tmp_2 = true; +SBool queue_0[1] = { true }; +SWord8 queue_1[2] = { 0, 1 }; +SBool queue_2[2] = { true, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord64 ext_e1 = 0; +SWord64 ext_e2 = 0; +SWord64 ext_e3_0 = 0; +SWord64 ext_ff_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 2 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 1 )); + global invariant a_bound_ptr_2: ptr_2 < 2 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 1 )); +*/ + +/*@ + assigns ext_e1; + assigns ext_e2; + //ensures ext_e1 == e1; + //ensures ext_e2 == e2; + assigns ext_e3_0 ; + //ensures ext_e3_0 == tmp_e3; + assigns ext_ff_1; + //ensures ext_ff_1 == tmp_ff; +*/ +void sampleExts(void) { + ext_e1 = e1; + ext_e2 = e2; + SWord64 tmp_ext_e3_0 = e3[ext_arr_e3(queue_1, ptr_1)]; + ext_e3_0 = tmp_ext_e3_0; + SWord64 tmp_ff = ff(ext_ff_1_arg0(queue_1, ptr_1)); + ext_ff_1 = tmp_ff; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_trig1(queue_0, ptr_0)) + trig1(trigger_trig1_arg_0(queue_1, ptr_1), + trigger_trig1_arg_1(ext_e1, ext_e2, ext_e3_0, ext_ff_1, queue_1, ptr_1), + trigger_trig1_arg_2(queue_2, ptr_2)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_2 = update_state_2(queue_2, ptr_2, queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 2; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 2; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 2; + ptr_2 = (ptr_2 + 1) % 2; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example1/copilot-sbv-codegen/ext_arr_e3.c b/example1/copilot-sbv-codegen/ext_arr_e3.c new file mode 100644 index 00000000..d052d0fd --- /dev/null +++ b/example1/copilot-sbv-codegen/ext_arr_e3.c @@ -0,0 +1,31 @@ +/* File: "ext_arr_e3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 002*/ +/*ACSL to write + (s1 + 6) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] + 6); +*/ +SWord8 ext_arr_e3(const SWord8 *queue_1, const SWord32 ptr_1) +{ + const SWord8 s0 = queue_1[0]; + const SWord8 s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SWord8 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord8 s5 = table0[s4]; + const SWord8 s7 = s5 + 6; + + return s7; +} diff --git a/example1/copilot-sbv-codegen/ext_ff_1_arg0.c b/example1/copilot-sbv-codegen/ext_ff_1_arg0.c new file mode 100644 index 00000000..383a1eb9 --- /dev/null +++ b/example1/copilot-sbv-codegen/ext_ff_1_arg0.c @@ -0,0 +1,30 @@ +/* File: "ext_ff_1_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SWord8 ext_ff_1_arg0(const SWord8 *queue_1, const SWord32 ptr_1) +{ + const SWord8 s0 = queue_1[0]; + const SWord8 s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SWord8 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord8 s5 = table0[s4]; + + return s5; +} diff --git a/example1/copilot-sbv-codegen/internal.h b/example1/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..631494dc --- /dev/null +++ b/example1/copilot-sbv-codegen/internal.h @@ -0,0 +1,50 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SWord8 update_state_1(const SWord8 *queue_1, const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2, + const SWord8 *queue_1, const SWord32 ptr_1); +SBool trigger_guard_trig1(const SBool *queue_0, + const SWord32 ptr_0); +SBool trigger_trig1_arg_0(const SWord8 *queue_1, + const SWord32 ptr_1); +SWord64 trigger_trig1_arg_1(const SWord64 ext_e1, + const SWord64 ext_e2, const SWord64 ext_e3_0, + const SWord64 ext_ff_1, const SWord8 *queue_1, + const SWord32 ptr_1); +SBool trigger_trig1_arg_2(const SBool *queue_2, + const SWord32 ptr_2); +SWord8 ext_arr_e3(const SWord8 *queue_1, const SWord32 ptr_1); +SWord8 ext_ff_1_arg0(const SWord8 *queue_1, const SWord32 ptr_1); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example1/copilot-sbv-codegen/trigger_guard_trig1.c b/example1/copilot-sbv-codegen/trigger_guard_trig1.c new file mode 100644 index 00000000..e09a34cb --- /dev/null +++ b/example1/copilot-sbv-codegen/trigger_guard_trig1.c @@ -0,0 +1,24 @@ +/* File: "trigger_guard_trig1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool trigger_guard_trig1(const SBool *queue_0, + const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example1/copilot-sbv-codegen/trigger_trig1_arg_0.c b/example1/copilot-sbv-codegen/trigger_trig1_arg_0.c new file mode 100644 index 00000000..628bba1a --- /dev/null +++ b/example1/copilot-sbv-codegen/trigger_trig1_arg_0.c @@ -0,0 +1,32 @@ +/* File: "trigger_trig1_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (s1 < 3) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] < 3); +*/ +SBool trigger_trig1_arg_0(const SWord8 *queue_1, + const SWord32 ptr_1) +{ + const SWord8 s0 = queue_1[0]; + const SWord8 s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SWord8 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord8 s5 = table0[s4]; + const SBool s7 = s5 < 3; + + return s7; +} diff --git a/example1/copilot-sbv-codegen/trigger_trig1_arg_1.c b/example1/copilot-sbv-codegen/trigger_trig1_arg_1.c new file mode 100644 index 00000000..59b8a7d3 --- /dev/null +++ b/example1/copilot-sbv-codegen/trigger_trig1_arg_1.c @@ -0,0 +1,34 @@ +/* File: "trigger_trig1_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (((extern "e1" + extern "e2") + extern "e3[(s1 + 6)]") + extern "ff(s1)") +*/ +/*@ + assigns \nothing; + ensures \result == (((ext_e1 + ext_e2) + ext_e3_0) + ext_ff_1); +*/ +SWord64 trigger_trig1_arg_1(const SWord64 ext_e1, + const SWord64 ext_e2, const SWord64 ext_e3_0, + const SWord64 ext_ff_1, const SWord8 *queue_1, const SWord32 ptr_1) +{ + const SWord64 s0 = ext_e1; + const SWord64 s1 = ext_e2; + const SWord64 s2 = ext_e3_0; + const SWord64 s3 = ext_ff_1; + const SWord8 s4 = queue_1[0]; + const SWord8 s5 = queue_1[1]; + const SWord32 s6 = ptr_1; + const SWord64 s7 = s0 + s1; + const SWord64 s8 = s2 + s7; + const SWord64 s9 = s3 + s8; + + return s9; +} diff --git a/example1/copilot-sbv-codegen/trigger_trig1_arg_2.c b/example1/copilot-sbv-codegen/trigger_trig1_arg_2.c new file mode 100644 index 00000000..6cc8899f --- /dev/null +++ b/example1/copilot-sbv-codegen/trigger_trig1_arg_2.c @@ -0,0 +1,31 @@ +/* File: "trigger_trig1_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool trigger_trig1_arg_2(const SBool *queue_2, + const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SWord32 s2 = ptr_2; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example1/copilot-sbv-codegen/update_state_0.c b/example1/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..3fd5a600 --- /dev/null +++ b/example1/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,25 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + not s0 +*/ +/*@ + assigns \nothing; + ensures \result == ! queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = !s0; + + return s2; +} diff --git a/example1/copilot-sbv-codegen/update_state_1.c b/example1/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..7bf7745a --- /dev/null +++ b/example1/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,31 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s1 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] + 1); +*/ +SWord8 update_state_1(const SWord8 *queue_1, const SWord32 ptr_1) +{ + const SWord8 s0 = queue_1[0]; + const SWord8 s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SWord8 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord8 s5 = table0[s4]; + const SWord8 s7 = s5 + 1; + + return s7; +} diff --git a/example1/copilot-sbv-codegen/update_state_2.c b/example1/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..d2a21f1a --- /dev/null +++ b/example1/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,47 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s2 || (drop 1 s2 && ((drop 1 s1 mod 2) == 0))) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_2[ptr_2] || (queue_2[(ptr_2 + 1) % 2] && ((queue_1[(ptr_1 + 1) % 2] % 2) == 0))); +*/ +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2, + const SWord8 *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SWord32 s2 = ptr_2; + const SWord8 s3 = queue_1[0]; + const SWord8 s4 = queue_1[1]; + const SWord32 s5 = ptr_1; + const SBool table0[] = { + s0, s1 + }; + const SWord8 table1[] = { + s3, s4 + }; + const SWord32 s7 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s8 = table0[s7]; + const SWord32 s10 = s2 + 0x00000001UL; + const SWord32 s11 = (0x00000002UL == 0) ? s10 : (s10 % 0x00000002UL); + const SBool s12 = table0[s11]; + const SWord32 s13 = s5 + 0x00000001UL; + const SWord32 s14 = (0x00000002UL == 0) ? s13 : (s13 % 0x00000002UL); + const SWord8 s15 = table1[s14]; + const SWord8 s17 = (2 == 0) ? s15 : (s15 % 2); + const SBool s19 = s17 == 0; + const SBool s20 = s12 && s19; + const SBool s21 = s8 || s20; + + return s21; +} diff --git a/example1/main.hs b/example1/main.hs new file mode 100644 index 00000000..37abb975 --- /dev/null +++ b/example1/main.hs @@ -0,0 +1,46 @@ +import Copilot.Language.Reify +import Copilot.Language + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +nats :: Stream Word8 +nats = [0,1] ++ nats + 1 + +alt :: Stream Bool +alt = [True] ++ not alt + +logic :: Stream Bool +logic = [True, False] ++ logic || (drop 1 logic && ((drop 1 nats) `mod` 2 == 0)) + +sumExterns :: Stream Word64 +sumExterns = + let + e1 = extern "e1" (Just [0..]) + e2 = extern "e2" (Just $ L.cycle [2,3,4]) + e3 = externArrayW64 "e3" (nats+6) 256 (Just $ repeat [0..255]) + e4 = externFun "ff" [arg nats] Nothing + in + e1 + e2 + e3 + e4 + +spec :: Spec +spec = do + trigger "trig1" alt [ arg $ nats < 3 + , arg sumExterns + , arg logic + ] + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example10/--list-options/add-source-timestamps b/example10/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example10/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example10/--list-options/packages/00-index.cache b/example10/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example10/--list-options/packages/00-index.tar b/example10/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example10/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example10/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example10/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example10/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example10/.cabal-sandbox/add-source-timestamps b/example10/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example10/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example10/.cabal-sandbox/packages/00-index.cache b/example10/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example10/.cabal-sandbox/packages/00-index.tar b/example10/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example10/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example10/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example10/Makefile b/example10/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example10/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example10/cabal.sandbox.config b/example10/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example10/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example10/copilot-sbv-codegen/Makefile b/example10/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..0185d523 --- /dev/null +++ b/example10/copilot-sbv-codegen/Makefile @@ -0,0 +1,65 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o trigger_guard_trigger.o trigger_trigger_arg_0.o trigger_trigger_arg_1.o trigger_trigger_arg_2.o trigger_trigger_arg_3.o ext_func0_1_arg0.o ext_func0_1_arg1.o ext_func0_3_arg0.o ext_func0_3_arg1.o ext_func0_4_arg0.o ext_func0_4_arg1.o ext_func0_5_arg0.o ext_func0_5_arg1.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_trigger.o: trigger_guard_trigger.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_0.o: trigger_trigger_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_1.o: trigger_trigger_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_2.o: trigger_trigger_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_3.o: trigger_trigger_arg_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_1_arg0.o: ext_func0_1_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_1_arg1.o: ext_func0_1_arg1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_3_arg0.o: ext_func0_3_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_3_arg1.o: ext_func0_3_arg1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_4_arg0.o: ext_func0_4_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_4_arg1.o: ext_func0_4_arg1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_5_arg0.o: ext_func0_5_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_func0_5_arg1.o: ext_func0_5_arg1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example10/copilot-sbv-codegen/README b/example10/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example10/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example10/copilot-sbv-codegen/copilot.h b/example10/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..c82b7c88 --- /dev/null +++ b/example10/copilot-sbv-codegen/copilot.h @@ -0,0 +1,27 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void trigger(uint16_t, bool, uint16_t, uint16_t); + +/* External variables (must be defined by user): */ + +extern uint8_t x; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + +bool func1(); +uint16_t func0(uint8_t,uint16_t); + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example10/copilot-sbv-codegen/copilot.mk b/example10/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example10/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example10/copilot-sbv-codegen/driver.c b/example10/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..af478d33 --- /dev/null +++ b/example10/copilot-sbv-codegen/driver.c @@ -0,0 +1,125 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SWord16 tmp_0 = 0; +SBool tmp_1 = false; +SWord16 queue_0[2] = { 0, 1 }; +SBool queue_1[1] = { false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord8 ext_x = 0; +SBool ext_func1_0 = 0; +SWord16 ext_func0_1 = 0; +SBool ext_func1_2 = 0; +SWord16 ext_func0_3 = 0; +SWord16 ext_func0_4 = 0; +SWord16 ext_func0_5 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 2 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 1 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); +*/ + +/*@ + assigns ext_x; + //ensures ext_x == x; + assigns ext_func1_0; + assigns ext_func0_1; + assigns ext_func1_2; + assigns ext_func0_3; + assigns ext_func0_4; + assigns ext_func0_5; + //ensures ext_func1_0 == tmp_func1; + //ensures ext_func0_1 == tmp_func0; + //ensures ext_func1_2 == tmp_func1; + //ensures ext_func0_3 == tmp_func0; + //ensures ext_func0_4 == tmp_func0; + //ensures ext_func0_5 == tmp_func0; +*/ +void sampleExts(void) { + ext_x = x; + SBool tmp_func1 = func1(); + ext_func1_0 = tmp_func1; + SWord16 tmp_func0 = func0(ext_func0_1_arg0(ext_x), ext_func0_1_arg1(queue_0, ptr_0)); + ext_func0_1 = tmp_func0; + SBool tmp_func1 = func1(); + ext_func1_2 = tmp_func1; + SWord16 tmp_func0 = func0(ext_func0_3_arg0(), ext_func0_3_arg1()); + ext_func0_3 = tmp_func0; + SWord16 tmp_func0 = func0(ext_func0_4_arg0(ext_x), ext_func0_4_arg1(queue_0, ptr_0)); + ext_func0_4 = tmp_func0; + SWord16 tmp_func0 = func0(ext_func0_5_arg0(ext_x), ext_func0_5_arg1(queue_0, ptr_0)); + ext_func0_5 = tmp_func0; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_trigger()) + trigger(trigger_trigger_arg_0(ext_func0_1, ext_x, queue_0, ptr_0), + trigger_trigger_arg_1(ext_func1_2), + trigger_trigger_arg_2(ext_func0_3), + trigger_trigger_arg_3(ext_func0_4, ext_x, queue_0, ptr_0, ext_func0_5)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + assigns tmp_1; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(ext_func1_0); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 2; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 2; + ptr_1 = (ptr_1 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example10/copilot-sbv-codegen/ext_func0_1_arg0.c b/example10/copilot-sbv-codegen/ext_func0_1_arg0.c new file mode 100644 index 00000000..c93f98b5 --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_1_arg0.c @@ -0,0 +1,22 @@ +/* File: "ext_func0_1_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "x" +*/ +/*@ + assigns \nothing; + ensures \result == ext_x; +*/ +SWord8 ext_func0_1_arg0(const SWord8 ext_x) +{ + const SWord8 s0 = ext_x; + return s0; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_1_arg1.c b/example10/copilot-sbv-codegen/ext_func0_1_arg1.c new file mode 100644 index 00000000..0287441e --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_1_arg1.c @@ -0,0 +1,31 @@ +/* File: "ext_func0_1_arg1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 ext_func0_1_arg1(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord16 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord16 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord16 s5 = table0[s4]; + + return s5; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_3_arg0.c b/example10/copilot-sbv-codegen/ext_func0_3_arg0.c new file mode 100644 index 00000000..bf42a5fe --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_3_arg0.c @@ -0,0 +1,21 @@ +/* File: "ext_func0_3_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + 3 +*/ +/*@ + assigns \nothing; + ensures \result == 3; +*/ +SWord8 ext_func0_3_arg0() +{ + return 3; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_3_arg1.c b/example10/copilot-sbv-codegen/ext_func0_3_arg1.c new file mode 100644 index 00000000..86fb9918 --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_3_arg1.c @@ -0,0 +1,21 @@ +/* File: "ext_func0_3_arg1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + 4 +*/ +/*@ + assigns \nothing; + ensures \result == 4; +*/ +SWord16 ext_func0_3_arg1() +{ + return 0x0004U; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_4_arg0.c b/example10/copilot-sbv-codegen/ext_func0_4_arg0.c new file mode 100644 index 00000000..f994e4bf --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_4_arg0.c @@ -0,0 +1,22 @@ +/* File: "ext_func0_4_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "x" +*/ +/*@ + assigns \nothing; + ensures \result == ext_x; +*/ +SWord8 ext_func0_4_arg0(const SWord8 ext_x) +{ + const SWord8 s0 = ext_x; + return s0; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_4_arg1.c b/example10/copilot-sbv-codegen/ext_func0_4_arg1.c new file mode 100644 index 00000000..3cec8e6e --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_4_arg1.c @@ -0,0 +1,31 @@ +/* File: "ext_func0_4_arg1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 ext_func0_4_arg1(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord16 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord16 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord16 s5 = table0[s4]; + + return s5; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_5_arg0.c b/example10/copilot-sbv-codegen/ext_func0_5_arg0.c new file mode 100644 index 00000000..cb2d8f08 --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_5_arg0.c @@ -0,0 +1,22 @@ +/* File: "ext_func0_5_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "x" +*/ +/*@ + assigns \nothing; + ensures \result == ext_x; +*/ +SWord8 ext_func0_5_arg0(const SWord8 ext_x) +{ + const SWord8 s0 = ext_x; + return s0; +} diff --git a/example10/copilot-sbv-codegen/ext_func0_5_arg1.c b/example10/copilot-sbv-codegen/ext_func0_5_arg1.c new file mode 100644 index 00000000..e4ba10cf --- /dev/null +++ b/example10/copilot-sbv-codegen/ext_func0_5_arg1.c @@ -0,0 +1,31 @@ +/* File: "ext_func0_5_arg1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 ext_func0_5_arg1(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord16 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord16 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord16 s5 = table0[s4]; + + return s5; +} diff --git a/example10/copilot-sbv-codegen/internal.h b/example10/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..61ecf052 --- /dev/null +++ b/example10/copilot-sbv-codegen/internal.h @@ -0,0 +1,56 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord16 update_state_0(const SWord16 *queue_0, + const SWord32 ptr_0); +SBool update_state_1(const SBool ext_func1_0); +SBool trigger_guard_trigger(); +SWord16 trigger_trigger_arg_0(const SWord16 ext_func0_1, + const SWord8 ext_x, const SWord16 *queue_0, const SWord32 ptr_0); +SBool trigger_trigger_arg_1(const SBool ext_func1_2); +SWord16 trigger_trigger_arg_2(const SWord16 ext_func0_3); +SWord16 trigger_trigger_arg_3(const SWord16 ext_func0_4, + const SWord8 ext_x, const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 ext_func0_5); +SWord8 ext_func0_1_arg0(const SWord8 ext_x); +SWord16 ext_func0_1_arg1(const SWord16 *queue_0, + const SWord32 ptr_0); +SWord8 ext_func0_3_arg0(); +SWord16 ext_func0_3_arg1(); +SWord8 ext_func0_4_arg0(const SWord8 ext_x); +SWord16 ext_func0_4_arg1(const SWord16 *queue_0, + const SWord32 ptr_0); +SWord8 ext_func0_5_arg0(const SWord8 ext_x); +SWord16 ext_func0_5_arg1(const SWord16 *queue_0, + const SWord32 ptr_0); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example10/copilot-sbv-codegen/trigger_guard_trigger.c b/example10/copilot-sbv-codegen/trigger_guard_trigger.c new file mode 100644 index 00000000..219a0e0f --- /dev/null +++ b/example10/copilot-sbv-codegen/trigger_guard_trigger.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_trigger.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_trigger() +{ + return true; +} diff --git a/example10/copilot-sbv-codegen/trigger_trigger_arg_0.c b/example10/copilot-sbv-codegen/trigger_trigger_arg_0.c new file mode 100644 index 00000000..1aca8019 --- /dev/null +++ b/example10/copilot-sbv-codegen/trigger_trigger_arg_0.c @@ -0,0 +1,27 @@ +/* File: "trigger_trigger_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "func0(extern "x", s0)" +*/ +/*@ + assigns \nothing; + ensures \result == ext_func0_1; +*/ +SWord16 trigger_trigger_arg_0(const SWord16 ext_func0_1, + const SWord8 ext_x, const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SWord16 s0 = ext_func0_1; + const SWord8 s1 = ext_x; + const SWord16 s2 = queue_0[0]; + const SWord16 s3 = queue_0[1]; + const SWord32 s4 = ptr_0; + return s0; +} diff --git a/example10/copilot-sbv-codegen/trigger_trigger_arg_1.c b/example10/copilot-sbv-codegen/trigger_trigger_arg_1.c new file mode 100644 index 00000000..171f7d5e --- /dev/null +++ b/example10/copilot-sbv-codegen/trigger_trigger_arg_1.c @@ -0,0 +1,22 @@ +/* File: "trigger_trigger_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "func1()" +*/ +/*@ + assigns \nothing; + ensures \result == ext_func1_2; +*/ +SBool trigger_trigger_arg_1(const SBool ext_func1_2) +{ + const SBool s0 = ext_func1_2; + return s0; +} diff --git a/example10/copilot-sbv-codegen/trigger_trigger_arg_2.c b/example10/copilot-sbv-codegen/trigger_trigger_arg_2.c new file mode 100644 index 00000000..f98883c3 --- /dev/null +++ b/example10/copilot-sbv-codegen/trigger_trigger_arg_2.c @@ -0,0 +1,22 @@ +/* File: "trigger_trigger_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "func0(3, 4)" +*/ +/*@ + assigns \nothing; + ensures \result == ext_func0_3; +*/ +SWord16 trigger_trigger_arg_2(const SWord16 ext_func0_3) +{ + const SWord16 s0 = ext_func0_3; + return s0; +} diff --git a/example10/copilot-sbv-codegen/trigger_trigger_arg_3.c b/example10/copilot-sbv-codegen/trigger_trigger_arg_3.c new file mode 100644 index 00000000..9cceea13 --- /dev/null +++ b/example10/copilot-sbv-codegen/trigger_trigger_arg_3.c @@ -0,0 +1,31 @@ +/* File: "trigger_trigger_arg_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (extern "func0(extern "x", s0)" + extern "func0(extern "x", s0)") +*/ +/*@ + assigns \nothing; + ensures \result == (ext_func0_4 + ext_func0_5); +*/ +SWord16 trigger_trigger_arg_3(const SWord16 ext_func0_4, + const SWord8 ext_x, const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 ext_func0_5) +{ + const SWord16 s0 = ext_func0_4; + const SWord8 s1 = ext_x; + const SWord16 s2 = queue_0[0]; + const SWord16 s3 = queue_0[1]; + const SWord32 s4 = ptr_0; + const SWord16 s5 = ext_func0_5; + const SWord16 s6 = s5 + s5; + + return s6; +} diff --git a/example10/copilot-sbv-codegen/update_state_0.c b/example10/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..76ee29df --- /dev/null +++ b/example10/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,31 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] + 1); +*/ +SWord16 update_state_0(const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord16 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord16 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord16 s5 = table0[s4]; + const SWord16 s7 = s5 + 0x0001U; + + return s7; +} diff --git a/example10/copilot-sbv-codegen/update_state_1.c b/example10/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..b23628ab --- /dev/null +++ b/example10/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,24 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + not extern "func1()" +*/ +/*@ + assigns \nothing; + ensures \result == ! ext_func1_0; +*/ +SBool update_state_1(const SBool ext_func1_0) +{ + const SBool s0 = ext_func1_0; + const SBool s1 = !s0; + + return s1; +} diff --git a/example10/main.hs b/example10/main.hs new file mode 100644 index 00000000..c8d3ae1c --- /dev/null +++ b/example10/main.hs @@ -0,0 +1,55 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +doubles :: Stream Word16 +doubles = [0,1] ++ doubles + 1 + +--------------------------------------------------------------------------------- + +-- Function func0 and it's environment for interpreting +func0 :: Stream Word16 +func0 = externFun "func0" [ arg x, arg doubles ] + (Just $ cast x + doubles) + where x = externW8 "x" (Just [0..]) + +--------------------------------------------------------------------------------- + +-- Function func1 and it's environment for interpreting +func1 :: Stream Bool +func1 = externFun "func1" [] (Just $ [False] ++ not func1) + +--------------------------------------------------------------------------------- + +-- Function func0 with another set of args and it's environment for interpreting +func2 :: Stream Word16 +func2 = externFun "func0" [ arg $ constW8 3, arg $ constW16 4 ] + (Just $ cast (constW8 3) + constW16 4) + +--------------------------------------------------------------------------------- + +a :: Stream Word16 +a = func0 + func0 + +spec :: Spec +spec = trigger "trigger" true [ arg func0 + , arg func1 + , arg func2 + , arg a ] +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example11/--list-options/add-source-timestamps b/example11/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example11/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example11/--list-options/packages/00-index.cache b/example11/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example11/--list-options/packages/00-index.tar b/example11/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example11/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example11/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example11/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example11/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example11/.cabal-sandbox/add-source-timestamps b/example11/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example11/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example11/.cabal-sandbox/packages/00-index.cache b/example11/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example11/.cabal-sandbox/packages/00-index.tar b/example11/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example11/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example11/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example11/Makefile b/example11/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example11/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example11/cabal.sandbox.config b/example11/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example11/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example11/main.hs b/example11/main.hs new file mode 100644 index 00000000..63bd543e --- /dev/null +++ b/example11/main.hs @@ -0,0 +1,148 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +--------------------------------------------------------------------------------- +-- Regular expressions + +{- +We'll build a Copilot program to accept the regular language over the alphabet +{0,1} that contains an even number of 0s. +-} + +reAccept :: Spec +reAccept = do + observer "accept" accept + observer "string" string + where + accept :: Stream Bool + accept = [True] ++ mux (string == 0) (mux accept false true) accept + + -- Input tokens. + string :: Stream Word8 + string = [0] ++ (mux (string == 0) 1 0) + +-- interpret 10 reAccept + +--------------------------------------------------------------------------------- + +--------------------------------------------------------------------------------- +-- Context-free Grammars + +{- +This Copilot program recognizes <0^n 1^n>, for n >= 0. +-} + +cfAccept :: Int -> Spec +cfAccept n = do + observer "accept" accept + observer "string" string + where + accept :: Stream Bool + accept = mux (zerosSeen == 0) true false + + zerosSeen :: Stream Word64 + zerosSeen = [0] ++ (mux (string == 0) (zerosSeen + 1) (zerosSeen - 1)) + + -- Input tokens. + string :: Stream Word8 + string = L.replicate n 0 P.++ L.replicate n 1 ++ 0 -- don't care about part of + -- stream after ++ + +-- interpret 40 (cfAccept 10) +--------------------------------------------------------------------------------- + +--------------------------------------------------------------------------------- +-- Context-sensitive grammars + +{- +This Copilot program recognizes <0^n 1^n 2^n>, for n >= 0. +-} + +csAccept :: Int -> Spec +csAccept n = do + observer "accept" accept + observer "string" string + where + accept :: Stream Bool + accept = mux (zerosSeen == 0 && onesSeen == 0) true false + + zerosSeen :: Stream Word64 + zerosSeen = [0] ++ (mux (string == 0) (zerosSeen + 1) (mux (string == 1) (zerosSeen - 1) (zerosSeen))) + + onesSeen :: Stream Word64 + onesSeen = [0] ++ (mux (string == 1) (onesSeen + 1) (mux (string == 0) (onesSeen) (onesSeen - 1))) + + -- Input tokens. + string :: Stream Word8 + string = L.replicate n 0 P.++ L.replicate n 1 P.++ L.replicate n 2 + ++ 0 -- don't care about part of + -- stream after ++ + +-- interpret 40 (csAccept 5) +--------------------------------------------------------------------------------- + +--------------------------------------------------------------------------------- +-- Context-sensitive grammars + +{- +This Copilot program recognizes the "copy language" . + +Note: the "trick" is to encode the history of streams in a bitvector. Thus, we +can only recognize arbitrarily long words if we have arbitrarily long +bitvectors. There is nothing in Copilot preventing this, but the largest base +type is currently a Word64. + +Without this encoding, we couldn't build a recognizers, because we can't +generate new streams on the fly or look back arbitrarily far in the history of a +stream; both are fixed at compile time. + +-} + + +spec :: Spec +spec = do + observer "accept" accept + observer "hist" hist + observer "string" string + observer "cnt" cnt + where + + accept :: Stream Bool + accept = mux (cnt `mod` 2 == 1) false (bottom == top ) + where + halfCnt = cnt `div` 2 + zeroBot = (complement $ (2^halfCnt) - 1) .&. hist + top = zeroBot .>>. halfCnt + bottom = hist - zeroBot + + hist :: Stream Word64 + hist = [0] ++ ((2^cnt) * cast string) + hist + + cnt :: Stream Word64 + cnt = [0] ++ cnt + 1 + + -- Input tokens. + string :: Stream Word8 + string = let x = [1,0,0,1,0,1] in + x P.++ x + ++ 0 -- don't care about part of + -- stream after ++ + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example12/--list-options/add-source-timestamps b/example12/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example12/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example12/--list-options/packages/00-index.cache b/example12/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example12/--list-options/packages/00-index.tar b/example12/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example12/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example12/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example12/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example12/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example12/.cabal-sandbox/add-source-timestamps b/example12/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example12/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example12/.cabal-sandbox/packages/00-index.cache b/example12/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example12/.cabal-sandbox/packages/00-index.tar b/example12/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example12/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example12/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example12/Makefile b/example12/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example12/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example12/cabal.sandbox.config b/example12/cabal.sandbox.config new file mode 100644 index 00000000..7ca34fed --- /dev/null +++ b/example12/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.8.4-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example12/copilot-sbv-codegen/Makefile b/example12/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..f16fe39f --- /dev/null +++ b/example12/copilot-sbv-codegen/Makefile @@ -0,0 +1,29 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o trigger_guard_strm.o trigger_strm_arg_0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_strm.o: trigger_guard_strm.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_strm_arg_0.o: trigger_strm_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example12/copilot-sbv-codegen/README b/example12/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example12/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example12/copilot-sbv-codegen/copilot.h b/example12/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..9683476b --- /dev/null +++ b/example12/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void strm(int32_t); + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example12/copilot-sbv-codegen/copilot.mk b/example12/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example12/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example12/copilot-sbv-codegen/driver.c b/example12/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..bf23d9a9 --- /dev/null +++ b/example12/copilot-sbv-codegen/driver.c @@ -0,0 +1,75 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SInt32 tmp_1 = 0; +SInt32 queue_1[1] = { 0 }; +SWord32 ptr_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_strm()) + strm(trigger_strm_arg_0(queue_1, ptr_1)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_1; + */ +void updateStates(void) { + tmp_1 = update_state_1(queue_1, ptr_1); +} + +/*@ + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_1 = (ptr_1 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example12/copilot-sbv-codegen/internal.h b/example12/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..b1190200 --- /dev/null +++ b/example12/copilot-sbv-codegen/internal.h @@ -0,0 +1,38 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SInt32 update_state_1(const SInt32 *queue_1, const SWord32 ptr_1); +SBool trigger_guard_strm(); +SInt32 trigger_strm_arg_0(const SInt32 *queue_1, + const SWord32 ptr_1); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example12/copilot-sbv-codegen/trigger_guard_strm.c b/example12/copilot-sbv-codegen/trigger_guard_strm.c new file mode 100644 index 00000000..27d870a7 --- /dev/null +++ b/example12/copilot-sbv-codegen/trigger_guard_strm.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_strm.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_strm() +{ + return true; +} diff --git a/example12/copilot-sbv-codegen/trigger_strm_arg_0.c b/example12/copilot-sbv-codegen/trigger_strm_arg_0.c new file mode 100644 index 00000000..52871ede --- /dev/null +++ b/example12/copilot-sbv-codegen/trigger_strm_arg_0.c @@ -0,0 +1,28 @@ +/* File: "trigger_strm_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + local "local_0" = (s1 + 1) +in (var "local_0" + var "local_0") +*/ +/*@ + assigns \nothing; + ensures \result == (\let local_0 = (queue_1[ptr_1] + 1) ; (local_0 + local_0) ); +*/ +SInt32 trigger_strm_arg_0(const SInt32 *queue_1, + const SWord32 ptr_1) +{ + const SInt32 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SInt32 s3 = s0 + 0x00000001L; + const SInt32 s4 = s3 + s3; + + return s4; +} diff --git a/example12/copilot-sbv-codegen/update_state_1.c b/example12/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..330dd4db --- /dev/null +++ b/example12/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,25 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (1 + s1) +*/ +/*@ + assigns \nothing; + ensures \result == (1 + queue_1[ptr_1]); +*/ +SInt32 update_state_1(const SInt32 *queue_1, const SWord32 ptr_1) +{ + const SInt32 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SInt32 s3 = s0 + 0x00000001L; + + return s3; +} diff --git a/example12/main.hs b/example12/main.hs new file mode 100644 index 00000000..e5a813a3 --- /dev/null +++ b/example12/main.hs @@ -0,0 +1,43 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +nats :: Stream Int32 +nats = [0] ++ (1 + nats) + +strm :: Stream Int32 +strm = + local (nats + 1) $ \nats' -> nats' + nats' + +-- The above code corresponds to +-- +-- strm :: Stream Int32 +-- strm = +-- let x = nats * nats +-- in x + x + +spec :: Spec +spec = do + trigger "strm" true [arg strm] +-- trigger "strm" true [arg $ replStrm 100000] +-- trigger "strm" true [arg $ replStrm_ 100000 10000] + -- observer "nats" nats + -- observer "strm" strm + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example13/--list-options/add-source-timestamps b/example13/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example13/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example13/--list-options/packages/00-index.cache b/example13/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example13/--list-options/packages/00-index.tar b/example13/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example13/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example13/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example13/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example13/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example13/.cabal-sandbox/add-source-timestamps b/example13/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example13/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example13/.cabal-sandbox/packages/00-index.cache b/example13/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example13/.cabal-sandbox/packages/00-index.tar b/example13/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example13/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example13/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example13/Makefile b/example13/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example13/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example13/cabal.sandbox.config b/example13/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example13/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example13/copilot-sbv-codegen/Makefile b/example13/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..78b6a4b0 --- /dev/null +++ b/example13/copilot-sbv-codegen/Makefile @@ -0,0 +1,80 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o update_state_3.o update_state_4.o update_state_5.o update_state_6.o update_state_7.o trigger_guard_testRelease.o trigger_testRelease_arg_0.o trigger_guard_testUntil.o trigger_testUntil_arg_0.o trigger_guard_testFuture.o trigger_testFuture_arg_0.o trigger_guard_testNext.o trigger_testNext_arg_0.o trigger_guard_testAlways2.o trigger_testAlways2_arg_0.o trigger_guard_testAlways1.o trigger_testAlways1_arg_0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_7.o: update_state_7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testRelease.o: trigger_guard_testRelease.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testRelease_arg_0.o: trigger_testRelease_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testUntil.o: trigger_guard_testUntil.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testUntil_arg_0.o: trigger_testUntil_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testFuture.o: trigger_guard_testFuture.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testFuture_arg_0.o: trigger_testFuture_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testNext.o: trigger_guard_testNext.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testNext_arg_0.o: trigger_testNext_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testAlways2.o: trigger_guard_testAlways2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testAlways2_arg_0.o: trigger_testAlways2_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_testAlways1.o: trigger_guard_testAlways1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_testAlways1_arg_0.o: trigger_testAlways1_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example13/copilot-sbv-codegen/README b/example13/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example13/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example13/copilot-sbv-codegen/copilot.h b/example13/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..2320f822 --- /dev/null +++ b/example13/copilot-sbv-codegen/copilot.h @@ -0,0 +1,29 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void testRelease(bool); +void testUntil(bool); +void testFuture(bool); +void testNext(bool); +void testAlways2(bool); +void testAlways1(bool); + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example13/copilot-sbv-codegen/copilot.mk b/example13/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example13/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example13/copilot-sbv-codegen/driver.c b/example13/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..5480540f --- /dev/null +++ b/example13/copilot-sbv-codegen/driver.c @@ -0,0 +1,183 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SBool tmp_0 = true; +SBool tmp_1 = false; +SBool tmp_2 = true; +SBool tmp_3 = false; +SBool tmp_4 = false; +SBool tmp_5 = false; +SBool tmp_6 = true; +SBool tmp_7 = false; +SBool queue_0[5] = { true, true, true, true, true }; +SBool queue_1[5] = { false, false, false, false, true }; +SBool queue_2[5] = { true, true, true, true, true }; +SBool queue_3[6] = { false, false, false, false, false, true }; +SBool queue_4[13] = { false, false, false, false, false, false, false, false, false, false, false, false, true }; +SBool queue_5[3] = { false, false, true }; +SBool queue_6[6] = { true, true, true, true, true, false }; +SBool queue_7[1] = { false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord32 ptr_7 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 5 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 4 )); + global invariant a_bound_ptr_1: ptr_1 < 5 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 4 )); + global invariant a_bound_ptr_2: ptr_2 < 5 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 4 )); + global invariant a_bound_ptr_3: ptr_3 < 6 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 5 )); + global invariant a_bound_ptr_4: ptr_4 < 13 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 12 )); + global invariant a_bound_ptr_5: ptr_5 < 3 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 2 )); + global invariant a_bound_ptr_6: ptr_6 < 6 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 5 )); + global invariant a_bound_ptr_7: ptr_7 < 1 ; + global invariant a_pos_ptr_7: ptr_7 >= 0 ; + global invariant a_valid_ptr_7: \valid (queue_7 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_testAlways1()) + testAlways1(trigger_testAlways1_arg_0(queue_7, ptr_7)); + if (trigger_guard_testAlways2()) + testAlways2(trigger_testAlways2_arg_0(queue_6, ptr_6)); + if (trigger_guard_testFuture()) + testFuture(trigger_testFuture_arg_0(queue_4, ptr_4)); + if (trigger_guard_testNext()) + testNext(trigger_testNext_arg_0(queue_5, ptr_5)); + if (trigger_guard_testRelease()) + testRelease(trigger_testRelease_arg_0(queue_0, ptr_0, queue_1, ptr_1)); + if (trigger_guard_testUntil()) + testUntil(trigger_testUntil_arg_0(queue_2, ptr_2, queue_3, ptr_3)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + assigns tmp_3; + assigns tmp_4; + assigns tmp_5; + assigns tmp_6; + assigns tmp_7; + */ +void updateStates(void) { + tmp_0 = update_state_0(); + tmp_1 = update_state_1(); + tmp_2 = update_state_2(); + tmp_3 = update_state_3(); + tmp_4 = update_state_4(); + tmp_5 = update_state_5(queue_5, ptr_5); + tmp_6 = update_state_6(); + tmp_7 = update_state_7(); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + assigns queue_7[ptr_7]; + ensures queue_7[ptr_7] == tmp_7; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; + queue_7[ptr_7] = tmp_7; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 5; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 5; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 5; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 6; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 13; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 3; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 6; + assigns ptr_7; + ensures ptr_7 == (\old (ptr_7 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 5; + ptr_1 = (ptr_1 + 1) % 5; + ptr_2 = (ptr_2 + 1) % 5; + ptr_3 = (ptr_3 + 1) % 6; + ptr_4 = (ptr_4 + 1) % 13; + ptr_5 = (ptr_5 + 1) % 3; + ptr_6 = (ptr_6 + 1) % 6; + ptr_7 = (ptr_7 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example13/copilot-sbv-codegen/internal.h b/example13/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..c4bf023d --- /dev/null +++ b/example13/copilot-sbv-codegen/internal.h @@ -0,0 +1,60 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(); +SBool update_state_1(); +SBool update_state_2(); +SBool update_state_3(); +SBool update_state_4(); +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5); +SBool update_state_6(); +SBool update_state_7(); +SBool trigger_guard_testRelease(); +SBool trigger_testRelease_arg_0(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1); +SBool trigger_guard_testUntil(); +SBool trigger_testUntil_arg_0(const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_3, const SWord32 ptr_3); +SBool trigger_guard_testFuture(); +SBool trigger_testFuture_arg_0(const SBool *queue_4, + const SWord32 ptr_4); +SBool trigger_guard_testNext(); +SBool trigger_testNext_arg_0(const SBool *queue_5, + const SWord32 ptr_5); +SBool trigger_guard_testAlways2(); +SBool trigger_testAlways2_arg_0(const SBool *queue_6, + const SWord32 ptr_6); +SBool trigger_guard_testAlways1(); +SBool trigger_testAlways1_arg_0(const SBool *queue_7, + const SWord32 ptr_7); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example13/copilot-sbv-codegen/trigger_guard_testAlways1.c b/example13/copilot-sbv-codegen/trigger_guard_testAlways1.c new file mode 100644 index 00000000..304b080f --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testAlways1.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testAlways1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testAlways1() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_guard_testAlways2.c b/example13/copilot-sbv-codegen/trigger_guard_testAlways2.c new file mode 100644 index 00000000..79dd7735 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testAlways2.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testAlways2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testAlways2() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_guard_testFuture.c b/example13/copilot-sbv-codegen/trigger_guard_testFuture.c new file mode 100644 index 00000000..89dcd227 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testFuture.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testFuture.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testFuture() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_guard_testNext.c b/example13/copilot-sbv-codegen/trigger_guard_testNext.c new file mode 100644 index 00000000..9a36cb47 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testNext.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testNext.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testNext() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_guard_testRelease.c b/example13/copilot-sbv-codegen/trigger_guard_testRelease.c new file mode 100644 index 00000000..f7f31691 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testRelease.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testRelease.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testRelease() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_guard_testUntil.c b/example13/copilot-sbv-codegen/trigger_guard_testUntil.c new file mode 100644 index 00000000..6430a5a2 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_guard_testUntil.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_testUntil.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_testUntil() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/trigger_testAlways1_arg_0.c b/example13/copilot-sbv-codegen/trigger_testAlways1_arg_0.c new file mode 100644 index 00000000..bbb51067 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testAlways1_arg_0.c @@ -0,0 +1,24 @@ +/* File: "trigger_testAlways1_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s7 +*/ +/*@ + assigns \nothing; + ensures \result == queue_7[ptr_7]; +*/ +SBool trigger_testAlways1_arg_0(const SBool *queue_7, + const SWord32 ptr_7) +{ + const SBool s0 = queue_7[0]; + const SWord32 s1 = ptr_7; + return s0; +} diff --git a/example13/copilot-sbv-codegen/trigger_testAlways2_arg_0.c b/example13/copilot-sbv-codegen/trigger_testAlways2_arg_0.c new file mode 100644 index 00000000..a6ded6cb --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testAlways2_arg_0.c @@ -0,0 +1,39 @@ +/* File: "trigger_testAlways2_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (s6 && drop 1 s6) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_6[ptr_6] && queue_6[(ptr_6 + 1) % 6]); +*/ +SBool trigger_testAlways2_arg_0(const SBool *queue_6, + const SWord32 ptr_6) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SWord32 s6 = ptr_6; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + const SWord32 s11 = s6 + 0x00000001UL; + const SWord32 s12 = (0x00000006UL == 0) ? s11 : (s11 % 0x00000006UL); + const SBool s13 = table0[s12]; + const SBool s14 = s9 && s13; + + return s14; +} diff --git a/example13/copilot-sbv-codegen/trigger_testFuture_arg_0.c b/example13/copilot-sbv-codegen/trigger_testFuture_arg_0.c new file mode 100644 index 00000000..98f99712 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testFuture_arg_0.c @@ -0,0 +1,82 @@ +/* File: "trigger_testFuture_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + ((((((((((s4 || drop 1 s4) || drop 2 s4) || drop 3 s4) || drop 4 s4) || drop 5 s4) || drop 6 s4) || drop 7 s4) || drop 8 s4) || drop 9 s4) || drop 10 s4) +*/ +/*@ + assigns \nothing; + ensures \result == ((((((((((queue_4[ptr_4] || queue_4[(ptr_4 + 1) % 13]) || queue_4[(ptr_4 + 2) % 13]) || queue_4[(ptr_4 + 3) % 13]) || queue_4[(ptr_4 + 4) % 13]) || queue_4[(ptr_4 + 5) % 13]) || queue_4[(ptr_4 + 6) % 13]) || queue_4[(ptr_4 + 7) % 13]) || queue_4[(ptr_4 + 8) % 13]) || queue_4[(ptr_4 + 9) % 13]) || queue_4[(ptr_4 + 10) % 13]); +*/ +SBool trigger_testFuture_arg_0(const SBool *queue_4, + const SWord32 ptr_4) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SBool s6 = queue_4[6]; + const SBool s7 = queue_4[7]; + const SBool s8 = queue_4[8]; + const SBool s9 = queue_4[9]; + const SBool s10 = queue_4[10]; + const SBool s11 = queue_4[11]; + const SBool s12 = queue_4[12]; + const SWord32 s13 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12 + }; + const SWord32 s15 = (0x0000000dUL == 0) ? s13 : (s13 % 0x0000000dUL); + const SBool s16 = table0[s15]; + const SWord32 s18 = s13 + 0x00000001UL; + const SWord32 s19 = (0x0000000dUL == 0) ? s18 : (s18 % 0x0000000dUL); + const SBool s20 = table0[s19]; + const SBool s21 = s16 || s20; + const SWord32 s23 = s13 + 0x00000002UL; + const SWord32 s24 = (0x0000000dUL == 0) ? s23 : (s23 % 0x0000000dUL); + const SBool s25 = table0[s24]; + const SBool s26 = s21 || s25; + const SWord32 s28 = s13 + 0x00000003UL; + const SWord32 s29 = (0x0000000dUL == 0) ? s28 : (s28 % 0x0000000dUL); + const SBool s30 = table0[s29]; + const SBool s31 = s26 || s30; + const SWord32 s33 = s13 + 0x00000004UL; + const SWord32 s34 = (0x0000000dUL == 0) ? s33 : (s33 % 0x0000000dUL); + const SBool s35 = table0[s34]; + const SBool s36 = s31 || s35; + const SWord32 s38 = s13 + 0x00000005UL; + const SWord32 s39 = (0x0000000dUL == 0) ? s38 : (s38 % 0x0000000dUL); + const SBool s40 = table0[s39]; + const SBool s41 = s36 || s40; + const SWord32 s43 = s13 + 0x00000006UL; + const SWord32 s44 = (0x0000000dUL == 0) ? s43 : (s43 % 0x0000000dUL); + const SBool s45 = table0[s44]; + const SBool s46 = s41 || s45; + const SWord32 s48 = s13 + 0x00000007UL; + const SWord32 s49 = (0x0000000dUL == 0) ? s48 : (s48 % 0x0000000dUL); + const SBool s50 = table0[s49]; + const SBool s51 = s46 || s50; + const SWord32 s53 = s13 + 0x00000008UL; + const SWord32 s54 = (0x0000000dUL == 0) ? s53 : (s53 % 0x0000000dUL); + const SBool s55 = table0[s54]; + const SBool s56 = s51 || s55; + const SWord32 s58 = s13 + 0x00000009UL; + const SWord32 s59 = (0x0000000dUL == 0) ? s58 : (s58 % 0x0000000dUL); + const SBool s60 = table0[s59]; + const SBool s61 = s56 || s60; + const SWord32 s63 = s13 + 0x0000000aUL; + const SWord32 s64 = (0x0000000dUL == 0) ? s63 : (s63 % 0x0000000dUL); + const SBool s65 = table0[s64]; + const SBool s66 = s61 || s65; + + return s66; +} diff --git a/example13/copilot-sbv-codegen/trigger_testNext_arg_0.c b/example13/copilot-sbv-codegen/trigger_testNext_arg_0.c new file mode 100644 index 00000000..f3a227e2 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testNext_arg_0.c @@ -0,0 +1,33 @@ +/* File: "trigger_testNext_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + drop 1 s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[(ptr_5 + 1) % 3]; +*/ +SBool trigger_testNext_arg_0(const SBool *queue_5, + const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SWord32 s3 = ptr_5; + const SBool table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = s3 + 0x00000001UL; + const SWord32 s7 = (0x00000003UL == 0) ? s5 : (s5 % 0x00000003UL); + const SBool s8 = table0[s7]; + + return s8; +} diff --git a/example13/copilot-sbv-codegen/trigger_testRelease_arg_0.c b/example13/copilot-sbv-codegen/trigger_testRelease_arg_0.c new file mode 100644 index 00000000..a8254187 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testRelease_arg_0.c @@ -0,0 +1,78 @@ +/* File: "trigger_testRelease_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (((((s0 && drop 1 s0) && drop 2 s0) && drop 3 s0) && drop 4 s0) || ((((s0 && s1) || ((s0 && drop 1 s0) && drop 1 s1)) || (((s0 && drop 1 s0) && drop 2 s0) && drop 2 s1)) || ((((s0 && drop 1 s0) && drop 2 s0) && drop 3 s0) && drop 3 s1))) +*/ +/*@ + assigns \nothing; + ensures \result == (((((queue_0[ptr_0] && queue_0[(ptr_0 + 1) % 5]) && queue_0[(ptr_0 + 2) % 5]) && queue_0[(ptr_0 + 3) % 5]) && queue_0[(ptr_0 + 4) % 5]) || ((((queue_0[ptr_0] && queue_1[ptr_1]) || ((queue_0[ptr_0] && queue_0[(ptr_0 + 1) % 5]) && queue_1[(ptr_1 + 1) % 5])) || (((queue_0[ptr_0] && queue_0[(ptr_0 + 1) % 5]) && queue_0[(ptr_0 + 2) % 5]) && queue_1[(ptr_1 + 2) % 5])) || ((((queue_0[ptr_0] && queue_0[(ptr_0 + 1) % 5]) && queue_0[(ptr_0 + 2) % 5]) && queue_0[(ptr_0 + 3) % 5]) && queue_1[(ptr_1 + 3) % 5]))); +*/ +SBool trigger_testRelease_arg_0(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SWord32 s5 = ptr_0; + const SBool s6 = queue_1[0]; + const SBool s7 = queue_1[1]; + const SBool s8 = queue_1[2]; + const SBool s9 = queue_1[3]; + const SBool s10 = queue_1[4]; + const SWord32 s11 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4 + }; + const SBool table1[] = { + s6, s7, s8, s9, s10 + }; + const SWord32 s13 = (0x00000005UL == 0) ? s5 : (s5 % 0x00000005UL); + const SBool s14 = table0[s13]; + const SWord32 s16 = s5 + 0x00000001UL; + const SWord32 s17 = (0x00000005UL == 0) ? s16 : (s16 % 0x00000005UL); + const SBool s18 = table0[s17]; + const SBool s19 = s14 && s18; + const SWord32 s21 = s5 + 0x00000002UL; + const SWord32 s22 = (0x00000005UL == 0) ? s21 : (s21 % 0x00000005UL); + const SBool s23 = table0[s22]; + const SBool s24 = s19 && s23; + const SWord32 s26 = s5 + 0x00000003UL; + const SWord32 s27 = (0x00000005UL == 0) ? s26 : (s26 % 0x00000005UL); + const SBool s28 = table0[s27]; + const SBool s29 = s24 && s28; + const SWord32 s31 = s5 + 0x00000004UL; + const SWord32 s32 = (0x00000005UL == 0) ? s31 : (s31 % 0x00000005UL); + const SBool s33 = table0[s32]; + const SBool s34 = s29 && s33; + const SWord32 s35 = (0x00000005UL == 0) ? s11 : (s11 % 0x00000005UL); + const SBool s36 = table1[s35]; + const SBool s37 = s14 && s36; + const SWord32 s38 = s11 + 0x00000001UL; + const SWord32 s39 = (0x00000005UL == 0) ? s38 : (s38 % 0x00000005UL); + const SBool s40 = table1[s39]; + const SBool s41 = s19 && s40; + const SBool s42 = s37 || s41; + const SWord32 s43 = s11 + 0x00000002UL; + const SWord32 s44 = (0x00000005UL == 0) ? s43 : (s43 % 0x00000005UL); + const SBool s45 = table1[s44]; + const SBool s46 = s24 && s45; + const SBool s47 = s42 || s46; + const SWord32 s48 = s11 + 0x00000003UL; + const SWord32 s49 = (0x00000005UL == 0) ? s48 : (s48 % 0x00000005UL); + const SBool s50 = table1[s49]; + const SBool s51 = s29 && s50; + const SBool s52 = s47 || s51; + const SBool s53 = s34 || s52; + + return s53; +} diff --git a/example13/copilot-sbv-codegen/trigger_testUntil_arg_0.c b/example13/copilot-sbv-codegen/trigger_testUntil_arg_0.c new file mode 100644 index 00000000..25a88184 --- /dev/null +++ b/example13/copilot-sbv-codegen/trigger_testUntil_arg_0.c @@ -0,0 +1,75 @@ +/* File: "trigger_testUntil_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + ((((s2 && drop 1 s3) || ((s2 && drop 1 s2) && drop 2 s3)) || (((s2 && drop 1 s2) && drop 2 s2) && drop 3 s3)) || ((((s2 && drop 1 s2) && drop 2 s2) && drop 3 s2) && drop 4 s3)) +*/ +/*@ + assigns \nothing; + ensures \result == ((((queue_2[ptr_2] && queue_3[(ptr_3 + 1) % 6]) || ((queue_2[ptr_2] && queue_2[(ptr_2 + 1) % 5]) && queue_3[(ptr_3 + 2) % 6])) || (((queue_2[ptr_2] && queue_2[(ptr_2 + 1) % 5]) && queue_2[(ptr_2 + 2) % 5]) && queue_3[(ptr_3 + 3) % 6])) || ((((queue_2[ptr_2] && queue_2[(ptr_2 + 1) % 5]) && queue_2[(ptr_2 + 2) % 5]) && queue_2[(ptr_2 + 3) % 5]) && queue_3[(ptr_3 + 4) % 6])); +*/ +SBool trigger_testUntil_arg_0(const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_3, const SWord32 ptr_3) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SBool s3 = queue_2[3]; + const SBool s4 = queue_2[4]; + const SWord32 s5 = ptr_2; + const SBool s6 = queue_3[0]; + const SBool s7 = queue_3[1]; + const SBool s8 = queue_3[2]; + const SBool s9 = queue_3[3]; + const SBool s10 = queue_3[4]; + const SBool s11 = queue_3[5]; + const SWord32 s12 = ptr_3; + const SBool table0[] = { + s0, s1, s2, s3, s4 + }; + const SBool table1[] = { + s6, s7, s8, s9, s10, s11 + }; + const SWord32 s14 = (0x00000005UL == 0) ? s5 : (s5 % 0x00000005UL); + const SBool s15 = table0[s14]; + const SWord32 s17 = s12 + 0x00000001UL; + const SWord32 s19 = (0x00000006UL == 0) ? s17 : (s17 % 0x00000006UL); + const SBool s20 = table1[s19]; + const SBool s21 = s15 && s20; + const SWord32 s22 = s5 + 0x00000001UL; + const SWord32 s23 = (0x00000005UL == 0) ? s22 : (s22 % 0x00000005UL); + const SBool s24 = table0[s23]; + const SBool s25 = s15 && s24; + const SWord32 s27 = s12 + 0x00000002UL; + const SWord32 s28 = (0x00000006UL == 0) ? s27 : (s27 % 0x00000006UL); + const SBool s29 = table1[s28]; + const SBool s30 = s25 && s29; + const SBool s31 = s21 || s30; + const SWord32 s32 = s5 + 0x00000002UL; + const SWord32 s33 = (0x00000005UL == 0) ? s32 : (s32 % 0x00000005UL); + const SBool s34 = table0[s33]; + const SBool s35 = s25 && s34; + const SWord32 s37 = s12 + 0x00000003UL; + const SWord32 s38 = (0x00000006UL == 0) ? s37 : (s37 % 0x00000006UL); + const SBool s39 = table1[s38]; + const SBool s40 = s35 && s39; + const SBool s41 = s31 || s40; + const SWord32 s42 = s5 + 0x00000003UL; + const SWord32 s43 = (0x00000005UL == 0) ? s42 : (s42 % 0x00000005UL); + const SBool s44 = table0[s43]; + const SBool s45 = s35 && s44; + const SWord32 s47 = s12 + 0x00000004UL; + const SWord32 s48 = (0x00000006UL == 0) ? s47 : (s47 % 0x00000006UL); + const SBool s49 = table1[s48]; + const SBool s50 = s45 && s49; + const SBool s51 = s41 || s50; + + return s51; +} diff --git a/example13/copilot-sbv-codegen/update_state_0.c b/example13/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..bba97645 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,21 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_0() +{ + return false; +} diff --git a/example13/copilot-sbv-codegen/update_state_1.c b/example13/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..6fac0803 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,21 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_1() +{ + return false; +} diff --git a/example13/copilot-sbv-codegen/update_state_2.c b/example13/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..21d05ddc --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,21 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_2() +{ + return false; +} diff --git a/example13/copilot-sbv-codegen/update_state_3.c b/example13/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..8b3d3f89 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,21 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_3() +{ + return false; +} diff --git a/example13/copilot-sbv-codegen/update_state_4.c b/example13/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..c04ab343 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,21 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_4() +{ + return false; +} diff --git a/example13/copilot-sbv-codegen/update_state_5.c b/example13/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..49281b62 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,31 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SWord32 s3 = ptr_5; + const SBool table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SBool s6 = table0[s5]; + + return s6; +} diff --git a/example13/copilot-sbv-codegen/update_state_6.c b/example13/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..b0411454 --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,21 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool update_state_6() +{ + return true; +} diff --git a/example13/copilot-sbv-codegen/update_state_7.c b/example13/copilot-sbv-codegen/update_state_7.c new file mode 100644 index 00000000..c8c108cb --- /dev/null +++ b/example13/copilot-sbv-codegen/update_state_7.c @@ -0,0 +1,21 @@ +/* File: "update_state_7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool update_state_7() +{ + return true; +} diff --git a/example13/main.hs b/example13/main.hs new file mode 100644 index 00000000..b06032d3 --- /dev/null +++ b/example13/main.hs @@ -0,0 +1,55 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import Copilot.Library.LTL +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +testAlways :: Int -> Int -> Stream Bool +testAlways i1 i2 = let input = replicate i1 P.True P.++ [ False ] ++ true + in always i2 input + +testNext :: Stream Bool +testNext = let input = [ False, False, True ] ++ input + in next input + +testFuture :: Int -> Int -> Stream Bool +testFuture i1 i2 = let input = replicate i1 False P.++ [ True ] ++ false + in eventually i2 input + +testUntil :: Int -> Int -> Int -> Stream Bool +testUntil i1 i2 i3 = + let t0 = replicate i1 True ++ false + t1 = replicate ( i2 - 1 ) False P.++ [ True ] ++ false + in until i3 t0 t1 + +testRelease :: Int -> Int -> Int -> Stream Bool +testRelease i1 i2 i3 = + let t0 = replicate i1 True ++ false + t1 = replicate ( i2 - 1 ) False P.++ [ True ] ++ false + in release i3 t1 t0 + +spec :: Spec +spec = do + trigger "testAlways1" true [ arg $ testAlways 0 0 ] + trigger "testAlways2" true [ arg $ testAlways 5 1 ] + trigger "testNext" true [ arg $ testNext ] + trigger "testFuture" true [ arg $ testFuture 12 10 ] + trigger "testUntil" true [ arg $ testUntil 5 6 4 ] + trigger "testRelease" true [ arg $ testRelease 5 5 4 ] + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example14/--list-options/add-source-timestamps b/example14/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example14/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example14/--list-options/packages/00-index.cache b/example14/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example14/--list-options/packages/00-index.tar b/example14/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example14/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example14/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example14/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example14/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example14/.cabal-sandbox/add-source-timestamps b/example14/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example14/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example14/.cabal-sandbox/packages/00-index.cache b/example14/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example14/.cabal-sandbox/packages/00-index.tar b/example14/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example14/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example14/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example14/Makefile b/example14/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example14/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example14/cabal.sandbox.config b/example14/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example14/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example14/copilot-sbv-codegen/Makefile b/example14/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..1cabc660 --- /dev/null +++ b/example14/copilot-sbv-codegen/Makefile @@ -0,0 +1,38 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o update_state_0.o update_state_2.o update_state_3.o update_state_4.o observer_sinceTest.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_sinceTest.o: observer_sinceTest.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example14/copilot-sbv-codegen/README b/example14/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example14/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example14/copilot-sbv-codegen/copilot.h b/example14/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..c9b8386e --- /dev/null +++ b/example14/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool sinceTest; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example14/copilot-sbv-codegen/copilot.mk b/example14/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example14/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example14/copilot-sbv-codegen/driver.c b/example14/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..ba04dbd7 --- /dev/null +++ b/example14/copilot-sbv-codegen/driver.c @@ -0,0 +1,130 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool sinceTest; + +/* Variables */ +SBool tmp_0 = false; +SBool tmp_1 = false; +SBool tmp_2 = false; +SBool tmp_3 = false; +SBool tmp_4 = true; +SBool queue_0[1] = { false }; +SBool queue_1[7] = { false, false, true, false, false, false, false }; +SBool queue_2[1] = { false }; +SBool queue_3[3] = { false, false, false }; +SBool queue_4[1] = { true }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 7 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 6 )); + global invariant a_bound_ptr_2: ptr_2 < 1 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 0 )); + global invariant a_bound_ptr_3: ptr_3 < 3 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 2 )); + global invariant a_bound_ptr_4: ptr_4 < 1 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns sinceTest; + */ +void updateObservers(void) { + sinceTest = observer_sinceTest(queue_0, ptr_0, queue_2, ptr_2, queue_3, ptr_3, queue_4, ptr_4); +} + +/*@ + assigns tmp_1; + assigns tmp_0; + assigns tmp_2; + assigns tmp_3; + assigns tmp_4; + */ +void updateStates(void) { + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_0 = update_state_0(queue_1, ptr_1); + tmp_2 = update_state_2(queue_0, ptr_0, queue_2, ptr_2); + tmp_3 = update_state_3(); + tmp_4 = update_state_4(queue_0, ptr_0, queue_2, ptr_2, queue_3, ptr_3, queue_4, ptr_4); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 7; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 1; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 3; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 7; + ptr_2 = (ptr_2 + 1) % 1; + ptr_3 = (ptr_3 + 1) % 3; + ptr_4 = (ptr_4 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example14/copilot-sbv-codegen/internal.h b/example14/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..e6d4d991 --- /dev/null +++ b/example14/copilot-sbv-codegen/internal.h @@ -0,0 +1,45 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2); +SBool update_state_3(); +SBool update_state_4(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2, const SBool *queue_3, + const SWord32 ptr_3, const SBool *queue_4, const SWord32 ptr_4); +SBool observer_sinceTest(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2, const SBool *queue_3, + const SWord32 ptr_3, const SBool *queue_4, const SWord32 ptr_4); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example14/copilot-sbv-codegen/observer_sinceTest.c b/example14/copilot-sbv-codegen/observer_sinceTest.c new file mode 100644 index 00000000..543e3172 --- /dev/null +++ b/example14/copilot-sbv-codegen/observer_sinceTest.c @@ -0,0 +1,43 @@ +/* File: "observer_sinceTest.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + ((not (s0 || s2) || s3) && s4) +*/ +/*@ + assigns \nothing; + ensures \result == ((! (queue_0[ptr_0] || queue_2[ptr_2]) || queue_3[ptr_3]) && queue_4[ptr_4]); +*/ +SBool observer_sinceTest(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2, const SBool *queue_3, + const SWord32 ptr_3, const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_2[0]; + const SWord32 s3 = ptr_2; + const SBool s4 = queue_3[0]; + const SBool s5 = queue_3[1]; + const SBool s6 = queue_3[2]; + const SWord32 s7 = ptr_3; + const SBool s8 = queue_4[0]; + const SWord32 s9 = ptr_4; + const SBool table0[] = { + s4, s5, s6 + }; + const SBool s10 = s0 || s2; + const SBool s11 = !s10; + const SWord32 s13 = (0x00000003UL == 0) ? s7 : (s7 % 0x00000003UL); + const SBool s14 = table0[s13]; + const SBool s15 = s11 || s14; + const SBool s16 = s15 && s8; + + return s16; +} diff --git a/example14/copilot-sbv-codegen/update_state_0.c b/example14/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..65400f20 --- /dev/null +++ b/example14/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,35 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SWord32 s7 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6 + }; + const SWord32 s9 = (0x00000007UL == 0) ? s7 : (s7 % 0x00000007UL); + const SBool s10 = table0[s9]; + + return s10; +} diff --git a/example14/copilot-sbv-codegen/update_state_1.c b/example14/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..e1b76e7f --- /dev/null +++ b/example14/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,35 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SWord32 s7 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6 + }; + const SWord32 s9 = (0x00000007UL == 0) ? s7 : (s7 % 0x00000007UL); + const SBool s10 = table0[s9]; + + return s10; +} diff --git a/example14/copilot-sbv-codegen/update_state_2.c b/example14/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..e64b2e4f --- /dev/null +++ b/example14/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,28 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 || s2) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] || queue_2[ptr_2]); +*/ +SBool update_state_2(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_2[0]; + const SWord32 s3 = ptr_2; + const SBool s4 = s0 || s2; + + return s4; +} diff --git a/example14/copilot-sbv-codegen/update_state_3.c b/example14/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..537248db --- /dev/null +++ b/example14/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,21 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool update_state_3() +{ + return true; +} diff --git a/example14/copilot-sbv-codegen/update_state_4.c b/example14/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..647362ae --- /dev/null +++ b/example14/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,43 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((not (s0 || s2) || s3) && s4) +*/ +/*@ + assigns \nothing; + ensures \result == ((! (queue_0[ptr_0] || queue_2[ptr_2]) || queue_3[ptr_3]) && queue_4[ptr_4]); +*/ +SBool update_state_4(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_2, const SWord32 ptr_2, const SBool *queue_3, + const SWord32 ptr_3, const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_2[0]; + const SWord32 s3 = ptr_2; + const SBool s4 = queue_3[0]; + const SBool s5 = queue_3[1]; + const SBool s6 = queue_3[2]; + const SWord32 s7 = ptr_3; + const SBool s8 = queue_4[0]; + const SWord32 s9 = ptr_4; + const SBool table0[] = { + s4, s5, s6 + }; + const SBool s10 = s0 || s2; + const SBool s11 = !s10; + const SWord32 s13 = (0x00000003UL == 0) ? s7 : (s7 % 0x00000003UL); + const SBool s14 = table0[s13]; + const SBool s15 = s11 || s14; + const SBool s16 = s15 && s8; + + return s16; +} diff --git a/example14/main.hs b/example14/main.hs new file mode 100644 index 00000000..0c563446 --- /dev/null +++ b/example14/main.hs @@ -0,0 +1,76 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.LTL +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + + +-- | test of previous +previousTestData :: Stream Bool +previousTestData = [ True, False ] ++ previousTestData + +previousTest :: Spec +previousTest = do + observer "previousTest" ( previous previousTestData ) + + +-- | test of alwaysBeen +alwaysBeenTestData :: Stream Bool +alwaysBeenTestData = [ True, True, True, True, True, True, True, False ] + ++ alwaysBeenTestData + +alwaysBeenTest :: Spec +alwaysBeenTest = do + observer "testAlwaysBeen" ( alwaysBeen alwaysBeenTestData ) + + +-- | test of eventuallyPrevious +eventuallyPrevTestData :: Stream Bool +eventuallyPrevTestData = [ False, False, False, False, False, True, False ] + ++ eventuallyPrevTestData + +eventuallyPrevTest :: Spec +eventuallyPrevTest = observer "eventuallyPrevTest" + ( eventuallyPrev eventuallyPrevTestData ) + + +-- | test of since +sinceTestData1 :: Stream Bool +sinceTestData1 = [ False, False, False ] ++ true + +sinceTestData2 :: Stream Bool +sinceTestData2 = [ False, False, True, False, False, False, False ] + ++ sinceTestData2 + +sinceTest :: Spec +sinceTest = observer "sinceTest" + ( sinceTestData1 `since` sinceTestData2 ) + + +-- | test since with external variables +sinceExtTest :: Spec +sinceExtTest = observer "sinceExtTest" + ( extern "e1" (Just e1) `since` extern "e2" (Just e2)) + +-- | external variables +e1, e2 :: [Bool] +e1 = replicate 10 False L.++ repeat True +e2 = replicate 9 False L.++ [ True ] L.++ repeat False + +main = do + reify sinceTest >>= C.compile C.defaultParams + reify sinceTest >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example15/--list-options/add-source-timestamps b/example15/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example15/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example15/--list-options/packages/00-index.cache b/example15/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example15/--list-options/packages/00-index.tar b/example15/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example15/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example15/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example15/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example15/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example15/.cabal-sandbox/add-source-timestamps b/example15/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example15/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example15/.cabal-sandbox/packages/00-index.cache b/example15/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example15/.cabal-sandbox/packages/00-index.tar b/example15/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example15/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example15/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example15/Makefile b/example15/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example15/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example15/cabal.sandbox.config b/example15/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example15/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example15/copilot-sbv-codegen/Makefile b/example15/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..46bbec9d --- /dev/null +++ b/example15/copilot-sbv-codegen/Makefile @@ -0,0 +1,164 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o update_state_0.o update_state_2.o update_state_9.o update_state_8.o update_state_7.o update_state_6.o update_state_5.o update_state_4.o update_state_3.o update_state_10.o update_state_11.o update_state_12.o update_state_13.o update_state_14.o update_state_15.o update_state_16.o update_state_17.o update_state_18.o update_state_19.o update_state_20.o update_state_26.o update_state_25.o update_state_24.o update_state_23.o update_state_22.o update_state_21.o update_state_27.o update_state_28.o update_state_29.o update_state_30.o update_state_31.o update_state_32.o update_state_33.o update_state_35.o update_state_37.o update_state_38.o update_state_36.o update_state_34.o update_state_39.o update_state_40.o update_state_41.o update_state_42.o update_state_43.o update_state_44.o observer_reset.o observer_test2.o observer_test1.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_9.o: update_state_9.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_8.o: update_state_8.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_7.o: update_state_7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_10.o: update_state_10.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_11.o: update_state_11.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_12.o: update_state_12.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_13.o: update_state_13.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_14.o: update_state_14.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_15.o: update_state_15.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_16.o: update_state_16.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_17.o: update_state_17.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_18.o: update_state_18.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_19.o: update_state_19.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_20.o: update_state_20.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_26.o: update_state_26.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_25.o: update_state_25.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_24.o: update_state_24.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_23.o: update_state_23.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_22.o: update_state_22.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_21.o: update_state_21.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_27.o: update_state_27.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_28.o: update_state_28.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_29.o: update_state_29.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_30.o: update_state_30.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_31.o: update_state_31.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_32.o: update_state_32.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_33.o: update_state_33.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_35.o: update_state_35.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_37.o: update_state_37.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_38.o: update_state_38.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_36.o: update_state_36.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_34.o: update_state_34.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_39.o: update_state_39.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_40.o: update_state_40.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_41.o: update_state_41.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_42.o: update_state_42.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_43.o: update_state_43.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_44.o: update_state_44.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_reset.o: observer_reset.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_test2.o: observer_test2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_test1.o: observer_test1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example15/copilot-sbv-codegen/README b/example15/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example15/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example15/copilot-sbv-codegen/copilot.h b/example15/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..bf445aef --- /dev/null +++ b/example15/copilot-sbv-codegen/copilot.h @@ -0,0 +1,27 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool reset; +extern bool test2; +extern bool test1; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + +extern int8_t e; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example15/copilot-sbv-codegen/copilot.mk b/example15/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example15/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example15/copilot-sbv-codegen/driver.c b/example15/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..e8753939 --- /dev/null +++ b/example15/copilot-sbv-codegen/driver.c @@ -0,0 +1,699 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool reset; +SBool test2; +SBool test1; + +/* Variables */ +SBool tmp_0 = false; +SBool tmp_1 = false; +SBool tmp_2 = true; +SBool tmp_3 = false; +SBool tmp_4 = true; +SBool tmp_5 = false; +SBool tmp_6 = false; +SBool tmp_7 = false; +SBool tmp_8 = false; +SBool tmp_9 = false; +SBool tmp_10 = false; +SBool tmp_11 = false; +SBool tmp_12 = false; +SBool tmp_13 = false; +SBool tmp_14 = false; +SBool tmp_15 = false; +SBool tmp_16 = false; +SBool tmp_17 = false; +SBool tmp_18 = false; +SBool tmp_19 = false; +SBool tmp_20 = false; +SBool tmp_21 = false; +SBool tmp_22 = false; +SBool tmp_23 = false; +SBool tmp_24 = false; +SBool tmp_25 = false; +SBool tmp_26 = false; +SBool tmp_27 = false; +SBool tmp_28 = false; +SBool tmp_29 = false; +SBool tmp_30 = false; +SBool tmp_31 = false; +SBool tmp_32 = false; +SBool tmp_33 = false; +SBool tmp_34 = false; +SBool tmp_35 = false; +SBool tmp_36 = false; +SBool tmp_37 = false; +SBool tmp_38 = false; +SBool tmp_39 = false; +SBool tmp_40 = false; +SBool tmp_41 = false; +SBool tmp_42 = false; +SBool tmp_43 = false; +SBool tmp_44 = false; +SBool queue_0[1] = { false }; +SBool queue_1[4] = { false, false, false, true }; +SBool queue_2[1] = { true }; +SBool queue_3[1] = { false }; +SBool queue_4[6] = { true, false, false, false, false, false }; +SBool queue_5[6] = { false, true, false, false, false, false }; +SBool queue_6[6] = { false, false, true, false, false, false }; +SBool queue_7[6] = { false, false, false, true, false, false }; +SBool queue_8[6] = { false, false, false, false, true, false }; +SBool queue_9[6] = { false, false, false, false, false, true }; +SBool queue_10[1] = { false }; +SBool queue_11[1] = { false }; +SBool queue_12[1] = { false }; +SBool queue_13[1] = { false }; +SBool queue_14[1] = { false }; +SBool queue_15[1] = { false }; +SBool queue_16[1] = { false }; +SBool queue_17[1] = { false }; +SBool queue_18[1] = { false }; +SBool queue_19[1] = { false }; +SBool queue_20[1] = { false }; +SBool queue_21[1] = { false }; +SBool queue_22[1] = { false }; +SBool queue_23[1] = { false }; +SBool queue_24[1] = { false }; +SBool queue_25[1] = { false }; +SBool queue_26[1] = { false }; +SBool queue_27[1] = { false }; +SBool queue_28[1] = { false }; +SBool queue_29[1] = { false }; +SBool queue_30[1] = { false }; +SBool queue_31[1] = { false }; +SBool queue_32[1] = { false }; +SBool queue_33[1] = { false }; +SBool queue_34[1] = { false }; +SBool queue_35[1] = { false }; +SBool queue_36[1] = { false }; +SBool queue_37[1] = { false }; +SBool queue_38[1] = { false }; +SBool queue_39[1] = { false }; +SBool queue_40[1] = { false }; +SBool queue_41[1] = { false }; +SBool queue_42[1] = { false }; +SBool queue_43[1] = { false }; +SBool queue_44[1] = { false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord32 ptr_7 = 0; +SWord32 ptr_8 = 0; +SWord32 ptr_9 = 0; +SWord32 ptr_10 = 0; +SWord32 ptr_11 = 0; +SWord32 ptr_12 = 0; +SWord32 ptr_13 = 0; +SWord32 ptr_14 = 0; +SWord32 ptr_15 = 0; +SWord32 ptr_16 = 0; +SWord32 ptr_17 = 0; +SWord32 ptr_18 = 0; +SWord32 ptr_19 = 0; +SWord32 ptr_20 = 0; +SWord32 ptr_21 = 0; +SWord32 ptr_22 = 0; +SWord32 ptr_23 = 0; +SWord32 ptr_24 = 0; +SWord32 ptr_25 = 0; +SWord32 ptr_26 = 0; +SWord32 ptr_27 = 0; +SWord32 ptr_28 = 0; +SWord32 ptr_29 = 0; +SWord32 ptr_30 = 0; +SWord32 ptr_31 = 0; +SWord32 ptr_32 = 0; +SWord32 ptr_33 = 0; +SWord32 ptr_34 = 0; +SWord32 ptr_35 = 0; +SWord32 ptr_36 = 0; +SWord32 ptr_37 = 0; +SWord32 ptr_38 = 0; +SWord32 ptr_39 = 0; +SWord32 ptr_40 = 0; +SWord32 ptr_41 = 0; +SWord32 ptr_42 = 0; +SWord32 ptr_43 = 0; +SWord32 ptr_44 = 0; +SInt8 ext_e = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 4 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 3 )); + global invariant a_bound_ptr_2: ptr_2 < 1 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 0 )); + global invariant a_bound_ptr_3: ptr_3 < 1 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 0 )); + global invariant a_bound_ptr_4: ptr_4 < 6 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 5 )); + global invariant a_bound_ptr_5: ptr_5 < 6 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 5 )); + global invariant a_bound_ptr_6: ptr_6 < 6 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 5 )); + global invariant a_bound_ptr_7: ptr_7 < 6 ; + global invariant a_pos_ptr_7: ptr_7 >= 0 ; + global invariant a_valid_ptr_7: \valid (queue_7 + (0.. 5 )); + global invariant a_bound_ptr_8: ptr_8 < 6 ; + global invariant a_pos_ptr_8: ptr_8 >= 0 ; + global invariant a_valid_ptr_8: \valid (queue_8 + (0.. 5 )); + global invariant a_bound_ptr_9: ptr_9 < 6 ; + global invariant a_pos_ptr_9: ptr_9 >= 0 ; + global invariant a_valid_ptr_9: \valid (queue_9 + (0.. 5 )); + global invariant a_bound_ptr_10: ptr_10 < 1 ; + global invariant a_pos_ptr_10: ptr_10 >= 0 ; + global invariant a_valid_ptr_10: \valid (queue_10 + (0.. 0 )); + global invariant a_bound_ptr_11: ptr_11 < 1 ; + global invariant a_pos_ptr_11: ptr_11 >= 0 ; + global invariant a_valid_ptr_11: \valid (queue_11 + (0.. 0 )); + global invariant a_bound_ptr_12: ptr_12 < 1 ; + global invariant a_pos_ptr_12: ptr_12 >= 0 ; + global invariant a_valid_ptr_12: \valid (queue_12 + (0.. 0 )); + global invariant a_bound_ptr_13: ptr_13 < 1 ; + global invariant a_pos_ptr_13: ptr_13 >= 0 ; + global invariant a_valid_ptr_13: \valid (queue_13 + (0.. 0 )); + global invariant a_bound_ptr_14: ptr_14 < 1 ; + global invariant a_pos_ptr_14: ptr_14 >= 0 ; + global invariant a_valid_ptr_14: \valid (queue_14 + (0.. 0 )); + global invariant a_bound_ptr_15: ptr_15 < 1 ; + global invariant a_pos_ptr_15: ptr_15 >= 0 ; + global invariant a_valid_ptr_15: \valid (queue_15 + (0.. 0 )); + global invariant a_bound_ptr_16: ptr_16 < 1 ; + global invariant a_pos_ptr_16: ptr_16 >= 0 ; + global invariant a_valid_ptr_16: \valid (queue_16 + (0.. 0 )); + global invariant a_bound_ptr_17: ptr_17 < 1 ; + global invariant a_pos_ptr_17: ptr_17 >= 0 ; + global invariant a_valid_ptr_17: \valid (queue_17 + (0.. 0 )); + global invariant a_bound_ptr_18: ptr_18 < 1 ; + global invariant a_pos_ptr_18: ptr_18 >= 0 ; + global invariant a_valid_ptr_18: \valid (queue_18 + (0.. 0 )); + global invariant a_bound_ptr_19: ptr_19 < 1 ; + global invariant a_pos_ptr_19: ptr_19 >= 0 ; + global invariant a_valid_ptr_19: \valid (queue_19 + (0.. 0 )); + global invariant a_bound_ptr_20: ptr_20 < 1 ; + global invariant a_pos_ptr_20: ptr_20 >= 0 ; + global invariant a_valid_ptr_20: \valid (queue_20 + (0.. 0 )); + global invariant a_bound_ptr_21: ptr_21 < 1 ; + global invariant a_pos_ptr_21: ptr_21 >= 0 ; + global invariant a_valid_ptr_21: \valid (queue_21 + (0.. 0 )); + global invariant a_bound_ptr_22: ptr_22 < 1 ; + global invariant a_pos_ptr_22: ptr_22 >= 0 ; + global invariant a_valid_ptr_22: \valid (queue_22 + (0.. 0 )); + global invariant a_bound_ptr_23: ptr_23 < 1 ; + global invariant a_pos_ptr_23: ptr_23 >= 0 ; + global invariant a_valid_ptr_23: \valid (queue_23 + (0.. 0 )); + global invariant a_bound_ptr_24: ptr_24 < 1 ; + global invariant a_pos_ptr_24: ptr_24 >= 0 ; + global invariant a_valid_ptr_24: \valid (queue_24 + (0.. 0 )); + global invariant a_bound_ptr_25: ptr_25 < 1 ; + global invariant a_pos_ptr_25: ptr_25 >= 0 ; + global invariant a_valid_ptr_25: \valid (queue_25 + (0.. 0 )); + global invariant a_bound_ptr_26: ptr_26 < 1 ; + global invariant a_pos_ptr_26: ptr_26 >= 0 ; + global invariant a_valid_ptr_26: \valid (queue_26 + (0.. 0 )); + global invariant a_bound_ptr_27: ptr_27 < 1 ; + global invariant a_pos_ptr_27: ptr_27 >= 0 ; + global invariant a_valid_ptr_27: \valid (queue_27 + (0.. 0 )); + global invariant a_bound_ptr_28: ptr_28 < 1 ; + global invariant a_pos_ptr_28: ptr_28 >= 0 ; + global invariant a_valid_ptr_28: \valid (queue_28 + (0.. 0 )); + global invariant a_bound_ptr_29: ptr_29 < 1 ; + global invariant a_pos_ptr_29: ptr_29 >= 0 ; + global invariant a_valid_ptr_29: \valid (queue_29 + (0.. 0 )); + global invariant a_bound_ptr_30: ptr_30 < 1 ; + global invariant a_pos_ptr_30: ptr_30 >= 0 ; + global invariant a_valid_ptr_30: \valid (queue_30 + (0.. 0 )); + global invariant a_bound_ptr_31: ptr_31 < 1 ; + global invariant a_pos_ptr_31: ptr_31 >= 0 ; + global invariant a_valid_ptr_31: \valid (queue_31 + (0.. 0 )); + global invariant a_bound_ptr_32: ptr_32 < 1 ; + global invariant a_pos_ptr_32: ptr_32 >= 0 ; + global invariant a_valid_ptr_32: \valid (queue_32 + (0.. 0 )); + global invariant a_bound_ptr_33: ptr_33 < 1 ; + global invariant a_pos_ptr_33: ptr_33 >= 0 ; + global invariant a_valid_ptr_33: \valid (queue_33 + (0.. 0 )); + global invariant a_bound_ptr_34: ptr_34 < 1 ; + global invariant a_pos_ptr_34: ptr_34 >= 0 ; + global invariant a_valid_ptr_34: \valid (queue_34 + (0.. 0 )); + global invariant a_bound_ptr_35: ptr_35 < 1 ; + global invariant a_pos_ptr_35: ptr_35 >= 0 ; + global invariant a_valid_ptr_35: \valid (queue_35 + (0.. 0 )); + global invariant a_bound_ptr_36: ptr_36 < 1 ; + global invariant a_pos_ptr_36: ptr_36 >= 0 ; + global invariant a_valid_ptr_36: \valid (queue_36 + (0.. 0 )); + global invariant a_bound_ptr_37: ptr_37 < 1 ; + global invariant a_pos_ptr_37: ptr_37 >= 0 ; + global invariant a_valid_ptr_37: \valid (queue_37 + (0.. 0 )); + global invariant a_bound_ptr_38: ptr_38 < 1 ; + global invariant a_pos_ptr_38: ptr_38 >= 0 ; + global invariant a_valid_ptr_38: \valid (queue_38 + (0.. 0 )); + global invariant a_bound_ptr_39: ptr_39 < 1 ; + global invariant a_pos_ptr_39: ptr_39 >= 0 ; + global invariant a_valid_ptr_39: \valid (queue_39 + (0.. 0 )); + global invariant a_bound_ptr_40: ptr_40 < 1 ; + global invariant a_pos_ptr_40: ptr_40 >= 0 ; + global invariant a_valid_ptr_40: \valid (queue_40 + (0.. 0 )); + global invariant a_bound_ptr_41: ptr_41 < 1 ; + global invariant a_pos_ptr_41: ptr_41 >= 0 ; + global invariant a_valid_ptr_41: \valid (queue_41 + (0.. 0 )); + global invariant a_bound_ptr_42: ptr_42 < 1 ; + global invariant a_pos_ptr_42: ptr_42 >= 0 ; + global invariant a_valid_ptr_42: \valid (queue_42 + (0.. 0 )); + global invariant a_bound_ptr_43: ptr_43 < 1 ; + global invariant a_pos_ptr_43: ptr_43 >= 0 ; + global invariant a_valid_ptr_43: \valid (queue_43 + (0.. 0 )); + global invariant a_bound_ptr_44: ptr_44 < 1 ; + global invariant a_pos_ptr_44: ptr_44 >= 0 ; + global invariant a_valid_ptr_44: \valid (queue_44 + (0.. 0 )); +*/ + +/*@ + assigns ext_e; + //ensures ext_e == e; +*/ +void sampleExts(void) { + ext_e = e; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns reset; + assigns test1; + assigns test2; + */ +void updateObservers(void) { + reset = observer_reset(queue_0, ptr_0); + test1 = observer_test1(queue_2, ptr_2, queue_0, ptr_0, queue_27, ptr_27, queue_28, ptr_28, queue_29, ptr_29, queue_30, ptr_30, queue_31, ptr_31, queue_32, ptr_32, queue_33, ptr_33, queue_34, ptr_34, queue_37, ptr_37, queue_38, ptr_38, queue_35, ptr_35, queue_36, ptr_36, queue_39, ptr_39, queue_40, ptr_40, queue_41, ptr_41, queue_42, ptr_42, queue_43, ptr_43, queue_44, ptr_44); + test2 = observer_test2(queue_2, ptr_2, queue_3, ptr_3, queue_10, ptr_10, queue_11, ptr_11, queue_12, ptr_12, queue_13, ptr_13, queue_14, ptr_14, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26); +} + +/*@ + assigns tmp_1; + assigns tmp_0; + assigns tmp_2; + assigns tmp_9; + assigns tmp_8; + assigns tmp_7; + assigns tmp_6; + assigns tmp_5; + assigns tmp_4; + assigns tmp_3; + assigns tmp_10; + assigns tmp_11; + assigns tmp_12; + assigns tmp_13; + assigns tmp_14; + assigns tmp_15; + assigns tmp_16; + assigns tmp_17; + assigns tmp_18; + assigns tmp_19; + assigns tmp_20; + assigns tmp_26; + assigns tmp_25; + assigns tmp_24; + assigns tmp_23; + assigns tmp_22; + assigns tmp_21; + assigns tmp_27; + assigns tmp_28; + assigns tmp_29; + assigns tmp_30; + assigns tmp_31; + assigns tmp_32; + assigns tmp_33; + assigns tmp_35; + assigns tmp_37; + assigns tmp_38; + assigns tmp_36; + assigns tmp_34; + assigns tmp_39; + assigns tmp_40; + assigns tmp_41; + assigns tmp_42; + assigns tmp_43; + assigns tmp_44; + */ +void updateStates(void) { + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_0 = update_state_0(queue_1, ptr_1); + tmp_2 = update_state_2(); + tmp_9 = update_state_9(queue_4, ptr_4); + tmp_8 = update_state_8(queue_9, ptr_9); + tmp_7 = update_state_7(queue_8, ptr_8); + tmp_6 = update_state_6(queue_7, ptr_7); + tmp_5 = update_state_5(queue_6, ptr_6); + tmp_4 = update_state_4(queue_5, ptr_5); + tmp_3 = update_state_3(queue_4, ptr_4, queue_2, ptr_2); + tmp_10 = update_state_10(queue_5, ptr_5, queue_3, ptr_3); + tmp_11 = update_state_11(queue_6, ptr_6, queue_10, ptr_10); + tmp_12 = update_state_12(queue_7, ptr_7, queue_11, ptr_11); + tmp_13 = update_state_13(queue_8, ptr_8, queue_12, ptr_12); + tmp_14 = update_state_14(queue_9, ptr_9, queue_13, ptr_13); + tmp_15 = update_state_15(queue_4, ptr_4, queue_14, ptr_14); + tmp_16 = update_state_16(queue_5, ptr_5, queue_14, ptr_14); + tmp_17 = update_state_17(queue_6, ptr_6, queue_14, ptr_14); + tmp_18 = update_state_18(queue_7, ptr_7, queue_14, ptr_14); + tmp_19 = update_state_19(queue_8, ptr_8, queue_14, ptr_14); + tmp_20 = update_state_20(queue_9, ptr_9, queue_14, ptr_14); + tmp_26 = update_state_26(queue_9, ptr_9, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_25 = update_state_25(queue_8, ptr_8, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_24 = update_state_24(queue_7, ptr_7, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_23 = update_state_23(queue_6, ptr_6, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_22 = update_state_22(queue_5, ptr_5, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_21 = update_state_21(queue_4, ptr_4, queue_21, ptr_21, queue_22, ptr_22, queue_23, ptr_23, queue_24, ptr_24, queue_25, ptr_25, queue_26, ptr_26, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_20, ptr_20); + tmp_27 = update_state_27(ext_e); + tmp_28 = update_state_28(ext_e, queue_2, ptr_2); + tmp_29 = update_state_29(ext_e); + tmp_30 = update_state_30(ext_e, queue_2, ptr_2, queue_0, ptr_0, queue_27, ptr_27, queue_28, ptr_28); + tmp_31 = update_state_31(ext_e); + tmp_32 = update_state_32(ext_e, queue_2, ptr_2, queue_0, ptr_0, queue_29, ptr_29, queue_30, ptr_30, queue_27, ptr_27, queue_28, ptr_28); + tmp_33 = update_state_33(); + tmp_35 = update_state_35(); + tmp_37 = update_state_37(); + tmp_38 = update_state_38(ext_e, queue_0, ptr_0, queue_33, ptr_33, queue_34, ptr_34, queue_35, ptr_35, queue_36, ptr_36, queue_31, ptr_31, queue_32, ptr_32); + tmp_36 = update_state_36(ext_e, queue_0, ptr_0, queue_37, ptr_37, queue_38, ptr_38, queue_33, ptr_33, queue_34, ptr_34, queue_35, ptr_35, queue_36, ptr_36, queue_31, ptr_31, queue_32, ptr_32); + tmp_34 = update_state_34(ext_e, queue_0, ptr_0, queue_35, ptr_35, queue_36, ptr_36, queue_31, ptr_31, queue_32, ptr_32); + tmp_39 = update_state_39(ext_e); + tmp_40 = update_state_40(ext_e, queue_2, ptr_2); + tmp_41 = update_state_41(ext_e); + tmp_42 = update_state_42(ext_e, queue_2, ptr_2, queue_0, ptr_0, queue_39, ptr_39, queue_40, ptr_40); + tmp_43 = update_state_43(); + tmp_44 = update_state_44(ext_e, queue_0, ptr_0, queue_43, ptr_43, queue_44, ptr_44, queue_41, ptr_41, queue_42, ptr_42); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + assigns queue_7[ptr_7]; + ensures queue_7[ptr_7] == tmp_7; + assigns queue_8[ptr_8]; + ensures queue_8[ptr_8] == tmp_8; + assigns queue_9[ptr_9]; + ensures queue_9[ptr_9] == tmp_9; + assigns queue_10[ptr_10]; + ensures queue_10[ptr_10] == tmp_10; + assigns queue_11[ptr_11]; + ensures queue_11[ptr_11] == tmp_11; + assigns queue_12[ptr_12]; + ensures queue_12[ptr_12] == tmp_12; + assigns queue_13[ptr_13]; + ensures queue_13[ptr_13] == tmp_13; + assigns queue_14[ptr_14]; + ensures queue_14[ptr_14] == tmp_14; + assigns queue_15[ptr_15]; + ensures queue_15[ptr_15] == tmp_15; + assigns queue_16[ptr_16]; + ensures queue_16[ptr_16] == tmp_16; + assigns queue_17[ptr_17]; + ensures queue_17[ptr_17] == tmp_17; + assigns queue_18[ptr_18]; + ensures queue_18[ptr_18] == tmp_18; + assigns queue_19[ptr_19]; + ensures queue_19[ptr_19] == tmp_19; + assigns queue_20[ptr_20]; + ensures queue_20[ptr_20] == tmp_20; + assigns queue_21[ptr_21]; + ensures queue_21[ptr_21] == tmp_21; + assigns queue_22[ptr_22]; + ensures queue_22[ptr_22] == tmp_22; + assigns queue_23[ptr_23]; + ensures queue_23[ptr_23] == tmp_23; + assigns queue_24[ptr_24]; + ensures queue_24[ptr_24] == tmp_24; + assigns queue_25[ptr_25]; + ensures queue_25[ptr_25] == tmp_25; + assigns queue_26[ptr_26]; + ensures queue_26[ptr_26] == tmp_26; + assigns queue_27[ptr_27]; + ensures queue_27[ptr_27] == tmp_27; + assigns queue_28[ptr_28]; + ensures queue_28[ptr_28] == tmp_28; + assigns queue_29[ptr_29]; + ensures queue_29[ptr_29] == tmp_29; + assigns queue_30[ptr_30]; + ensures queue_30[ptr_30] == tmp_30; + assigns queue_31[ptr_31]; + ensures queue_31[ptr_31] == tmp_31; + assigns queue_32[ptr_32]; + ensures queue_32[ptr_32] == tmp_32; + assigns queue_33[ptr_33]; + ensures queue_33[ptr_33] == tmp_33; + assigns queue_34[ptr_34]; + ensures queue_34[ptr_34] == tmp_34; + assigns queue_35[ptr_35]; + ensures queue_35[ptr_35] == tmp_35; + assigns queue_36[ptr_36]; + ensures queue_36[ptr_36] == tmp_36; + assigns queue_37[ptr_37]; + ensures queue_37[ptr_37] == tmp_37; + assigns queue_38[ptr_38]; + ensures queue_38[ptr_38] == tmp_38; + assigns queue_39[ptr_39]; + ensures queue_39[ptr_39] == tmp_39; + assigns queue_40[ptr_40]; + ensures queue_40[ptr_40] == tmp_40; + assigns queue_41[ptr_41]; + ensures queue_41[ptr_41] == tmp_41; + assigns queue_42[ptr_42]; + ensures queue_42[ptr_42] == tmp_42; + assigns queue_43[ptr_43]; + ensures queue_43[ptr_43] == tmp_43; + assigns queue_44[ptr_44]; + ensures queue_44[ptr_44] == tmp_44; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; + queue_7[ptr_7] = tmp_7; + queue_8[ptr_8] = tmp_8; + queue_9[ptr_9] = tmp_9; + queue_10[ptr_10] = tmp_10; + queue_11[ptr_11] = tmp_11; + queue_12[ptr_12] = tmp_12; + queue_13[ptr_13] = tmp_13; + queue_14[ptr_14] = tmp_14; + queue_15[ptr_15] = tmp_15; + queue_16[ptr_16] = tmp_16; + queue_17[ptr_17] = tmp_17; + queue_18[ptr_18] = tmp_18; + queue_19[ptr_19] = tmp_19; + queue_20[ptr_20] = tmp_20; + queue_21[ptr_21] = tmp_21; + queue_22[ptr_22] = tmp_22; + queue_23[ptr_23] = tmp_23; + queue_24[ptr_24] = tmp_24; + queue_25[ptr_25] = tmp_25; + queue_26[ptr_26] = tmp_26; + queue_27[ptr_27] = tmp_27; + queue_28[ptr_28] = tmp_28; + queue_29[ptr_29] = tmp_29; + queue_30[ptr_30] = tmp_30; + queue_31[ptr_31] = tmp_31; + queue_32[ptr_32] = tmp_32; + queue_33[ptr_33] = tmp_33; + queue_34[ptr_34] = tmp_34; + queue_35[ptr_35] = tmp_35; + queue_36[ptr_36] = tmp_36; + queue_37[ptr_37] = tmp_37; + queue_38[ptr_38] = tmp_38; + queue_39[ptr_39] = tmp_39; + queue_40[ptr_40] = tmp_40; + queue_41[ptr_41] = tmp_41; + queue_42[ptr_42] = tmp_42; + queue_43[ptr_43] = tmp_43; + queue_44[ptr_44] = tmp_44; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 4; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 1; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 1; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 6; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 6; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 6; + assigns ptr_7; + ensures ptr_7 == (\old (ptr_7 ) + 1) % 6; + assigns ptr_8; + ensures ptr_8 == (\old (ptr_8 ) + 1) % 6; + assigns ptr_9; + ensures ptr_9 == (\old (ptr_9 ) + 1) % 6; + assigns ptr_10; + ensures ptr_10 == (\old (ptr_10 ) + 1) % 1; + assigns ptr_11; + ensures ptr_11 == (\old (ptr_11 ) + 1) % 1; + assigns ptr_12; + ensures ptr_12 == (\old (ptr_12 ) + 1) % 1; + assigns ptr_13; + ensures ptr_13 == (\old (ptr_13 ) + 1) % 1; + assigns ptr_14; + ensures ptr_14 == (\old (ptr_14 ) + 1) % 1; + assigns ptr_15; + ensures ptr_15 == (\old (ptr_15 ) + 1) % 1; + assigns ptr_16; + ensures ptr_16 == (\old (ptr_16 ) + 1) % 1; + assigns ptr_17; + ensures ptr_17 == (\old (ptr_17 ) + 1) % 1; + assigns ptr_18; + ensures ptr_18 == (\old (ptr_18 ) + 1) % 1; + assigns ptr_19; + ensures ptr_19 == (\old (ptr_19 ) + 1) % 1; + assigns ptr_20; + ensures ptr_20 == (\old (ptr_20 ) + 1) % 1; + assigns ptr_21; + ensures ptr_21 == (\old (ptr_21 ) + 1) % 1; + assigns ptr_22; + ensures ptr_22 == (\old (ptr_22 ) + 1) % 1; + assigns ptr_23; + ensures ptr_23 == (\old (ptr_23 ) + 1) % 1; + assigns ptr_24; + ensures ptr_24 == (\old (ptr_24 ) + 1) % 1; + assigns ptr_25; + ensures ptr_25 == (\old (ptr_25 ) + 1) % 1; + assigns ptr_26; + ensures ptr_26 == (\old (ptr_26 ) + 1) % 1; + assigns ptr_27; + ensures ptr_27 == (\old (ptr_27 ) + 1) % 1; + assigns ptr_28; + ensures ptr_28 == (\old (ptr_28 ) + 1) % 1; + assigns ptr_29; + ensures ptr_29 == (\old (ptr_29 ) + 1) % 1; + assigns ptr_30; + ensures ptr_30 == (\old (ptr_30 ) + 1) % 1; + assigns ptr_31; + ensures ptr_31 == (\old (ptr_31 ) + 1) % 1; + assigns ptr_32; + ensures ptr_32 == (\old (ptr_32 ) + 1) % 1; + assigns ptr_33; + ensures ptr_33 == (\old (ptr_33 ) + 1) % 1; + assigns ptr_34; + ensures ptr_34 == (\old (ptr_34 ) + 1) % 1; + assigns ptr_35; + ensures ptr_35 == (\old (ptr_35 ) + 1) % 1; + assigns ptr_36; + ensures ptr_36 == (\old (ptr_36 ) + 1) % 1; + assigns ptr_37; + ensures ptr_37 == (\old (ptr_37 ) + 1) % 1; + assigns ptr_38; + ensures ptr_38 == (\old (ptr_38 ) + 1) % 1; + assigns ptr_39; + ensures ptr_39 == (\old (ptr_39 ) + 1) % 1; + assigns ptr_40; + ensures ptr_40 == (\old (ptr_40 ) + 1) % 1; + assigns ptr_41; + ensures ptr_41 == (\old (ptr_41 ) + 1) % 1; + assigns ptr_42; + ensures ptr_42 == (\old (ptr_42 ) + 1) % 1; + assigns ptr_43; + ensures ptr_43 == (\old (ptr_43 ) + 1) % 1; + assigns ptr_44; + ensures ptr_44 == (\old (ptr_44 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 4; + ptr_2 = (ptr_2 + 1) % 1; + ptr_3 = (ptr_3 + 1) % 1; + ptr_4 = (ptr_4 + 1) % 6; + ptr_5 = (ptr_5 + 1) % 6; + ptr_6 = (ptr_6 + 1) % 6; + ptr_7 = (ptr_7 + 1) % 6; + ptr_8 = (ptr_8 + 1) % 6; + ptr_9 = (ptr_9 + 1) % 6; + ptr_10 = (ptr_10 + 1) % 1; + ptr_11 = (ptr_11 + 1) % 1; + ptr_12 = (ptr_12 + 1) % 1; + ptr_13 = (ptr_13 + 1) % 1; + ptr_14 = (ptr_14 + 1) % 1; + ptr_15 = (ptr_15 + 1) % 1; + ptr_16 = (ptr_16 + 1) % 1; + ptr_17 = (ptr_17 + 1) % 1; + ptr_18 = (ptr_18 + 1) % 1; + ptr_19 = (ptr_19 + 1) % 1; + ptr_20 = (ptr_20 + 1) % 1; + ptr_21 = (ptr_21 + 1) % 1; + ptr_22 = (ptr_22 + 1) % 1; + ptr_23 = (ptr_23 + 1) % 1; + ptr_24 = (ptr_24 + 1) % 1; + ptr_25 = (ptr_25 + 1) % 1; + ptr_26 = (ptr_26 + 1) % 1; + ptr_27 = (ptr_27 + 1) % 1; + ptr_28 = (ptr_28 + 1) % 1; + ptr_29 = (ptr_29 + 1) % 1; + ptr_30 = (ptr_30 + 1) % 1; + ptr_31 = (ptr_31 + 1) % 1; + ptr_32 = (ptr_32 + 1) % 1; + ptr_33 = (ptr_33 + 1) % 1; + ptr_34 = (ptr_34 + 1) % 1; + ptr_35 = (ptr_35 + 1) % 1; + ptr_36 = (ptr_36 + 1) % 1; + ptr_37 = (ptr_37 + 1) % 1; + ptr_38 = (ptr_38 + 1) % 1; + ptr_39 = (ptr_39 + 1) % 1; + ptr_40 = (ptr_40 + 1) % 1; + ptr_41 = (ptr_41 + 1) % 1; + ptr_42 = (ptr_42 + 1) % 1; + ptr_43 = (ptr_43 + 1) % 1; + ptr_44 = (ptr_44 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example15/copilot-sbv-codegen/internal.h b/example15/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..331aa800 --- /dev/null +++ b/example15/copilot-sbv-codegen/internal.h @@ -0,0 +1,196 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_2(); +SBool update_state_9(const SBool *queue_4, const SWord32 ptr_4); +SBool update_state_8(const SBool *queue_9, const SWord32 ptr_9); +SBool update_state_7(const SBool *queue_8, const SWord32 ptr_8); +SBool update_state_6(const SBool *queue_7, const SWord32 ptr_7); +SBool update_state_5(const SBool *queue_6, const SWord32 ptr_6); +SBool update_state_4(const SBool *queue_5, const SWord32 ptr_5); +SBool update_state_3(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_2, const SWord32 ptr_2); +SBool update_state_10(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_3, const SWord32 ptr_3); +SBool update_state_11(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_10, const SWord32 ptr_10); +SBool update_state_12(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_11, const SWord32 ptr_11); +SBool update_state_13(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_12, const SWord32 ptr_12); +SBool update_state_14(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_13, const SWord32 ptr_13); +SBool update_state_15(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_16(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_17(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_18(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_19(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_20(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_26(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_25(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_24(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_23(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_22(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_21(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20); +SBool update_state_27(const SInt8 ext_e); +SBool update_state_28(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2); +SBool update_state_29(const SInt8 ext_e); +SBool update_state_30(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_27, const SWord32 ptr_27, const SBool *queue_28, + const SWord32 ptr_28); +SBool update_state_31(const SInt8 ext_e); +SBool update_state_32(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_29, const SWord32 ptr_29, const SBool *queue_30, + const SWord32 ptr_30, const SBool *queue_27, const SWord32 ptr_27, + const SBool *queue_28, const SWord32 ptr_28); +SBool update_state_33(); +SBool update_state_35(); +SBool update_state_37(); +SBool update_state_38(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_33, const SWord32 ptr_33, + const SBool *queue_34, const SWord32 ptr_34, const SBool *queue_35, + const SWord32 ptr_35, const SBool *queue_36, const SWord32 ptr_36, + const SBool *queue_31, const SWord32 ptr_31, const SBool *queue_32, + const SWord32 ptr_32); +SBool update_state_36(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_37, const SWord32 ptr_37, + const SBool *queue_38, const SWord32 ptr_38, const SBool *queue_33, + const SWord32 ptr_33, const SBool *queue_34, const SWord32 ptr_34, + const SBool *queue_35, const SWord32 ptr_35, const SBool *queue_36, + const SWord32 ptr_36, const SBool *queue_31, const SWord32 ptr_31, + const SBool *queue_32, const SWord32 ptr_32); +SBool update_state_34(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_35, const SWord32 ptr_35, + const SBool *queue_36, const SWord32 ptr_36, const SBool *queue_31, + const SWord32 ptr_31, const SBool *queue_32, const SWord32 ptr_32); +SBool update_state_39(const SInt8 ext_e); +SBool update_state_40(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2); +SBool update_state_41(const SInt8 ext_e); +SBool update_state_42(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_39, const SWord32 ptr_39, const SBool *queue_40, + const SWord32 ptr_40); +SBool update_state_43(); +SBool update_state_44(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_43, const SWord32 ptr_43, + const SBool *queue_44, const SWord32 ptr_44, const SBool *queue_41, + const SWord32 ptr_41, const SBool *queue_42, const SWord32 ptr_42); +SBool observer_reset(const SBool *queue_0, const SWord32 ptr_0); +SBool observer_test2(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_3, const SWord32 ptr_3, const SBool *queue_10, + const SWord32 ptr_10, const SBool *queue_11, const SWord32 ptr_11, + const SBool *queue_12, const SWord32 ptr_12, const SBool *queue_13, + const SWord32 ptr_13, const SBool *queue_14, const SWord32 ptr_14, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26); +SBool observer_test1(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_0, const SWord32 ptr_0, const SBool *queue_27, + const SWord32 ptr_27, const SBool *queue_28, const SWord32 ptr_28, + const SBool *queue_29, const SWord32 ptr_29, const SBool *queue_30, + const SWord32 ptr_30, const SBool *queue_31, const SWord32 ptr_31, + const SBool *queue_32, const SWord32 ptr_32, const SBool *queue_33, + const SWord32 ptr_33, const SBool *queue_34, const SWord32 ptr_34, + const SBool *queue_37, const SWord32 ptr_37, const SBool *queue_38, + const SWord32 ptr_38, const SBool *queue_35, const SWord32 ptr_35, + const SBool *queue_36, const SWord32 ptr_36, const SBool *queue_39, + const SWord32 ptr_39, const SBool *queue_40, const SWord32 ptr_40, + const SBool *queue_41, const SWord32 ptr_41, const SBool *queue_42, + const SWord32 ptr_42, const SBool *queue_43, const SWord32 ptr_43, + const SBool *queue_44, const SWord32 ptr_44); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example15/copilot-sbv-codegen/observer_reset.c b/example15/copilot-sbv-codegen/observer_reset.c new file mode 100644 index 00000000..b5206918 --- /dev/null +++ b/example15/copilot-sbv-codegen/observer_reset.c @@ -0,0 +1,23 @@ +/* File: "observer_reset.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool observer_reset(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example15/copilot-sbv-codegen/observer_test1.c b/example15/copilot-sbv-codegen/observer_test1.c new file mode 100644 index 00000000..f0687a26 --- /dev/null +++ b/example15/copilot-sbv-codegen/observer_test1.c @@ -0,0 +1,93 @@ +/* File: "observer_test1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (((((((((s2 || (if s0 then s27 else s28)) || (if s0 then s29 else s30)) || (if s0 then s31 else s32)) || (if s0 then s33 else s34)) || (if s0 then s37 else s38)) || (if s0 then s35 else s36)) || (if s0 then s39 else s40)) || (if s0 then s41 else s42)) || (if s0 then s43 else s44)) +*/ +/*@ + assigns \nothing; + ensures \result == (((((((((queue_2[ptr_2] || ( queue_0[ptr_0] ? queue_27[ptr_27] : queue_28[ptr_28])) || ( queue_0[ptr_0] ? queue_29[ptr_29] : queue_30[ptr_30])) || ( queue_0[ptr_0] ? queue_31[ptr_31] : queue_32[ptr_32])) || ( queue_0[ptr_0] ? queue_33[ptr_33] : queue_34[ptr_34])) || ( queue_0[ptr_0] ? queue_37[ptr_37] : queue_38[ptr_38])) || ( queue_0[ptr_0] ? queue_35[ptr_35] : queue_36[ptr_36])) || ( queue_0[ptr_0] ? queue_39[ptr_39] : queue_40[ptr_40])) || ( queue_0[ptr_0] ? queue_41[ptr_41] : queue_42[ptr_42])) || ( queue_0[ptr_0] ? queue_43[ptr_43] : queue_44[ptr_44])); +*/ +SBool observer_test1(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_0, const SWord32 ptr_0, const SBool *queue_27, + const SWord32 ptr_27, const SBool *queue_28, const SWord32 ptr_28, + const SBool *queue_29, const SWord32 ptr_29, const SBool *queue_30, + const SWord32 ptr_30, const SBool *queue_31, const SWord32 ptr_31, + const SBool *queue_32, const SWord32 ptr_32, const SBool *queue_33, + const SWord32 ptr_33, const SBool *queue_34, const SWord32 ptr_34, + const SBool *queue_37, const SWord32 ptr_37, const SBool *queue_38, + const SWord32 ptr_38, const SBool *queue_35, const SWord32 ptr_35, + const SBool *queue_36, const SWord32 ptr_36, const SBool *queue_39, + const SWord32 ptr_39, const SBool *queue_40, const SWord32 ptr_40, + const SBool *queue_41, const SWord32 ptr_41, const SBool *queue_42, + const SWord32 ptr_42, const SBool *queue_43, const SWord32 ptr_43, + const SBool *queue_44, const SWord32 ptr_44) +{ + const SBool s0 = queue_2[0]; + const SWord32 s1 = ptr_2; + const SBool s2 = queue_0[0]; + const SWord32 s3 = ptr_0; + const SBool s4 = queue_27[0]; + const SWord32 s5 = ptr_27; + const SBool s6 = queue_28[0]; + const SWord32 s7 = ptr_28; + const SBool s8 = queue_29[0]; + const SWord32 s9 = ptr_29; + const SBool s10 = queue_30[0]; + const SWord32 s11 = ptr_30; + const SBool s12 = queue_31[0]; + const SWord32 s13 = ptr_31; + const SBool s14 = queue_32[0]; + const SWord32 s15 = ptr_32; + const SBool s16 = queue_33[0]; + const SWord32 s17 = ptr_33; + const SBool s18 = queue_34[0]; + const SWord32 s19 = ptr_34; + const SBool s20 = queue_37[0]; + const SWord32 s21 = ptr_37; + const SBool s22 = queue_38[0]; + const SWord32 s23 = ptr_38; + const SBool s24 = queue_35[0]; + const SWord32 s25 = ptr_35; + const SBool s26 = queue_36[0]; + const SWord32 s27 = ptr_36; + const SBool s28 = queue_39[0]; + const SWord32 s29 = ptr_39; + const SBool s30 = queue_40[0]; + const SWord32 s31 = ptr_40; + const SBool s32 = queue_41[0]; + const SWord32 s33 = ptr_41; + const SBool s34 = queue_42[0]; + const SWord32 s35 = ptr_42; + const SBool s36 = queue_43[0]; + const SWord32 s37 = ptr_43; + const SBool s38 = queue_44[0]; + const SWord32 s39 = ptr_44; + const SBool s40 = s2 ? s4 : s6; + const SBool s41 = s0 || s40; + const SBool s42 = s2 ? s8 : s10; + const SBool s43 = s41 || s42; + const SBool s44 = s2 ? s12 : s14; + const SBool s45 = s43 || s44; + const SBool s46 = s2 ? s16 : s18; + const SBool s47 = s45 || s46; + const SBool s48 = s2 ? s20 : s22; + const SBool s49 = s47 || s48; + const SBool s50 = s2 ? s24 : s26; + const SBool s51 = s49 || s50; + const SBool s52 = s2 ? s28 : s30; + const SBool s53 = s51 || s52; + const SBool s54 = s2 ? s32 : s34; + const SBool s55 = s53 || s54; + const SBool s56 = s2 ? s36 : s38; + const SBool s57 = s55 || s56; + + return s57; +} diff --git a/example15/copilot-sbv-codegen/observer_test2.c b/example15/copilot-sbv-codegen/observer_test2.c new file mode 100644 index 00000000..1907aea5 --- /dev/null +++ b/example15/copilot-sbv-codegen/observer_test2.c @@ -0,0 +1,90 @@ +/* File: "observer_test2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + ((((((((((((((((((s2 || s3) || s10) || s11) || s12) || s13) || s14) || s15) || s16) || s17) || s18) || s19) || s20) || s21) || s22) || s23) || s24) || s25) || s26) +*/ +/*@ + assigns \nothing; + ensures \result == ((((((((((((((((((queue_2[ptr_2] || queue_3[ptr_3]) || queue_10[ptr_10]) || queue_11[ptr_11]) || queue_12[ptr_12]) || queue_13[ptr_13]) || queue_14[ptr_14]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20]) || queue_21[ptr_21]) || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]); +*/ +SBool observer_test2(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_3, const SWord32 ptr_3, const SBool *queue_10, + const SWord32 ptr_10, const SBool *queue_11, const SWord32 ptr_11, + const SBool *queue_12, const SWord32 ptr_12, const SBool *queue_13, + const SWord32 ptr_13, const SBool *queue_14, const SWord32 ptr_14, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26) +{ + const SBool s0 = queue_2[0]; + const SWord32 s1 = ptr_2; + const SBool s2 = queue_3[0]; + const SWord32 s3 = ptr_3; + const SBool s4 = queue_10[0]; + const SWord32 s5 = ptr_10; + const SBool s6 = queue_11[0]; + const SWord32 s7 = ptr_11; + const SBool s8 = queue_12[0]; + const SWord32 s9 = ptr_12; + const SBool s10 = queue_13[0]; + const SWord32 s11 = ptr_13; + const SBool s12 = queue_14[0]; + const SWord32 s13 = ptr_14; + const SBool s14 = queue_15[0]; + const SWord32 s15 = ptr_15; + const SBool s16 = queue_16[0]; + const SWord32 s17 = ptr_16; + const SBool s18 = queue_17[0]; + const SWord32 s19 = ptr_17; + const SBool s20 = queue_18[0]; + const SWord32 s21 = ptr_18; + const SBool s22 = queue_19[0]; + const SWord32 s23 = ptr_19; + const SBool s24 = queue_20[0]; + const SWord32 s25 = ptr_20; + const SBool s26 = queue_21[0]; + const SWord32 s27 = ptr_21; + const SBool s28 = queue_22[0]; + const SWord32 s29 = ptr_22; + const SBool s30 = queue_23[0]; + const SWord32 s31 = ptr_23; + const SBool s32 = queue_24[0]; + const SWord32 s33 = ptr_24; + const SBool s34 = queue_25[0]; + const SWord32 s35 = ptr_25; + const SBool s36 = queue_26[0]; + const SWord32 s37 = ptr_26; + const SBool s38 = s0 || s2; + const SBool s39 = s38 || s4; + const SBool s40 = s39 || s6; + const SBool s41 = s40 || s8; + const SBool s42 = s41 || s10; + const SBool s43 = s42 || s12; + const SBool s44 = s43 || s14; + const SBool s45 = s44 || s16; + const SBool s46 = s45 || s18; + const SBool s47 = s46 || s20; + const SBool s48 = s47 || s22; + const SBool s49 = s48 || s24; + const SBool s50 = s49 || s26; + const SBool s51 = s50 || s28; + const SBool s52 = s51 || s30; + const SBool s53 = s52 || s32; + const SBool s54 = s53 || s34; + const SBool s55 = s54 || s36; + + return s55; +} diff --git a/example15/copilot-sbv-codegen/update_state_0.c b/example15/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..44638cc9 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,32 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example15/copilot-sbv-codegen/update_state_1.c b/example15/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..eff46813 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,32 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example15/copilot-sbv-codegen/update_state_10.c b/example15/copilot-sbv-codegen/update_state_10.c new file mode 100644 index 00000000..f835ac9c --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_10.c @@ -0,0 +1,38 @@ +/* File: "update_state_10.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s5 && s3) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_5[ptr_5] && queue_3[ptr_3]); +*/ +SBool update_state_10(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_3, const SWord32 ptr_3) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SWord32 s6 = ptr_5; + const SBool s7 = queue_3[0]; + const SWord32 s8 = ptr_3; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_11.c b/example15/copilot-sbv-codegen/update_state_11.c new file mode 100644 index 00000000..eedb847d --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_11.c @@ -0,0 +1,38 @@ +/* File: "update_state_11.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s6 && s10) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_6[ptr_6] && queue_10[ptr_10]); +*/ +SBool update_state_11(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_10, const SWord32 ptr_10) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SWord32 s6 = ptr_6; + const SBool s7 = queue_10[0]; + const SWord32 s8 = ptr_10; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_12.c b/example15/copilot-sbv-codegen/update_state_12.c new file mode 100644 index 00000000..c3292017 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_12.c @@ -0,0 +1,38 @@ +/* File: "update_state_12.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s7 && s11) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_7[ptr_7] && queue_11[ptr_11]); +*/ +SBool update_state_12(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_11, const SWord32 ptr_11) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SWord32 s6 = ptr_7; + const SBool s7 = queue_11[0]; + const SWord32 s8 = ptr_11; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_13.c b/example15/copilot-sbv-codegen/update_state_13.c new file mode 100644 index 00000000..416d6dae --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_13.c @@ -0,0 +1,38 @@ +/* File: "update_state_13.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s8 && s12) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_8[ptr_8] && queue_12[ptr_12]); +*/ +SBool update_state_13(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_12, const SWord32 ptr_12) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SWord32 s6 = ptr_8; + const SBool s7 = queue_12[0]; + const SWord32 s8 = ptr_12; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_14.c b/example15/copilot-sbv-codegen/update_state_14.c new file mode 100644 index 00000000..f6a14178 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_14.c @@ -0,0 +1,38 @@ +/* File: "update_state_14.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s9 && s13) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_9[ptr_9] && queue_13[ptr_13]); +*/ +SBool update_state_14(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_13, const SWord32 ptr_13) +{ + const SBool s0 = queue_9[0]; + const SBool s1 = queue_9[1]; + const SBool s2 = queue_9[2]; + const SBool s3 = queue_9[3]; + const SBool s4 = queue_9[4]; + const SBool s5 = queue_9[5]; + const SWord32 s6 = ptr_9; + const SBool s7 = queue_13[0]; + const SWord32 s8 = ptr_13; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_15.c b/example15/copilot-sbv-codegen/update_state_15.c new file mode 100644 index 00000000..2be0209f --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_15.c @@ -0,0 +1,38 @@ +/* File: "update_state_15.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s4 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_4[ptr_4] && queue_14[ptr_14]); +*/ +SBool update_state_15(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SWord32 s6 = ptr_4; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_16.c b/example15/copilot-sbv-codegen/update_state_16.c new file mode 100644 index 00000000..68a5aeb4 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_16.c @@ -0,0 +1,38 @@ +/* File: "update_state_16.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s5 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_5[ptr_5] && queue_14[ptr_14]); +*/ +SBool update_state_16(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SWord32 s6 = ptr_5; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_17.c b/example15/copilot-sbv-codegen/update_state_17.c new file mode 100644 index 00000000..45b6b22d --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_17.c @@ -0,0 +1,38 @@ +/* File: "update_state_17.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s6 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_6[ptr_6] && queue_14[ptr_14]); +*/ +SBool update_state_17(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SWord32 s6 = ptr_6; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_18.c b/example15/copilot-sbv-codegen/update_state_18.c new file mode 100644 index 00000000..60ba680c --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_18.c @@ -0,0 +1,38 @@ +/* File: "update_state_18.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s7 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_7[ptr_7] && queue_14[ptr_14]); +*/ +SBool update_state_18(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SWord32 s6 = ptr_7; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_19.c b/example15/copilot-sbv-codegen/update_state_19.c new file mode 100644 index 00000000..5d5b0dad --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_19.c @@ -0,0 +1,38 @@ +/* File: "update_state_19.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s8 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_8[ptr_8] && queue_14[ptr_14]); +*/ +SBool update_state_19(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SWord32 s6 = ptr_8; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_2.c b/example15/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..21d05ddc --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,21 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_2() +{ + return false; +} diff --git a/example15/copilot-sbv-codegen/update_state_20.c b/example15/copilot-sbv-codegen/update_state_20.c new file mode 100644 index 00000000..8a3466a7 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_20.c @@ -0,0 +1,38 @@ +/* File: "update_state_20.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s9 && s14) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_9[ptr_9] && queue_14[ptr_14]); +*/ +SBool update_state_20(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_9[0]; + const SBool s1 = queue_9[1]; + const SBool s2 = queue_9[2]; + const SBool s3 = queue_9[3]; + const SBool s4 = queue_9[4]; + const SBool s5 = queue_9[5]; + const SWord32 s6 = ptr_9; + const SBool s7 = queue_14[0]; + const SWord32 s8 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_21.c b/example15/copilot-sbv-codegen/update_state_21.c new file mode 100644 index 00000000..20c9f632 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_21.c @@ -0,0 +1,78 @@ +/* File: "update_state_21.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s4 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_4[ptr_4] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_21(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SWord32 s6 = ptr_4; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_22.c b/example15/copilot-sbv-codegen/update_state_22.c new file mode 100644 index 00000000..e35b61db --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_22.c @@ -0,0 +1,78 @@ +/* File: "update_state_22.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s5 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_5[ptr_5] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_22(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SWord32 s6 = ptr_5; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_23.c b/example15/copilot-sbv-codegen/update_state_23.c new file mode 100644 index 00000000..e9046c99 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_23.c @@ -0,0 +1,78 @@ +/* File: "update_state_23.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s6 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_6[ptr_6] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_23(const SBool *queue_6, const SWord32 ptr_6, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SWord32 s6 = ptr_6; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_24.c b/example15/copilot-sbv-codegen/update_state_24.c new file mode 100644 index 00000000..f8c369e1 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_24.c @@ -0,0 +1,78 @@ +/* File: "update_state_24.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s7 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_7[ptr_7] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_24(const SBool *queue_7, const SWord32 ptr_7, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SWord32 s6 = ptr_7; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_25.c b/example15/copilot-sbv-codegen/update_state_25.c new file mode 100644 index 00000000..e12c40b4 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_25.c @@ -0,0 +1,78 @@ +/* File: "update_state_25.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s8 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_8[ptr_8] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_25(const SBool *queue_8, const SWord32 ptr_8, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SWord32 s6 = ptr_8; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_26.c b/example15/copilot-sbv-codegen/update_state_26.c new file mode 100644 index 00000000..75092569 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_26.c @@ -0,0 +1,78 @@ +/* File: "update_state_26.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s9 && (((((((((((s21 || s22) || s23) || s24) || s25) || s26) || s15) || s16) || s17) || s18) || s19) || s20)) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_9[ptr_9] && (((((((((((queue_21[ptr_21] || queue_22[ptr_22]) || queue_23[ptr_23]) || queue_24[ptr_24]) || queue_25[ptr_25]) || queue_26[ptr_26]) || queue_15[ptr_15]) || queue_16[ptr_16]) || queue_17[ptr_17]) || queue_18[ptr_18]) || queue_19[ptr_19]) || queue_20[ptr_20])); +*/ +SBool update_state_26(const SBool *queue_9, const SWord32 ptr_9, + const SBool *queue_21, const SWord32 ptr_21, const SBool *queue_22, + const SWord32 ptr_22, const SBool *queue_23, const SWord32 ptr_23, + const SBool *queue_24, const SWord32 ptr_24, const SBool *queue_25, + const SWord32 ptr_25, const SBool *queue_26, const SWord32 ptr_26, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_20, const SWord32 ptr_20) +{ + const SBool s0 = queue_9[0]; + const SBool s1 = queue_9[1]; + const SBool s2 = queue_9[2]; + const SBool s3 = queue_9[3]; + const SBool s4 = queue_9[4]; + const SBool s5 = queue_9[5]; + const SWord32 s6 = ptr_9; + const SBool s7 = queue_21[0]; + const SWord32 s8 = ptr_21; + const SBool s9 = queue_22[0]; + const SWord32 s10 = ptr_22; + const SBool s11 = queue_23[0]; + const SWord32 s12 = ptr_23; + const SBool s13 = queue_24[0]; + const SWord32 s14 = ptr_24; + const SBool s15 = queue_25[0]; + const SWord32 s16 = ptr_25; + const SBool s17 = queue_26[0]; + const SWord32 s18 = ptr_26; + const SBool s19 = queue_15[0]; + const SWord32 s20 = ptr_15; + const SBool s21 = queue_16[0]; + const SWord32 s22 = ptr_16; + const SBool s23 = queue_17[0]; + const SWord32 s24 = ptr_17; + const SBool s25 = queue_18[0]; + const SWord32 s26 = ptr_18; + const SBool s27 = queue_19[0]; + const SWord32 s28 = ptr_19; + const SBool s29 = queue_20[0]; + const SWord32 s30 = ptr_20; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s32 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s33 = table0[s32]; + const SBool s34 = s7 || s9; + const SBool s35 = s34 || s11; + const SBool s36 = s35 || s13; + const SBool s37 = s36 || s15; + const SBool s38 = s37 || s17; + const SBool s39 = s38 || s19; + const SBool s40 = s39 || s21; + const SBool s41 = s40 || s23; + const SBool s42 = s41 || s25; + const SBool s43 = s42 || s27; + const SBool s44 = s43 || s29; + const SBool s45 = s33 && s44; + + return s45; +} diff --git a/example15/copilot-sbv-codegen/update_state_27.c b/example15/copilot-sbv-codegen/update_state_27.c new file mode 100644 index 00000000..622207a9 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_27.c @@ -0,0 +1,24 @@ +/* File: "update_state_27.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "e" == 0) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e == 0); +*/ +SBool update_state_27(const SInt8 ext_e) +{ + const SInt8 s0 = ext_e; + const SBool s2 = s0 == 0; + + return s2; +} diff --git a/example15/copilot-sbv-codegen/update_state_28.c b/example15/copilot-sbv-codegen/update_state_28.c new file mode 100644 index 00000000..0d8bf625 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_28.c @@ -0,0 +1,28 @@ +/* File: "update_state_28.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 0) && s2) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 0) && queue_2[ptr_2]); +*/ +SBool update_state_28(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_2[0]; + const SWord32 s2 = ptr_2; + const SBool s4 = s0 == 0; + const SBool s5 = s4 && s1; + + return s5; +} diff --git a/example15/copilot-sbv-codegen/update_state_29.c b/example15/copilot-sbv-codegen/update_state_29.c new file mode 100644 index 00000000..5993dddf --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_29.c @@ -0,0 +1,24 @@ +/* File: "update_state_29.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "e" == 0) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e == 0); +*/ +SBool update_state_29(const SInt8 ext_e) +{ + const SInt8 s0 = ext_e; + const SBool s2 = s0 == 0; + + return s2; +} diff --git a/example15/copilot-sbv-codegen/update_state_3.c b/example15/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..04b84965 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,38 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s4 && s2) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_4[ptr_4] && queue_2[ptr_2]); +*/ +SBool update_state_3(const SBool *queue_4, const SWord32 ptr_4, + const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SWord32 s6 = ptr_4; + const SBool s7 = queue_2[0]; + const SWord32 s8 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s10 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s11 = table0[s10]; + const SBool s12 = s11 && s7; + + return s12; +} diff --git a/example15/copilot-sbv-codegen/update_state_30.c b/example15/copilot-sbv-codegen/update_state_30.c new file mode 100644 index 00000000..a849d8a0 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_30.c @@ -0,0 +1,38 @@ +/* File: "update_state_30.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 0) && (s2 || (if s0 then s27 else s28))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 0) && (queue_2[ptr_2] || ( queue_0[ptr_0] ? queue_27[ptr_27] : queue_28[ptr_28]))); +*/ +SBool update_state_30(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_27, const SWord32 ptr_27, const SBool *queue_28, + const SWord32 ptr_28) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_2[0]; + const SWord32 s2 = ptr_2; + const SBool s3 = queue_0[0]; + const SWord32 s4 = ptr_0; + const SBool s5 = queue_27[0]; + const SWord32 s6 = ptr_27; + const SBool s7 = queue_28[0]; + const SWord32 s8 = ptr_28; + const SBool s10 = s0 == 0; + const SBool s11 = s3 ? s5 : s7; + const SBool s12 = s1 || s11; + const SBool s13 = s10 && s12; + + return s13; +} diff --git a/example15/copilot-sbv-codegen/update_state_31.c b/example15/copilot-sbv-codegen/update_state_31.c new file mode 100644 index 00000000..14f76088 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_31.c @@ -0,0 +1,24 @@ +/* File: "update_state_31.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "e" == 1) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e == 1); +*/ +SBool update_state_31(const SInt8 ext_e) +{ + const SInt8 s0 = ext_e; + const SBool s2 = s0 == 1; + + return s2; +} diff --git a/example15/copilot-sbv-codegen/update_state_32.c b/example15/copilot-sbv-codegen/update_state_32.c new file mode 100644 index 00000000..adaf4bd2 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_32.c @@ -0,0 +1,45 @@ +/* File: "update_state_32.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 1) && ((s2 || (if s0 then s29 else s30)) || (if s0 then s27 else s28))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 1) && ((queue_2[ptr_2] || ( queue_0[ptr_0] ? queue_29[ptr_29] : queue_30[ptr_30])) || ( queue_0[ptr_0] ? queue_27[ptr_27] : queue_28[ptr_28]))); +*/ +SBool update_state_32(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_29, const SWord32 ptr_29, const SBool *queue_30, + const SWord32 ptr_30, const SBool *queue_27, const SWord32 ptr_27, + const SBool *queue_28, const SWord32 ptr_28) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_2[0]; + const SWord32 s2 = ptr_2; + const SBool s3 = queue_0[0]; + const SWord32 s4 = ptr_0; + const SBool s5 = queue_29[0]; + const SWord32 s6 = ptr_29; + const SBool s7 = queue_30[0]; + const SWord32 s8 = ptr_30; + const SBool s9 = queue_27[0]; + const SWord32 s10 = ptr_27; + const SBool s11 = queue_28[0]; + const SWord32 s12 = ptr_28; + const SBool s14 = s0 == 1; + const SBool s15 = s3 ? s5 : s7; + const SBool s16 = s1 || s15; + const SBool s17 = s3 ? s9 : s11; + const SBool s18 = s16 || s17; + const SBool s19 = s14 && s18; + + return s19; +} diff --git a/example15/copilot-sbv-codegen/update_state_33.c b/example15/copilot-sbv-codegen/update_state_33.c new file mode 100644 index 00000000..89bd583c --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_33.c @@ -0,0 +1,21 @@ +/* File: "update_state_33.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_33() +{ + return false; +} diff --git a/example15/copilot-sbv-codegen/update_state_34.c b/example15/copilot-sbv-codegen/update_state_34.c new file mode 100644 index 00000000..705dd5aa --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_34.c @@ -0,0 +1,41 @@ +/* File: "update_state_34.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 0) && ((if s0 then s35 else s36) || (if s0 then s31 else s32))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 0) && (( queue_0[ptr_0] ? queue_35[ptr_35] : queue_36[ptr_36]) || ( queue_0[ptr_0] ? queue_31[ptr_31] : queue_32[ptr_32]))); +*/ +SBool update_state_34(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_35, const SWord32 ptr_35, + const SBool *queue_36, const SWord32 ptr_36, const SBool *queue_31, + const SWord32 ptr_31, const SBool *queue_32, const SWord32 ptr_32) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + const SBool s3 = queue_35[0]; + const SWord32 s4 = ptr_35; + const SBool s5 = queue_36[0]; + const SWord32 s6 = ptr_36; + const SBool s7 = queue_31[0]; + const SWord32 s8 = ptr_31; + const SBool s9 = queue_32[0]; + const SWord32 s10 = ptr_32; + const SBool s12 = s0 == 0; + const SBool s13 = s1 ? s3 : s5; + const SBool s14 = s1 ? s7 : s9; + const SBool s15 = s13 || s14; + const SBool s16 = s12 && s15; + + return s16; +} diff --git a/example15/copilot-sbv-codegen/update_state_35.c b/example15/copilot-sbv-codegen/update_state_35.c new file mode 100644 index 00000000..346dc230 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_35.c @@ -0,0 +1,21 @@ +/* File: "update_state_35.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_35() +{ + return false; +} diff --git a/example15/copilot-sbv-codegen/update_state_36.c b/example15/copilot-sbv-codegen/update_state_36.c new file mode 100644 index 00000000..546c72fe --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_36.c @@ -0,0 +1,56 @@ +/* File: "update_state_36.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 1) && ((((if s0 then s37 else s38) || (if s0 then s33 else s34)) || (if s0 then s35 else s36)) || (if s0 then s31 else s32))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 1) && (((( queue_0[ptr_0] ? queue_37[ptr_37] : queue_38[ptr_38]) || ( queue_0[ptr_0] ? queue_33[ptr_33] : queue_34[ptr_34])) || ( queue_0[ptr_0] ? queue_35[ptr_35] : queue_36[ptr_36])) || ( queue_0[ptr_0] ? queue_31[ptr_31] : queue_32[ptr_32]))); +*/ +SBool update_state_36(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_37, const SWord32 ptr_37, + const SBool *queue_38, const SWord32 ptr_38, const SBool *queue_33, + const SWord32 ptr_33, const SBool *queue_34, const SWord32 ptr_34, + const SBool *queue_35, const SWord32 ptr_35, const SBool *queue_36, + const SWord32 ptr_36, const SBool *queue_31, const SWord32 ptr_31, + const SBool *queue_32, const SWord32 ptr_32) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + const SBool s3 = queue_37[0]; + const SWord32 s4 = ptr_37; + const SBool s5 = queue_38[0]; + const SWord32 s6 = ptr_38; + const SBool s7 = queue_33[0]; + const SWord32 s8 = ptr_33; + const SBool s9 = queue_34[0]; + const SWord32 s10 = ptr_34; + const SBool s11 = queue_35[0]; + const SWord32 s12 = ptr_35; + const SBool s13 = queue_36[0]; + const SWord32 s14 = ptr_36; + const SBool s15 = queue_31[0]; + const SWord32 s16 = ptr_31; + const SBool s17 = queue_32[0]; + const SWord32 s18 = ptr_32; + const SBool s20 = s0 == 1; + const SBool s21 = s1 ? s3 : s5; + const SBool s22 = s1 ? s7 : s9; + const SBool s23 = s21 || s22; + const SBool s24 = s1 ? s11 : s13; + const SBool s25 = s23 || s24; + const SBool s26 = s1 ? s15 : s17; + const SBool s27 = s25 || s26; + const SBool s28 = s20 && s27; + + return s28; +} diff --git a/example15/copilot-sbv-codegen/update_state_37.c b/example15/copilot-sbv-codegen/update_state_37.c new file mode 100644 index 00000000..c0e27b7b --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_37.c @@ -0,0 +1,21 @@ +/* File: "update_state_37.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_37() +{ + return false; +} diff --git a/example15/copilot-sbv-codegen/update_state_38.c b/example15/copilot-sbv-codegen/update_state_38.c new file mode 100644 index 00000000..7f647992 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_38.c @@ -0,0 +1,49 @@ +/* File: "update_state_38.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 0) && (((if s0 then s33 else s34) || (if s0 then s35 else s36)) || (if s0 then s31 else s32))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 0) && ((( queue_0[ptr_0] ? queue_33[ptr_33] : queue_34[ptr_34]) || ( queue_0[ptr_0] ? queue_35[ptr_35] : queue_36[ptr_36])) || ( queue_0[ptr_0] ? queue_31[ptr_31] : queue_32[ptr_32]))); +*/ +SBool update_state_38(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_33, const SWord32 ptr_33, + const SBool *queue_34, const SWord32 ptr_34, const SBool *queue_35, + const SWord32 ptr_35, const SBool *queue_36, const SWord32 ptr_36, + const SBool *queue_31, const SWord32 ptr_31, const SBool *queue_32, + const SWord32 ptr_32) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + const SBool s3 = queue_33[0]; + const SWord32 s4 = ptr_33; + const SBool s5 = queue_34[0]; + const SWord32 s6 = ptr_34; + const SBool s7 = queue_35[0]; + const SWord32 s8 = ptr_35; + const SBool s9 = queue_36[0]; + const SWord32 s10 = ptr_36; + const SBool s11 = queue_31[0]; + const SWord32 s12 = ptr_31; + const SBool s13 = queue_32[0]; + const SWord32 s14 = ptr_32; + const SBool s16 = s0 == 0; + const SBool s17 = s1 ? s3 : s5; + const SBool s18 = s1 ? s7 : s9; + const SBool s19 = s17 || s18; + const SBool s20 = s1 ? s11 : s13; + const SBool s21 = s19 || s20; + const SBool s22 = s16 && s21; + + return s22; +} diff --git a/example15/copilot-sbv-codegen/update_state_39.c b/example15/copilot-sbv-codegen/update_state_39.c new file mode 100644 index 00000000..46fda978 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_39.c @@ -0,0 +1,24 @@ +/* File: "update_state_39.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "e" == 2) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e == 2); +*/ +SBool update_state_39(const SInt8 ext_e) +{ + const SInt8 s0 = ext_e; + const SBool s2 = s0 == 2; + + return s2; +} diff --git a/example15/copilot-sbv-codegen/update_state_4.c b/example15/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..af2fb064 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,34 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SBool update_state_4(const SBool *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SWord32 s6 = ptr_5; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/copilot-sbv-codegen/update_state_40.c b/example15/copilot-sbv-codegen/update_state_40.c new file mode 100644 index 00000000..5da74e83 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_40.c @@ -0,0 +1,28 @@ +/* File: "update_state_40.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 2) && s2) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 2) && queue_2[ptr_2]); +*/ +SBool update_state_40(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_2[0]; + const SWord32 s2 = ptr_2; + const SBool s4 = s0 == 2; + const SBool s5 = s4 && s1; + + return s5; +} diff --git a/example15/copilot-sbv-codegen/update_state_41.c b/example15/copilot-sbv-codegen/update_state_41.c new file mode 100644 index 00000000..081f19ca --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_41.c @@ -0,0 +1,24 @@ +/* File: "update_state_41.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "e" == 3) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e == 3); +*/ +SBool update_state_41(const SInt8 ext_e) +{ + const SInt8 s0 = ext_e; + const SBool s2 = s0 == 3; + + return s2; +} diff --git a/example15/copilot-sbv-codegen/update_state_42.c b/example15/copilot-sbv-codegen/update_state_42.c new file mode 100644 index 00000000..022a063d --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_42.c @@ -0,0 +1,38 @@ +/* File: "update_state_42.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 3) && (s2 || (if s0 then s39 else s40))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 3) && (queue_2[ptr_2] || ( queue_0[ptr_0] ? queue_39[ptr_39] : queue_40[ptr_40]))); +*/ +SBool update_state_42(const SInt8 ext_e, const SBool *queue_2, + const SWord32 ptr_2, const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_39, const SWord32 ptr_39, const SBool *queue_40, + const SWord32 ptr_40) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_2[0]; + const SWord32 s2 = ptr_2; + const SBool s3 = queue_0[0]; + const SWord32 s4 = ptr_0; + const SBool s5 = queue_39[0]; + const SWord32 s6 = ptr_39; + const SBool s7 = queue_40[0]; + const SWord32 s8 = ptr_40; + const SBool s10 = s0 == 3; + const SBool s11 = s3 ? s5 : s7; + const SBool s12 = s1 || s11; + const SBool s13 = s10 && s12; + + return s13; +} diff --git a/example15/copilot-sbv-codegen/update_state_43.c b/example15/copilot-sbv-codegen/update_state_43.c new file mode 100644 index 00000000..316188e3 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_43.c @@ -0,0 +1,21 @@ +/* File: "update_state_43.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_43() +{ + return false; +} diff --git a/example15/copilot-sbv-codegen/update_state_44.c b/example15/copilot-sbv-codegen/update_state_44.c new file mode 100644 index 00000000..0da5bc02 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_44.c @@ -0,0 +1,41 @@ +/* File: "update_state_44.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((extern "e" == 3) && ((if s0 then s43 else s44) || (if s0 then s41 else s42))) +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e == 3) && (( queue_0[ptr_0] ? queue_43[ptr_43] : queue_44[ptr_44]) || ( queue_0[ptr_0] ? queue_41[ptr_41] : queue_42[ptr_42]))); +*/ +SBool update_state_44(const SInt8 ext_e, const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_43, const SWord32 ptr_43, + const SBool *queue_44, const SWord32 ptr_44, const SBool *queue_41, + const SWord32 ptr_41, const SBool *queue_42, const SWord32 ptr_42) +{ + const SInt8 s0 = ext_e; + const SBool s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + const SBool s3 = queue_43[0]; + const SWord32 s4 = ptr_43; + const SBool s5 = queue_44[0]; + const SWord32 s6 = ptr_44; + const SBool s7 = queue_41[0]; + const SWord32 s8 = ptr_41; + const SBool s9 = queue_42[0]; + const SWord32 s10 = ptr_42; + const SBool s12 = s0 == 3; + const SBool s13 = s1 ? s3 : s5; + const SBool s14 = s1 ? s7 : s9; + const SBool s15 = s13 || s14; + const SBool s16 = s12 && s15; + + return s16; +} diff --git a/example15/copilot-sbv-codegen/update_state_5.c b/example15/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..5ccdcd85 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,34 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s6 +*/ +/*@ + assigns \nothing; + ensures \result == queue_6[ptr_6]; +*/ +SBool update_state_5(const SBool *queue_6, const SWord32 ptr_6) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SWord32 s6 = ptr_6; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/copilot-sbv-codegen/update_state_6.c b/example15/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..4cd421aa --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,34 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s7 +*/ +/*@ + assigns \nothing; + ensures \result == queue_7[ptr_7]; +*/ +SBool update_state_6(const SBool *queue_7, const SWord32 ptr_7) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SWord32 s6 = ptr_7; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/copilot-sbv-codegen/update_state_7.c b/example15/copilot-sbv-codegen/update_state_7.c new file mode 100644 index 00000000..66d17356 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_7.c @@ -0,0 +1,34 @@ +/* File: "update_state_7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s8 +*/ +/*@ + assigns \nothing; + ensures \result == queue_8[ptr_8]; +*/ +SBool update_state_7(const SBool *queue_8, const SWord32 ptr_8) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SWord32 s6 = ptr_8; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/copilot-sbv-codegen/update_state_8.c b/example15/copilot-sbv-codegen/update_state_8.c new file mode 100644 index 00000000..a3e8e026 --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_8.c @@ -0,0 +1,34 @@ +/* File: "update_state_8.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s9 +*/ +/*@ + assigns \nothing; + ensures \result == queue_9[ptr_9]; +*/ +SBool update_state_8(const SBool *queue_9, const SWord32 ptr_9) +{ + const SBool s0 = queue_9[0]; + const SBool s1 = queue_9[1]; + const SBool s2 = queue_9[2]; + const SBool s3 = queue_9[3]; + const SBool s4 = queue_9[4]; + const SBool s5 = queue_9[5]; + const SWord32 s6 = ptr_9; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/copilot-sbv-codegen/update_state_9.c b/example15/copilot-sbv-codegen/update_state_9.c new file mode 100644 index 00000000..a05497cc --- /dev/null +++ b/example15/copilot-sbv-codegen/update_state_9.c @@ -0,0 +1,34 @@ +/* File: "update_state_9.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s4 +*/ +/*@ + assigns \nothing; + ensures \result == queue_4[ptr_4]; +*/ +SBool update_state_9(const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SWord32 s6 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5 + }; + const SWord32 s8 = (0x00000006UL == 0) ? s6 : (s6 % 0x00000006UL); + const SBool s9 = table0[s8]; + + return s9; +} diff --git a/example15/main.hs b/example15/main.hs new file mode 100644 index 00000000..8b43d92e --- /dev/null +++ b/example15/main.hs @@ -0,0 +1,61 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.RegExp +import Copilot.Library.Utils + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +reset :: Stream Bool +reset = [ False ] ++ cycle [ False, False, False, True ] + + +-- | Regular expression matching on integral streams +s :: Stream Int8 +s = extern "e" (Just $ P.cycle [ 0, 1 ]) + +test1 :: Stream Bool +test1 = copilotRegexp s "(<0>?<0>?<1>)+|<2>?<3>+" reset + + +-- | Regular expressions over boolean streams + +s0, s1, s2, s3, s4, s5 :: Stream Bool +s0 = [ True, False, False, False, False, False ] ++ s1 +s1 = [ False, True, False, False, False, False ] ++ s2 +s2 = [ False, False, True, False, False, False ] ++ s3 +s3 = [ False, False, False, True, False, False ] ++ s4 +s4 = [ False, False, False, False, True, False ] ++ s5 +s5 = [ False, False, False, False, False, True ] ++ s0 + + +test2 :: Stream Bool +test2 = copilotRegexpB + "(|||||)+" + [ ( "s0", s0 ) + , ( "s1", s1 ) + , ( "s2", s2 ) + , ( "s3", s3 ) + , ( "s4", s4 ) + , ( "s5", s5 ) ] false + +spec :: Spec +spec = do + observer "test1" test1 + observer "test2" test2 + observer "reset" reset +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example16/--list-options/add-source-timestamps b/example16/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example16/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example16/--list-options/packages/00-index.cache b/example16/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example16/--list-options/packages/00-index.tar b/example16/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example16/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example16/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example16/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example16/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example16/.cabal-sandbox/add-source-timestamps b/example16/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example16/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example16/.cabal-sandbox/packages/00-index.cache b/example16/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example16/.cabal-sandbox/packages/00-index.tar b/example16/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example16/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example16/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example16/Makefile b/example16/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example16/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example16/cabal.sandbox.config b/example16/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example16/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example16/copilot-sbv-codegen/Makefile b/example16/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..06142742 --- /dev/null +++ b/example16/copilot-sbv-codegen/Makefile @@ -0,0 +1,59 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o update_state_3.o update_state_5.o update_state_6.o update_state_7.o update_state_4.o observer_obs2.o observer_obs1.o observer_obs0.o observer_done.o observer_sat.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_7.o: update_state_7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs2.o: observer_obs2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs1.o: observer_obs1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs0.o: observer_obs0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_done.o: observer_done.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_sat.o: observer_sat.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example16/copilot-sbv-codegen/README b/example16/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example16/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example16/copilot-sbv-codegen/copilot.h b/example16/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..acfbbf75 --- /dev/null +++ b/example16/copilot-sbv-codegen/copilot.h @@ -0,0 +1,28 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool obs2; +extern bool obs1; +extern bool obs0; +extern bool done; +extern bool sat; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example16/copilot-sbv-codegen/copilot.mk b/example16/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example16/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example16/copilot-sbv-codegen/driver.c b/example16/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..0ff56171 --- /dev/null +++ b/example16/copilot-sbv-codegen/driver.c @@ -0,0 +1,184 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool obs2; +SBool obs1; +SBool obs0; +SBool done; +SBool sat; + +/* Variables */ +SBool tmp_0 = true; +SBool tmp_1 = true; +SBool tmp_2 = true; +SWord64 tmp_3 = 1; +SBool tmp_4 = false; +SBool tmp_5 = true; +SBool tmp_6 = true; +SBool tmp_7 = true; +SBool queue_0[2] = { true, false }; +SBool queue_1[4] = { true, false, false, false }; +SBool queue_2[8] = { true, false, false, false, false, false, false, false }; +SWord64 queue_3[1] = { 1 }; +SBool queue_4[1] = { false }; +SBool queue_5[8] = { true, false, false, false, false, false, false, false }; +SBool queue_6[4] = { true, false, false, false }; +SBool queue_7[2] = { true, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord32 ptr_7 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 2 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 1 )); + global invariant a_bound_ptr_1: ptr_1 < 4 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 3 )); + global invariant a_bound_ptr_2: ptr_2 < 8 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 7 )); + global invariant a_bound_ptr_3: ptr_3 < 1 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 0 )); + global invariant a_bound_ptr_4: ptr_4 < 1 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 0 )); + global invariant a_bound_ptr_5: ptr_5 < 8 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 7 )); + global invariant a_bound_ptr_6: ptr_6 < 4 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 3 )); + global invariant a_bound_ptr_7: ptr_7 < 2 ; + global invariant a_pos_ptr_7: ptr_7 >= 0 ; + global invariant a_valid_ptr_7: \valid (queue_7 + (0.. 1 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns done; + assigns obs0; + assigns obs1; + assigns obs2; + assigns sat; + */ +void updateObservers(void) { + done = observer_done(queue_3, ptr_3); + obs0 = observer_obs0(queue_2, ptr_2); + obs1 = observer_obs1(queue_1, ptr_1); + obs2 = observer_obs2(queue_0, ptr_0); + sat = observer_sat(queue_4, ptr_4); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + assigns tmp_3; + assigns tmp_5; + assigns tmp_6; + assigns tmp_7; + assigns tmp_4; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_2 = update_state_2(queue_2, ptr_2); + tmp_3 = update_state_3(queue_3, ptr_3); + tmp_5 = update_state_5(queue_5, ptr_5); + tmp_6 = update_state_6(queue_6, ptr_6); + tmp_7 = update_state_7(queue_7, ptr_7); + tmp_4 = update_state_4(queue_5, ptr_5, queue_6, ptr_6, queue_7, ptr_7, queue_4, ptr_4); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + assigns queue_7[ptr_7]; + ensures queue_7[ptr_7] == tmp_7; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; + queue_7[ptr_7] = tmp_7; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 2; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 4; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 8; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 1; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 1; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 8; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 4; + assigns ptr_7; + ensures ptr_7 == (\old (ptr_7 ) + 1) % 2; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 2; + ptr_1 = (ptr_1 + 1) % 4; + ptr_2 = (ptr_2 + 1) % 8; + ptr_3 = (ptr_3 + 1) % 1; + ptr_4 = (ptr_4 + 1) % 1; + ptr_5 = (ptr_5 + 1) % 8; + ptr_6 = (ptr_6 + 1) % 4; + ptr_7 = (ptr_7 + 1) % 2; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example16/copilot-sbv-codegen/internal.h b/example16/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..f912806f --- /dev/null +++ b/example16/copilot-sbv-codegen/internal.h @@ -0,0 +1,50 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2); +SWord64 update_state_3(const SWord64 *queue_3, + const SWord32 ptr_3); +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5); +SBool update_state_6(const SBool *queue_6, const SWord32 ptr_6); +SBool update_state_7(const SBool *queue_7, const SWord32 ptr_7); +SBool update_state_4(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_6, const SWord32 ptr_6, const SBool *queue_7, + const SWord32 ptr_7, const SBool *queue_4, const SWord32 ptr_4); +SBool observer_obs2(const SBool *queue_0, const SWord32 ptr_0); +SBool observer_obs1(const SBool *queue_1, const SWord32 ptr_1); +SBool observer_obs0(const SBool *queue_2, const SWord32 ptr_2); +SBool observer_done(const SWord64 *queue_3, const SWord32 ptr_3); +SBool observer_sat(const SBool *queue_4, const SWord32 ptr_4); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example16/copilot-sbv-codegen/observer_done.c b/example16/copilot-sbv-codegen/observer_done.c new file mode 100644 index 00000000..539c6b7b --- /dev/null +++ b/example16/copilot-sbv-codegen/observer_done.c @@ -0,0 +1,25 @@ +/* File: "observer_done.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (s3 == 8) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_3[ptr_3] == 8); +*/ +SBool observer_done(const SWord64 *queue_3, const SWord32 ptr_3) +{ + const SWord64 s0 = queue_3[0]; + const SWord32 s1 = ptr_3; + const SBool s3 = s0 == 0x0000000000000008ULL; + + return s3; +} diff --git a/example16/copilot-sbv-codegen/observer_obs0.c b/example16/copilot-sbv-codegen/observer_obs0.c new file mode 100644 index 00000000..7497c2cc --- /dev/null +++ b/example16/copilot-sbv-codegen/observer_obs0.c @@ -0,0 +1,36 @@ +/* File: "observer_obs0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool observer_obs0(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SBool s3 = queue_2[3]; + const SBool s4 = queue_2[4]; + const SBool s5 = queue_2[5]; + const SBool s6 = queue_2[6]; + const SBool s7 = queue_2[7]; + const SWord32 s8 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example16/copilot-sbv-codegen/observer_obs1.c b/example16/copilot-sbv-codegen/observer_obs1.c new file mode 100644 index 00000000..ada0c2a3 --- /dev/null +++ b/example16/copilot-sbv-codegen/observer_obs1.c @@ -0,0 +1,32 @@ +/* File: "observer_obs1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool observer_obs1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example16/copilot-sbv-codegen/observer_obs2.c b/example16/copilot-sbv-codegen/observer_obs2.c new file mode 100644 index 00000000..aa846ba3 --- /dev/null +++ b/example16/copilot-sbv-codegen/observer_obs2.c @@ -0,0 +1,30 @@ +/* File: "observer_obs2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool observer_obs2(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example16/copilot-sbv-codegen/observer_sat.c b/example16/copilot-sbv-codegen/observer_sat.c new file mode 100644 index 00000000..61ca9970 --- /dev/null +++ b/example16/copilot-sbv-codegen/observer_sat.c @@ -0,0 +1,23 @@ +/* File: "observer_sat.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s4 +*/ +/*@ + assigns \nothing; + ensures \result == queue_4[ptr_4]; +*/ +SBool observer_sat(const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + return s0; +} diff --git a/example16/copilot-sbv-codegen/update_state_0.c b/example16/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..13b7093a --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,30 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example16/copilot-sbv-codegen/update_state_1.c b/example16/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..eff46813 --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,32 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example16/copilot-sbv-codegen/update_state_2.c b/example16/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..6e32ce0f --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,36 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SBool s3 = queue_2[3]; + const SBool s4 = queue_2[4]; + const SBool s5 = queue_2[5]; + const SBool s6 = queue_2[6]; + const SBool s7 = queue_2[7]; + const SWord32 s8 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example16/copilot-sbv-codegen/update_state_3.c b/example16/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..2d43159c --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,25 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s3 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_3[ptr_3] + 1); +*/ +SWord64 update_state_3(const SWord64 *queue_3, const SWord32 ptr_3) +{ + const SWord64 s0 = queue_3[0]; + const SWord32 s1 = ptr_3; + const SWord64 s3 = s0 + 0x0000000000000001ULL; + + return s3; +} diff --git a/example16/copilot-sbv-codegen/update_state_4.c b/example16/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..b3eea5b4 --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,62 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((s5 && (s6 || not s7)) || s4) +*/ +/*@ + assigns \nothing; + ensures \result == ((queue_5[ptr_5] && (queue_6[ptr_6] || ! queue_7[ptr_7])) || queue_4[ptr_4]); +*/ +SBool update_state_4(const SBool *queue_5, const SWord32 ptr_5, + const SBool *queue_6, const SWord32 ptr_6, const SBool *queue_7, + const SWord32 ptr_7, const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SBool s6 = queue_5[6]; + const SBool s7 = queue_5[7]; + const SWord32 s8 = ptr_5; + const SBool s9 = queue_6[0]; + const SBool s10 = queue_6[1]; + const SBool s11 = queue_6[2]; + const SBool s12 = queue_6[3]; + const SWord32 s13 = ptr_6; + const SBool s14 = queue_7[0]; + const SBool s15 = queue_7[1]; + const SWord32 s16 = ptr_7; + const SBool s17 = queue_4[0]; + const SWord32 s18 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SBool table1[] = { + s9, s10, s11, s12 + }; + const SBool table2[] = { + s14, s15 + }; + const SWord32 s20 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s21 = table0[s20]; + const SWord32 s23 = (0x00000004UL == 0) ? s13 : (s13 % 0x00000004UL); + const SBool s24 = table1[s23]; + const SWord32 s26 = (0x00000002UL == 0) ? s16 : (s16 % 0x00000002UL); + const SBool s27 = table2[s26]; + const SBool s28 = !s27; + const SBool s29 = s24 || s28; + const SBool s30 = s21 && s29; + const SBool s31 = s30 || s17; + + return s31; +} diff --git a/example16/copilot-sbv-codegen/update_state_5.c b/example16/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..38677a72 --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,36 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SBool s6 = queue_5[6]; + const SBool s7 = queue_5[7]; + const SWord32 s8 = ptr_5; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example16/copilot-sbv-codegen/update_state_6.c b/example16/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..743cea10 --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,32 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s6 +*/ +/*@ + assigns \nothing; + ensures \result == queue_6[ptr_6]; +*/ +SBool update_state_6(const SBool *queue_6, const SWord32 ptr_6) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SWord32 s4 = ptr_6; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example16/copilot-sbv-codegen/update_state_7.c b/example16/copilot-sbv-codegen/update_state_7.c new file mode 100644 index 00000000..4cddcb51 --- /dev/null +++ b/example16/copilot-sbv-codegen/update_state_7.c @@ -0,0 +1,30 @@ +/* File: "update_state_7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s7 +*/ +/*@ + assigns \nothing; + ensures \result == queue_7[ptr_7]; +*/ +SBool update_state_7(const SBool *queue_7, const SWord32 ptr_7) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SWord32 s2 = ptr_7; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example16/main.hs b/example16/main.hs new file mode 100644 index 00000000..0b7444bf --- /dev/null +++ b/example16/main.hs @@ -0,0 +1,70 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L +-- | Number of sat variables and a Boolean function over those variables. +type SatFunc = (Int, [Stream Bool] -> Stream Bool) + +-- Takes a Sat function and returns the stream of variables and a SAT function. +sat :: SatFunc -> ([Stream Bool], Stream Bool) +sat (i,f) = (xs, res) + where + -- If it becomes true, it stays true. + res = [False] ++ (f xs || res) + + xs = xs' i + + xs' 0 = [] + xs' n = clk (period $ 2 P.^ n) (phase (0 :: Int)) : xs' (n P.- 1) + +satSpec :: SatFunc -> Spec +satSpec f = do + observer "sat" (snd $ sat f) + observer "done" done + foldM_ mkObs (0 :: Int) xs + + where + xs = fst $ sat f + cnt :: Stream Word64 -- Would need to be extended depending on number of + -- variables. + cnt = [1] ++ cnt + 1 + done = cnt == (2 P.^ length xs) + mkObs idx strm = do observer ("obs" P.++ show idx) strm + return (idx P.+ 1) + + +f0 :: SatFunc +--f0 = (3, \[a,b,c] -> a && (b || (not c))) +f0 = (3, f) + where + f [a,b,c] = a && (b || (not c)) + f _ = error "Bad SAT function." + +f1 :: SatFunc +f1 = (9, f') + where + f' [a,b,c,d,e,f,g,h,i] = + a && b && c && d && e && + f && g && h && i && i && not i + f' _ = error "Bad SAT function." + + +spec :: Spec +spec = satSpec f0 + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example17/--list-options/add-source-timestamps b/example17/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example17/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example17/--list-options/packages/00-index.cache b/example17/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example17/--list-options/packages/00-index.tar b/example17/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example17/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example17/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example17/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example17/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example17/.cabal-sandbox/add-source-timestamps b/example17/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example17/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example17/.cabal-sandbox/packages/00-index.cache b/example17/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example17/.cabal-sandbox/packages/00-index.tar b/example17/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example17/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example17/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example17/Makefile b/example17/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example17/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example17/cabal.sandbox.config b/example17/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example17/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example17/copilot-sbv-codegen/Makefile b/example17/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..dbdc6fc7 --- /dev/null +++ b/example17/copilot-sbv-codegen/Makefile @@ -0,0 +1,32 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o observer_sinceExtTest.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_sinceExtTest.o: observer_sinceExtTest.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example17/copilot-sbv-codegen/README b/example17/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example17/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example17/copilot-sbv-codegen/copilot.h b/example17/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..f5518db2 --- /dev/null +++ b/example17/copilot-sbv-codegen/copilot.h @@ -0,0 +1,26 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool sinceExtTest; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + +extern bool e2; +extern bool e1; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example17/copilot-sbv-codegen/copilot.mk b/example17/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example17/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example17/copilot-sbv-codegen/driver.c b/example17/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..311998de --- /dev/null +++ b/example17/copilot-sbv-codegen/driver.c @@ -0,0 +1,109 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool sinceExtTest; + +/* Variables */ +SBool tmp_0 = false; +SBool tmp_1 = false; +SBool tmp_2 = true; +SBool queue_0[1] = { false }; +SBool queue_1[1] = { false }; +SBool queue_2[1] = { true }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SBool ext_e1 = 0; +SBool ext_e2 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); + global invariant a_bound_ptr_2: ptr_2 < 1 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 0 )); +*/ + +/*@ + assigns ext_e1; + assigns ext_e2; + //ensures ext_e1 == e1; + //ensures ext_e2 == e2; +*/ +void sampleExts(void) { + ext_e1 = e1; + ext_e2 = e2; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns sinceExtTest; + */ +void updateObservers(void) { + sinceExtTest = observer_sinceExtTest(queue_0, ptr_0, queue_1, ptr_1, ext_e1, queue_2, ptr_2); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + */ +void updateStates(void) { + tmp_0 = update_state_0(ext_e2); + tmp_1 = update_state_1(queue_0, ptr_0, queue_1, ptr_1); + tmp_2 = update_state_2(queue_0, ptr_0, queue_1, ptr_1, ext_e1, queue_2, ptr_2); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 1; + ptr_2 = (ptr_2 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example17/copilot-sbv-codegen/internal.h b/example17/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..803efe56 --- /dev/null +++ b/example17/copilot-sbv-codegen/internal.h @@ -0,0 +1,43 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool ext_e2); +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1, const SBool ext_e1, + const SBool *queue_2, const SWord32 ptr_2); +SBool observer_sinceExtTest(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1, + const SBool ext_e1, const SBool *queue_2, const SWord32 ptr_2); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example17/copilot-sbv-codegen/observer_sinceExtTest.c b/example17/copilot-sbv-codegen/observer_sinceExtTest.c new file mode 100644 index 00000000..5167e149 --- /dev/null +++ b/example17/copilot-sbv-codegen/observer_sinceExtTest.c @@ -0,0 +1,35 @@ +/* File: "observer_sinceExtTest.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + ((not (s0 || s1) || extern "e1") && s2) +*/ +/*@ + assigns \nothing; + ensures \result == ((! (queue_0[ptr_0] || queue_1[ptr_1]) || ext_e1) && queue_2[ptr_2]); +*/ +SBool observer_sinceExtTest(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1, + const SBool ext_e1, const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_1[0]; + const SWord32 s3 = ptr_1; + const SBool s4 = ext_e1; + const SBool s5 = queue_2[0]; + const SWord32 s6 = ptr_2; + const SBool s7 = s0 || s2; + const SBool s8 = !s7; + const SBool s9 = s8 || s4; + const SBool s10 = s9 && s5; + + return s10; +} diff --git a/example17/copilot-sbv-codegen/update_state_0.c b/example17/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..1a8d47be --- /dev/null +++ b/example17/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,22 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + extern "e2" +*/ +/*@ + assigns \nothing; + ensures \result == ext_e2; +*/ +SBool update_state_0(const SBool ext_e2) +{ + const SBool s0 = ext_e2; + return s0; +} diff --git a/example17/copilot-sbv-codegen/update_state_1.c b/example17/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..93464da6 --- /dev/null +++ b/example17/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,28 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 || s1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] || queue_1[ptr_1]); +*/ +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_1[0]; + const SWord32 s3 = ptr_1; + const SBool s4 = s0 || s2; + + return s4; +} diff --git a/example17/copilot-sbv-codegen/update_state_2.c b/example17/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..34f8b65d --- /dev/null +++ b/example17/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,35 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((not (s0 || s1) || extern "e1") && s2) +*/ +/*@ + assigns \nothing; + ensures \result == ((! (queue_0[ptr_0] || queue_1[ptr_1]) || ext_e1) && queue_2[ptr_2]); +*/ +SBool update_state_2(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1, const SBool ext_e1, + const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = queue_1[0]; + const SWord32 s3 = ptr_1; + const SBool s4 = ext_e1; + const SBool s5 = queue_2[0]; + const SWord32 s6 = ptr_2; + const SBool s7 = s0 || s2; + const SBool s8 = !s7; + const SBool s9 = s8 || s4; + const SBool s10 = s9 && s5; + + return s10; +} diff --git a/example17/main.hs b/example17/main.hs new file mode 100644 index 00000000..9fb51409 --- /dev/null +++ b/example17/main.hs @@ -0,0 +1,76 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.LTL +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + + +-- | test of previous +previousTestData :: Stream Bool +previousTestData = [ True, False ] ++ previousTestData + +previousTest :: Spec +previousTest = do + observer "previousTest" ( previous previousTestData ) + + +-- | test of alwaysBeen +alwaysBeenTestData :: Stream Bool +alwaysBeenTestData = [ True, True, True, True, True, True, True, False ] + ++ alwaysBeenTestData + +alwaysBeenTest :: Spec +alwaysBeenTest = do + observer "testAlwaysBeen" ( alwaysBeen alwaysBeenTestData ) + + +-- | test of eventuallyPrevious +eventuallyPrevTestData :: Stream Bool +eventuallyPrevTestData = [ False, False, False, False, False, True, False ] + ++ eventuallyPrevTestData + +eventuallyPrevTest :: Spec +eventuallyPrevTest = observer "eventuallyPrevTest" + ( eventuallyPrev eventuallyPrevTestData ) + + +-- | test of since +sinceTestData1 :: Stream Bool +sinceTestData1 = [ False, False, False ] ++ true + +sinceTestData2 :: Stream Bool +sinceTestData2 = [ False, False, True, False, False, False, False ] + ++ sinceTestData2 + +sinceTest :: Spec +sinceTest = observer "sinceTest" + ( sinceTestData1 `since` sinceTestData2 ) + + +-- | test since with external variables +sinceExtTest :: Spec +sinceExtTest = observer "sinceExtTest" + ( extern "e1" (Just e1) `since` extern "e2" (Just e2)) + +-- | external variables +e1, e2 :: [Bool] +e1 = replicate 10 False L.++ repeat True +e2 = replicate 9 False L.++ [ True ] L.++ repeat False + +main = do + reify sinceExtTest >>= C.compile C.defaultParams + reify sinceExtTest >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example18/--list-options/add-source-timestamps b/example18/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example18/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example18/--list-options/packages/00-index.cache b/example18/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example18/--list-options/packages/00-index.tar b/example18/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example18/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example18/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example18/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example18/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example18/.cabal-sandbox/add-source-timestamps b/example18/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example18/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example18/.cabal-sandbox/packages/00-index.cache b/example18/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example18/.cabal-sandbox/packages/00-index.tar b/example18/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example18/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example18/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example18/Makefile b/example18/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example18/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example18/cabal.sandbox.config b/example18/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example18/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example18/copilot-sbv-codegen/Makefile b/example18/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..cd47a1da --- /dev/null +++ b/example18/copilot-sbv-codegen/Makefile @@ -0,0 +1,29 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o observer_eventuallyPrevTest.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_eventuallyPrevTest.o: observer_eventuallyPrevTest.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example18/copilot-sbv-codegen/README b/example18/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example18/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example18/copilot-sbv-codegen/copilot.h b/example18/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..7dec238a --- /dev/null +++ b/example18/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool eventuallyPrevTest; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example18/copilot-sbv-codegen/copilot.mk b/example18/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example18/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example18/copilot-sbv-codegen/driver.c b/example18/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..0f12aaab --- /dev/null +++ b/example18/copilot-sbv-codegen/driver.c @@ -0,0 +1,88 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool eventuallyPrevTest; + +/* Variables */ +SBool tmp_0 = false; +SBool tmp_1 = false; +SBool queue_0[7] = { false, false, false, false, false, true, false }; +SBool queue_1[1] = { false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 7 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 6 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns eventuallyPrevTest; + */ +void updateObservers(void) { + eventuallyPrevTest = observer_eventuallyPrevTest(queue_0, ptr_0, queue_1, ptr_1); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_0, ptr_0, queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 7; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 7; + ptr_1 = (ptr_1 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example18/copilot-sbv-codegen/internal.h b/example18/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..7b1e4a19 --- /dev/null +++ b/example18/copilot-sbv-codegen/internal.h @@ -0,0 +1,39 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1); +SBool observer_eventuallyPrevTest(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example18/copilot-sbv-codegen/observer_eventuallyPrevTest.c b/example18/copilot-sbv-codegen/observer_eventuallyPrevTest.c new file mode 100644 index 00000000..4d8c52fa --- /dev/null +++ b/example18/copilot-sbv-codegen/observer_eventuallyPrevTest.c @@ -0,0 +1,39 @@ +/* File: "observer_eventuallyPrevTest.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (s0 || s1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] || queue_1[ptr_1]); +*/ +SBool observer_eventuallyPrevTest(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SWord32 s7 = ptr_0; + const SBool s8 = queue_1[0]; + const SWord32 s9 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6 + }; + const SWord32 s11 = (0x00000007UL == 0) ? s7 : (s7 % 0x00000007UL); + const SBool s12 = table0[s11]; + const SBool s13 = s12 || s8; + + return s13; +} diff --git a/example18/copilot-sbv-codegen/update_state_0.c b/example18/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..1644d9f9 --- /dev/null +++ b/example18/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,35 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SWord32 s7 = ptr_0; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6 + }; + const SWord32 s9 = (0x00000007UL == 0) ? s7 : (s7 % 0x00000007UL); + const SBool s10 = table0[s9]; + + return s10; +} diff --git a/example18/copilot-sbv-codegen/update_state_1.c b/example18/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..14c6ef14 --- /dev/null +++ b/example18/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,39 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 || s1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] || queue_1[ptr_1]); +*/ +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SWord32 s7 = ptr_0; + const SBool s8 = queue_1[0]; + const SWord32 s9 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6 + }; + const SWord32 s11 = (0x00000007UL == 0) ? s7 : (s7 % 0x00000007UL); + const SBool s12 = table0[s11]; + const SBool s13 = s12 || s8; + + return s13; +} diff --git a/example18/main.hs b/example18/main.hs new file mode 100644 index 00000000..3f1124e6 --- /dev/null +++ b/example18/main.hs @@ -0,0 +1,76 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.LTL +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + + +-- | test of previous +previousTestData :: Stream Bool +previousTestData = [ True, False ] ++ previousTestData + +previousTest :: Spec +previousTest = do + observer "previousTest" ( previous previousTestData ) + + +-- | test of alwaysBeen +alwaysBeenTestData :: Stream Bool +alwaysBeenTestData = [ True, True, True, True, True, True, True, False ] + ++ alwaysBeenTestData + +alwaysBeenTest :: Spec +alwaysBeenTest = do + observer "testAlwaysBeen" ( alwaysBeen alwaysBeenTestData ) + + +-- | test of eventuallyPrevious +eventuallyPrevTestData :: Stream Bool +eventuallyPrevTestData = [ False, False, False, False, False, True, False ] + ++ eventuallyPrevTestData + +eventuallyPrevTest :: Spec +eventuallyPrevTest = observer "eventuallyPrevTest" + ( eventuallyPrev eventuallyPrevTestData ) + + +-- | test of since +sinceTestData1 :: Stream Bool +sinceTestData1 = [ False, False, False ] ++ true + +sinceTestData2 :: Stream Bool +sinceTestData2 = [ False, False, True, False, False, False, False ] + ++ sinceTestData2 + +sinceTest :: Spec +sinceTest = observer "sinceTest" + ( sinceTestData1 `since` sinceTestData2 ) + + +-- | test since with external variables +sinceExtTest :: Spec +sinceExtTest = observer "sinceExtTest" + ( extern "e1" (Just e1) `since` extern "e2" (Just e2)) + +-- | external variables +e1, e2 :: [Bool] +e1 = replicate 10 False L.++ repeat True +e2 = replicate 9 False L.++ [ True ] L.++ repeat False + +main = do + reify eventuallyPrevTest >>= C.compile C.defaultParams + reify eventuallyPrevTest >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example19/--list-options/add-source-timestamps b/example19/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example19/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example19/--list-options/packages/00-index.cache b/example19/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example19/--list-options/packages/00-index.tar b/example19/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example19/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example19/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example19/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example19/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example19/.cabal-sandbox/add-source-timestamps b/example19/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example19/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example19/.cabal-sandbox/packages/00-index.cache b/example19/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example19/.cabal-sandbox/packages/00-index.tar b/example19/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example19/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example19/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example19/Makefile b/example19/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example19/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example19/cabal.sandbox.config b/example19/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example19/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example19/copilot-sbv-codegen/Makefile b/example19/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..a2f5dcc8 --- /dev/null +++ b/example19/copilot-sbv-codegen/Makefile @@ -0,0 +1,29 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o observer_testAlwaysBeen.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_testAlwaysBeen.o: observer_testAlwaysBeen.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example19/copilot-sbv-codegen/README b/example19/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example19/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example19/copilot-sbv-codegen/copilot.h b/example19/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..f6141757 --- /dev/null +++ b/example19/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool testAlwaysBeen; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example19/copilot-sbv-codegen/copilot.mk b/example19/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example19/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example19/copilot-sbv-codegen/driver.c b/example19/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..fe7ff4e1 --- /dev/null +++ b/example19/copilot-sbv-codegen/driver.c @@ -0,0 +1,88 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool testAlwaysBeen; + +/* Variables */ +SBool tmp_0 = true; +SBool tmp_1 = true; +SBool queue_0[8] = { true, true, true, true, true, true, true, false }; +SBool queue_1[1] = { true }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 8 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 7 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns testAlwaysBeen; + */ +void updateObservers(void) { + testAlwaysBeen = observer_testAlwaysBeen(queue_0, ptr_0, queue_1, ptr_1); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_0, ptr_0, queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 8; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 8; + ptr_1 = (ptr_1 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example19/copilot-sbv-codegen/internal.h b/example19/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..80751d9d --- /dev/null +++ b/example19/copilot-sbv-codegen/internal.h @@ -0,0 +1,39 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1); +SBool observer_testAlwaysBeen(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example19/copilot-sbv-codegen/observer_testAlwaysBeen.c b/example19/copilot-sbv-codegen/observer_testAlwaysBeen.c new file mode 100644 index 00000000..5f5ab862 --- /dev/null +++ b/example19/copilot-sbv-codegen/observer_testAlwaysBeen.c @@ -0,0 +1,40 @@ +/* File: "observer_testAlwaysBeen.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (s0 && s1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] && queue_1[ptr_1]); +*/ +SBool observer_testAlwaysBeen(const SBool *queue_0, + const SWord32 ptr_0, const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SBool s7 = queue_0[7]; + const SWord32 s8 = ptr_0; + const SBool s9 = queue_1[0]; + const SWord32 s10 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s12 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s13 = table0[s12]; + const SBool s14 = s13 && s9; + + return s14; +} diff --git a/example19/copilot-sbv-codegen/update_state_0.c b/example19/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..a18f37c3 --- /dev/null +++ b/example19/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,36 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SBool s7 = queue_0[7]; + const SWord32 s8 = ptr_0; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example19/copilot-sbv-codegen/update_state_1.c b/example19/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..d97370f9 --- /dev/null +++ b/example19/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,40 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 && s1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] && queue_1[ptr_1]); +*/ +SBool update_state_1(const SBool *queue_0, const SWord32 ptr_0, + const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SBool s2 = queue_0[2]; + const SBool s3 = queue_0[3]; + const SBool s4 = queue_0[4]; + const SBool s5 = queue_0[5]; + const SBool s6 = queue_0[6]; + const SBool s7 = queue_0[7]; + const SWord32 s8 = ptr_0; + const SBool s9 = queue_1[0]; + const SWord32 s10 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s12 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s13 = table0[s12]; + const SBool s14 = s13 && s9; + + return s14; +} diff --git a/example19/main.hs b/example19/main.hs new file mode 100644 index 00000000..1d65315b --- /dev/null +++ b/example19/main.hs @@ -0,0 +1,76 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.LTL +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + + +-- | test of previous +previousTestData :: Stream Bool +previousTestData = [ True, False ] ++ previousTestData + +previousTest :: Spec +previousTest = do + observer "previousTest" ( previous previousTestData ) + + +-- | test of alwaysBeen +alwaysBeenTestData :: Stream Bool +alwaysBeenTestData = [ True, True, True, True, True, True, True, False ] + ++ alwaysBeenTestData + +alwaysBeenTest :: Spec +alwaysBeenTest = do + observer "testAlwaysBeen" ( alwaysBeen alwaysBeenTestData ) + + +-- | test of eventuallyPrevious +eventuallyPrevTestData :: Stream Bool +eventuallyPrevTestData = [ False, False, False, False, False, True, False ] + ++ eventuallyPrevTestData + +eventuallyPrevTest :: Spec +eventuallyPrevTest = observer "eventuallyPrevTest" + ( eventuallyPrev eventuallyPrevTestData ) + + +-- | test of since +sinceTestData1 :: Stream Bool +sinceTestData1 = [ False, False, False ] ++ true + +sinceTestData2 :: Stream Bool +sinceTestData2 = [ False, False, True, False, False, False, False ] + ++ sinceTestData2 + +sinceTest :: Spec +sinceTest = observer "sinceTest" + ( sinceTestData1 `since` sinceTestData2 ) + + +-- | test since with external variables +sinceExtTest :: Spec +sinceExtTest = observer "sinceExtTest" + ( extern "e1" (Just e1) `since` extern "e2" (Just e2)) + +-- | external variables +e1, e2 :: [Bool] +e1 = replicate 10 False L.++ repeat True +e2 = replicate 9 False L.++ [ True ] L.++ repeat False + +main = do + reify alwaysBeenTest >>= C.compile C.defaultParams + reify alwaysBeenTest >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example2/--list-options/add-source-timestamps b/example2/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example2/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example2/--list-options/packages/00-index.cache b/example2/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example2/--list-options/packages/00-index.tar b/example2/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example2/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example2/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example2/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example2/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example2/.cabal-sandbox/add-source-timestamps b/example2/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example2/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example2/.cabal-sandbox/packages/00-index.cache b/example2/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example2/.cabal-sandbox/packages/00-index.tar b/example2/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example2/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example2/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example2/Makefile b/example2/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example2/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example2/cabal.sandbox.config b/example2/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example2/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example2/copilot-sbv-codegen/Makefile b/example2/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..b4b62ca3 --- /dev/null +++ b/example2/copilot-sbv-codegen/Makefile @@ -0,0 +1,26 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: trigger_guard_f.o trigger_f_arg_0.o + ${AR} ${ARFLAGS} $@ $^ + +trigger_guard_f.o: trigger_guard_f.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_f_arg_0.o: trigger_f_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example2/copilot-sbv-codegen/README b/example2/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example2/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example2/copilot-sbv-codegen/copilot.h b/example2/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..82d04042 --- /dev/null +++ b/example2/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void f(uint64_t); + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example2/copilot-sbv-codegen/copilot.mk b/example2/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example2/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example2/copilot-sbv-codegen/driver.c b/example2/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..44f3a77c --- /dev/null +++ b/example2/copilot-sbv-codegen/driver.c @@ -0,0 +1,63 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ + +/*ACSL following*/ +/*@ +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_f()) + f(trigger_f_arg_0()); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns \nothing; + */ +void updateStates(void) { +} + +/*@ + */ +void updateBuffers(void) { +} + +/*@ + */ +void updatePtrs(void) { +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example2/copilot-sbv-codegen/internal.h b/example2/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..35eaee9d --- /dev/null +++ b/example2/copilot-sbv-codegen/internal.h @@ -0,0 +1,36 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool trigger_guard_f(); +SWord64 trigger_f_arg_0(); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example2/copilot-sbv-codegen/trigger_f_arg_0.c b/example2/copilot-sbv-codegen/trigger_f_arg_0.c new file mode 100644 index 00000000..3e79e3ba --- /dev/null +++ b/example2/copilot-sbv-codegen/trigger_f_arg_0.c @@ -0,0 +1,21 @@ +/* File: "trigger_f_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + 120 +*/ +/*@ + assigns \nothing; + ensures \result == 120; +*/ +SWord64 trigger_f_arg_0() +{ + return 0x0000000000000078ULL; +} diff --git a/example2/copilot-sbv-codegen/trigger_guard_f.c b/example2/copilot-sbv-codegen/trigger_guard_f.c new file mode 100644 index 00000000..b51cbda6 --- /dev/null +++ b/example2/copilot-sbv-codegen/trigger_guard_f.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_f.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_f() +{ + return true; +} diff --git a/example2/main.hs b/example2/main.hs new file mode 100644 index 00000000..a96862e1 --- /dev/null +++ b/example2/main.hs @@ -0,0 +1,30 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +spec :: Spec +spec = + trigger "f" true [ arg $ mult 5 ] + + where + mult :: Word64 -> Stream Word64 + mult 0 = 1 + mult i = constant i * mult (i-1) + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example20/--list-options/add-source-timestamps b/example20/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example20/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example20/--list-options/packages/00-index.cache b/example20/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example20/--list-options/packages/00-index.tar b/example20/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example20/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example20/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example20/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example20/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example20/.cabal-sandbox/add-source-timestamps b/example20/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example20/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example20/.cabal-sandbox/packages/00-index.cache b/example20/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example20/.cabal-sandbox/packages/00-index.tar b/example20/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example20/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example20/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example20/Makefile b/example20/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example20/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example20/cabal.sandbox.config b/example20/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example20/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example20/copilot-sbv-codegen/Makefile b/example20/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..0b249be7 --- /dev/null +++ b/example20/copilot-sbv-codegen/Makefile @@ -0,0 +1,29 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o update_state_0.o observer_previousTest.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_previousTest.o: observer_previousTest.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example20/copilot-sbv-codegen/README b/example20/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example20/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example20/copilot-sbv-codegen/copilot.h b/example20/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..a0cd1321 --- /dev/null +++ b/example20/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool previousTest; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example20/copilot-sbv-codegen/copilot.mk b/example20/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example20/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example20/copilot-sbv-codegen/driver.c b/example20/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..de940155 --- /dev/null +++ b/example20/copilot-sbv-codegen/driver.c @@ -0,0 +1,88 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool previousTest; + +/* Variables */ +SBool tmp_0 = false; +SBool tmp_1 = true; +SBool queue_0[1] = { false }; +SBool queue_1[2] = { true, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 2 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 1 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns previousTest; + */ +void updateObservers(void) { + previousTest = observer_previousTest(queue_0, ptr_0); +} + +/*@ + assigns tmp_1; + assigns tmp_0; + */ +void updateStates(void) { + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_0 = update_state_0(queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 2; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 2; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example20/copilot-sbv-codegen/internal.h b/example20/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..cdbd98a7 --- /dev/null +++ b/example20/copilot-sbv-codegen/internal.h @@ -0,0 +1,38 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1); +SBool observer_previousTest(const SBool *queue_0, + const SWord32 ptr_0); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example20/copilot-sbv-codegen/observer_previousTest.c b/example20/copilot-sbv-codegen/observer_previousTest.c new file mode 100644 index 00000000..e0242858 --- /dev/null +++ b/example20/copilot-sbv-codegen/observer_previousTest.c @@ -0,0 +1,24 @@ +/* File: "observer_previousTest.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool observer_previousTest(const SBool *queue_0, + const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example20/copilot-sbv-codegen/update_state_0.c b/example20/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..1d589e08 --- /dev/null +++ b/example20/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,30 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_0(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example20/copilot-sbv-codegen/update_state_1.c b/example20/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..196507c3 --- /dev/null +++ b/example20/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,30 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SWord32 s2 = ptr_1; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example20/main.hs b/example20/main.hs new file mode 100644 index 00000000..66a0c289 --- /dev/null +++ b/example20/main.hs @@ -0,0 +1,76 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.LTL +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + + +-- | test of previous +previousTestData :: Stream Bool +previousTestData = [ True, False ] ++ previousTestData + +previousTest :: Spec +previousTest = do + observer "previousTest" ( previous previousTestData ) + + +-- | test of alwaysBeen +alwaysBeenTestData :: Stream Bool +alwaysBeenTestData = [ True, True, True, True, True, True, True, False ] + ++ alwaysBeenTestData + +alwaysBeenTest :: Spec +alwaysBeenTest = do + observer "testAlwaysBeen" ( alwaysBeen alwaysBeenTestData ) + + +-- | test of eventuallyPrevious +eventuallyPrevTestData :: Stream Bool +eventuallyPrevTestData = [ False, False, False, False, False, True, False ] + ++ eventuallyPrevTestData + +eventuallyPrevTest :: Spec +eventuallyPrevTest = observer "eventuallyPrevTest" + ( eventuallyPrev eventuallyPrevTestData ) + + +-- | test of since +sinceTestData1 :: Stream Bool +sinceTestData1 = [ False, False, False ] ++ true + +sinceTestData2 :: Stream Bool +sinceTestData2 = [ False, False, True, False, False, False, False ] + ++ sinceTestData2 + +sinceTest :: Spec +sinceTest = observer "sinceTest" + ( sinceTestData1 `since` sinceTestData2 ) + + +-- | test since with external variables +sinceExtTest :: Spec +sinceExtTest = observer "sinceExtTest" + ( extern "e1" (Just e1) `since` extern "e2" (Just e2)) + +-- | external variables +e1, e2 :: [Bool] +e1 = replicate 10 False L.++ repeat True +e2 = replicate 9 False L.++ [ True ] L.++ repeat False + +main = do + reify previousTest >>= C.compile C.defaultParams + reify previousTest >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example21/--list-options/add-source-timestamps b/example21/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example21/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example21/--list-options/packages/00-index.cache b/example21/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example21/--list-options/packages/00-index.tar b/example21/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example21/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example21/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example21/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example21/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example21/.cabal-sandbox/add-source-timestamps b/example21/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example21/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example21/.cabal-sandbox/packages/00-index.cache b/example21/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example21/.cabal-sandbox/packages/00-index.tar b/example21/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example21/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example21/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example21/Makefile b/example21/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example21/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example21/cabal.sandbox.config b/example21/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example21/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example21/copilot-sbv-codegen/Makefile b/example21/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..00ff5e7e --- /dev/null +++ b/example21/copilot-sbv-codegen/Makefile @@ -0,0 +1,113 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o update_state_3.o update_state_4.o update_state_5.o update_state_6.o update_state_7.o update_state_8.o update_state_9.o update_state_11.o update_state_12.o update_state_13.o update_state_14.o update_state_15.o update_state_16.o update_state_17.o update_state_18.o update_state_19.o update_state_10.o observer_obs8.o observer_obs7.o observer_obs6.o observer_obs5.o observer_obs4.o observer_obs3.o observer_obs2.o observer_obs1.o observer_obs0.o observer_done.o observer_sat.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_7.o: update_state_7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_8.o: update_state_8.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_9.o: update_state_9.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_11.o: update_state_11.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_12.o: update_state_12.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_13.o: update_state_13.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_14.o: update_state_14.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_15.o: update_state_15.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_16.o: update_state_16.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_17.o: update_state_17.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_18.o: update_state_18.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_19.o: update_state_19.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_10.o: update_state_10.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs8.o: observer_obs8.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs7.o: observer_obs7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs6.o: observer_obs6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs5.o: observer_obs5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs4.o: observer_obs4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs3.o: observer_obs3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs2.o: observer_obs2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs1.o: observer_obs1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_obs0.o: observer_obs0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_done.o: observer_done.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_sat.o: observer_sat.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example21/copilot-sbv-codegen/README b/example21/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example21/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example21/copilot-sbv-codegen/copilot.h b/example21/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..af5dd634 --- /dev/null +++ b/example21/copilot-sbv-codegen/copilot.h @@ -0,0 +1,34 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool obs8; +extern bool obs7; +extern bool obs6; +extern bool obs5; +extern bool obs4; +extern bool obs3; +extern bool obs2; +extern bool obs1; +extern bool obs0; +extern bool done; +extern bool sat; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example21/copilot-sbv-codegen/copilot.mk b/example21/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example21/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example21/copilot-sbv-codegen/driver.c b/example21/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..e7f33f9c --- /dev/null +++ b/example21/copilot-sbv-codegen/driver.c @@ -0,0 +1,370 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool obs8; +SBool obs7; +SBool obs6; +SBool obs5; +SBool obs4; +SBool obs3; +SBool obs2; +SBool obs1; +SBool obs0; +SBool done; +SBool sat; + +/* Variables */ +SBool tmp_0 = true; +SBool tmp_1 = true; +SBool tmp_2 = true; +SBool tmp_3 = true; +SBool tmp_4 = true; +SBool tmp_5 = true; +SBool tmp_6 = true; +SBool tmp_7 = true; +SBool tmp_8 = true; +SWord64 tmp_9 = 1; +SBool tmp_10 = false; +SBool tmp_11 = true; +SBool tmp_12 = true; +SBool tmp_13 = true; +SBool tmp_14 = true; +SBool tmp_15 = true; +SBool tmp_16 = true; +SBool tmp_17 = true; +SBool tmp_18 = true; +SBool tmp_19 = true; +SBool queue_0[2] = { true, false }; +SBool queue_1[4] = { true, false, false, false }; +SBool queue_2[8] = { true, false, false, false, false, false, false, false }; +SBool queue_3[16] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_4[32] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_5[64] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_6[128] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_7[256] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_8[512] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SWord64 queue_9[1] = { 1 }; +SBool queue_10[1] = { false }; +SBool queue_11[512] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_12[256] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_13[128] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_14[64] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_15[32] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_16[16] = { true, false, false, false, false, false, false, false, false, false, false, false, false, false, false, false }; +SBool queue_17[8] = { true, false, false, false, false, false, false, false }; +SBool queue_18[4] = { true, false, false, false }; +SBool queue_19[2] = { true, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord32 ptr_7 = 0; +SWord32 ptr_8 = 0; +SWord32 ptr_9 = 0; +SWord32 ptr_10 = 0; +SWord32 ptr_11 = 0; +SWord32 ptr_12 = 0; +SWord32 ptr_13 = 0; +SWord32 ptr_14 = 0; +SWord32 ptr_15 = 0; +SWord32 ptr_16 = 0; +SWord32 ptr_17 = 0; +SWord32 ptr_18 = 0; +SWord32 ptr_19 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 2 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 1 )); + global invariant a_bound_ptr_1: ptr_1 < 4 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 3 )); + global invariant a_bound_ptr_2: ptr_2 < 8 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 7 )); + global invariant a_bound_ptr_3: ptr_3 < 16 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 15 )); + global invariant a_bound_ptr_4: ptr_4 < 32 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 31 )); + global invariant a_bound_ptr_5: ptr_5 < 64 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 63 )); + global invariant a_bound_ptr_6: ptr_6 < 128 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 127 )); + global invariant a_bound_ptr_7: ptr_7 < 256 ; + global invariant a_pos_ptr_7: ptr_7 >= 0 ; + global invariant a_valid_ptr_7: \valid (queue_7 + (0.. 255 )); + global invariant a_bound_ptr_8: ptr_8 < 512 ; + global invariant a_pos_ptr_8: ptr_8 >= 0 ; + global invariant a_valid_ptr_8: \valid (queue_8 + (0.. 511 )); + global invariant a_bound_ptr_9: ptr_9 < 1 ; + global invariant a_pos_ptr_9: ptr_9 >= 0 ; + global invariant a_valid_ptr_9: \valid (queue_9 + (0.. 0 )); + global invariant a_bound_ptr_10: ptr_10 < 1 ; + global invariant a_pos_ptr_10: ptr_10 >= 0 ; + global invariant a_valid_ptr_10: \valid (queue_10 + (0.. 0 )); + global invariant a_bound_ptr_11: ptr_11 < 512 ; + global invariant a_pos_ptr_11: ptr_11 >= 0 ; + global invariant a_valid_ptr_11: \valid (queue_11 + (0.. 511 )); + global invariant a_bound_ptr_12: ptr_12 < 256 ; + global invariant a_pos_ptr_12: ptr_12 >= 0 ; + global invariant a_valid_ptr_12: \valid (queue_12 + (0.. 255 )); + global invariant a_bound_ptr_13: ptr_13 < 128 ; + global invariant a_pos_ptr_13: ptr_13 >= 0 ; + global invariant a_valid_ptr_13: \valid (queue_13 + (0.. 127 )); + global invariant a_bound_ptr_14: ptr_14 < 64 ; + global invariant a_pos_ptr_14: ptr_14 >= 0 ; + global invariant a_valid_ptr_14: \valid (queue_14 + (0.. 63 )); + global invariant a_bound_ptr_15: ptr_15 < 32 ; + global invariant a_pos_ptr_15: ptr_15 >= 0 ; + global invariant a_valid_ptr_15: \valid (queue_15 + (0.. 31 )); + global invariant a_bound_ptr_16: ptr_16 < 16 ; + global invariant a_pos_ptr_16: ptr_16 >= 0 ; + global invariant a_valid_ptr_16: \valid (queue_16 + (0.. 15 )); + global invariant a_bound_ptr_17: ptr_17 < 8 ; + global invariant a_pos_ptr_17: ptr_17 >= 0 ; + global invariant a_valid_ptr_17: \valid (queue_17 + (0.. 7 )); + global invariant a_bound_ptr_18: ptr_18 < 4 ; + global invariant a_pos_ptr_18: ptr_18 >= 0 ; + global invariant a_valid_ptr_18: \valid (queue_18 + (0.. 3 )); + global invariant a_bound_ptr_19: ptr_19 < 2 ; + global invariant a_pos_ptr_19: ptr_19 >= 0 ; + global invariant a_valid_ptr_19: \valid (queue_19 + (0.. 1 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns done; + assigns obs0; + assigns obs1; + assigns obs2; + assigns obs3; + assigns obs4; + assigns obs5; + assigns obs6; + assigns obs7; + assigns obs8; + assigns sat; + */ +void updateObservers(void) { + done = observer_done(queue_9, ptr_9); + obs0 = observer_obs0(queue_8, ptr_8); + obs1 = observer_obs1(queue_7, ptr_7); + obs2 = observer_obs2(queue_6, ptr_6); + obs3 = observer_obs3(queue_5, ptr_5); + obs4 = observer_obs4(queue_4, ptr_4); + obs5 = observer_obs5(queue_3, ptr_3); + obs6 = observer_obs6(queue_2, ptr_2); + obs7 = observer_obs7(queue_1, ptr_1); + obs8 = observer_obs8(queue_0, ptr_0); + sat = observer_sat(queue_10, ptr_10); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + assigns tmp_3; + assigns tmp_4; + assigns tmp_5; + assigns tmp_6; + assigns tmp_7; + assigns tmp_8; + assigns tmp_9; + assigns tmp_11; + assigns tmp_12; + assigns tmp_13; + assigns tmp_14; + assigns tmp_15; + assigns tmp_16; + assigns tmp_17; + assigns tmp_18; + assigns tmp_19; + assigns tmp_10; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_2 = update_state_2(queue_2, ptr_2); + tmp_3 = update_state_3(queue_3, ptr_3); + tmp_4 = update_state_4(queue_4, ptr_4); + tmp_5 = update_state_5(queue_5, ptr_5); + tmp_6 = update_state_6(queue_6, ptr_6); + tmp_7 = update_state_7(queue_7, ptr_7); + tmp_8 = update_state_8(queue_8, ptr_8); + tmp_9 = update_state_9(queue_9, ptr_9); + tmp_11 = update_state_11(queue_11, ptr_11); + tmp_12 = update_state_12(queue_12, ptr_12); + tmp_13 = update_state_13(queue_13, ptr_13); + tmp_14 = update_state_14(queue_14, ptr_14); + tmp_15 = update_state_15(queue_15, ptr_15); + tmp_16 = update_state_16(queue_16, ptr_16); + tmp_17 = update_state_17(queue_17, ptr_17); + tmp_18 = update_state_18(queue_18, ptr_18); + tmp_19 = update_state_19(queue_19, ptr_19); + tmp_10 = update_state_10(queue_11, ptr_11, queue_12, ptr_12, queue_13, ptr_13, queue_14, ptr_14, queue_15, ptr_15, queue_16, ptr_16, queue_17, ptr_17, queue_18, ptr_18, queue_19, ptr_19, queue_10, ptr_10); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + assigns queue_7[ptr_7]; + ensures queue_7[ptr_7] == tmp_7; + assigns queue_8[ptr_8]; + ensures queue_8[ptr_8] == tmp_8; + assigns queue_9[ptr_9]; + ensures queue_9[ptr_9] == tmp_9; + assigns queue_10[ptr_10]; + ensures queue_10[ptr_10] == tmp_10; + assigns queue_11[ptr_11]; + ensures queue_11[ptr_11] == tmp_11; + assigns queue_12[ptr_12]; + ensures queue_12[ptr_12] == tmp_12; + assigns queue_13[ptr_13]; + ensures queue_13[ptr_13] == tmp_13; + assigns queue_14[ptr_14]; + ensures queue_14[ptr_14] == tmp_14; + assigns queue_15[ptr_15]; + ensures queue_15[ptr_15] == tmp_15; + assigns queue_16[ptr_16]; + ensures queue_16[ptr_16] == tmp_16; + assigns queue_17[ptr_17]; + ensures queue_17[ptr_17] == tmp_17; + assigns queue_18[ptr_18]; + ensures queue_18[ptr_18] == tmp_18; + assigns queue_19[ptr_19]; + ensures queue_19[ptr_19] == tmp_19; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; + queue_7[ptr_7] = tmp_7; + queue_8[ptr_8] = tmp_8; + queue_9[ptr_9] = tmp_9; + queue_10[ptr_10] = tmp_10; + queue_11[ptr_11] = tmp_11; + queue_12[ptr_12] = tmp_12; + queue_13[ptr_13] = tmp_13; + queue_14[ptr_14] = tmp_14; + queue_15[ptr_15] = tmp_15; + queue_16[ptr_16] = tmp_16; + queue_17[ptr_17] = tmp_17; + queue_18[ptr_18] = tmp_18; + queue_19[ptr_19] = tmp_19; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 2; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 4; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 8; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 16; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 32; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 64; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 128; + assigns ptr_7; + ensures ptr_7 == (\old (ptr_7 ) + 1) % 256; + assigns ptr_8; + ensures ptr_8 == (\old (ptr_8 ) + 1) % 512; + assigns ptr_9; + ensures ptr_9 == (\old (ptr_9 ) + 1) % 1; + assigns ptr_10; + ensures ptr_10 == (\old (ptr_10 ) + 1) % 1; + assigns ptr_11; + ensures ptr_11 == (\old (ptr_11 ) + 1) % 512; + assigns ptr_12; + ensures ptr_12 == (\old (ptr_12 ) + 1) % 256; + assigns ptr_13; + ensures ptr_13 == (\old (ptr_13 ) + 1) % 128; + assigns ptr_14; + ensures ptr_14 == (\old (ptr_14 ) + 1) % 64; + assigns ptr_15; + ensures ptr_15 == (\old (ptr_15 ) + 1) % 32; + assigns ptr_16; + ensures ptr_16 == (\old (ptr_16 ) + 1) % 16; + assigns ptr_17; + ensures ptr_17 == (\old (ptr_17 ) + 1) % 8; + assigns ptr_18; + ensures ptr_18 == (\old (ptr_18 ) + 1) % 4; + assigns ptr_19; + ensures ptr_19 == (\old (ptr_19 ) + 1) % 2; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 2; + ptr_1 = (ptr_1 + 1) % 4; + ptr_2 = (ptr_2 + 1) % 8; + ptr_3 = (ptr_3 + 1) % 16; + ptr_4 = (ptr_4 + 1) % 32; + ptr_5 = (ptr_5 + 1) % 64; + ptr_6 = (ptr_6 + 1) % 128; + ptr_7 = (ptr_7 + 1) % 256; + ptr_8 = (ptr_8 + 1) % 512; + ptr_9 = (ptr_9 + 1) % 1; + ptr_10 = (ptr_10 + 1) % 1; + ptr_11 = (ptr_11 + 1) % 512; + ptr_12 = (ptr_12 + 1) % 256; + ptr_13 = (ptr_13 + 1) % 128; + ptr_14 = (ptr_14 + 1) % 64; + ptr_15 = (ptr_15 + 1) % 32; + ptr_16 = (ptr_16 + 1) % 16; + ptr_17 = (ptr_17 + 1) % 8; + ptr_18 = (ptr_18 + 1) % 4; + ptr_19 = (ptr_19 + 1) % 2; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example21/copilot-sbv-codegen/internal.h b/example21/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..e24f6720 --- /dev/null +++ b/example21/copilot-sbv-codegen/internal.h @@ -0,0 +1,72 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2); +SBool update_state_3(const SBool *queue_3, const SWord32 ptr_3); +SBool update_state_4(const SBool *queue_4, const SWord32 ptr_4); +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5); +SBool update_state_6(const SBool *queue_6, const SWord32 ptr_6); +SBool update_state_7(const SBool *queue_7, const SWord32 ptr_7); +SBool update_state_8(const SBool *queue_8, const SWord32 ptr_8); +SWord64 update_state_9(const SWord64 *queue_9, + const SWord32 ptr_9); +SBool update_state_11(const SBool *queue_11, const SWord32 ptr_11); +SBool update_state_12(const SBool *queue_12, const SWord32 ptr_12); +SBool update_state_13(const SBool *queue_13, const SWord32 ptr_13); +SBool update_state_14(const SBool *queue_14, const SWord32 ptr_14); +SBool update_state_15(const SBool *queue_15, const SWord32 ptr_15); +SBool update_state_16(const SBool *queue_16, const SWord32 ptr_16); +SBool update_state_17(const SBool *queue_17, const SWord32 ptr_17); +SBool update_state_18(const SBool *queue_18, const SWord32 ptr_18); +SBool update_state_19(const SBool *queue_19, const SWord32 ptr_19); +SBool update_state_10(const SBool *queue_11, const SWord32 ptr_11, + const SBool *queue_12, const SWord32 ptr_12, const SBool *queue_13, + const SWord32 ptr_13, const SBool *queue_14, const SWord32 ptr_14, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_10, const SWord32 ptr_10); +SBool observer_obs8(const SBool *queue_0, const SWord32 ptr_0); +SBool observer_obs7(const SBool *queue_1, const SWord32 ptr_1); +SBool observer_obs6(const SBool *queue_2, const SWord32 ptr_2); +SBool observer_obs5(const SBool *queue_3, const SWord32 ptr_3); +SBool observer_obs4(const SBool *queue_4, const SWord32 ptr_4); +SBool observer_obs3(const SBool *queue_5, const SWord32 ptr_5); +SBool observer_obs2(const SBool *queue_6, const SWord32 ptr_6); +SBool observer_obs1(const SBool *queue_7, const SWord32 ptr_7); +SBool observer_obs0(const SBool *queue_8, const SWord32 ptr_8); +SBool observer_done(const SWord64 *queue_9, const SWord32 ptr_9); +SBool observer_sat(const SBool *queue_10, const SWord32 ptr_10); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example21/copilot-sbv-codegen/observer_done.c b/example21/copilot-sbv-codegen/observer_done.c new file mode 100644 index 00000000..1b89e756 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_done.c @@ -0,0 +1,25 @@ +/* File: "observer_done.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (s9 == 512) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_9[ptr_9] == 512); +*/ +SBool observer_done(const SWord64 *queue_9, const SWord32 ptr_9) +{ + const SWord64 s0 = queue_9[0]; + const SWord32 s1 = ptr_9; + const SBool s3 = s0 == 0x0000000000000200ULL; + + return s3; +} diff --git a/example21/copilot-sbv-codegen/observer_obs0.c b/example21/copilot-sbv-codegen/observer_obs0.c new file mode 100644 index 00000000..0c57a428 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs0.c @@ -0,0 +1,586 @@ +/* File: "observer_obs0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s8 +*/ +/*@ + assigns \nothing; + ensures \result == queue_8[ptr_8]; +*/ +SBool observer_obs0(const SBool *queue_8, const SWord32 ptr_8) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SBool s6 = queue_8[6]; + const SBool s7 = queue_8[7]; + const SBool s8 = queue_8[8]; + const SBool s9 = queue_8[9]; + const SBool s10 = queue_8[10]; + const SBool s11 = queue_8[11]; + const SBool s12 = queue_8[12]; + const SBool s13 = queue_8[13]; + const SBool s14 = queue_8[14]; + const SBool s15 = queue_8[15]; + const SBool s16 = queue_8[16]; + const SBool s17 = queue_8[17]; + const SBool s18 = queue_8[18]; + const SBool s19 = queue_8[19]; + const SBool s20 = queue_8[20]; + const SBool s21 = queue_8[21]; + const SBool s22 = queue_8[22]; + const SBool s23 = queue_8[23]; + const SBool s24 = queue_8[24]; + const SBool s25 = queue_8[25]; + const SBool s26 = queue_8[26]; + const SBool s27 = queue_8[27]; + const SBool s28 = queue_8[28]; + const SBool s29 = queue_8[29]; + const SBool s30 = queue_8[30]; + const SBool s31 = queue_8[31]; + const SBool s32 = queue_8[32]; + const SBool s33 = queue_8[33]; + const SBool s34 = queue_8[34]; + const SBool s35 = queue_8[35]; + const SBool s36 = queue_8[36]; + const SBool s37 = queue_8[37]; + const SBool s38 = queue_8[38]; + const SBool s39 = queue_8[39]; + const SBool s40 = queue_8[40]; + const SBool s41 = queue_8[41]; + const SBool s42 = queue_8[42]; + const SBool s43 = queue_8[43]; + const SBool s44 = queue_8[44]; + const SBool s45 = queue_8[45]; + const SBool s46 = queue_8[46]; + const SBool s47 = queue_8[47]; + const SBool s48 = queue_8[48]; + const SBool s49 = queue_8[49]; + const SBool s50 = queue_8[50]; + const SBool s51 = queue_8[51]; + const SBool s52 = queue_8[52]; + const SBool s53 = queue_8[53]; + const SBool s54 = queue_8[54]; + const SBool s55 = queue_8[55]; + const SBool s56 = queue_8[56]; + const SBool s57 = queue_8[57]; + const SBool s58 = queue_8[58]; + const SBool s59 = queue_8[59]; + const SBool s60 = queue_8[60]; + const SBool s61 = queue_8[61]; + const SBool s62 = queue_8[62]; + const SBool s63 = queue_8[63]; + const SBool s64 = queue_8[64]; + const SBool s65 = queue_8[65]; + const SBool s66 = queue_8[66]; + const SBool s67 = queue_8[67]; + const SBool s68 = queue_8[68]; + const SBool s69 = queue_8[69]; + const SBool s70 = queue_8[70]; + const SBool s71 = queue_8[71]; + const SBool s72 = queue_8[72]; + const SBool s73 = queue_8[73]; + const SBool s74 = queue_8[74]; + const SBool s75 = queue_8[75]; + const SBool s76 = queue_8[76]; + const SBool s77 = queue_8[77]; + const SBool s78 = queue_8[78]; + const SBool s79 = queue_8[79]; + const SBool s80 = queue_8[80]; + const SBool s81 = queue_8[81]; + const SBool s82 = queue_8[82]; + const SBool s83 = queue_8[83]; + const SBool s84 = queue_8[84]; + const SBool s85 = queue_8[85]; + const SBool s86 = queue_8[86]; + const SBool s87 = queue_8[87]; + const SBool s88 = queue_8[88]; + const SBool s89 = queue_8[89]; + const SBool s90 = queue_8[90]; + const SBool s91 = queue_8[91]; + const SBool s92 = queue_8[92]; + const SBool s93 = queue_8[93]; + const SBool s94 = queue_8[94]; + const SBool s95 = queue_8[95]; + const SBool s96 = queue_8[96]; + const SBool s97 = queue_8[97]; + const SBool s98 = queue_8[98]; + const SBool s99 = queue_8[99]; + const SBool s100 = queue_8[100]; + const SBool s101 = queue_8[101]; + const SBool s102 = queue_8[102]; + const SBool s103 = queue_8[103]; + const SBool s104 = queue_8[104]; + const SBool s105 = queue_8[105]; + const SBool s106 = queue_8[106]; + const SBool s107 = queue_8[107]; + const SBool s108 = queue_8[108]; + const SBool s109 = queue_8[109]; + const SBool s110 = queue_8[110]; + const SBool s111 = queue_8[111]; + const SBool s112 = queue_8[112]; + const SBool s113 = queue_8[113]; + const SBool s114 = queue_8[114]; + const SBool s115 = queue_8[115]; + const SBool s116 = queue_8[116]; + const SBool s117 = queue_8[117]; + const SBool s118 = queue_8[118]; + const SBool s119 = queue_8[119]; + const SBool s120 = queue_8[120]; + const SBool s121 = queue_8[121]; + const SBool s122 = queue_8[122]; + const SBool s123 = queue_8[123]; + const SBool s124 = queue_8[124]; + const SBool s125 = queue_8[125]; + const SBool s126 = queue_8[126]; + const SBool s127 = queue_8[127]; + const SBool s128 = queue_8[128]; + const SBool s129 = queue_8[129]; + const SBool s130 = queue_8[130]; + const SBool s131 = queue_8[131]; + const SBool s132 = queue_8[132]; + const SBool s133 = queue_8[133]; + const SBool s134 = queue_8[134]; + const SBool s135 = queue_8[135]; + const SBool s136 = queue_8[136]; + const SBool s137 = queue_8[137]; + const SBool s138 = queue_8[138]; + const SBool s139 = queue_8[139]; + const SBool s140 = queue_8[140]; + const SBool s141 = queue_8[141]; + const SBool s142 = queue_8[142]; + const SBool s143 = queue_8[143]; + const SBool s144 = queue_8[144]; + const SBool s145 = queue_8[145]; + const SBool s146 = queue_8[146]; + const SBool s147 = queue_8[147]; + const SBool s148 = queue_8[148]; + const SBool s149 = queue_8[149]; + const SBool s150 = queue_8[150]; + const SBool s151 = queue_8[151]; + const SBool s152 = queue_8[152]; + const SBool s153 = queue_8[153]; + const SBool s154 = queue_8[154]; + const SBool s155 = queue_8[155]; + const SBool s156 = queue_8[156]; + const SBool s157 = queue_8[157]; + const SBool s158 = queue_8[158]; + const SBool s159 = queue_8[159]; + const SBool s160 = queue_8[160]; + const SBool s161 = queue_8[161]; + const SBool s162 = queue_8[162]; + const SBool s163 = queue_8[163]; + const SBool s164 = queue_8[164]; + const SBool s165 = queue_8[165]; + const SBool s166 = queue_8[166]; + const SBool s167 = queue_8[167]; + const SBool s168 = queue_8[168]; + const SBool s169 = queue_8[169]; + const SBool s170 = queue_8[170]; + const SBool s171 = queue_8[171]; + const SBool s172 = queue_8[172]; + const SBool s173 = queue_8[173]; + const SBool s174 = queue_8[174]; + const SBool s175 = queue_8[175]; + const SBool s176 = queue_8[176]; + const SBool s177 = queue_8[177]; + const SBool s178 = queue_8[178]; + const SBool s179 = queue_8[179]; + const SBool s180 = queue_8[180]; + const SBool s181 = queue_8[181]; + const SBool s182 = queue_8[182]; + const SBool s183 = queue_8[183]; + const SBool s184 = queue_8[184]; + const SBool s185 = queue_8[185]; + const SBool s186 = queue_8[186]; + const SBool s187 = queue_8[187]; + const SBool s188 = queue_8[188]; + const SBool s189 = queue_8[189]; + const SBool s190 = queue_8[190]; + const SBool s191 = queue_8[191]; + const SBool s192 = queue_8[192]; + const SBool s193 = queue_8[193]; + const SBool s194 = queue_8[194]; + const SBool s195 = queue_8[195]; + const SBool s196 = queue_8[196]; + const SBool s197 = queue_8[197]; + const SBool s198 = queue_8[198]; + const SBool s199 = queue_8[199]; + const SBool s200 = queue_8[200]; + const SBool s201 = queue_8[201]; + const SBool s202 = queue_8[202]; + const SBool s203 = queue_8[203]; + const SBool s204 = queue_8[204]; + const SBool s205 = queue_8[205]; + const SBool s206 = queue_8[206]; + const SBool s207 = queue_8[207]; + const SBool s208 = queue_8[208]; + const SBool s209 = queue_8[209]; + const SBool s210 = queue_8[210]; + const SBool s211 = queue_8[211]; + const SBool s212 = queue_8[212]; + const SBool s213 = queue_8[213]; + const SBool s214 = queue_8[214]; + const SBool s215 = queue_8[215]; + const SBool s216 = queue_8[216]; + const SBool s217 = queue_8[217]; + const SBool s218 = queue_8[218]; + const SBool s219 = queue_8[219]; + const SBool s220 = queue_8[220]; + const SBool s221 = queue_8[221]; + const SBool s222 = queue_8[222]; + const SBool s223 = queue_8[223]; + const SBool s224 = queue_8[224]; + const SBool s225 = queue_8[225]; + const SBool s226 = queue_8[226]; + const SBool s227 = queue_8[227]; + const SBool s228 = queue_8[228]; + const SBool s229 = queue_8[229]; + const SBool s230 = queue_8[230]; + const SBool s231 = queue_8[231]; + const SBool s232 = queue_8[232]; + const SBool s233 = queue_8[233]; + const SBool s234 = queue_8[234]; + const SBool s235 = queue_8[235]; + const SBool s236 = queue_8[236]; + const SBool s237 = queue_8[237]; + const SBool s238 = queue_8[238]; + const SBool s239 = queue_8[239]; + const SBool s240 = queue_8[240]; + const SBool s241 = queue_8[241]; + const SBool s242 = queue_8[242]; + const SBool s243 = queue_8[243]; + const SBool s244 = queue_8[244]; + const SBool s245 = queue_8[245]; + const SBool s246 = queue_8[246]; + const SBool s247 = queue_8[247]; + const SBool s248 = queue_8[248]; + const SBool s249 = queue_8[249]; + const SBool s250 = queue_8[250]; + const SBool s251 = queue_8[251]; + const SBool s252 = queue_8[252]; + const SBool s253 = queue_8[253]; + const SBool s254 = queue_8[254]; + const SBool s255 = queue_8[255]; + const SBool s256 = queue_8[256]; + const SBool s257 = queue_8[257]; + const SBool s258 = queue_8[258]; + const SBool s259 = queue_8[259]; + const SBool s260 = queue_8[260]; + const SBool s261 = queue_8[261]; + const SBool s262 = queue_8[262]; + const SBool s263 = queue_8[263]; + const SBool s264 = queue_8[264]; + const SBool s265 = queue_8[265]; + const SBool s266 = queue_8[266]; + const SBool s267 = queue_8[267]; + const SBool s268 = queue_8[268]; + const SBool s269 = queue_8[269]; + const SBool s270 = queue_8[270]; + const SBool s271 = queue_8[271]; + const SBool s272 = queue_8[272]; + const SBool s273 = queue_8[273]; + const SBool s274 = queue_8[274]; + const SBool s275 = queue_8[275]; + const SBool s276 = queue_8[276]; + const SBool s277 = queue_8[277]; + const SBool s278 = queue_8[278]; + const SBool s279 = queue_8[279]; + const SBool s280 = queue_8[280]; + const SBool s281 = queue_8[281]; + const SBool s282 = queue_8[282]; + const SBool s283 = queue_8[283]; + const SBool s284 = queue_8[284]; + const SBool s285 = queue_8[285]; + const SBool s286 = queue_8[286]; + const SBool s287 = queue_8[287]; + const SBool s288 = queue_8[288]; + const SBool s289 = queue_8[289]; + const SBool s290 = queue_8[290]; + const SBool s291 = queue_8[291]; + const SBool s292 = queue_8[292]; + const SBool s293 = queue_8[293]; + const SBool s294 = queue_8[294]; + const SBool s295 = queue_8[295]; + const SBool s296 = queue_8[296]; + const SBool s297 = queue_8[297]; + const SBool s298 = queue_8[298]; + const SBool s299 = queue_8[299]; + const SBool s300 = queue_8[300]; + const SBool s301 = queue_8[301]; + const SBool s302 = queue_8[302]; + const SBool s303 = queue_8[303]; + const SBool s304 = queue_8[304]; + const SBool s305 = queue_8[305]; + const SBool s306 = queue_8[306]; + const SBool s307 = queue_8[307]; + const SBool s308 = queue_8[308]; + const SBool s309 = queue_8[309]; + const SBool s310 = queue_8[310]; + const SBool s311 = queue_8[311]; + const SBool s312 = queue_8[312]; + const SBool s313 = queue_8[313]; + const SBool s314 = queue_8[314]; + const SBool s315 = queue_8[315]; + const SBool s316 = queue_8[316]; + const SBool s317 = queue_8[317]; + const SBool s318 = queue_8[318]; + const SBool s319 = queue_8[319]; + const SBool s320 = queue_8[320]; + const SBool s321 = queue_8[321]; + const SBool s322 = queue_8[322]; + const SBool s323 = queue_8[323]; + const SBool s324 = queue_8[324]; + const SBool s325 = queue_8[325]; + const SBool s326 = queue_8[326]; + const SBool s327 = queue_8[327]; + const SBool s328 = queue_8[328]; + const SBool s329 = queue_8[329]; + const SBool s330 = queue_8[330]; + const SBool s331 = queue_8[331]; + const SBool s332 = queue_8[332]; + const SBool s333 = queue_8[333]; + const SBool s334 = queue_8[334]; + const SBool s335 = queue_8[335]; + const SBool s336 = queue_8[336]; + const SBool s337 = queue_8[337]; + const SBool s338 = queue_8[338]; + const SBool s339 = queue_8[339]; + const SBool s340 = queue_8[340]; + const SBool s341 = queue_8[341]; + const SBool s342 = queue_8[342]; + const SBool s343 = queue_8[343]; + const SBool s344 = queue_8[344]; + const SBool s345 = queue_8[345]; + const SBool s346 = queue_8[346]; + const SBool s347 = queue_8[347]; + const SBool s348 = queue_8[348]; + const SBool s349 = queue_8[349]; + const SBool s350 = queue_8[350]; + const SBool s351 = queue_8[351]; + const SBool s352 = queue_8[352]; + const SBool s353 = queue_8[353]; + const SBool s354 = queue_8[354]; + const SBool s355 = queue_8[355]; + const SBool s356 = queue_8[356]; + const SBool s357 = queue_8[357]; + const SBool s358 = queue_8[358]; + const SBool s359 = queue_8[359]; + const SBool s360 = queue_8[360]; + const SBool s361 = queue_8[361]; + const SBool s362 = queue_8[362]; + const SBool s363 = queue_8[363]; + const SBool s364 = queue_8[364]; + const SBool s365 = queue_8[365]; + const SBool s366 = queue_8[366]; + const SBool s367 = queue_8[367]; + const SBool s368 = queue_8[368]; + const SBool s369 = queue_8[369]; + const SBool s370 = queue_8[370]; + const SBool s371 = queue_8[371]; + const SBool s372 = queue_8[372]; + const SBool s373 = queue_8[373]; + const SBool s374 = queue_8[374]; + const SBool s375 = queue_8[375]; + const SBool s376 = queue_8[376]; + const SBool s377 = queue_8[377]; + const SBool s378 = queue_8[378]; + const SBool s379 = queue_8[379]; + const SBool s380 = queue_8[380]; + const SBool s381 = queue_8[381]; + const SBool s382 = queue_8[382]; + const SBool s383 = queue_8[383]; + const SBool s384 = queue_8[384]; + const SBool s385 = queue_8[385]; + const SBool s386 = queue_8[386]; + const SBool s387 = queue_8[387]; + const SBool s388 = queue_8[388]; + const SBool s389 = queue_8[389]; + const SBool s390 = queue_8[390]; + const SBool s391 = queue_8[391]; + const SBool s392 = queue_8[392]; + const SBool s393 = queue_8[393]; + const SBool s394 = queue_8[394]; + const SBool s395 = queue_8[395]; + const SBool s396 = queue_8[396]; + const SBool s397 = queue_8[397]; + const SBool s398 = queue_8[398]; + const SBool s399 = queue_8[399]; + const SBool s400 = queue_8[400]; + const SBool s401 = queue_8[401]; + const SBool s402 = queue_8[402]; + const SBool s403 = queue_8[403]; + const SBool s404 = queue_8[404]; + const SBool s405 = queue_8[405]; + const SBool s406 = queue_8[406]; + const SBool s407 = queue_8[407]; + const SBool s408 = queue_8[408]; + const SBool s409 = queue_8[409]; + const SBool s410 = queue_8[410]; + const SBool s411 = queue_8[411]; + const SBool s412 = queue_8[412]; + const SBool s413 = queue_8[413]; + const SBool s414 = queue_8[414]; + const SBool s415 = queue_8[415]; + const SBool s416 = queue_8[416]; + const SBool s417 = queue_8[417]; + const SBool s418 = queue_8[418]; + const SBool s419 = queue_8[419]; + const SBool s420 = queue_8[420]; + const SBool s421 = queue_8[421]; + const SBool s422 = queue_8[422]; + const SBool s423 = queue_8[423]; + const SBool s424 = queue_8[424]; + const SBool s425 = queue_8[425]; + const SBool s426 = queue_8[426]; + const SBool s427 = queue_8[427]; + const SBool s428 = queue_8[428]; + const SBool s429 = queue_8[429]; + const SBool s430 = queue_8[430]; + const SBool s431 = queue_8[431]; + const SBool s432 = queue_8[432]; + const SBool s433 = queue_8[433]; + const SBool s434 = queue_8[434]; + const SBool s435 = queue_8[435]; + const SBool s436 = queue_8[436]; + const SBool s437 = queue_8[437]; + const SBool s438 = queue_8[438]; + const SBool s439 = queue_8[439]; + const SBool s440 = queue_8[440]; + const SBool s441 = queue_8[441]; + const SBool s442 = queue_8[442]; + const SBool s443 = queue_8[443]; + const SBool s444 = queue_8[444]; + const SBool s445 = queue_8[445]; + const SBool s446 = queue_8[446]; + const SBool s447 = queue_8[447]; + const SBool s448 = queue_8[448]; + const SBool s449 = queue_8[449]; + const SBool s450 = queue_8[450]; + const SBool s451 = queue_8[451]; + const SBool s452 = queue_8[452]; + const SBool s453 = queue_8[453]; + const SBool s454 = queue_8[454]; + const SBool s455 = queue_8[455]; + const SBool s456 = queue_8[456]; + const SBool s457 = queue_8[457]; + const SBool s458 = queue_8[458]; + const SBool s459 = queue_8[459]; + const SBool s460 = queue_8[460]; + const SBool s461 = queue_8[461]; + const SBool s462 = queue_8[462]; + const SBool s463 = queue_8[463]; + const SBool s464 = queue_8[464]; + const SBool s465 = queue_8[465]; + const SBool s466 = queue_8[466]; + const SBool s467 = queue_8[467]; + const SBool s468 = queue_8[468]; + const SBool s469 = queue_8[469]; + const SBool s470 = queue_8[470]; + const SBool s471 = queue_8[471]; + const SBool s472 = queue_8[472]; + const SBool s473 = queue_8[473]; + const SBool s474 = queue_8[474]; + const SBool s475 = queue_8[475]; + const SBool s476 = queue_8[476]; + const SBool s477 = queue_8[477]; + const SBool s478 = queue_8[478]; + const SBool s479 = queue_8[479]; + const SBool s480 = queue_8[480]; + const SBool s481 = queue_8[481]; + const SBool s482 = queue_8[482]; + const SBool s483 = queue_8[483]; + const SBool s484 = queue_8[484]; + const SBool s485 = queue_8[485]; + const SBool s486 = queue_8[486]; + const SBool s487 = queue_8[487]; + const SBool s488 = queue_8[488]; + const SBool s489 = queue_8[489]; + const SBool s490 = queue_8[490]; + const SBool s491 = queue_8[491]; + const SBool s492 = queue_8[492]; + const SBool s493 = queue_8[493]; + const SBool s494 = queue_8[494]; + const SBool s495 = queue_8[495]; + const SBool s496 = queue_8[496]; + const SBool s497 = queue_8[497]; + const SBool s498 = queue_8[498]; + const SBool s499 = queue_8[499]; + const SBool s500 = queue_8[500]; + const SBool s501 = queue_8[501]; + const SBool s502 = queue_8[502]; + const SBool s503 = queue_8[503]; + const SBool s504 = queue_8[504]; + const SBool s505 = queue_8[505]; + const SBool s506 = queue_8[506]; + const SBool s507 = queue_8[507]; + const SBool s508 = queue_8[508]; + const SBool s509 = queue_8[509]; + const SBool s510 = queue_8[510]; + const SBool s511 = queue_8[511]; + const SWord32 s512 = ptr_8; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255, s256, s257, s258, s259, s260, s261, s262, s263, + s264, s265, s266, s267, s268, s269, s270, s271, s272, s273, s274, + s275, s276, s277, s278, s279, s280, s281, s282, s283, s284, s285, + s286, s287, s288, s289, s290, s291, s292, s293, s294, s295, s296, + s297, s298, s299, s300, s301, s302, s303, s304, s305, s306, s307, + s308, s309, s310, s311, s312, s313, s314, s315, s316, s317, s318, + s319, s320, s321, s322, s323, s324, s325, s326, s327, s328, s329, + s330, s331, s332, s333, s334, s335, s336, s337, s338, s339, s340, + s341, s342, s343, s344, s345, s346, s347, s348, s349, s350, s351, + s352, s353, s354, s355, s356, s357, s358, s359, s360, s361, s362, + s363, s364, s365, s366, s367, s368, s369, s370, s371, s372, s373, + s374, s375, s376, s377, s378, s379, s380, s381, s382, s383, s384, + s385, s386, s387, s388, s389, s390, s391, s392, s393, s394, s395, + s396, s397, s398, s399, s400, s401, s402, s403, s404, s405, s406, + s407, s408, s409, s410, s411, s412, s413, s414, s415, s416, s417, + s418, s419, s420, s421, s422, s423, s424, s425, s426, s427, s428, + s429, s430, s431, s432, s433, s434, s435, s436, s437, s438, s439, + s440, s441, s442, s443, s444, s445, s446, s447, s448, s449, s450, + s451, s452, s453, s454, s455, s456, s457, s458, s459, s460, s461, + s462, s463, s464, s465, s466, s467, s468, s469, s470, s471, s472, + s473, s474, s475, s476, s477, s478, s479, s480, s481, s482, s483, + s484, s485, s486, s487, s488, s489, s490, s491, s492, s493, s494, + s495, s496, s497, s498, s499, s500, s501, s502, s503, s504, s505, + s506, s507, s508, s509, s510, s511 + }; + const SWord32 s514 = (0x00000200UL == 0) ? s512 : (s512 % 0x00000200UL); + const SBool s515 = table0[s514]; + + return s515; +} diff --git a/example21/copilot-sbv-codegen/observer_obs1.c b/example21/copilot-sbv-codegen/observer_obs1.c new file mode 100644 index 00000000..7b4868b0 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs1.c @@ -0,0 +1,307 @@ +/* File: "observer_obs1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s7 +*/ +/*@ + assigns \nothing; + ensures \result == queue_7[ptr_7]; +*/ +SBool observer_obs1(const SBool *queue_7, const SWord32 ptr_7) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SBool s6 = queue_7[6]; + const SBool s7 = queue_7[7]; + const SBool s8 = queue_7[8]; + const SBool s9 = queue_7[9]; + const SBool s10 = queue_7[10]; + const SBool s11 = queue_7[11]; + const SBool s12 = queue_7[12]; + const SBool s13 = queue_7[13]; + const SBool s14 = queue_7[14]; + const SBool s15 = queue_7[15]; + const SBool s16 = queue_7[16]; + const SBool s17 = queue_7[17]; + const SBool s18 = queue_7[18]; + const SBool s19 = queue_7[19]; + const SBool s20 = queue_7[20]; + const SBool s21 = queue_7[21]; + const SBool s22 = queue_7[22]; + const SBool s23 = queue_7[23]; + const SBool s24 = queue_7[24]; + const SBool s25 = queue_7[25]; + const SBool s26 = queue_7[26]; + const SBool s27 = queue_7[27]; + const SBool s28 = queue_7[28]; + const SBool s29 = queue_7[29]; + const SBool s30 = queue_7[30]; + const SBool s31 = queue_7[31]; + const SBool s32 = queue_7[32]; + const SBool s33 = queue_7[33]; + const SBool s34 = queue_7[34]; + const SBool s35 = queue_7[35]; + const SBool s36 = queue_7[36]; + const SBool s37 = queue_7[37]; + const SBool s38 = queue_7[38]; + const SBool s39 = queue_7[39]; + const SBool s40 = queue_7[40]; + const SBool s41 = queue_7[41]; + const SBool s42 = queue_7[42]; + const SBool s43 = queue_7[43]; + const SBool s44 = queue_7[44]; + const SBool s45 = queue_7[45]; + const SBool s46 = queue_7[46]; + const SBool s47 = queue_7[47]; + const SBool s48 = queue_7[48]; + const SBool s49 = queue_7[49]; + const SBool s50 = queue_7[50]; + const SBool s51 = queue_7[51]; + const SBool s52 = queue_7[52]; + const SBool s53 = queue_7[53]; + const SBool s54 = queue_7[54]; + const SBool s55 = queue_7[55]; + const SBool s56 = queue_7[56]; + const SBool s57 = queue_7[57]; + const SBool s58 = queue_7[58]; + const SBool s59 = queue_7[59]; + const SBool s60 = queue_7[60]; + const SBool s61 = queue_7[61]; + const SBool s62 = queue_7[62]; + const SBool s63 = queue_7[63]; + const SBool s64 = queue_7[64]; + const SBool s65 = queue_7[65]; + const SBool s66 = queue_7[66]; + const SBool s67 = queue_7[67]; + const SBool s68 = queue_7[68]; + const SBool s69 = queue_7[69]; + const SBool s70 = queue_7[70]; + const SBool s71 = queue_7[71]; + const SBool s72 = queue_7[72]; + const SBool s73 = queue_7[73]; + const SBool s74 = queue_7[74]; + const SBool s75 = queue_7[75]; + const SBool s76 = queue_7[76]; + const SBool s77 = queue_7[77]; + const SBool s78 = queue_7[78]; + const SBool s79 = queue_7[79]; + const SBool s80 = queue_7[80]; + const SBool s81 = queue_7[81]; + const SBool s82 = queue_7[82]; + const SBool s83 = queue_7[83]; + const SBool s84 = queue_7[84]; + const SBool s85 = queue_7[85]; + const SBool s86 = queue_7[86]; + const SBool s87 = queue_7[87]; + const SBool s88 = queue_7[88]; + const SBool s89 = queue_7[89]; + const SBool s90 = queue_7[90]; + const SBool s91 = queue_7[91]; + const SBool s92 = queue_7[92]; + const SBool s93 = queue_7[93]; + const SBool s94 = queue_7[94]; + const SBool s95 = queue_7[95]; + const SBool s96 = queue_7[96]; + const SBool s97 = queue_7[97]; + const SBool s98 = queue_7[98]; + const SBool s99 = queue_7[99]; + const SBool s100 = queue_7[100]; + const SBool s101 = queue_7[101]; + const SBool s102 = queue_7[102]; + const SBool s103 = queue_7[103]; + const SBool s104 = queue_7[104]; + const SBool s105 = queue_7[105]; + const SBool s106 = queue_7[106]; + const SBool s107 = queue_7[107]; + const SBool s108 = queue_7[108]; + const SBool s109 = queue_7[109]; + const SBool s110 = queue_7[110]; + const SBool s111 = queue_7[111]; + const SBool s112 = queue_7[112]; + const SBool s113 = queue_7[113]; + const SBool s114 = queue_7[114]; + const SBool s115 = queue_7[115]; + const SBool s116 = queue_7[116]; + const SBool s117 = queue_7[117]; + const SBool s118 = queue_7[118]; + const SBool s119 = queue_7[119]; + const SBool s120 = queue_7[120]; + const SBool s121 = queue_7[121]; + const SBool s122 = queue_7[122]; + const SBool s123 = queue_7[123]; + const SBool s124 = queue_7[124]; + const SBool s125 = queue_7[125]; + const SBool s126 = queue_7[126]; + const SBool s127 = queue_7[127]; + const SBool s128 = queue_7[128]; + const SBool s129 = queue_7[129]; + const SBool s130 = queue_7[130]; + const SBool s131 = queue_7[131]; + const SBool s132 = queue_7[132]; + const SBool s133 = queue_7[133]; + const SBool s134 = queue_7[134]; + const SBool s135 = queue_7[135]; + const SBool s136 = queue_7[136]; + const SBool s137 = queue_7[137]; + const SBool s138 = queue_7[138]; + const SBool s139 = queue_7[139]; + const SBool s140 = queue_7[140]; + const SBool s141 = queue_7[141]; + const SBool s142 = queue_7[142]; + const SBool s143 = queue_7[143]; + const SBool s144 = queue_7[144]; + const SBool s145 = queue_7[145]; + const SBool s146 = queue_7[146]; + const SBool s147 = queue_7[147]; + const SBool s148 = queue_7[148]; + const SBool s149 = queue_7[149]; + const SBool s150 = queue_7[150]; + const SBool s151 = queue_7[151]; + const SBool s152 = queue_7[152]; + const SBool s153 = queue_7[153]; + const SBool s154 = queue_7[154]; + const SBool s155 = queue_7[155]; + const SBool s156 = queue_7[156]; + const SBool s157 = queue_7[157]; + const SBool s158 = queue_7[158]; + const SBool s159 = queue_7[159]; + const SBool s160 = queue_7[160]; + const SBool s161 = queue_7[161]; + const SBool s162 = queue_7[162]; + const SBool s163 = queue_7[163]; + const SBool s164 = queue_7[164]; + const SBool s165 = queue_7[165]; + const SBool s166 = queue_7[166]; + const SBool s167 = queue_7[167]; + const SBool s168 = queue_7[168]; + const SBool s169 = queue_7[169]; + const SBool s170 = queue_7[170]; + const SBool s171 = queue_7[171]; + const SBool s172 = queue_7[172]; + const SBool s173 = queue_7[173]; + const SBool s174 = queue_7[174]; + const SBool s175 = queue_7[175]; + const SBool s176 = queue_7[176]; + const SBool s177 = queue_7[177]; + const SBool s178 = queue_7[178]; + const SBool s179 = queue_7[179]; + const SBool s180 = queue_7[180]; + const SBool s181 = queue_7[181]; + const SBool s182 = queue_7[182]; + const SBool s183 = queue_7[183]; + const SBool s184 = queue_7[184]; + const SBool s185 = queue_7[185]; + const SBool s186 = queue_7[186]; + const SBool s187 = queue_7[187]; + const SBool s188 = queue_7[188]; + const SBool s189 = queue_7[189]; + const SBool s190 = queue_7[190]; + const SBool s191 = queue_7[191]; + const SBool s192 = queue_7[192]; + const SBool s193 = queue_7[193]; + const SBool s194 = queue_7[194]; + const SBool s195 = queue_7[195]; + const SBool s196 = queue_7[196]; + const SBool s197 = queue_7[197]; + const SBool s198 = queue_7[198]; + const SBool s199 = queue_7[199]; + const SBool s200 = queue_7[200]; + const SBool s201 = queue_7[201]; + const SBool s202 = queue_7[202]; + const SBool s203 = queue_7[203]; + const SBool s204 = queue_7[204]; + const SBool s205 = queue_7[205]; + const SBool s206 = queue_7[206]; + const SBool s207 = queue_7[207]; + const SBool s208 = queue_7[208]; + const SBool s209 = queue_7[209]; + const SBool s210 = queue_7[210]; + const SBool s211 = queue_7[211]; + const SBool s212 = queue_7[212]; + const SBool s213 = queue_7[213]; + const SBool s214 = queue_7[214]; + const SBool s215 = queue_7[215]; + const SBool s216 = queue_7[216]; + const SBool s217 = queue_7[217]; + const SBool s218 = queue_7[218]; + const SBool s219 = queue_7[219]; + const SBool s220 = queue_7[220]; + const SBool s221 = queue_7[221]; + const SBool s222 = queue_7[222]; + const SBool s223 = queue_7[223]; + const SBool s224 = queue_7[224]; + const SBool s225 = queue_7[225]; + const SBool s226 = queue_7[226]; + const SBool s227 = queue_7[227]; + const SBool s228 = queue_7[228]; + const SBool s229 = queue_7[229]; + const SBool s230 = queue_7[230]; + const SBool s231 = queue_7[231]; + const SBool s232 = queue_7[232]; + const SBool s233 = queue_7[233]; + const SBool s234 = queue_7[234]; + const SBool s235 = queue_7[235]; + const SBool s236 = queue_7[236]; + const SBool s237 = queue_7[237]; + const SBool s238 = queue_7[238]; + const SBool s239 = queue_7[239]; + const SBool s240 = queue_7[240]; + const SBool s241 = queue_7[241]; + const SBool s242 = queue_7[242]; + const SBool s243 = queue_7[243]; + const SBool s244 = queue_7[244]; + const SBool s245 = queue_7[245]; + const SBool s246 = queue_7[246]; + const SBool s247 = queue_7[247]; + const SBool s248 = queue_7[248]; + const SBool s249 = queue_7[249]; + const SBool s250 = queue_7[250]; + const SBool s251 = queue_7[251]; + const SBool s252 = queue_7[252]; + const SBool s253 = queue_7[253]; + const SBool s254 = queue_7[254]; + const SBool s255 = queue_7[255]; + const SWord32 s256 = ptr_7; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255 + }; + const SWord32 s258 = (0x00000100UL == 0) ? s256 : (s256 % 0x00000100UL); + const SBool s259 = table0[s258]; + + return s259; +} diff --git a/example21/copilot-sbv-codegen/observer_obs2.c b/example21/copilot-sbv-codegen/observer_obs2.c new file mode 100644 index 00000000..2b5fe8fe --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs2.c @@ -0,0 +1,167 @@ +/* File: "observer_obs2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s6 +*/ +/*@ + assigns \nothing; + ensures \result == queue_6[ptr_6]; +*/ +SBool observer_obs2(const SBool *queue_6, const SWord32 ptr_6) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SBool s6 = queue_6[6]; + const SBool s7 = queue_6[7]; + const SBool s8 = queue_6[8]; + const SBool s9 = queue_6[9]; + const SBool s10 = queue_6[10]; + const SBool s11 = queue_6[11]; + const SBool s12 = queue_6[12]; + const SBool s13 = queue_6[13]; + const SBool s14 = queue_6[14]; + const SBool s15 = queue_6[15]; + const SBool s16 = queue_6[16]; + const SBool s17 = queue_6[17]; + const SBool s18 = queue_6[18]; + const SBool s19 = queue_6[19]; + const SBool s20 = queue_6[20]; + const SBool s21 = queue_6[21]; + const SBool s22 = queue_6[22]; + const SBool s23 = queue_6[23]; + const SBool s24 = queue_6[24]; + const SBool s25 = queue_6[25]; + const SBool s26 = queue_6[26]; + const SBool s27 = queue_6[27]; + const SBool s28 = queue_6[28]; + const SBool s29 = queue_6[29]; + const SBool s30 = queue_6[30]; + const SBool s31 = queue_6[31]; + const SBool s32 = queue_6[32]; + const SBool s33 = queue_6[33]; + const SBool s34 = queue_6[34]; + const SBool s35 = queue_6[35]; + const SBool s36 = queue_6[36]; + const SBool s37 = queue_6[37]; + const SBool s38 = queue_6[38]; + const SBool s39 = queue_6[39]; + const SBool s40 = queue_6[40]; + const SBool s41 = queue_6[41]; + const SBool s42 = queue_6[42]; + const SBool s43 = queue_6[43]; + const SBool s44 = queue_6[44]; + const SBool s45 = queue_6[45]; + const SBool s46 = queue_6[46]; + const SBool s47 = queue_6[47]; + const SBool s48 = queue_6[48]; + const SBool s49 = queue_6[49]; + const SBool s50 = queue_6[50]; + const SBool s51 = queue_6[51]; + const SBool s52 = queue_6[52]; + const SBool s53 = queue_6[53]; + const SBool s54 = queue_6[54]; + const SBool s55 = queue_6[55]; + const SBool s56 = queue_6[56]; + const SBool s57 = queue_6[57]; + const SBool s58 = queue_6[58]; + const SBool s59 = queue_6[59]; + const SBool s60 = queue_6[60]; + const SBool s61 = queue_6[61]; + const SBool s62 = queue_6[62]; + const SBool s63 = queue_6[63]; + const SBool s64 = queue_6[64]; + const SBool s65 = queue_6[65]; + const SBool s66 = queue_6[66]; + const SBool s67 = queue_6[67]; + const SBool s68 = queue_6[68]; + const SBool s69 = queue_6[69]; + const SBool s70 = queue_6[70]; + const SBool s71 = queue_6[71]; + const SBool s72 = queue_6[72]; + const SBool s73 = queue_6[73]; + const SBool s74 = queue_6[74]; + const SBool s75 = queue_6[75]; + const SBool s76 = queue_6[76]; + const SBool s77 = queue_6[77]; + const SBool s78 = queue_6[78]; + const SBool s79 = queue_6[79]; + const SBool s80 = queue_6[80]; + const SBool s81 = queue_6[81]; + const SBool s82 = queue_6[82]; + const SBool s83 = queue_6[83]; + const SBool s84 = queue_6[84]; + const SBool s85 = queue_6[85]; + const SBool s86 = queue_6[86]; + const SBool s87 = queue_6[87]; + const SBool s88 = queue_6[88]; + const SBool s89 = queue_6[89]; + const SBool s90 = queue_6[90]; + const SBool s91 = queue_6[91]; + const SBool s92 = queue_6[92]; + const SBool s93 = queue_6[93]; + const SBool s94 = queue_6[94]; + const SBool s95 = queue_6[95]; + const SBool s96 = queue_6[96]; + const SBool s97 = queue_6[97]; + const SBool s98 = queue_6[98]; + const SBool s99 = queue_6[99]; + const SBool s100 = queue_6[100]; + const SBool s101 = queue_6[101]; + const SBool s102 = queue_6[102]; + const SBool s103 = queue_6[103]; + const SBool s104 = queue_6[104]; + const SBool s105 = queue_6[105]; + const SBool s106 = queue_6[106]; + const SBool s107 = queue_6[107]; + const SBool s108 = queue_6[108]; + const SBool s109 = queue_6[109]; + const SBool s110 = queue_6[110]; + const SBool s111 = queue_6[111]; + const SBool s112 = queue_6[112]; + const SBool s113 = queue_6[113]; + const SBool s114 = queue_6[114]; + const SBool s115 = queue_6[115]; + const SBool s116 = queue_6[116]; + const SBool s117 = queue_6[117]; + const SBool s118 = queue_6[118]; + const SBool s119 = queue_6[119]; + const SBool s120 = queue_6[120]; + const SBool s121 = queue_6[121]; + const SBool s122 = queue_6[122]; + const SBool s123 = queue_6[123]; + const SBool s124 = queue_6[124]; + const SBool s125 = queue_6[125]; + const SBool s126 = queue_6[126]; + const SBool s127 = queue_6[127]; + const SWord32 s128 = ptr_6; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127 + }; + const SWord32 s130 = (0x00000080UL == 0) ? s128 : (s128 % 0x00000080UL); + const SBool s131 = table0[s130]; + + return s131; +} diff --git a/example21/copilot-sbv-codegen/observer_obs3.c b/example21/copilot-sbv-codegen/observer_obs3.c new file mode 100644 index 00000000..3851192c --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs3.c @@ -0,0 +1,96 @@ +/* File: "observer_obs3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SBool observer_obs3(const SBool *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SBool s6 = queue_5[6]; + const SBool s7 = queue_5[7]; + const SBool s8 = queue_5[8]; + const SBool s9 = queue_5[9]; + const SBool s10 = queue_5[10]; + const SBool s11 = queue_5[11]; + const SBool s12 = queue_5[12]; + const SBool s13 = queue_5[13]; + const SBool s14 = queue_5[14]; + const SBool s15 = queue_5[15]; + const SBool s16 = queue_5[16]; + const SBool s17 = queue_5[17]; + const SBool s18 = queue_5[18]; + const SBool s19 = queue_5[19]; + const SBool s20 = queue_5[20]; + const SBool s21 = queue_5[21]; + const SBool s22 = queue_5[22]; + const SBool s23 = queue_5[23]; + const SBool s24 = queue_5[24]; + const SBool s25 = queue_5[25]; + const SBool s26 = queue_5[26]; + const SBool s27 = queue_5[27]; + const SBool s28 = queue_5[28]; + const SBool s29 = queue_5[29]; + const SBool s30 = queue_5[30]; + const SBool s31 = queue_5[31]; + const SBool s32 = queue_5[32]; + const SBool s33 = queue_5[33]; + const SBool s34 = queue_5[34]; + const SBool s35 = queue_5[35]; + const SBool s36 = queue_5[36]; + const SBool s37 = queue_5[37]; + const SBool s38 = queue_5[38]; + const SBool s39 = queue_5[39]; + const SBool s40 = queue_5[40]; + const SBool s41 = queue_5[41]; + const SBool s42 = queue_5[42]; + const SBool s43 = queue_5[43]; + const SBool s44 = queue_5[44]; + const SBool s45 = queue_5[45]; + const SBool s46 = queue_5[46]; + const SBool s47 = queue_5[47]; + const SBool s48 = queue_5[48]; + const SBool s49 = queue_5[49]; + const SBool s50 = queue_5[50]; + const SBool s51 = queue_5[51]; + const SBool s52 = queue_5[52]; + const SBool s53 = queue_5[53]; + const SBool s54 = queue_5[54]; + const SBool s55 = queue_5[55]; + const SBool s56 = queue_5[56]; + const SBool s57 = queue_5[57]; + const SBool s58 = queue_5[58]; + const SBool s59 = queue_5[59]; + const SBool s60 = queue_5[60]; + const SBool s61 = queue_5[61]; + const SBool s62 = queue_5[62]; + const SBool s63 = queue_5[63]; + const SWord32 s64 = ptr_5; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31, s32, s33, s34, s35, s36, s37, s38, + s39, s40, s41, s42, s43, s44, s45, s46, s47, s48, s49, s50, s51, + s52, s53, s54, s55, s56, s57, s58, s59, s60, s61, s62, s63 + }; + const SWord32 s66 = (0x00000040UL == 0) ? s64 : (s64 % 0x00000040UL); + const SBool s67 = table0[s66]; + + return s67; +} diff --git a/example21/copilot-sbv-codegen/observer_obs4.c b/example21/copilot-sbv-codegen/observer_obs4.c new file mode 100644 index 00000000..2b161d4b --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs4.c @@ -0,0 +1,62 @@ +/* File: "observer_obs4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s4 +*/ +/*@ + assigns \nothing; + ensures \result == queue_4[ptr_4]; +*/ +SBool observer_obs4(const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SBool s6 = queue_4[6]; + const SBool s7 = queue_4[7]; + const SBool s8 = queue_4[8]; + const SBool s9 = queue_4[9]; + const SBool s10 = queue_4[10]; + const SBool s11 = queue_4[11]; + const SBool s12 = queue_4[12]; + const SBool s13 = queue_4[13]; + const SBool s14 = queue_4[14]; + const SBool s15 = queue_4[15]; + const SBool s16 = queue_4[16]; + const SBool s17 = queue_4[17]; + const SBool s18 = queue_4[18]; + const SBool s19 = queue_4[19]; + const SBool s20 = queue_4[20]; + const SBool s21 = queue_4[21]; + const SBool s22 = queue_4[22]; + const SBool s23 = queue_4[23]; + const SBool s24 = queue_4[24]; + const SBool s25 = queue_4[25]; + const SBool s26 = queue_4[26]; + const SBool s27 = queue_4[27]; + const SBool s28 = queue_4[28]; + const SBool s29 = queue_4[29]; + const SBool s30 = queue_4[30]; + const SBool s31 = queue_4[31]; + const SWord32 s32 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31 + }; + const SWord32 s34 = (0x00000020UL == 0) ? s32 : (s32 % 0x00000020UL); + const SBool s35 = table0[s34]; + + return s35; +} diff --git a/example21/copilot-sbv-codegen/observer_obs5.c b/example21/copilot-sbv-codegen/observer_obs5.c new file mode 100644 index 00000000..d01ba8ee --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs5.c @@ -0,0 +1,45 @@ +/* File: "observer_obs5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s3 +*/ +/*@ + assigns \nothing; + ensures \result == queue_3[ptr_3]; +*/ +SBool observer_obs5(const SBool *queue_3, const SWord32 ptr_3) +{ + const SBool s0 = queue_3[0]; + const SBool s1 = queue_3[1]; + const SBool s2 = queue_3[2]; + const SBool s3 = queue_3[3]; + const SBool s4 = queue_3[4]; + const SBool s5 = queue_3[5]; + const SBool s6 = queue_3[6]; + const SBool s7 = queue_3[7]; + const SBool s8 = queue_3[8]; + const SBool s9 = queue_3[9]; + const SBool s10 = queue_3[10]; + const SBool s11 = queue_3[11]; + const SBool s12 = queue_3[12]; + const SBool s13 = queue_3[13]; + const SBool s14 = queue_3[14]; + const SBool s15 = queue_3[15]; + const SWord32 s16 = ptr_3; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15 + }; + const SWord32 s18 = (0x00000010UL == 0) ? s16 : (s16 % 0x00000010UL); + const SBool s19 = table0[s18]; + + return s19; +} diff --git a/example21/copilot-sbv-codegen/observer_obs6.c b/example21/copilot-sbv-codegen/observer_obs6.c new file mode 100644 index 00000000..047519d4 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs6.c @@ -0,0 +1,36 @@ +/* File: "observer_obs6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool observer_obs6(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SBool s3 = queue_2[3]; + const SBool s4 = queue_2[4]; + const SBool s5 = queue_2[5]; + const SBool s6 = queue_2[6]; + const SBool s7 = queue_2[7]; + const SWord32 s8 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example21/copilot-sbv-codegen/observer_obs7.c b/example21/copilot-sbv-codegen/observer_obs7.c new file mode 100644 index 00000000..02d5ab13 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs7.c @@ -0,0 +1,32 @@ +/* File: "observer_obs7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool observer_obs7(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example21/copilot-sbv-codegen/observer_obs8.c b/example21/copilot-sbv-codegen/observer_obs8.c new file mode 100644 index 00000000..39e63b97 --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_obs8.c @@ -0,0 +1,30 @@ +/* File: "observer_obs8.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool observer_obs8(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example21/copilot-sbv-codegen/observer_sat.c b/example21/copilot-sbv-codegen/observer_sat.c new file mode 100644 index 00000000..67f03bae --- /dev/null +++ b/example21/copilot-sbv-codegen/observer_sat.c @@ -0,0 +1,23 @@ +/* File: "observer_sat.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s10 +*/ +/*@ + assigns \nothing; + ensures \result == queue_10[ptr_10]; +*/ +SBool observer_sat(const SBool *queue_10, const SWord32 ptr_10) +{ + const SBool s0 = queue_10[0]; + const SWord32 s1 = ptr_10; + return s0; +} diff --git a/example21/copilot-sbv-codegen/update_state_0.c b/example21/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..13b7093a --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,30 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SBool s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example21/copilot-sbv-codegen/update_state_1.c b/example21/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..eff46813 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,32 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SWord32 s4 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example21/copilot-sbv-codegen/update_state_10.c b/example21/copilot-sbv-codegen/update_state_10.c new file mode 100644 index 00000000..82433ea6 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_10.c @@ -0,0 +1,1206 @@ +/* File: "update_state_10.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((s11 && (s12 && (s13 && (s14 && (s15 && (s16 && (s17 && (s18 && (s19 && (s19 && not s19)))))))))) || s10) +*/ +/*@ + assigns \nothing; + ensures \result == ((queue_11[ptr_11] && (queue_12[ptr_12] && (queue_13[ptr_13] && (queue_14[ptr_14] && (queue_15[ptr_15] && (queue_16[ptr_16] && (queue_17[ptr_17] && (queue_18[ptr_18] && (queue_19[ptr_19] && (queue_19[ptr_19] && ! queue_19[ptr_19])))))))))) || queue_10[ptr_10]); +*/ +SBool update_state_10(const SBool *queue_11, const SWord32 ptr_11, + const SBool *queue_12, const SWord32 ptr_12, const SBool *queue_13, + const SWord32 ptr_13, const SBool *queue_14, const SWord32 ptr_14, + const SBool *queue_15, const SWord32 ptr_15, const SBool *queue_16, + const SWord32 ptr_16, const SBool *queue_17, const SWord32 ptr_17, + const SBool *queue_18, const SWord32 ptr_18, const SBool *queue_19, + const SWord32 ptr_19, const SBool *queue_10, const SWord32 ptr_10) +{ + const SBool s0 = queue_11[0]; + const SBool s1 = queue_11[1]; + const SBool s2 = queue_11[2]; + const SBool s3 = queue_11[3]; + const SBool s4 = queue_11[4]; + const SBool s5 = queue_11[5]; + const SBool s6 = queue_11[6]; + const SBool s7 = queue_11[7]; + const SBool s8 = queue_11[8]; + const SBool s9 = queue_11[9]; + const SBool s10 = queue_11[10]; + const SBool s11 = queue_11[11]; + const SBool s12 = queue_11[12]; + const SBool s13 = queue_11[13]; + const SBool s14 = queue_11[14]; + const SBool s15 = queue_11[15]; + const SBool s16 = queue_11[16]; + const SBool s17 = queue_11[17]; + const SBool s18 = queue_11[18]; + const SBool s19 = queue_11[19]; + const SBool s20 = queue_11[20]; + const SBool s21 = queue_11[21]; + const SBool s22 = queue_11[22]; + const SBool s23 = queue_11[23]; + const SBool s24 = queue_11[24]; + const SBool s25 = queue_11[25]; + const SBool s26 = queue_11[26]; + const SBool s27 = queue_11[27]; + const SBool s28 = queue_11[28]; + const SBool s29 = queue_11[29]; + const SBool s30 = queue_11[30]; + const SBool s31 = queue_11[31]; + const SBool s32 = queue_11[32]; + const SBool s33 = queue_11[33]; + const SBool s34 = queue_11[34]; + const SBool s35 = queue_11[35]; + const SBool s36 = queue_11[36]; + const SBool s37 = queue_11[37]; + const SBool s38 = queue_11[38]; + const SBool s39 = queue_11[39]; + const SBool s40 = queue_11[40]; + const SBool s41 = queue_11[41]; + const SBool s42 = queue_11[42]; + const SBool s43 = queue_11[43]; + const SBool s44 = queue_11[44]; + const SBool s45 = queue_11[45]; + const SBool s46 = queue_11[46]; + const SBool s47 = queue_11[47]; + const SBool s48 = queue_11[48]; + const SBool s49 = queue_11[49]; + const SBool s50 = queue_11[50]; + const SBool s51 = queue_11[51]; + const SBool s52 = queue_11[52]; + const SBool s53 = queue_11[53]; + const SBool s54 = queue_11[54]; + const SBool s55 = queue_11[55]; + const SBool s56 = queue_11[56]; + const SBool s57 = queue_11[57]; + const SBool s58 = queue_11[58]; + const SBool s59 = queue_11[59]; + const SBool s60 = queue_11[60]; + const SBool s61 = queue_11[61]; + const SBool s62 = queue_11[62]; + const SBool s63 = queue_11[63]; + const SBool s64 = queue_11[64]; + const SBool s65 = queue_11[65]; + const SBool s66 = queue_11[66]; + const SBool s67 = queue_11[67]; + const SBool s68 = queue_11[68]; + const SBool s69 = queue_11[69]; + const SBool s70 = queue_11[70]; + const SBool s71 = queue_11[71]; + const SBool s72 = queue_11[72]; + const SBool s73 = queue_11[73]; + const SBool s74 = queue_11[74]; + const SBool s75 = queue_11[75]; + const SBool s76 = queue_11[76]; + const SBool s77 = queue_11[77]; + const SBool s78 = queue_11[78]; + const SBool s79 = queue_11[79]; + const SBool s80 = queue_11[80]; + const SBool s81 = queue_11[81]; + const SBool s82 = queue_11[82]; + const SBool s83 = queue_11[83]; + const SBool s84 = queue_11[84]; + const SBool s85 = queue_11[85]; + const SBool s86 = queue_11[86]; + const SBool s87 = queue_11[87]; + const SBool s88 = queue_11[88]; + const SBool s89 = queue_11[89]; + const SBool s90 = queue_11[90]; + const SBool s91 = queue_11[91]; + const SBool s92 = queue_11[92]; + const SBool s93 = queue_11[93]; + const SBool s94 = queue_11[94]; + const SBool s95 = queue_11[95]; + const SBool s96 = queue_11[96]; + const SBool s97 = queue_11[97]; + const SBool s98 = queue_11[98]; + const SBool s99 = queue_11[99]; + const SBool s100 = queue_11[100]; + const SBool s101 = queue_11[101]; + const SBool s102 = queue_11[102]; + const SBool s103 = queue_11[103]; + const SBool s104 = queue_11[104]; + const SBool s105 = queue_11[105]; + const SBool s106 = queue_11[106]; + const SBool s107 = queue_11[107]; + const SBool s108 = queue_11[108]; + const SBool s109 = queue_11[109]; + const SBool s110 = queue_11[110]; + const SBool s111 = queue_11[111]; + const SBool s112 = queue_11[112]; + const SBool s113 = queue_11[113]; + const SBool s114 = queue_11[114]; + const SBool s115 = queue_11[115]; + const SBool s116 = queue_11[116]; + const SBool s117 = queue_11[117]; + const SBool s118 = queue_11[118]; + const SBool s119 = queue_11[119]; + const SBool s120 = queue_11[120]; + const SBool s121 = queue_11[121]; + const SBool s122 = queue_11[122]; + const SBool s123 = queue_11[123]; + const SBool s124 = queue_11[124]; + const SBool s125 = queue_11[125]; + const SBool s126 = queue_11[126]; + const SBool s127 = queue_11[127]; + const SBool s128 = queue_11[128]; + const SBool s129 = queue_11[129]; + const SBool s130 = queue_11[130]; + const SBool s131 = queue_11[131]; + const SBool s132 = queue_11[132]; + const SBool s133 = queue_11[133]; + const SBool s134 = queue_11[134]; + const SBool s135 = queue_11[135]; + const SBool s136 = queue_11[136]; + const SBool s137 = queue_11[137]; + const SBool s138 = queue_11[138]; + const SBool s139 = queue_11[139]; + const SBool s140 = queue_11[140]; + const SBool s141 = queue_11[141]; + const SBool s142 = queue_11[142]; + const SBool s143 = queue_11[143]; + const SBool s144 = queue_11[144]; + const SBool s145 = queue_11[145]; + const SBool s146 = queue_11[146]; + const SBool s147 = queue_11[147]; + const SBool s148 = queue_11[148]; + const SBool s149 = queue_11[149]; + const SBool s150 = queue_11[150]; + const SBool s151 = queue_11[151]; + const SBool s152 = queue_11[152]; + const SBool s153 = queue_11[153]; + const SBool s154 = queue_11[154]; + const SBool s155 = queue_11[155]; + const SBool s156 = queue_11[156]; + const SBool s157 = queue_11[157]; + const SBool s158 = queue_11[158]; + const SBool s159 = queue_11[159]; + const SBool s160 = queue_11[160]; + const SBool s161 = queue_11[161]; + const SBool s162 = queue_11[162]; + const SBool s163 = queue_11[163]; + const SBool s164 = queue_11[164]; + const SBool s165 = queue_11[165]; + const SBool s166 = queue_11[166]; + const SBool s167 = queue_11[167]; + const SBool s168 = queue_11[168]; + const SBool s169 = queue_11[169]; + const SBool s170 = queue_11[170]; + const SBool s171 = queue_11[171]; + const SBool s172 = queue_11[172]; + const SBool s173 = queue_11[173]; + const SBool s174 = queue_11[174]; + const SBool s175 = queue_11[175]; + const SBool s176 = queue_11[176]; + const SBool s177 = queue_11[177]; + const SBool s178 = queue_11[178]; + const SBool s179 = queue_11[179]; + const SBool s180 = queue_11[180]; + const SBool s181 = queue_11[181]; + const SBool s182 = queue_11[182]; + const SBool s183 = queue_11[183]; + const SBool s184 = queue_11[184]; + const SBool s185 = queue_11[185]; + const SBool s186 = queue_11[186]; + const SBool s187 = queue_11[187]; + const SBool s188 = queue_11[188]; + const SBool s189 = queue_11[189]; + const SBool s190 = queue_11[190]; + const SBool s191 = queue_11[191]; + const SBool s192 = queue_11[192]; + const SBool s193 = queue_11[193]; + const SBool s194 = queue_11[194]; + const SBool s195 = queue_11[195]; + const SBool s196 = queue_11[196]; + const SBool s197 = queue_11[197]; + const SBool s198 = queue_11[198]; + const SBool s199 = queue_11[199]; + const SBool s200 = queue_11[200]; + const SBool s201 = queue_11[201]; + const SBool s202 = queue_11[202]; + const SBool s203 = queue_11[203]; + const SBool s204 = queue_11[204]; + const SBool s205 = queue_11[205]; + const SBool s206 = queue_11[206]; + const SBool s207 = queue_11[207]; + const SBool s208 = queue_11[208]; + const SBool s209 = queue_11[209]; + const SBool s210 = queue_11[210]; + const SBool s211 = queue_11[211]; + const SBool s212 = queue_11[212]; + const SBool s213 = queue_11[213]; + const SBool s214 = queue_11[214]; + const SBool s215 = queue_11[215]; + const SBool s216 = queue_11[216]; + const SBool s217 = queue_11[217]; + const SBool s218 = queue_11[218]; + const SBool s219 = queue_11[219]; + const SBool s220 = queue_11[220]; + const SBool s221 = queue_11[221]; + const SBool s222 = queue_11[222]; + const SBool s223 = queue_11[223]; + const SBool s224 = queue_11[224]; + const SBool s225 = queue_11[225]; + const SBool s226 = queue_11[226]; + const SBool s227 = queue_11[227]; + const SBool s228 = queue_11[228]; + const SBool s229 = queue_11[229]; + const SBool s230 = queue_11[230]; + const SBool s231 = queue_11[231]; + const SBool s232 = queue_11[232]; + const SBool s233 = queue_11[233]; + const SBool s234 = queue_11[234]; + const SBool s235 = queue_11[235]; + const SBool s236 = queue_11[236]; + const SBool s237 = queue_11[237]; + const SBool s238 = queue_11[238]; + const SBool s239 = queue_11[239]; + const SBool s240 = queue_11[240]; + const SBool s241 = queue_11[241]; + const SBool s242 = queue_11[242]; + const SBool s243 = queue_11[243]; + const SBool s244 = queue_11[244]; + const SBool s245 = queue_11[245]; + const SBool s246 = queue_11[246]; + const SBool s247 = queue_11[247]; + const SBool s248 = queue_11[248]; + const SBool s249 = queue_11[249]; + const SBool s250 = queue_11[250]; + const SBool s251 = queue_11[251]; + const SBool s252 = queue_11[252]; + const SBool s253 = queue_11[253]; + const SBool s254 = queue_11[254]; + const SBool s255 = queue_11[255]; + const SBool s256 = queue_11[256]; + const SBool s257 = queue_11[257]; + const SBool s258 = queue_11[258]; + const SBool s259 = queue_11[259]; + const SBool s260 = queue_11[260]; + const SBool s261 = queue_11[261]; + const SBool s262 = queue_11[262]; + const SBool s263 = queue_11[263]; + const SBool s264 = queue_11[264]; + const SBool s265 = queue_11[265]; + const SBool s266 = queue_11[266]; + const SBool s267 = queue_11[267]; + const SBool s268 = queue_11[268]; + const SBool s269 = queue_11[269]; + const SBool s270 = queue_11[270]; + const SBool s271 = queue_11[271]; + const SBool s272 = queue_11[272]; + const SBool s273 = queue_11[273]; + const SBool s274 = queue_11[274]; + const SBool s275 = queue_11[275]; + const SBool s276 = queue_11[276]; + const SBool s277 = queue_11[277]; + const SBool s278 = queue_11[278]; + const SBool s279 = queue_11[279]; + const SBool s280 = queue_11[280]; + const SBool s281 = queue_11[281]; + const SBool s282 = queue_11[282]; + const SBool s283 = queue_11[283]; + const SBool s284 = queue_11[284]; + const SBool s285 = queue_11[285]; + const SBool s286 = queue_11[286]; + const SBool s287 = queue_11[287]; + const SBool s288 = queue_11[288]; + const SBool s289 = queue_11[289]; + const SBool s290 = queue_11[290]; + const SBool s291 = queue_11[291]; + const SBool s292 = queue_11[292]; + const SBool s293 = queue_11[293]; + const SBool s294 = queue_11[294]; + const SBool s295 = queue_11[295]; + const SBool s296 = queue_11[296]; + const SBool s297 = queue_11[297]; + const SBool s298 = queue_11[298]; + const SBool s299 = queue_11[299]; + const SBool s300 = queue_11[300]; + const SBool s301 = queue_11[301]; + const SBool s302 = queue_11[302]; + const SBool s303 = queue_11[303]; + const SBool s304 = queue_11[304]; + const SBool s305 = queue_11[305]; + const SBool s306 = queue_11[306]; + const SBool s307 = queue_11[307]; + const SBool s308 = queue_11[308]; + const SBool s309 = queue_11[309]; + const SBool s310 = queue_11[310]; + const SBool s311 = queue_11[311]; + const SBool s312 = queue_11[312]; + const SBool s313 = queue_11[313]; + const SBool s314 = queue_11[314]; + const SBool s315 = queue_11[315]; + const SBool s316 = queue_11[316]; + const SBool s317 = queue_11[317]; + const SBool s318 = queue_11[318]; + const SBool s319 = queue_11[319]; + const SBool s320 = queue_11[320]; + const SBool s321 = queue_11[321]; + const SBool s322 = queue_11[322]; + const SBool s323 = queue_11[323]; + const SBool s324 = queue_11[324]; + const SBool s325 = queue_11[325]; + const SBool s326 = queue_11[326]; + const SBool s327 = queue_11[327]; + const SBool s328 = queue_11[328]; + const SBool s329 = queue_11[329]; + const SBool s330 = queue_11[330]; + const SBool s331 = queue_11[331]; + const SBool s332 = queue_11[332]; + const SBool s333 = queue_11[333]; + const SBool s334 = queue_11[334]; + const SBool s335 = queue_11[335]; + const SBool s336 = queue_11[336]; + const SBool s337 = queue_11[337]; + const SBool s338 = queue_11[338]; + const SBool s339 = queue_11[339]; + const SBool s340 = queue_11[340]; + const SBool s341 = queue_11[341]; + const SBool s342 = queue_11[342]; + const SBool s343 = queue_11[343]; + const SBool s344 = queue_11[344]; + const SBool s345 = queue_11[345]; + const SBool s346 = queue_11[346]; + const SBool s347 = queue_11[347]; + const SBool s348 = queue_11[348]; + const SBool s349 = queue_11[349]; + const SBool s350 = queue_11[350]; + const SBool s351 = queue_11[351]; + const SBool s352 = queue_11[352]; + const SBool s353 = queue_11[353]; + const SBool s354 = queue_11[354]; + const SBool s355 = queue_11[355]; + const SBool s356 = queue_11[356]; + const SBool s357 = queue_11[357]; + const SBool s358 = queue_11[358]; + const SBool s359 = queue_11[359]; + const SBool s360 = queue_11[360]; + const SBool s361 = queue_11[361]; + const SBool s362 = queue_11[362]; + const SBool s363 = queue_11[363]; + const SBool s364 = queue_11[364]; + const SBool s365 = queue_11[365]; + const SBool s366 = queue_11[366]; + const SBool s367 = queue_11[367]; + const SBool s368 = queue_11[368]; + const SBool s369 = queue_11[369]; + const SBool s370 = queue_11[370]; + const SBool s371 = queue_11[371]; + const SBool s372 = queue_11[372]; + const SBool s373 = queue_11[373]; + const SBool s374 = queue_11[374]; + const SBool s375 = queue_11[375]; + const SBool s376 = queue_11[376]; + const SBool s377 = queue_11[377]; + const SBool s378 = queue_11[378]; + const SBool s379 = queue_11[379]; + const SBool s380 = queue_11[380]; + const SBool s381 = queue_11[381]; + const SBool s382 = queue_11[382]; + const SBool s383 = queue_11[383]; + const SBool s384 = queue_11[384]; + const SBool s385 = queue_11[385]; + const SBool s386 = queue_11[386]; + const SBool s387 = queue_11[387]; + const SBool s388 = queue_11[388]; + const SBool s389 = queue_11[389]; + const SBool s390 = queue_11[390]; + const SBool s391 = queue_11[391]; + const SBool s392 = queue_11[392]; + const SBool s393 = queue_11[393]; + const SBool s394 = queue_11[394]; + const SBool s395 = queue_11[395]; + const SBool s396 = queue_11[396]; + const SBool s397 = queue_11[397]; + const SBool s398 = queue_11[398]; + const SBool s399 = queue_11[399]; + const SBool s400 = queue_11[400]; + const SBool s401 = queue_11[401]; + const SBool s402 = queue_11[402]; + const SBool s403 = queue_11[403]; + const SBool s404 = queue_11[404]; + const SBool s405 = queue_11[405]; + const SBool s406 = queue_11[406]; + const SBool s407 = queue_11[407]; + const SBool s408 = queue_11[408]; + const SBool s409 = queue_11[409]; + const SBool s410 = queue_11[410]; + const SBool s411 = queue_11[411]; + const SBool s412 = queue_11[412]; + const SBool s413 = queue_11[413]; + const SBool s414 = queue_11[414]; + const SBool s415 = queue_11[415]; + const SBool s416 = queue_11[416]; + const SBool s417 = queue_11[417]; + const SBool s418 = queue_11[418]; + const SBool s419 = queue_11[419]; + const SBool s420 = queue_11[420]; + const SBool s421 = queue_11[421]; + const SBool s422 = queue_11[422]; + const SBool s423 = queue_11[423]; + const SBool s424 = queue_11[424]; + const SBool s425 = queue_11[425]; + const SBool s426 = queue_11[426]; + const SBool s427 = queue_11[427]; + const SBool s428 = queue_11[428]; + const SBool s429 = queue_11[429]; + const SBool s430 = queue_11[430]; + const SBool s431 = queue_11[431]; + const SBool s432 = queue_11[432]; + const SBool s433 = queue_11[433]; + const SBool s434 = queue_11[434]; + const SBool s435 = queue_11[435]; + const SBool s436 = queue_11[436]; + const SBool s437 = queue_11[437]; + const SBool s438 = queue_11[438]; + const SBool s439 = queue_11[439]; + const SBool s440 = queue_11[440]; + const SBool s441 = queue_11[441]; + const SBool s442 = queue_11[442]; + const SBool s443 = queue_11[443]; + const SBool s444 = queue_11[444]; + const SBool s445 = queue_11[445]; + const SBool s446 = queue_11[446]; + const SBool s447 = queue_11[447]; + const SBool s448 = queue_11[448]; + const SBool s449 = queue_11[449]; + const SBool s450 = queue_11[450]; + const SBool s451 = queue_11[451]; + const SBool s452 = queue_11[452]; + const SBool s453 = queue_11[453]; + const SBool s454 = queue_11[454]; + const SBool s455 = queue_11[455]; + const SBool s456 = queue_11[456]; + const SBool s457 = queue_11[457]; + const SBool s458 = queue_11[458]; + const SBool s459 = queue_11[459]; + const SBool s460 = queue_11[460]; + const SBool s461 = queue_11[461]; + const SBool s462 = queue_11[462]; + const SBool s463 = queue_11[463]; + const SBool s464 = queue_11[464]; + const SBool s465 = queue_11[465]; + const SBool s466 = queue_11[466]; + const SBool s467 = queue_11[467]; + const SBool s468 = queue_11[468]; + const SBool s469 = queue_11[469]; + const SBool s470 = queue_11[470]; + const SBool s471 = queue_11[471]; + const SBool s472 = queue_11[472]; + const SBool s473 = queue_11[473]; + const SBool s474 = queue_11[474]; + const SBool s475 = queue_11[475]; + const SBool s476 = queue_11[476]; + const SBool s477 = queue_11[477]; + const SBool s478 = queue_11[478]; + const SBool s479 = queue_11[479]; + const SBool s480 = queue_11[480]; + const SBool s481 = queue_11[481]; + const SBool s482 = queue_11[482]; + const SBool s483 = queue_11[483]; + const SBool s484 = queue_11[484]; + const SBool s485 = queue_11[485]; + const SBool s486 = queue_11[486]; + const SBool s487 = queue_11[487]; + const SBool s488 = queue_11[488]; + const SBool s489 = queue_11[489]; + const SBool s490 = queue_11[490]; + const SBool s491 = queue_11[491]; + const SBool s492 = queue_11[492]; + const SBool s493 = queue_11[493]; + const SBool s494 = queue_11[494]; + const SBool s495 = queue_11[495]; + const SBool s496 = queue_11[496]; + const SBool s497 = queue_11[497]; + const SBool s498 = queue_11[498]; + const SBool s499 = queue_11[499]; + const SBool s500 = queue_11[500]; + const SBool s501 = queue_11[501]; + const SBool s502 = queue_11[502]; + const SBool s503 = queue_11[503]; + const SBool s504 = queue_11[504]; + const SBool s505 = queue_11[505]; + const SBool s506 = queue_11[506]; + const SBool s507 = queue_11[507]; + const SBool s508 = queue_11[508]; + const SBool s509 = queue_11[509]; + const SBool s510 = queue_11[510]; + const SBool s511 = queue_11[511]; + const SWord32 s512 = ptr_11; + const SBool s513 = queue_12[0]; + const SBool s514 = queue_12[1]; + const SBool s515 = queue_12[2]; + const SBool s516 = queue_12[3]; + const SBool s517 = queue_12[4]; + const SBool s518 = queue_12[5]; + const SBool s519 = queue_12[6]; + const SBool s520 = queue_12[7]; + const SBool s521 = queue_12[8]; + const SBool s522 = queue_12[9]; + const SBool s523 = queue_12[10]; + const SBool s524 = queue_12[11]; + const SBool s525 = queue_12[12]; + const SBool s526 = queue_12[13]; + const SBool s527 = queue_12[14]; + const SBool s528 = queue_12[15]; + const SBool s529 = queue_12[16]; + const SBool s530 = queue_12[17]; + const SBool s531 = queue_12[18]; + const SBool s532 = queue_12[19]; + const SBool s533 = queue_12[20]; + const SBool s534 = queue_12[21]; + const SBool s535 = queue_12[22]; + const SBool s536 = queue_12[23]; + const SBool s537 = queue_12[24]; + const SBool s538 = queue_12[25]; + const SBool s539 = queue_12[26]; + const SBool s540 = queue_12[27]; + const SBool s541 = queue_12[28]; + const SBool s542 = queue_12[29]; + const SBool s543 = queue_12[30]; + const SBool s544 = queue_12[31]; + const SBool s545 = queue_12[32]; + const SBool s546 = queue_12[33]; + const SBool s547 = queue_12[34]; + const SBool s548 = queue_12[35]; + const SBool s549 = queue_12[36]; + const SBool s550 = queue_12[37]; + const SBool s551 = queue_12[38]; + const SBool s552 = queue_12[39]; + const SBool s553 = queue_12[40]; + const SBool s554 = queue_12[41]; + const SBool s555 = queue_12[42]; + const SBool s556 = queue_12[43]; + const SBool s557 = queue_12[44]; + const SBool s558 = queue_12[45]; + const SBool s559 = queue_12[46]; + const SBool s560 = queue_12[47]; + const SBool s561 = queue_12[48]; + const SBool s562 = queue_12[49]; + const SBool s563 = queue_12[50]; + const SBool s564 = queue_12[51]; + const SBool s565 = queue_12[52]; + const SBool s566 = queue_12[53]; + const SBool s567 = queue_12[54]; + const SBool s568 = queue_12[55]; + const SBool s569 = queue_12[56]; + const SBool s570 = queue_12[57]; + const SBool s571 = queue_12[58]; + const SBool s572 = queue_12[59]; + const SBool s573 = queue_12[60]; + const SBool s574 = queue_12[61]; + const SBool s575 = queue_12[62]; + const SBool s576 = queue_12[63]; + const SBool s577 = queue_12[64]; + const SBool s578 = queue_12[65]; + const SBool s579 = queue_12[66]; + const SBool s580 = queue_12[67]; + const SBool s581 = queue_12[68]; + const SBool s582 = queue_12[69]; + const SBool s583 = queue_12[70]; + const SBool s584 = queue_12[71]; + const SBool s585 = queue_12[72]; + const SBool s586 = queue_12[73]; + const SBool s587 = queue_12[74]; + const SBool s588 = queue_12[75]; + const SBool s589 = queue_12[76]; + const SBool s590 = queue_12[77]; + const SBool s591 = queue_12[78]; + const SBool s592 = queue_12[79]; + const SBool s593 = queue_12[80]; + const SBool s594 = queue_12[81]; + const SBool s595 = queue_12[82]; + const SBool s596 = queue_12[83]; + const SBool s597 = queue_12[84]; + const SBool s598 = queue_12[85]; + const SBool s599 = queue_12[86]; + const SBool s600 = queue_12[87]; + const SBool s601 = queue_12[88]; + const SBool s602 = queue_12[89]; + const SBool s603 = queue_12[90]; + const SBool s604 = queue_12[91]; + const SBool s605 = queue_12[92]; + const SBool s606 = queue_12[93]; + const SBool s607 = queue_12[94]; + const SBool s608 = queue_12[95]; + const SBool s609 = queue_12[96]; + const SBool s610 = queue_12[97]; + const SBool s611 = queue_12[98]; + const SBool s612 = queue_12[99]; + const SBool s613 = queue_12[100]; + const SBool s614 = queue_12[101]; + const SBool s615 = queue_12[102]; + const SBool s616 = queue_12[103]; + const SBool s617 = queue_12[104]; + const SBool s618 = queue_12[105]; + const SBool s619 = queue_12[106]; + const SBool s620 = queue_12[107]; + const SBool s621 = queue_12[108]; + const SBool s622 = queue_12[109]; + const SBool s623 = queue_12[110]; + const SBool s624 = queue_12[111]; + const SBool s625 = queue_12[112]; + const SBool s626 = queue_12[113]; + const SBool s627 = queue_12[114]; + const SBool s628 = queue_12[115]; + const SBool s629 = queue_12[116]; + const SBool s630 = queue_12[117]; + const SBool s631 = queue_12[118]; + const SBool s632 = queue_12[119]; + const SBool s633 = queue_12[120]; + const SBool s634 = queue_12[121]; + const SBool s635 = queue_12[122]; + const SBool s636 = queue_12[123]; + const SBool s637 = queue_12[124]; + const SBool s638 = queue_12[125]; + const SBool s639 = queue_12[126]; + const SBool s640 = queue_12[127]; + const SBool s641 = queue_12[128]; + const SBool s642 = queue_12[129]; + const SBool s643 = queue_12[130]; + const SBool s644 = queue_12[131]; + const SBool s645 = queue_12[132]; + const SBool s646 = queue_12[133]; + const SBool s647 = queue_12[134]; + const SBool s648 = queue_12[135]; + const SBool s649 = queue_12[136]; + const SBool s650 = queue_12[137]; + const SBool s651 = queue_12[138]; + const SBool s652 = queue_12[139]; + const SBool s653 = queue_12[140]; + const SBool s654 = queue_12[141]; + const SBool s655 = queue_12[142]; + const SBool s656 = queue_12[143]; + const SBool s657 = queue_12[144]; + const SBool s658 = queue_12[145]; + const SBool s659 = queue_12[146]; + const SBool s660 = queue_12[147]; + const SBool s661 = queue_12[148]; + const SBool s662 = queue_12[149]; + const SBool s663 = queue_12[150]; + const SBool s664 = queue_12[151]; + const SBool s665 = queue_12[152]; + const SBool s666 = queue_12[153]; + const SBool s667 = queue_12[154]; + const SBool s668 = queue_12[155]; + const SBool s669 = queue_12[156]; + const SBool s670 = queue_12[157]; + const SBool s671 = queue_12[158]; + const SBool s672 = queue_12[159]; + const SBool s673 = queue_12[160]; + const SBool s674 = queue_12[161]; + const SBool s675 = queue_12[162]; + const SBool s676 = queue_12[163]; + const SBool s677 = queue_12[164]; + const SBool s678 = queue_12[165]; + const SBool s679 = queue_12[166]; + const SBool s680 = queue_12[167]; + const SBool s681 = queue_12[168]; + const SBool s682 = queue_12[169]; + const SBool s683 = queue_12[170]; + const SBool s684 = queue_12[171]; + const SBool s685 = queue_12[172]; + const SBool s686 = queue_12[173]; + const SBool s687 = queue_12[174]; + const SBool s688 = queue_12[175]; + const SBool s689 = queue_12[176]; + const SBool s690 = queue_12[177]; + const SBool s691 = queue_12[178]; + const SBool s692 = queue_12[179]; + const SBool s693 = queue_12[180]; + const SBool s694 = queue_12[181]; + const SBool s695 = queue_12[182]; + const SBool s696 = queue_12[183]; + const SBool s697 = queue_12[184]; + const SBool s698 = queue_12[185]; + const SBool s699 = queue_12[186]; + const SBool s700 = queue_12[187]; + const SBool s701 = queue_12[188]; + const SBool s702 = queue_12[189]; + const SBool s703 = queue_12[190]; + const SBool s704 = queue_12[191]; + const SBool s705 = queue_12[192]; + const SBool s706 = queue_12[193]; + const SBool s707 = queue_12[194]; + const SBool s708 = queue_12[195]; + const SBool s709 = queue_12[196]; + const SBool s710 = queue_12[197]; + const SBool s711 = queue_12[198]; + const SBool s712 = queue_12[199]; + const SBool s713 = queue_12[200]; + const SBool s714 = queue_12[201]; + const SBool s715 = queue_12[202]; + const SBool s716 = queue_12[203]; + const SBool s717 = queue_12[204]; + const SBool s718 = queue_12[205]; + const SBool s719 = queue_12[206]; + const SBool s720 = queue_12[207]; + const SBool s721 = queue_12[208]; + const SBool s722 = queue_12[209]; + const SBool s723 = queue_12[210]; + const SBool s724 = queue_12[211]; + const SBool s725 = queue_12[212]; + const SBool s726 = queue_12[213]; + const SBool s727 = queue_12[214]; + const SBool s728 = queue_12[215]; + const SBool s729 = queue_12[216]; + const SBool s730 = queue_12[217]; + const SBool s731 = queue_12[218]; + const SBool s732 = queue_12[219]; + const SBool s733 = queue_12[220]; + const SBool s734 = queue_12[221]; + const SBool s735 = queue_12[222]; + const SBool s736 = queue_12[223]; + const SBool s737 = queue_12[224]; + const SBool s738 = queue_12[225]; + const SBool s739 = queue_12[226]; + const SBool s740 = queue_12[227]; + const SBool s741 = queue_12[228]; + const SBool s742 = queue_12[229]; + const SBool s743 = queue_12[230]; + const SBool s744 = queue_12[231]; + const SBool s745 = queue_12[232]; + const SBool s746 = queue_12[233]; + const SBool s747 = queue_12[234]; + const SBool s748 = queue_12[235]; + const SBool s749 = queue_12[236]; + const SBool s750 = queue_12[237]; + const SBool s751 = queue_12[238]; + const SBool s752 = queue_12[239]; + const SBool s753 = queue_12[240]; + const SBool s754 = queue_12[241]; + const SBool s755 = queue_12[242]; + const SBool s756 = queue_12[243]; + const SBool s757 = queue_12[244]; + const SBool s758 = queue_12[245]; + const SBool s759 = queue_12[246]; + const SBool s760 = queue_12[247]; + const SBool s761 = queue_12[248]; + const SBool s762 = queue_12[249]; + const SBool s763 = queue_12[250]; + const SBool s764 = queue_12[251]; + const SBool s765 = queue_12[252]; + const SBool s766 = queue_12[253]; + const SBool s767 = queue_12[254]; + const SBool s768 = queue_12[255]; + const SWord32 s769 = ptr_12; + const SBool s770 = queue_13[0]; + const SBool s771 = queue_13[1]; + const SBool s772 = queue_13[2]; + const SBool s773 = queue_13[3]; + const SBool s774 = queue_13[4]; + const SBool s775 = queue_13[5]; + const SBool s776 = queue_13[6]; + const SBool s777 = queue_13[7]; + const SBool s778 = queue_13[8]; + const SBool s779 = queue_13[9]; + const SBool s780 = queue_13[10]; + const SBool s781 = queue_13[11]; + const SBool s782 = queue_13[12]; + const SBool s783 = queue_13[13]; + const SBool s784 = queue_13[14]; + const SBool s785 = queue_13[15]; + const SBool s786 = queue_13[16]; + const SBool s787 = queue_13[17]; + const SBool s788 = queue_13[18]; + const SBool s789 = queue_13[19]; + const SBool s790 = queue_13[20]; + const SBool s791 = queue_13[21]; + const SBool s792 = queue_13[22]; + const SBool s793 = queue_13[23]; + const SBool s794 = queue_13[24]; + const SBool s795 = queue_13[25]; + const SBool s796 = queue_13[26]; + const SBool s797 = queue_13[27]; + const SBool s798 = queue_13[28]; + const SBool s799 = queue_13[29]; + const SBool s800 = queue_13[30]; + const SBool s801 = queue_13[31]; + const SBool s802 = queue_13[32]; + const SBool s803 = queue_13[33]; + const SBool s804 = queue_13[34]; + const SBool s805 = queue_13[35]; + const SBool s806 = queue_13[36]; + const SBool s807 = queue_13[37]; + const SBool s808 = queue_13[38]; + const SBool s809 = queue_13[39]; + const SBool s810 = queue_13[40]; + const SBool s811 = queue_13[41]; + const SBool s812 = queue_13[42]; + const SBool s813 = queue_13[43]; + const SBool s814 = queue_13[44]; + const SBool s815 = queue_13[45]; + const SBool s816 = queue_13[46]; + const SBool s817 = queue_13[47]; + const SBool s818 = queue_13[48]; + const SBool s819 = queue_13[49]; + const SBool s820 = queue_13[50]; + const SBool s821 = queue_13[51]; + const SBool s822 = queue_13[52]; + const SBool s823 = queue_13[53]; + const SBool s824 = queue_13[54]; + const SBool s825 = queue_13[55]; + const SBool s826 = queue_13[56]; + const SBool s827 = queue_13[57]; + const SBool s828 = queue_13[58]; + const SBool s829 = queue_13[59]; + const SBool s830 = queue_13[60]; + const SBool s831 = queue_13[61]; + const SBool s832 = queue_13[62]; + const SBool s833 = queue_13[63]; + const SBool s834 = queue_13[64]; + const SBool s835 = queue_13[65]; + const SBool s836 = queue_13[66]; + const SBool s837 = queue_13[67]; + const SBool s838 = queue_13[68]; + const SBool s839 = queue_13[69]; + const SBool s840 = queue_13[70]; + const SBool s841 = queue_13[71]; + const SBool s842 = queue_13[72]; + const SBool s843 = queue_13[73]; + const SBool s844 = queue_13[74]; + const SBool s845 = queue_13[75]; + const SBool s846 = queue_13[76]; + const SBool s847 = queue_13[77]; + const SBool s848 = queue_13[78]; + const SBool s849 = queue_13[79]; + const SBool s850 = queue_13[80]; + const SBool s851 = queue_13[81]; + const SBool s852 = queue_13[82]; + const SBool s853 = queue_13[83]; + const SBool s854 = queue_13[84]; + const SBool s855 = queue_13[85]; + const SBool s856 = queue_13[86]; + const SBool s857 = queue_13[87]; + const SBool s858 = queue_13[88]; + const SBool s859 = queue_13[89]; + const SBool s860 = queue_13[90]; + const SBool s861 = queue_13[91]; + const SBool s862 = queue_13[92]; + const SBool s863 = queue_13[93]; + const SBool s864 = queue_13[94]; + const SBool s865 = queue_13[95]; + const SBool s866 = queue_13[96]; + const SBool s867 = queue_13[97]; + const SBool s868 = queue_13[98]; + const SBool s869 = queue_13[99]; + const SBool s870 = queue_13[100]; + const SBool s871 = queue_13[101]; + const SBool s872 = queue_13[102]; + const SBool s873 = queue_13[103]; + const SBool s874 = queue_13[104]; + const SBool s875 = queue_13[105]; + const SBool s876 = queue_13[106]; + const SBool s877 = queue_13[107]; + const SBool s878 = queue_13[108]; + const SBool s879 = queue_13[109]; + const SBool s880 = queue_13[110]; + const SBool s881 = queue_13[111]; + const SBool s882 = queue_13[112]; + const SBool s883 = queue_13[113]; + const SBool s884 = queue_13[114]; + const SBool s885 = queue_13[115]; + const SBool s886 = queue_13[116]; + const SBool s887 = queue_13[117]; + const SBool s888 = queue_13[118]; + const SBool s889 = queue_13[119]; + const SBool s890 = queue_13[120]; + const SBool s891 = queue_13[121]; + const SBool s892 = queue_13[122]; + const SBool s893 = queue_13[123]; + const SBool s894 = queue_13[124]; + const SBool s895 = queue_13[125]; + const SBool s896 = queue_13[126]; + const SBool s897 = queue_13[127]; + const SWord32 s898 = ptr_13; + const SBool s899 = queue_14[0]; + const SBool s900 = queue_14[1]; + const SBool s901 = queue_14[2]; + const SBool s902 = queue_14[3]; + const SBool s903 = queue_14[4]; + const SBool s904 = queue_14[5]; + const SBool s905 = queue_14[6]; + const SBool s906 = queue_14[7]; + const SBool s907 = queue_14[8]; + const SBool s908 = queue_14[9]; + const SBool s909 = queue_14[10]; + const SBool s910 = queue_14[11]; + const SBool s911 = queue_14[12]; + const SBool s912 = queue_14[13]; + const SBool s913 = queue_14[14]; + const SBool s914 = queue_14[15]; + const SBool s915 = queue_14[16]; + const SBool s916 = queue_14[17]; + const SBool s917 = queue_14[18]; + const SBool s918 = queue_14[19]; + const SBool s919 = queue_14[20]; + const SBool s920 = queue_14[21]; + const SBool s921 = queue_14[22]; + const SBool s922 = queue_14[23]; + const SBool s923 = queue_14[24]; + const SBool s924 = queue_14[25]; + const SBool s925 = queue_14[26]; + const SBool s926 = queue_14[27]; + const SBool s927 = queue_14[28]; + const SBool s928 = queue_14[29]; + const SBool s929 = queue_14[30]; + const SBool s930 = queue_14[31]; + const SBool s931 = queue_14[32]; + const SBool s932 = queue_14[33]; + const SBool s933 = queue_14[34]; + const SBool s934 = queue_14[35]; + const SBool s935 = queue_14[36]; + const SBool s936 = queue_14[37]; + const SBool s937 = queue_14[38]; + const SBool s938 = queue_14[39]; + const SBool s939 = queue_14[40]; + const SBool s940 = queue_14[41]; + const SBool s941 = queue_14[42]; + const SBool s942 = queue_14[43]; + const SBool s943 = queue_14[44]; + const SBool s944 = queue_14[45]; + const SBool s945 = queue_14[46]; + const SBool s946 = queue_14[47]; + const SBool s947 = queue_14[48]; + const SBool s948 = queue_14[49]; + const SBool s949 = queue_14[50]; + const SBool s950 = queue_14[51]; + const SBool s951 = queue_14[52]; + const SBool s952 = queue_14[53]; + const SBool s953 = queue_14[54]; + const SBool s954 = queue_14[55]; + const SBool s955 = queue_14[56]; + const SBool s956 = queue_14[57]; + const SBool s957 = queue_14[58]; + const SBool s958 = queue_14[59]; + const SBool s959 = queue_14[60]; + const SBool s960 = queue_14[61]; + const SBool s961 = queue_14[62]; + const SBool s962 = queue_14[63]; + const SWord32 s963 = ptr_14; + const SBool s964 = queue_15[0]; + const SBool s965 = queue_15[1]; + const SBool s966 = queue_15[2]; + const SBool s967 = queue_15[3]; + const SBool s968 = queue_15[4]; + const SBool s969 = queue_15[5]; + const SBool s970 = queue_15[6]; + const SBool s971 = queue_15[7]; + const SBool s972 = queue_15[8]; + const SBool s973 = queue_15[9]; + const SBool s974 = queue_15[10]; + const SBool s975 = queue_15[11]; + const SBool s976 = queue_15[12]; + const SBool s977 = queue_15[13]; + const SBool s978 = queue_15[14]; + const SBool s979 = queue_15[15]; + const SBool s980 = queue_15[16]; + const SBool s981 = queue_15[17]; + const SBool s982 = queue_15[18]; + const SBool s983 = queue_15[19]; + const SBool s984 = queue_15[20]; + const SBool s985 = queue_15[21]; + const SBool s986 = queue_15[22]; + const SBool s987 = queue_15[23]; + const SBool s988 = queue_15[24]; + const SBool s989 = queue_15[25]; + const SBool s990 = queue_15[26]; + const SBool s991 = queue_15[27]; + const SBool s992 = queue_15[28]; + const SBool s993 = queue_15[29]; + const SBool s994 = queue_15[30]; + const SBool s995 = queue_15[31]; + const SWord32 s996 = ptr_15; + const SBool s997 = queue_16[0]; + const SBool s998 = queue_16[1]; + const SBool s999 = queue_16[2]; + const SBool s1000 = queue_16[3]; + const SBool s1001 = queue_16[4]; + const SBool s1002 = queue_16[5]; + const SBool s1003 = queue_16[6]; + const SBool s1004 = queue_16[7]; + const SBool s1005 = queue_16[8]; + const SBool s1006 = queue_16[9]; + const SBool s1007 = queue_16[10]; + const SBool s1008 = queue_16[11]; + const SBool s1009 = queue_16[12]; + const SBool s1010 = queue_16[13]; + const SBool s1011 = queue_16[14]; + const SBool s1012 = queue_16[15]; + const SWord32 s1013 = ptr_16; + const SBool s1014 = queue_17[0]; + const SBool s1015 = queue_17[1]; + const SBool s1016 = queue_17[2]; + const SBool s1017 = queue_17[3]; + const SBool s1018 = queue_17[4]; + const SBool s1019 = queue_17[5]; + const SBool s1020 = queue_17[6]; + const SBool s1021 = queue_17[7]; + const SWord32 s1022 = ptr_17; + const SBool s1023 = queue_18[0]; + const SBool s1024 = queue_18[1]; + const SBool s1025 = queue_18[2]; + const SBool s1026 = queue_18[3]; + const SWord32 s1027 = ptr_18; + const SBool s1028 = queue_19[0]; + const SBool s1029 = queue_19[1]; + const SWord32 s1030 = ptr_19; + const SBool s1031 = queue_10[0]; + const SWord32 s1032 = ptr_10; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255, s256, s257, s258, s259, s260, s261, s262, s263, + s264, s265, s266, s267, s268, s269, s270, s271, s272, s273, s274, + s275, s276, s277, s278, s279, s280, s281, s282, s283, s284, s285, + s286, s287, s288, s289, s290, s291, s292, s293, s294, s295, s296, + s297, s298, s299, s300, s301, s302, s303, s304, s305, s306, s307, + s308, s309, s310, s311, s312, s313, s314, s315, s316, s317, s318, + s319, s320, s321, s322, s323, s324, s325, s326, s327, s328, s329, + s330, s331, s332, s333, s334, s335, s336, s337, s338, s339, s340, + s341, s342, s343, s344, s345, s346, s347, s348, s349, s350, s351, + s352, s353, s354, s355, s356, s357, s358, s359, s360, s361, s362, + s363, s364, s365, s366, s367, s368, s369, s370, s371, s372, s373, + s374, s375, s376, s377, s378, s379, s380, s381, s382, s383, s384, + s385, s386, s387, s388, s389, s390, s391, s392, s393, s394, s395, + s396, s397, s398, s399, s400, s401, s402, s403, s404, s405, s406, + s407, s408, s409, s410, s411, s412, s413, s414, s415, s416, s417, + s418, s419, s420, s421, s422, s423, s424, s425, s426, s427, s428, + s429, s430, s431, s432, s433, s434, s435, s436, s437, s438, s439, + s440, s441, s442, s443, s444, s445, s446, s447, s448, s449, s450, + s451, s452, s453, s454, s455, s456, s457, s458, s459, s460, s461, + s462, s463, s464, s465, s466, s467, s468, s469, s470, s471, s472, + s473, s474, s475, s476, s477, s478, s479, s480, s481, s482, s483, + s484, s485, s486, s487, s488, s489, s490, s491, s492, s493, s494, + s495, s496, s497, s498, s499, s500, s501, s502, s503, s504, s505, + s506, s507, s508, s509, s510, s511 + }; + const SBool table1[] = { + s513, s514, s515, s516, s517, s518, s519, s520, s521, s522, s523, + s524, s525, s526, s527, s528, s529, s530, s531, s532, s533, s534, + s535, s536, s537, s538, s539, s540, s541, s542, s543, s544, s545, + s546, s547, s548, s549, s550, s551, s552, s553, s554, s555, s556, + s557, s558, s559, s560, s561, s562, s563, s564, s565, s566, s567, + s568, s569, s570, s571, s572, s573, s574, s575, s576, s577, s578, + s579, s580, s581, s582, s583, s584, s585, s586, s587, s588, s589, + s590, s591, s592, s593, s594, s595, s596, s597, s598, s599, s600, + s601, s602, s603, s604, s605, s606, s607, s608, s609, s610, s611, + s612, s613, s614, s615, s616, s617, s618, s619, s620, s621, s622, + s623, s624, s625, s626, s627, s628, s629, s630, s631, s632, s633, + s634, s635, s636, s637, s638, s639, s640, s641, s642, s643, s644, + s645, s646, s647, s648, s649, s650, s651, s652, s653, s654, s655, + s656, s657, s658, s659, s660, s661, s662, s663, s664, s665, s666, + s667, s668, s669, s670, s671, s672, s673, s674, s675, s676, s677, + s678, s679, s680, s681, s682, s683, s684, s685, s686, s687, s688, + s689, s690, s691, s692, s693, s694, s695, s696, s697, s698, s699, + s700, s701, s702, s703, s704, s705, s706, s707, s708, s709, s710, + s711, s712, s713, s714, s715, s716, s717, s718, s719, s720, s721, + s722, s723, s724, s725, s726, s727, s728, s729, s730, s731, s732, + s733, s734, s735, s736, s737, s738, s739, s740, s741, s742, s743, + s744, s745, s746, s747, s748, s749, s750, s751, s752, s753, s754, + s755, s756, s757, s758, s759, s760, s761, s762, s763, s764, s765, + s766, s767, s768 + }; + const SBool table2[] = { + s770, s771, s772, s773, s774, s775, s776, s777, s778, s779, s780, + s781, s782, s783, s784, s785, s786, s787, s788, s789, s790, s791, + s792, s793, s794, s795, s796, s797, s798, s799, s800, s801, s802, + s803, s804, s805, s806, s807, s808, s809, s810, s811, s812, s813, + s814, s815, s816, s817, s818, s819, s820, s821, s822, s823, s824, + s825, s826, s827, s828, s829, s830, s831, s832, s833, s834, s835, + s836, s837, s838, s839, s840, s841, s842, s843, s844, s845, s846, + s847, s848, s849, s850, s851, s852, s853, s854, s855, s856, s857, + s858, s859, s860, s861, s862, s863, s864, s865, s866, s867, s868, + s869, s870, s871, s872, s873, s874, s875, s876, s877, s878, s879, + s880, s881, s882, s883, s884, s885, s886, s887, s888, s889, s890, + s891, s892, s893, s894, s895, s896, s897 + }; + const SBool table3[] = { + s899, s900, s901, s902, s903, s904, s905, s906, s907, s908, s909, + s910, s911, s912, s913, s914, s915, s916, s917, s918, s919, s920, + s921, s922, s923, s924, s925, s926, s927, s928, s929, s930, s931, + s932, s933, s934, s935, s936, s937, s938, s939, s940, s941, s942, + s943, s944, s945, s946, s947, s948, s949, s950, s951, s952, s953, + s954, s955, s956, s957, s958, s959, s960, s961, s962 + }; + const SBool table4[] = { + s964, s965, s966, s967, s968, s969, s970, s971, s972, s973, s974, + s975, s976, s977, s978, s979, s980, s981, s982, s983, s984, s985, + s986, s987, s988, s989, s990, s991, s992, s993, s994, s995 + }; + const SBool table5[] = { + s997, s998, s999, s1000, s1001, s1002, s1003, s1004, s1005, + s1006, s1007, s1008, s1009, s1010, s1011, s1012 + }; + const SBool table6[] = { + s1014, s1015, s1016, s1017, s1018, s1019, s1020, s1021 + }; + const SBool table7[] = { + s1023, s1024, s1025, s1026 + }; + const SBool table8[] = { + s1028, s1029 + }; + const SWord32 s1034 = (0x00000200UL == 0) ? s512 : (s512 % 0x00000200UL); + const SBool s1035 = table0[s1034]; + const SWord32 s1037 = (0x00000100UL == 0) ? s769 : (s769 % 0x00000100UL); + const SBool s1038 = table1[s1037]; + const SWord32 s1040 = (0x00000080UL == 0) ? s898 : (s898 % 0x00000080UL); + const SBool s1041 = table2[s1040]; + const SWord32 s1043 = (0x00000040UL == 0) ? s963 : (s963 % 0x00000040UL); + const SBool s1044 = table3[s1043]; + const SWord32 s1046 = (0x00000020UL == 0) ? s996 : (s996 % 0x00000020UL); + const SBool s1047 = table4[s1046]; + const SWord32 s1049 = (0x00000010UL == 0) ? s1013 : (s1013 % 0x00000010UL); + const SBool s1050 = table5[s1049]; + const SWord32 s1052 = (0x00000008UL == 0) ? s1022 : (s1022 % 0x00000008UL); + const SBool s1053 = table6[s1052]; + const SWord32 s1055 = (0x00000004UL == 0) ? s1027 : (s1027 % 0x00000004UL); + const SBool s1056 = table7[s1055]; + const SWord32 s1058 = (0x00000002UL == 0) ? s1030 : (s1030 % 0x00000002UL); + const SBool s1059 = table8[s1058]; + const SBool s1060 = !s1059; + const SBool s1061 = s1059 && s1060; + const SBool s1062 = s1059 && s1061; + const SBool s1063 = s1056 && s1062; + const SBool s1064 = s1053 && s1063; + const SBool s1065 = s1050 && s1064; + const SBool s1066 = s1047 && s1065; + const SBool s1067 = s1044 && s1066; + const SBool s1068 = s1041 && s1067; + const SBool s1069 = s1038 && s1068; + const SBool s1070 = s1035 && s1069; + const SBool s1071 = s1070 || s1031; + + return s1071; +} diff --git a/example21/copilot-sbv-codegen/update_state_11.c b/example21/copilot-sbv-codegen/update_state_11.c new file mode 100644 index 00000000..3f1ca6da --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_11.c @@ -0,0 +1,586 @@ +/* File: "update_state_11.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s11 +*/ +/*@ + assigns \nothing; + ensures \result == queue_11[ptr_11]; +*/ +SBool update_state_11(const SBool *queue_11, const SWord32 ptr_11) +{ + const SBool s0 = queue_11[0]; + const SBool s1 = queue_11[1]; + const SBool s2 = queue_11[2]; + const SBool s3 = queue_11[3]; + const SBool s4 = queue_11[4]; + const SBool s5 = queue_11[5]; + const SBool s6 = queue_11[6]; + const SBool s7 = queue_11[7]; + const SBool s8 = queue_11[8]; + const SBool s9 = queue_11[9]; + const SBool s10 = queue_11[10]; + const SBool s11 = queue_11[11]; + const SBool s12 = queue_11[12]; + const SBool s13 = queue_11[13]; + const SBool s14 = queue_11[14]; + const SBool s15 = queue_11[15]; + const SBool s16 = queue_11[16]; + const SBool s17 = queue_11[17]; + const SBool s18 = queue_11[18]; + const SBool s19 = queue_11[19]; + const SBool s20 = queue_11[20]; + const SBool s21 = queue_11[21]; + const SBool s22 = queue_11[22]; + const SBool s23 = queue_11[23]; + const SBool s24 = queue_11[24]; + const SBool s25 = queue_11[25]; + const SBool s26 = queue_11[26]; + const SBool s27 = queue_11[27]; + const SBool s28 = queue_11[28]; + const SBool s29 = queue_11[29]; + const SBool s30 = queue_11[30]; + const SBool s31 = queue_11[31]; + const SBool s32 = queue_11[32]; + const SBool s33 = queue_11[33]; + const SBool s34 = queue_11[34]; + const SBool s35 = queue_11[35]; + const SBool s36 = queue_11[36]; + const SBool s37 = queue_11[37]; + const SBool s38 = queue_11[38]; + const SBool s39 = queue_11[39]; + const SBool s40 = queue_11[40]; + const SBool s41 = queue_11[41]; + const SBool s42 = queue_11[42]; + const SBool s43 = queue_11[43]; + const SBool s44 = queue_11[44]; + const SBool s45 = queue_11[45]; + const SBool s46 = queue_11[46]; + const SBool s47 = queue_11[47]; + const SBool s48 = queue_11[48]; + const SBool s49 = queue_11[49]; + const SBool s50 = queue_11[50]; + const SBool s51 = queue_11[51]; + const SBool s52 = queue_11[52]; + const SBool s53 = queue_11[53]; + const SBool s54 = queue_11[54]; + const SBool s55 = queue_11[55]; + const SBool s56 = queue_11[56]; + const SBool s57 = queue_11[57]; + const SBool s58 = queue_11[58]; + const SBool s59 = queue_11[59]; + const SBool s60 = queue_11[60]; + const SBool s61 = queue_11[61]; + const SBool s62 = queue_11[62]; + const SBool s63 = queue_11[63]; + const SBool s64 = queue_11[64]; + const SBool s65 = queue_11[65]; + const SBool s66 = queue_11[66]; + const SBool s67 = queue_11[67]; + const SBool s68 = queue_11[68]; + const SBool s69 = queue_11[69]; + const SBool s70 = queue_11[70]; + const SBool s71 = queue_11[71]; + const SBool s72 = queue_11[72]; + const SBool s73 = queue_11[73]; + const SBool s74 = queue_11[74]; + const SBool s75 = queue_11[75]; + const SBool s76 = queue_11[76]; + const SBool s77 = queue_11[77]; + const SBool s78 = queue_11[78]; + const SBool s79 = queue_11[79]; + const SBool s80 = queue_11[80]; + const SBool s81 = queue_11[81]; + const SBool s82 = queue_11[82]; + const SBool s83 = queue_11[83]; + const SBool s84 = queue_11[84]; + const SBool s85 = queue_11[85]; + const SBool s86 = queue_11[86]; + const SBool s87 = queue_11[87]; + const SBool s88 = queue_11[88]; + const SBool s89 = queue_11[89]; + const SBool s90 = queue_11[90]; + const SBool s91 = queue_11[91]; + const SBool s92 = queue_11[92]; + const SBool s93 = queue_11[93]; + const SBool s94 = queue_11[94]; + const SBool s95 = queue_11[95]; + const SBool s96 = queue_11[96]; + const SBool s97 = queue_11[97]; + const SBool s98 = queue_11[98]; + const SBool s99 = queue_11[99]; + const SBool s100 = queue_11[100]; + const SBool s101 = queue_11[101]; + const SBool s102 = queue_11[102]; + const SBool s103 = queue_11[103]; + const SBool s104 = queue_11[104]; + const SBool s105 = queue_11[105]; + const SBool s106 = queue_11[106]; + const SBool s107 = queue_11[107]; + const SBool s108 = queue_11[108]; + const SBool s109 = queue_11[109]; + const SBool s110 = queue_11[110]; + const SBool s111 = queue_11[111]; + const SBool s112 = queue_11[112]; + const SBool s113 = queue_11[113]; + const SBool s114 = queue_11[114]; + const SBool s115 = queue_11[115]; + const SBool s116 = queue_11[116]; + const SBool s117 = queue_11[117]; + const SBool s118 = queue_11[118]; + const SBool s119 = queue_11[119]; + const SBool s120 = queue_11[120]; + const SBool s121 = queue_11[121]; + const SBool s122 = queue_11[122]; + const SBool s123 = queue_11[123]; + const SBool s124 = queue_11[124]; + const SBool s125 = queue_11[125]; + const SBool s126 = queue_11[126]; + const SBool s127 = queue_11[127]; + const SBool s128 = queue_11[128]; + const SBool s129 = queue_11[129]; + const SBool s130 = queue_11[130]; + const SBool s131 = queue_11[131]; + const SBool s132 = queue_11[132]; + const SBool s133 = queue_11[133]; + const SBool s134 = queue_11[134]; + const SBool s135 = queue_11[135]; + const SBool s136 = queue_11[136]; + const SBool s137 = queue_11[137]; + const SBool s138 = queue_11[138]; + const SBool s139 = queue_11[139]; + const SBool s140 = queue_11[140]; + const SBool s141 = queue_11[141]; + const SBool s142 = queue_11[142]; + const SBool s143 = queue_11[143]; + const SBool s144 = queue_11[144]; + const SBool s145 = queue_11[145]; + const SBool s146 = queue_11[146]; + const SBool s147 = queue_11[147]; + const SBool s148 = queue_11[148]; + const SBool s149 = queue_11[149]; + const SBool s150 = queue_11[150]; + const SBool s151 = queue_11[151]; + const SBool s152 = queue_11[152]; + const SBool s153 = queue_11[153]; + const SBool s154 = queue_11[154]; + const SBool s155 = queue_11[155]; + const SBool s156 = queue_11[156]; + const SBool s157 = queue_11[157]; + const SBool s158 = queue_11[158]; + const SBool s159 = queue_11[159]; + const SBool s160 = queue_11[160]; + const SBool s161 = queue_11[161]; + const SBool s162 = queue_11[162]; + const SBool s163 = queue_11[163]; + const SBool s164 = queue_11[164]; + const SBool s165 = queue_11[165]; + const SBool s166 = queue_11[166]; + const SBool s167 = queue_11[167]; + const SBool s168 = queue_11[168]; + const SBool s169 = queue_11[169]; + const SBool s170 = queue_11[170]; + const SBool s171 = queue_11[171]; + const SBool s172 = queue_11[172]; + const SBool s173 = queue_11[173]; + const SBool s174 = queue_11[174]; + const SBool s175 = queue_11[175]; + const SBool s176 = queue_11[176]; + const SBool s177 = queue_11[177]; + const SBool s178 = queue_11[178]; + const SBool s179 = queue_11[179]; + const SBool s180 = queue_11[180]; + const SBool s181 = queue_11[181]; + const SBool s182 = queue_11[182]; + const SBool s183 = queue_11[183]; + const SBool s184 = queue_11[184]; + const SBool s185 = queue_11[185]; + const SBool s186 = queue_11[186]; + const SBool s187 = queue_11[187]; + const SBool s188 = queue_11[188]; + const SBool s189 = queue_11[189]; + const SBool s190 = queue_11[190]; + const SBool s191 = queue_11[191]; + const SBool s192 = queue_11[192]; + const SBool s193 = queue_11[193]; + const SBool s194 = queue_11[194]; + const SBool s195 = queue_11[195]; + const SBool s196 = queue_11[196]; + const SBool s197 = queue_11[197]; + const SBool s198 = queue_11[198]; + const SBool s199 = queue_11[199]; + const SBool s200 = queue_11[200]; + const SBool s201 = queue_11[201]; + const SBool s202 = queue_11[202]; + const SBool s203 = queue_11[203]; + const SBool s204 = queue_11[204]; + const SBool s205 = queue_11[205]; + const SBool s206 = queue_11[206]; + const SBool s207 = queue_11[207]; + const SBool s208 = queue_11[208]; + const SBool s209 = queue_11[209]; + const SBool s210 = queue_11[210]; + const SBool s211 = queue_11[211]; + const SBool s212 = queue_11[212]; + const SBool s213 = queue_11[213]; + const SBool s214 = queue_11[214]; + const SBool s215 = queue_11[215]; + const SBool s216 = queue_11[216]; + const SBool s217 = queue_11[217]; + const SBool s218 = queue_11[218]; + const SBool s219 = queue_11[219]; + const SBool s220 = queue_11[220]; + const SBool s221 = queue_11[221]; + const SBool s222 = queue_11[222]; + const SBool s223 = queue_11[223]; + const SBool s224 = queue_11[224]; + const SBool s225 = queue_11[225]; + const SBool s226 = queue_11[226]; + const SBool s227 = queue_11[227]; + const SBool s228 = queue_11[228]; + const SBool s229 = queue_11[229]; + const SBool s230 = queue_11[230]; + const SBool s231 = queue_11[231]; + const SBool s232 = queue_11[232]; + const SBool s233 = queue_11[233]; + const SBool s234 = queue_11[234]; + const SBool s235 = queue_11[235]; + const SBool s236 = queue_11[236]; + const SBool s237 = queue_11[237]; + const SBool s238 = queue_11[238]; + const SBool s239 = queue_11[239]; + const SBool s240 = queue_11[240]; + const SBool s241 = queue_11[241]; + const SBool s242 = queue_11[242]; + const SBool s243 = queue_11[243]; + const SBool s244 = queue_11[244]; + const SBool s245 = queue_11[245]; + const SBool s246 = queue_11[246]; + const SBool s247 = queue_11[247]; + const SBool s248 = queue_11[248]; + const SBool s249 = queue_11[249]; + const SBool s250 = queue_11[250]; + const SBool s251 = queue_11[251]; + const SBool s252 = queue_11[252]; + const SBool s253 = queue_11[253]; + const SBool s254 = queue_11[254]; + const SBool s255 = queue_11[255]; + const SBool s256 = queue_11[256]; + const SBool s257 = queue_11[257]; + const SBool s258 = queue_11[258]; + const SBool s259 = queue_11[259]; + const SBool s260 = queue_11[260]; + const SBool s261 = queue_11[261]; + const SBool s262 = queue_11[262]; + const SBool s263 = queue_11[263]; + const SBool s264 = queue_11[264]; + const SBool s265 = queue_11[265]; + const SBool s266 = queue_11[266]; + const SBool s267 = queue_11[267]; + const SBool s268 = queue_11[268]; + const SBool s269 = queue_11[269]; + const SBool s270 = queue_11[270]; + const SBool s271 = queue_11[271]; + const SBool s272 = queue_11[272]; + const SBool s273 = queue_11[273]; + const SBool s274 = queue_11[274]; + const SBool s275 = queue_11[275]; + const SBool s276 = queue_11[276]; + const SBool s277 = queue_11[277]; + const SBool s278 = queue_11[278]; + const SBool s279 = queue_11[279]; + const SBool s280 = queue_11[280]; + const SBool s281 = queue_11[281]; + const SBool s282 = queue_11[282]; + const SBool s283 = queue_11[283]; + const SBool s284 = queue_11[284]; + const SBool s285 = queue_11[285]; + const SBool s286 = queue_11[286]; + const SBool s287 = queue_11[287]; + const SBool s288 = queue_11[288]; + const SBool s289 = queue_11[289]; + const SBool s290 = queue_11[290]; + const SBool s291 = queue_11[291]; + const SBool s292 = queue_11[292]; + const SBool s293 = queue_11[293]; + const SBool s294 = queue_11[294]; + const SBool s295 = queue_11[295]; + const SBool s296 = queue_11[296]; + const SBool s297 = queue_11[297]; + const SBool s298 = queue_11[298]; + const SBool s299 = queue_11[299]; + const SBool s300 = queue_11[300]; + const SBool s301 = queue_11[301]; + const SBool s302 = queue_11[302]; + const SBool s303 = queue_11[303]; + const SBool s304 = queue_11[304]; + const SBool s305 = queue_11[305]; + const SBool s306 = queue_11[306]; + const SBool s307 = queue_11[307]; + const SBool s308 = queue_11[308]; + const SBool s309 = queue_11[309]; + const SBool s310 = queue_11[310]; + const SBool s311 = queue_11[311]; + const SBool s312 = queue_11[312]; + const SBool s313 = queue_11[313]; + const SBool s314 = queue_11[314]; + const SBool s315 = queue_11[315]; + const SBool s316 = queue_11[316]; + const SBool s317 = queue_11[317]; + const SBool s318 = queue_11[318]; + const SBool s319 = queue_11[319]; + const SBool s320 = queue_11[320]; + const SBool s321 = queue_11[321]; + const SBool s322 = queue_11[322]; + const SBool s323 = queue_11[323]; + const SBool s324 = queue_11[324]; + const SBool s325 = queue_11[325]; + const SBool s326 = queue_11[326]; + const SBool s327 = queue_11[327]; + const SBool s328 = queue_11[328]; + const SBool s329 = queue_11[329]; + const SBool s330 = queue_11[330]; + const SBool s331 = queue_11[331]; + const SBool s332 = queue_11[332]; + const SBool s333 = queue_11[333]; + const SBool s334 = queue_11[334]; + const SBool s335 = queue_11[335]; + const SBool s336 = queue_11[336]; + const SBool s337 = queue_11[337]; + const SBool s338 = queue_11[338]; + const SBool s339 = queue_11[339]; + const SBool s340 = queue_11[340]; + const SBool s341 = queue_11[341]; + const SBool s342 = queue_11[342]; + const SBool s343 = queue_11[343]; + const SBool s344 = queue_11[344]; + const SBool s345 = queue_11[345]; + const SBool s346 = queue_11[346]; + const SBool s347 = queue_11[347]; + const SBool s348 = queue_11[348]; + const SBool s349 = queue_11[349]; + const SBool s350 = queue_11[350]; + const SBool s351 = queue_11[351]; + const SBool s352 = queue_11[352]; + const SBool s353 = queue_11[353]; + const SBool s354 = queue_11[354]; + const SBool s355 = queue_11[355]; + const SBool s356 = queue_11[356]; + const SBool s357 = queue_11[357]; + const SBool s358 = queue_11[358]; + const SBool s359 = queue_11[359]; + const SBool s360 = queue_11[360]; + const SBool s361 = queue_11[361]; + const SBool s362 = queue_11[362]; + const SBool s363 = queue_11[363]; + const SBool s364 = queue_11[364]; + const SBool s365 = queue_11[365]; + const SBool s366 = queue_11[366]; + const SBool s367 = queue_11[367]; + const SBool s368 = queue_11[368]; + const SBool s369 = queue_11[369]; + const SBool s370 = queue_11[370]; + const SBool s371 = queue_11[371]; + const SBool s372 = queue_11[372]; + const SBool s373 = queue_11[373]; + const SBool s374 = queue_11[374]; + const SBool s375 = queue_11[375]; + const SBool s376 = queue_11[376]; + const SBool s377 = queue_11[377]; + const SBool s378 = queue_11[378]; + const SBool s379 = queue_11[379]; + const SBool s380 = queue_11[380]; + const SBool s381 = queue_11[381]; + const SBool s382 = queue_11[382]; + const SBool s383 = queue_11[383]; + const SBool s384 = queue_11[384]; + const SBool s385 = queue_11[385]; + const SBool s386 = queue_11[386]; + const SBool s387 = queue_11[387]; + const SBool s388 = queue_11[388]; + const SBool s389 = queue_11[389]; + const SBool s390 = queue_11[390]; + const SBool s391 = queue_11[391]; + const SBool s392 = queue_11[392]; + const SBool s393 = queue_11[393]; + const SBool s394 = queue_11[394]; + const SBool s395 = queue_11[395]; + const SBool s396 = queue_11[396]; + const SBool s397 = queue_11[397]; + const SBool s398 = queue_11[398]; + const SBool s399 = queue_11[399]; + const SBool s400 = queue_11[400]; + const SBool s401 = queue_11[401]; + const SBool s402 = queue_11[402]; + const SBool s403 = queue_11[403]; + const SBool s404 = queue_11[404]; + const SBool s405 = queue_11[405]; + const SBool s406 = queue_11[406]; + const SBool s407 = queue_11[407]; + const SBool s408 = queue_11[408]; + const SBool s409 = queue_11[409]; + const SBool s410 = queue_11[410]; + const SBool s411 = queue_11[411]; + const SBool s412 = queue_11[412]; + const SBool s413 = queue_11[413]; + const SBool s414 = queue_11[414]; + const SBool s415 = queue_11[415]; + const SBool s416 = queue_11[416]; + const SBool s417 = queue_11[417]; + const SBool s418 = queue_11[418]; + const SBool s419 = queue_11[419]; + const SBool s420 = queue_11[420]; + const SBool s421 = queue_11[421]; + const SBool s422 = queue_11[422]; + const SBool s423 = queue_11[423]; + const SBool s424 = queue_11[424]; + const SBool s425 = queue_11[425]; + const SBool s426 = queue_11[426]; + const SBool s427 = queue_11[427]; + const SBool s428 = queue_11[428]; + const SBool s429 = queue_11[429]; + const SBool s430 = queue_11[430]; + const SBool s431 = queue_11[431]; + const SBool s432 = queue_11[432]; + const SBool s433 = queue_11[433]; + const SBool s434 = queue_11[434]; + const SBool s435 = queue_11[435]; + const SBool s436 = queue_11[436]; + const SBool s437 = queue_11[437]; + const SBool s438 = queue_11[438]; + const SBool s439 = queue_11[439]; + const SBool s440 = queue_11[440]; + const SBool s441 = queue_11[441]; + const SBool s442 = queue_11[442]; + const SBool s443 = queue_11[443]; + const SBool s444 = queue_11[444]; + const SBool s445 = queue_11[445]; + const SBool s446 = queue_11[446]; + const SBool s447 = queue_11[447]; + const SBool s448 = queue_11[448]; + const SBool s449 = queue_11[449]; + const SBool s450 = queue_11[450]; + const SBool s451 = queue_11[451]; + const SBool s452 = queue_11[452]; + const SBool s453 = queue_11[453]; + const SBool s454 = queue_11[454]; + const SBool s455 = queue_11[455]; + const SBool s456 = queue_11[456]; + const SBool s457 = queue_11[457]; + const SBool s458 = queue_11[458]; + const SBool s459 = queue_11[459]; + const SBool s460 = queue_11[460]; + const SBool s461 = queue_11[461]; + const SBool s462 = queue_11[462]; + const SBool s463 = queue_11[463]; + const SBool s464 = queue_11[464]; + const SBool s465 = queue_11[465]; + const SBool s466 = queue_11[466]; + const SBool s467 = queue_11[467]; + const SBool s468 = queue_11[468]; + const SBool s469 = queue_11[469]; + const SBool s470 = queue_11[470]; + const SBool s471 = queue_11[471]; + const SBool s472 = queue_11[472]; + const SBool s473 = queue_11[473]; + const SBool s474 = queue_11[474]; + const SBool s475 = queue_11[475]; + const SBool s476 = queue_11[476]; + const SBool s477 = queue_11[477]; + const SBool s478 = queue_11[478]; + const SBool s479 = queue_11[479]; + const SBool s480 = queue_11[480]; + const SBool s481 = queue_11[481]; + const SBool s482 = queue_11[482]; + const SBool s483 = queue_11[483]; + const SBool s484 = queue_11[484]; + const SBool s485 = queue_11[485]; + const SBool s486 = queue_11[486]; + const SBool s487 = queue_11[487]; + const SBool s488 = queue_11[488]; + const SBool s489 = queue_11[489]; + const SBool s490 = queue_11[490]; + const SBool s491 = queue_11[491]; + const SBool s492 = queue_11[492]; + const SBool s493 = queue_11[493]; + const SBool s494 = queue_11[494]; + const SBool s495 = queue_11[495]; + const SBool s496 = queue_11[496]; + const SBool s497 = queue_11[497]; + const SBool s498 = queue_11[498]; + const SBool s499 = queue_11[499]; + const SBool s500 = queue_11[500]; + const SBool s501 = queue_11[501]; + const SBool s502 = queue_11[502]; + const SBool s503 = queue_11[503]; + const SBool s504 = queue_11[504]; + const SBool s505 = queue_11[505]; + const SBool s506 = queue_11[506]; + const SBool s507 = queue_11[507]; + const SBool s508 = queue_11[508]; + const SBool s509 = queue_11[509]; + const SBool s510 = queue_11[510]; + const SBool s511 = queue_11[511]; + const SWord32 s512 = ptr_11; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255, s256, s257, s258, s259, s260, s261, s262, s263, + s264, s265, s266, s267, s268, s269, s270, s271, s272, s273, s274, + s275, s276, s277, s278, s279, s280, s281, s282, s283, s284, s285, + s286, s287, s288, s289, s290, s291, s292, s293, s294, s295, s296, + s297, s298, s299, s300, s301, s302, s303, s304, s305, s306, s307, + s308, s309, s310, s311, s312, s313, s314, s315, s316, s317, s318, + s319, s320, s321, s322, s323, s324, s325, s326, s327, s328, s329, + s330, s331, s332, s333, s334, s335, s336, s337, s338, s339, s340, + s341, s342, s343, s344, s345, s346, s347, s348, s349, s350, s351, + s352, s353, s354, s355, s356, s357, s358, s359, s360, s361, s362, + s363, s364, s365, s366, s367, s368, s369, s370, s371, s372, s373, + s374, s375, s376, s377, s378, s379, s380, s381, s382, s383, s384, + s385, s386, s387, s388, s389, s390, s391, s392, s393, s394, s395, + s396, s397, s398, s399, s400, s401, s402, s403, s404, s405, s406, + s407, s408, s409, s410, s411, s412, s413, s414, s415, s416, s417, + s418, s419, s420, s421, s422, s423, s424, s425, s426, s427, s428, + s429, s430, s431, s432, s433, s434, s435, s436, s437, s438, s439, + s440, s441, s442, s443, s444, s445, s446, s447, s448, s449, s450, + s451, s452, s453, s454, s455, s456, s457, s458, s459, s460, s461, + s462, s463, s464, s465, s466, s467, s468, s469, s470, s471, s472, + s473, s474, s475, s476, s477, s478, s479, s480, s481, s482, s483, + s484, s485, s486, s487, s488, s489, s490, s491, s492, s493, s494, + s495, s496, s497, s498, s499, s500, s501, s502, s503, s504, s505, + s506, s507, s508, s509, s510, s511 + }; + const SWord32 s514 = (0x00000200UL == 0) ? s512 : (s512 % 0x00000200UL); + const SBool s515 = table0[s514]; + + return s515; +} diff --git a/example21/copilot-sbv-codegen/update_state_12.c b/example21/copilot-sbv-codegen/update_state_12.c new file mode 100644 index 00000000..348da85b --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_12.c @@ -0,0 +1,307 @@ +/* File: "update_state_12.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s12 +*/ +/*@ + assigns \nothing; + ensures \result == queue_12[ptr_12]; +*/ +SBool update_state_12(const SBool *queue_12, const SWord32 ptr_12) +{ + const SBool s0 = queue_12[0]; + const SBool s1 = queue_12[1]; + const SBool s2 = queue_12[2]; + const SBool s3 = queue_12[3]; + const SBool s4 = queue_12[4]; + const SBool s5 = queue_12[5]; + const SBool s6 = queue_12[6]; + const SBool s7 = queue_12[7]; + const SBool s8 = queue_12[8]; + const SBool s9 = queue_12[9]; + const SBool s10 = queue_12[10]; + const SBool s11 = queue_12[11]; + const SBool s12 = queue_12[12]; + const SBool s13 = queue_12[13]; + const SBool s14 = queue_12[14]; + const SBool s15 = queue_12[15]; + const SBool s16 = queue_12[16]; + const SBool s17 = queue_12[17]; + const SBool s18 = queue_12[18]; + const SBool s19 = queue_12[19]; + const SBool s20 = queue_12[20]; + const SBool s21 = queue_12[21]; + const SBool s22 = queue_12[22]; + const SBool s23 = queue_12[23]; + const SBool s24 = queue_12[24]; + const SBool s25 = queue_12[25]; + const SBool s26 = queue_12[26]; + const SBool s27 = queue_12[27]; + const SBool s28 = queue_12[28]; + const SBool s29 = queue_12[29]; + const SBool s30 = queue_12[30]; + const SBool s31 = queue_12[31]; + const SBool s32 = queue_12[32]; + const SBool s33 = queue_12[33]; + const SBool s34 = queue_12[34]; + const SBool s35 = queue_12[35]; + const SBool s36 = queue_12[36]; + const SBool s37 = queue_12[37]; + const SBool s38 = queue_12[38]; + const SBool s39 = queue_12[39]; + const SBool s40 = queue_12[40]; + const SBool s41 = queue_12[41]; + const SBool s42 = queue_12[42]; + const SBool s43 = queue_12[43]; + const SBool s44 = queue_12[44]; + const SBool s45 = queue_12[45]; + const SBool s46 = queue_12[46]; + const SBool s47 = queue_12[47]; + const SBool s48 = queue_12[48]; + const SBool s49 = queue_12[49]; + const SBool s50 = queue_12[50]; + const SBool s51 = queue_12[51]; + const SBool s52 = queue_12[52]; + const SBool s53 = queue_12[53]; + const SBool s54 = queue_12[54]; + const SBool s55 = queue_12[55]; + const SBool s56 = queue_12[56]; + const SBool s57 = queue_12[57]; + const SBool s58 = queue_12[58]; + const SBool s59 = queue_12[59]; + const SBool s60 = queue_12[60]; + const SBool s61 = queue_12[61]; + const SBool s62 = queue_12[62]; + const SBool s63 = queue_12[63]; + const SBool s64 = queue_12[64]; + const SBool s65 = queue_12[65]; + const SBool s66 = queue_12[66]; + const SBool s67 = queue_12[67]; + const SBool s68 = queue_12[68]; + const SBool s69 = queue_12[69]; + const SBool s70 = queue_12[70]; + const SBool s71 = queue_12[71]; + const SBool s72 = queue_12[72]; + const SBool s73 = queue_12[73]; + const SBool s74 = queue_12[74]; + const SBool s75 = queue_12[75]; + const SBool s76 = queue_12[76]; + const SBool s77 = queue_12[77]; + const SBool s78 = queue_12[78]; + const SBool s79 = queue_12[79]; + const SBool s80 = queue_12[80]; + const SBool s81 = queue_12[81]; + const SBool s82 = queue_12[82]; + const SBool s83 = queue_12[83]; + const SBool s84 = queue_12[84]; + const SBool s85 = queue_12[85]; + const SBool s86 = queue_12[86]; + const SBool s87 = queue_12[87]; + const SBool s88 = queue_12[88]; + const SBool s89 = queue_12[89]; + const SBool s90 = queue_12[90]; + const SBool s91 = queue_12[91]; + const SBool s92 = queue_12[92]; + const SBool s93 = queue_12[93]; + const SBool s94 = queue_12[94]; + const SBool s95 = queue_12[95]; + const SBool s96 = queue_12[96]; + const SBool s97 = queue_12[97]; + const SBool s98 = queue_12[98]; + const SBool s99 = queue_12[99]; + const SBool s100 = queue_12[100]; + const SBool s101 = queue_12[101]; + const SBool s102 = queue_12[102]; + const SBool s103 = queue_12[103]; + const SBool s104 = queue_12[104]; + const SBool s105 = queue_12[105]; + const SBool s106 = queue_12[106]; + const SBool s107 = queue_12[107]; + const SBool s108 = queue_12[108]; + const SBool s109 = queue_12[109]; + const SBool s110 = queue_12[110]; + const SBool s111 = queue_12[111]; + const SBool s112 = queue_12[112]; + const SBool s113 = queue_12[113]; + const SBool s114 = queue_12[114]; + const SBool s115 = queue_12[115]; + const SBool s116 = queue_12[116]; + const SBool s117 = queue_12[117]; + const SBool s118 = queue_12[118]; + const SBool s119 = queue_12[119]; + const SBool s120 = queue_12[120]; + const SBool s121 = queue_12[121]; + const SBool s122 = queue_12[122]; + const SBool s123 = queue_12[123]; + const SBool s124 = queue_12[124]; + const SBool s125 = queue_12[125]; + const SBool s126 = queue_12[126]; + const SBool s127 = queue_12[127]; + const SBool s128 = queue_12[128]; + const SBool s129 = queue_12[129]; + const SBool s130 = queue_12[130]; + const SBool s131 = queue_12[131]; + const SBool s132 = queue_12[132]; + const SBool s133 = queue_12[133]; + const SBool s134 = queue_12[134]; + const SBool s135 = queue_12[135]; + const SBool s136 = queue_12[136]; + const SBool s137 = queue_12[137]; + const SBool s138 = queue_12[138]; + const SBool s139 = queue_12[139]; + const SBool s140 = queue_12[140]; + const SBool s141 = queue_12[141]; + const SBool s142 = queue_12[142]; + const SBool s143 = queue_12[143]; + const SBool s144 = queue_12[144]; + const SBool s145 = queue_12[145]; + const SBool s146 = queue_12[146]; + const SBool s147 = queue_12[147]; + const SBool s148 = queue_12[148]; + const SBool s149 = queue_12[149]; + const SBool s150 = queue_12[150]; + const SBool s151 = queue_12[151]; + const SBool s152 = queue_12[152]; + const SBool s153 = queue_12[153]; + const SBool s154 = queue_12[154]; + const SBool s155 = queue_12[155]; + const SBool s156 = queue_12[156]; + const SBool s157 = queue_12[157]; + const SBool s158 = queue_12[158]; + const SBool s159 = queue_12[159]; + const SBool s160 = queue_12[160]; + const SBool s161 = queue_12[161]; + const SBool s162 = queue_12[162]; + const SBool s163 = queue_12[163]; + const SBool s164 = queue_12[164]; + const SBool s165 = queue_12[165]; + const SBool s166 = queue_12[166]; + const SBool s167 = queue_12[167]; + const SBool s168 = queue_12[168]; + const SBool s169 = queue_12[169]; + const SBool s170 = queue_12[170]; + const SBool s171 = queue_12[171]; + const SBool s172 = queue_12[172]; + const SBool s173 = queue_12[173]; + const SBool s174 = queue_12[174]; + const SBool s175 = queue_12[175]; + const SBool s176 = queue_12[176]; + const SBool s177 = queue_12[177]; + const SBool s178 = queue_12[178]; + const SBool s179 = queue_12[179]; + const SBool s180 = queue_12[180]; + const SBool s181 = queue_12[181]; + const SBool s182 = queue_12[182]; + const SBool s183 = queue_12[183]; + const SBool s184 = queue_12[184]; + const SBool s185 = queue_12[185]; + const SBool s186 = queue_12[186]; + const SBool s187 = queue_12[187]; + const SBool s188 = queue_12[188]; + const SBool s189 = queue_12[189]; + const SBool s190 = queue_12[190]; + const SBool s191 = queue_12[191]; + const SBool s192 = queue_12[192]; + const SBool s193 = queue_12[193]; + const SBool s194 = queue_12[194]; + const SBool s195 = queue_12[195]; + const SBool s196 = queue_12[196]; + const SBool s197 = queue_12[197]; + const SBool s198 = queue_12[198]; + const SBool s199 = queue_12[199]; + const SBool s200 = queue_12[200]; + const SBool s201 = queue_12[201]; + const SBool s202 = queue_12[202]; + const SBool s203 = queue_12[203]; + const SBool s204 = queue_12[204]; + const SBool s205 = queue_12[205]; + const SBool s206 = queue_12[206]; + const SBool s207 = queue_12[207]; + const SBool s208 = queue_12[208]; + const SBool s209 = queue_12[209]; + const SBool s210 = queue_12[210]; + const SBool s211 = queue_12[211]; + const SBool s212 = queue_12[212]; + const SBool s213 = queue_12[213]; + const SBool s214 = queue_12[214]; + const SBool s215 = queue_12[215]; + const SBool s216 = queue_12[216]; + const SBool s217 = queue_12[217]; + const SBool s218 = queue_12[218]; + const SBool s219 = queue_12[219]; + const SBool s220 = queue_12[220]; + const SBool s221 = queue_12[221]; + const SBool s222 = queue_12[222]; + const SBool s223 = queue_12[223]; + const SBool s224 = queue_12[224]; + const SBool s225 = queue_12[225]; + const SBool s226 = queue_12[226]; + const SBool s227 = queue_12[227]; + const SBool s228 = queue_12[228]; + const SBool s229 = queue_12[229]; + const SBool s230 = queue_12[230]; + const SBool s231 = queue_12[231]; + const SBool s232 = queue_12[232]; + const SBool s233 = queue_12[233]; + const SBool s234 = queue_12[234]; + const SBool s235 = queue_12[235]; + const SBool s236 = queue_12[236]; + const SBool s237 = queue_12[237]; + const SBool s238 = queue_12[238]; + const SBool s239 = queue_12[239]; + const SBool s240 = queue_12[240]; + const SBool s241 = queue_12[241]; + const SBool s242 = queue_12[242]; + const SBool s243 = queue_12[243]; + const SBool s244 = queue_12[244]; + const SBool s245 = queue_12[245]; + const SBool s246 = queue_12[246]; + const SBool s247 = queue_12[247]; + const SBool s248 = queue_12[248]; + const SBool s249 = queue_12[249]; + const SBool s250 = queue_12[250]; + const SBool s251 = queue_12[251]; + const SBool s252 = queue_12[252]; + const SBool s253 = queue_12[253]; + const SBool s254 = queue_12[254]; + const SBool s255 = queue_12[255]; + const SWord32 s256 = ptr_12; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255 + }; + const SWord32 s258 = (0x00000100UL == 0) ? s256 : (s256 % 0x00000100UL); + const SBool s259 = table0[s258]; + + return s259; +} diff --git a/example21/copilot-sbv-codegen/update_state_13.c b/example21/copilot-sbv-codegen/update_state_13.c new file mode 100644 index 00000000..62029ad5 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_13.c @@ -0,0 +1,167 @@ +/* File: "update_state_13.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s13 +*/ +/*@ + assigns \nothing; + ensures \result == queue_13[ptr_13]; +*/ +SBool update_state_13(const SBool *queue_13, const SWord32 ptr_13) +{ + const SBool s0 = queue_13[0]; + const SBool s1 = queue_13[1]; + const SBool s2 = queue_13[2]; + const SBool s3 = queue_13[3]; + const SBool s4 = queue_13[4]; + const SBool s5 = queue_13[5]; + const SBool s6 = queue_13[6]; + const SBool s7 = queue_13[7]; + const SBool s8 = queue_13[8]; + const SBool s9 = queue_13[9]; + const SBool s10 = queue_13[10]; + const SBool s11 = queue_13[11]; + const SBool s12 = queue_13[12]; + const SBool s13 = queue_13[13]; + const SBool s14 = queue_13[14]; + const SBool s15 = queue_13[15]; + const SBool s16 = queue_13[16]; + const SBool s17 = queue_13[17]; + const SBool s18 = queue_13[18]; + const SBool s19 = queue_13[19]; + const SBool s20 = queue_13[20]; + const SBool s21 = queue_13[21]; + const SBool s22 = queue_13[22]; + const SBool s23 = queue_13[23]; + const SBool s24 = queue_13[24]; + const SBool s25 = queue_13[25]; + const SBool s26 = queue_13[26]; + const SBool s27 = queue_13[27]; + const SBool s28 = queue_13[28]; + const SBool s29 = queue_13[29]; + const SBool s30 = queue_13[30]; + const SBool s31 = queue_13[31]; + const SBool s32 = queue_13[32]; + const SBool s33 = queue_13[33]; + const SBool s34 = queue_13[34]; + const SBool s35 = queue_13[35]; + const SBool s36 = queue_13[36]; + const SBool s37 = queue_13[37]; + const SBool s38 = queue_13[38]; + const SBool s39 = queue_13[39]; + const SBool s40 = queue_13[40]; + const SBool s41 = queue_13[41]; + const SBool s42 = queue_13[42]; + const SBool s43 = queue_13[43]; + const SBool s44 = queue_13[44]; + const SBool s45 = queue_13[45]; + const SBool s46 = queue_13[46]; + const SBool s47 = queue_13[47]; + const SBool s48 = queue_13[48]; + const SBool s49 = queue_13[49]; + const SBool s50 = queue_13[50]; + const SBool s51 = queue_13[51]; + const SBool s52 = queue_13[52]; + const SBool s53 = queue_13[53]; + const SBool s54 = queue_13[54]; + const SBool s55 = queue_13[55]; + const SBool s56 = queue_13[56]; + const SBool s57 = queue_13[57]; + const SBool s58 = queue_13[58]; + const SBool s59 = queue_13[59]; + const SBool s60 = queue_13[60]; + const SBool s61 = queue_13[61]; + const SBool s62 = queue_13[62]; + const SBool s63 = queue_13[63]; + const SBool s64 = queue_13[64]; + const SBool s65 = queue_13[65]; + const SBool s66 = queue_13[66]; + const SBool s67 = queue_13[67]; + const SBool s68 = queue_13[68]; + const SBool s69 = queue_13[69]; + const SBool s70 = queue_13[70]; + const SBool s71 = queue_13[71]; + const SBool s72 = queue_13[72]; + const SBool s73 = queue_13[73]; + const SBool s74 = queue_13[74]; + const SBool s75 = queue_13[75]; + const SBool s76 = queue_13[76]; + const SBool s77 = queue_13[77]; + const SBool s78 = queue_13[78]; + const SBool s79 = queue_13[79]; + const SBool s80 = queue_13[80]; + const SBool s81 = queue_13[81]; + const SBool s82 = queue_13[82]; + const SBool s83 = queue_13[83]; + const SBool s84 = queue_13[84]; + const SBool s85 = queue_13[85]; + const SBool s86 = queue_13[86]; + const SBool s87 = queue_13[87]; + const SBool s88 = queue_13[88]; + const SBool s89 = queue_13[89]; + const SBool s90 = queue_13[90]; + const SBool s91 = queue_13[91]; + const SBool s92 = queue_13[92]; + const SBool s93 = queue_13[93]; + const SBool s94 = queue_13[94]; + const SBool s95 = queue_13[95]; + const SBool s96 = queue_13[96]; + const SBool s97 = queue_13[97]; + const SBool s98 = queue_13[98]; + const SBool s99 = queue_13[99]; + const SBool s100 = queue_13[100]; + const SBool s101 = queue_13[101]; + const SBool s102 = queue_13[102]; + const SBool s103 = queue_13[103]; + const SBool s104 = queue_13[104]; + const SBool s105 = queue_13[105]; + const SBool s106 = queue_13[106]; + const SBool s107 = queue_13[107]; + const SBool s108 = queue_13[108]; + const SBool s109 = queue_13[109]; + const SBool s110 = queue_13[110]; + const SBool s111 = queue_13[111]; + const SBool s112 = queue_13[112]; + const SBool s113 = queue_13[113]; + const SBool s114 = queue_13[114]; + const SBool s115 = queue_13[115]; + const SBool s116 = queue_13[116]; + const SBool s117 = queue_13[117]; + const SBool s118 = queue_13[118]; + const SBool s119 = queue_13[119]; + const SBool s120 = queue_13[120]; + const SBool s121 = queue_13[121]; + const SBool s122 = queue_13[122]; + const SBool s123 = queue_13[123]; + const SBool s124 = queue_13[124]; + const SBool s125 = queue_13[125]; + const SBool s126 = queue_13[126]; + const SBool s127 = queue_13[127]; + const SWord32 s128 = ptr_13; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127 + }; + const SWord32 s130 = (0x00000080UL == 0) ? s128 : (s128 % 0x00000080UL); + const SBool s131 = table0[s130]; + + return s131; +} diff --git a/example21/copilot-sbv-codegen/update_state_14.c b/example21/copilot-sbv-codegen/update_state_14.c new file mode 100644 index 00000000..0234ac9f --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_14.c @@ -0,0 +1,96 @@ +/* File: "update_state_14.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s14 +*/ +/*@ + assigns \nothing; + ensures \result == queue_14[ptr_14]; +*/ +SBool update_state_14(const SBool *queue_14, const SWord32 ptr_14) +{ + const SBool s0 = queue_14[0]; + const SBool s1 = queue_14[1]; + const SBool s2 = queue_14[2]; + const SBool s3 = queue_14[3]; + const SBool s4 = queue_14[4]; + const SBool s5 = queue_14[5]; + const SBool s6 = queue_14[6]; + const SBool s7 = queue_14[7]; + const SBool s8 = queue_14[8]; + const SBool s9 = queue_14[9]; + const SBool s10 = queue_14[10]; + const SBool s11 = queue_14[11]; + const SBool s12 = queue_14[12]; + const SBool s13 = queue_14[13]; + const SBool s14 = queue_14[14]; + const SBool s15 = queue_14[15]; + const SBool s16 = queue_14[16]; + const SBool s17 = queue_14[17]; + const SBool s18 = queue_14[18]; + const SBool s19 = queue_14[19]; + const SBool s20 = queue_14[20]; + const SBool s21 = queue_14[21]; + const SBool s22 = queue_14[22]; + const SBool s23 = queue_14[23]; + const SBool s24 = queue_14[24]; + const SBool s25 = queue_14[25]; + const SBool s26 = queue_14[26]; + const SBool s27 = queue_14[27]; + const SBool s28 = queue_14[28]; + const SBool s29 = queue_14[29]; + const SBool s30 = queue_14[30]; + const SBool s31 = queue_14[31]; + const SBool s32 = queue_14[32]; + const SBool s33 = queue_14[33]; + const SBool s34 = queue_14[34]; + const SBool s35 = queue_14[35]; + const SBool s36 = queue_14[36]; + const SBool s37 = queue_14[37]; + const SBool s38 = queue_14[38]; + const SBool s39 = queue_14[39]; + const SBool s40 = queue_14[40]; + const SBool s41 = queue_14[41]; + const SBool s42 = queue_14[42]; + const SBool s43 = queue_14[43]; + const SBool s44 = queue_14[44]; + const SBool s45 = queue_14[45]; + const SBool s46 = queue_14[46]; + const SBool s47 = queue_14[47]; + const SBool s48 = queue_14[48]; + const SBool s49 = queue_14[49]; + const SBool s50 = queue_14[50]; + const SBool s51 = queue_14[51]; + const SBool s52 = queue_14[52]; + const SBool s53 = queue_14[53]; + const SBool s54 = queue_14[54]; + const SBool s55 = queue_14[55]; + const SBool s56 = queue_14[56]; + const SBool s57 = queue_14[57]; + const SBool s58 = queue_14[58]; + const SBool s59 = queue_14[59]; + const SBool s60 = queue_14[60]; + const SBool s61 = queue_14[61]; + const SBool s62 = queue_14[62]; + const SBool s63 = queue_14[63]; + const SWord32 s64 = ptr_14; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31, s32, s33, s34, s35, s36, s37, s38, + s39, s40, s41, s42, s43, s44, s45, s46, s47, s48, s49, s50, s51, + s52, s53, s54, s55, s56, s57, s58, s59, s60, s61, s62, s63 + }; + const SWord32 s66 = (0x00000040UL == 0) ? s64 : (s64 % 0x00000040UL); + const SBool s67 = table0[s66]; + + return s67; +} diff --git a/example21/copilot-sbv-codegen/update_state_15.c b/example21/copilot-sbv-codegen/update_state_15.c new file mode 100644 index 00000000..1d0a669f --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_15.c @@ -0,0 +1,62 @@ +/* File: "update_state_15.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s15 +*/ +/*@ + assigns \nothing; + ensures \result == queue_15[ptr_15]; +*/ +SBool update_state_15(const SBool *queue_15, const SWord32 ptr_15) +{ + const SBool s0 = queue_15[0]; + const SBool s1 = queue_15[1]; + const SBool s2 = queue_15[2]; + const SBool s3 = queue_15[3]; + const SBool s4 = queue_15[4]; + const SBool s5 = queue_15[5]; + const SBool s6 = queue_15[6]; + const SBool s7 = queue_15[7]; + const SBool s8 = queue_15[8]; + const SBool s9 = queue_15[9]; + const SBool s10 = queue_15[10]; + const SBool s11 = queue_15[11]; + const SBool s12 = queue_15[12]; + const SBool s13 = queue_15[13]; + const SBool s14 = queue_15[14]; + const SBool s15 = queue_15[15]; + const SBool s16 = queue_15[16]; + const SBool s17 = queue_15[17]; + const SBool s18 = queue_15[18]; + const SBool s19 = queue_15[19]; + const SBool s20 = queue_15[20]; + const SBool s21 = queue_15[21]; + const SBool s22 = queue_15[22]; + const SBool s23 = queue_15[23]; + const SBool s24 = queue_15[24]; + const SBool s25 = queue_15[25]; + const SBool s26 = queue_15[26]; + const SBool s27 = queue_15[27]; + const SBool s28 = queue_15[28]; + const SBool s29 = queue_15[29]; + const SBool s30 = queue_15[30]; + const SBool s31 = queue_15[31]; + const SWord32 s32 = ptr_15; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31 + }; + const SWord32 s34 = (0x00000020UL == 0) ? s32 : (s32 % 0x00000020UL); + const SBool s35 = table0[s34]; + + return s35; +} diff --git a/example21/copilot-sbv-codegen/update_state_16.c b/example21/copilot-sbv-codegen/update_state_16.c new file mode 100644 index 00000000..0e58e277 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_16.c @@ -0,0 +1,45 @@ +/* File: "update_state_16.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s16 +*/ +/*@ + assigns \nothing; + ensures \result == queue_16[ptr_16]; +*/ +SBool update_state_16(const SBool *queue_16, const SWord32 ptr_16) +{ + const SBool s0 = queue_16[0]; + const SBool s1 = queue_16[1]; + const SBool s2 = queue_16[2]; + const SBool s3 = queue_16[3]; + const SBool s4 = queue_16[4]; + const SBool s5 = queue_16[5]; + const SBool s6 = queue_16[6]; + const SBool s7 = queue_16[7]; + const SBool s8 = queue_16[8]; + const SBool s9 = queue_16[9]; + const SBool s10 = queue_16[10]; + const SBool s11 = queue_16[11]; + const SBool s12 = queue_16[12]; + const SBool s13 = queue_16[13]; + const SBool s14 = queue_16[14]; + const SBool s15 = queue_16[15]; + const SWord32 s16 = ptr_16; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15 + }; + const SWord32 s18 = (0x00000010UL == 0) ? s16 : (s16 % 0x00000010UL); + const SBool s19 = table0[s18]; + + return s19; +} diff --git a/example21/copilot-sbv-codegen/update_state_17.c b/example21/copilot-sbv-codegen/update_state_17.c new file mode 100644 index 00000000..e1d09616 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_17.c @@ -0,0 +1,36 @@ +/* File: "update_state_17.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s17 +*/ +/*@ + assigns \nothing; + ensures \result == queue_17[ptr_17]; +*/ +SBool update_state_17(const SBool *queue_17, const SWord32 ptr_17) +{ + const SBool s0 = queue_17[0]; + const SBool s1 = queue_17[1]; + const SBool s2 = queue_17[2]; + const SBool s3 = queue_17[3]; + const SBool s4 = queue_17[4]; + const SBool s5 = queue_17[5]; + const SBool s6 = queue_17[6]; + const SBool s7 = queue_17[7]; + const SWord32 s8 = ptr_17; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example21/copilot-sbv-codegen/update_state_18.c b/example21/copilot-sbv-codegen/update_state_18.c new file mode 100644 index 00000000..c828eb5b --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_18.c @@ -0,0 +1,32 @@ +/* File: "update_state_18.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s18 +*/ +/*@ + assigns \nothing; + ensures \result == queue_18[ptr_18]; +*/ +SBool update_state_18(const SBool *queue_18, const SWord32 ptr_18) +{ + const SBool s0 = queue_18[0]; + const SBool s1 = queue_18[1]; + const SBool s2 = queue_18[2]; + const SBool s3 = queue_18[3]; + const SWord32 s4 = ptr_18; + const SBool table0[] = { + s0, s1, s2, s3 + }; + const SWord32 s6 = (0x00000004UL == 0) ? s4 : (s4 % 0x00000004UL); + const SBool s7 = table0[s6]; + + return s7; +} diff --git a/example21/copilot-sbv-codegen/update_state_19.c b/example21/copilot-sbv-codegen/update_state_19.c new file mode 100644 index 00000000..2a5eb84b --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_19.c @@ -0,0 +1,30 @@ +/* File: "update_state_19.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s19 +*/ +/*@ + assigns \nothing; + ensures \result == queue_19[ptr_19]; +*/ +SBool update_state_19(const SBool *queue_19, const SWord32 ptr_19) +{ + const SBool s0 = queue_19[0]; + const SBool s1 = queue_19[1]; + const SWord32 s2 = ptr_19; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example21/copilot-sbv-codegen/update_state_2.c b/example21/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..6e32ce0f --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,36 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SBool s3 = queue_2[3]; + const SBool s4 = queue_2[4]; + const SBool s5 = queue_2[5]; + const SBool s6 = queue_2[6]; + const SBool s7 = queue_2[7]; + const SWord32 s8 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7 + }; + const SWord32 s10 = (0x00000008UL == 0) ? s8 : (s8 % 0x00000008UL); + const SBool s11 = table0[s10]; + + return s11; +} diff --git a/example21/copilot-sbv-codegen/update_state_3.c b/example21/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..77eee176 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,45 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s3 +*/ +/*@ + assigns \nothing; + ensures \result == queue_3[ptr_3]; +*/ +SBool update_state_3(const SBool *queue_3, const SWord32 ptr_3) +{ + const SBool s0 = queue_3[0]; + const SBool s1 = queue_3[1]; + const SBool s2 = queue_3[2]; + const SBool s3 = queue_3[3]; + const SBool s4 = queue_3[4]; + const SBool s5 = queue_3[5]; + const SBool s6 = queue_3[6]; + const SBool s7 = queue_3[7]; + const SBool s8 = queue_3[8]; + const SBool s9 = queue_3[9]; + const SBool s10 = queue_3[10]; + const SBool s11 = queue_3[11]; + const SBool s12 = queue_3[12]; + const SBool s13 = queue_3[13]; + const SBool s14 = queue_3[14]; + const SBool s15 = queue_3[15]; + const SWord32 s16 = ptr_3; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15 + }; + const SWord32 s18 = (0x00000010UL == 0) ? s16 : (s16 % 0x00000010UL); + const SBool s19 = table0[s18]; + + return s19; +} diff --git a/example21/copilot-sbv-codegen/update_state_4.c b/example21/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..18277dc8 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,62 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s4 +*/ +/*@ + assigns \nothing; + ensures \result == queue_4[ptr_4]; +*/ +SBool update_state_4(const SBool *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_4[0]; + const SBool s1 = queue_4[1]; + const SBool s2 = queue_4[2]; + const SBool s3 = queue_4[3]; + const SBool s4 = queue_4[4]; + const SBool s5 = queue_4[5]; + const SBool s6 = queue_4[6]; + const SBool s7 = queue_4[7]; + const SBool s8 = queue_4[8]; + const SBool s9 = queue_4[9]; + const SBool s10 = queue_4[10]; + const SBool s11 = queue_4[11]; + const SBool s12 = queue_4[12]; + const SBool s13 = queue_4[13]; + const SBool s14 = queue_4[14]; + const SBool s15 = queue_4[15]; + const SBool s16 = queue_4[16]; + const SBool s17 = queue_4[17]; + const SBool s18 = queue_4[18]; + const SBool s19 = queue_4[19]; + const SBool s20 = queue_4[20]; + const SBool s21 = queue_4[21]; + const SBool s22 = queue_4[22]; + const SBool s23 = queue_4[23]; + const SBool s24 = queue_4[24]; + const SBool s25 = queue_4[25]; + const SBool s26 = queue_4[26]; + const SBool s27 = queue_4[27]; + const SBool s28 = queue_4[28]; + const SBool s29 = queue_4[29]; + const SBool s30 = queue_4[30]; + const SBool s31 = queue_4[31]; + const SWord32 s32 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31 + }; + const SWord32 s34 = (0x00000020UL == 0) ? s32 : (s32 % 0x00000020UL); + const SBool s35 = table0[s34]; + + return s35; +} diff --git a/example21/copilot-sbv-codegen/update_state_5.c b/example21/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..762043fa --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,96 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SBool update_state_5(const SBool *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_5[0]; + const SBool s1 = queue_5[1]; + const SBool s2 = queue_5[2]; + const SBool s3 = queue_5[3]; + const SBool s4 = queue_5[4]; + const SBool s5 = queue_5[5]; + const SBool s6 = queue_5[6]; + const SBool s7 = queue_5[7]; + const SBool s8 = queue_5[8]; + const SBool s9 = queue_5[9]; + const SBool s10 = queue_5[10]; + const SBool s11 = queue_5[11]; + const SBool s12 = queue_5[12]; + const SBool s13 = queue_5[13]; + const SBool s14 = queue_5[14]; + const SBool s15 = queue_5[15]; + const SBool s16 = queue_5[16]; + const SBool s17 = queue_5[17]; + const SBool s18 = queue_5[18]; + const SBool s19 = queue_5[19]; + const SBool s20 = queue_5[20]; + const SBool s21 = queue_5[21]; + const SBool s22 = queue_5[22]; + const SBool s23 = queue_5[23]; + const SBool s24 = queue_5[24]; + const SBool s25 = queue_5[25]; + const SBool s26 = queue_5[26]; + const SBool s27 = queue_5[27]; + const SBool s28 = queue_5[28]; + const SBool s29 = queue_5[29]; + const SBool s30 = queue_5[30]; + const SBool s31 = queue_5[31]; + const SBool s32 = queue_5[32]; + const SBool s33 = queue_5[33]; + const SBool s34 = queue_5[34]; + const SBool s35 = queue_5[35]; + const SBool s36 = queue_5[36]; + const SBool s37 = queue_5[37]; + const SBool s38 = queue_5[38]; + const SBool s39 = queue_5[39]; + const SBool s40 = queue_5[40]; + const SBool s41 = queue_5[41]; + const SBool s42 = queue_5[42]; + const SBool s43 = queue_5[43]; + const SBool s44 = queue_5[44]; + const SBool s45 = queue_5[45]; + const SBool s46 = queue_5[46]; + const SBool s47 = queue_5[47]; + const SBool s48 = queue_5[48]; + const SBool s49 = queue_5[49]; + const SBool s50 = queue_5[50]; + const SBool s51 = queue_5[51]; + const SBool s52 = queue_5[52]; + const SBool s53 = queue_5[53]; + const SBool s54 = queue_5[54]; + const SBool s55 = queue_5[55]; + const SBool s56 = queue_5[56]; + const SBool s57 = queue_5[57]; + const SBool s58 = queue_5[58]; + const SBool s59 = queue_5[59]; + const SBool s60 = queue_5[60]; + const SBool s61 = queue_5[61]; + const SBool s62 = queue_5[62]; + const SBool s63 = queue_5[63]; + const SWord32 s64 = ptr_5; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, + s13, s14, s15, s16, s17, s18, s19, s20, s21, s22, s23, s24, s25, + s26, s27, s28, s29, s30, s31, s32, s33, s34, s35, s36, s37, s38, + s39, s40, s41, s42, s43, s44, s45, s46, s47, s48, s49, s50, s51, + s52, s53, s54, s55, s56, s57, s58, s59, s60, s61, s62, s63 + }; + const SWord32 s66 = (0x00000040UL == 0) ? s64 : (s64 % 0x00000040UL); + const SBool s67 = table0[s66]; + + return s67; +} diff --git a/example21/copilot-sbv-codegen/update_state_6.c b/example21/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..f4f3205e --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,167 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s6 +*/ +/*@ + assigns \nothing; + ensures \result == queue_6[ptr_6]; +*/ +SBool update_state_6(const SBool *queue_6, const SWord32 ptr_6) +{ + const SBool s0 = queue_6[0]; + const SBool s1 = queue_6[1]; + const SBool s2 = queue_6[2]; + const SBool s3 = queue_6[3]; + const SBool s4 = queue_6[4]; + const SBool s5 = queue_6[5]; + const SBool s6 = queue_6[6]; + const SBool s7 = queue_6[7]; + const SBool s8 = queue_6[8]; + const SBool s9 = queue_6[9]; + const SBool s10 = queue_6[10]; + const SBool s11 = queue_6[11]; + const SBool s12 = queue_6[12]; + const SBool s13 = queue_6[13]; + const SBool s14 = queue_6[14]; + const SBool s15 = queue_6[15]; + const SBool s16 = queue_6[16]; + const SBool s17 = queue_6[17]; + const SBool s18 = queue_6[18]; + const SBool s19 = queue_6[19]; + const SBool s20 = queue_6[20]; + const SBool s21 = queue_6[21]; + const SBool s22 = queue_6[22]; + const SBool s23 = queue_6[23]; + const SBool s24 = queue_6[24]; + const SBool s25 = queue_6[25]; + const SBool s26 = queue_6[26]; + const SBool s27 = queue_6[27]; + const SBool s28 = queue_6[28]; + const SBool s29 = queue_6[29]; + const SBool s30 = queue_6[30]; + const SBool s31 = queue_6[31]; + const SBool s32 = queue_6[32]; + const SBool s33 = queue_6[33]; + const SBool s34 = queue_6[34]; + const SBool s35 = queue_6[35]; + const SBool s36 = queue_6[36]; + const SBool s37 = queue_6[37]; + const SBool s38 = queue_6[38]; + const SBool s39 = queue_6[39]; + const SBool s40 = queue_6[40]; + const SBool s41 = queue_6[41]; + const SBool s42 = queue_6[42]; + const SBool s43 = queue_6[43]; + const SBool s44 = queue_6[44]; + const SBool s45 = queue_6[45]; + const SBool s46 = queue_6[46]; + const SBool s47 = queue_6[47]; + const SBool s48 = queue_6[48]; + const SBool s49 = queue_6[49]; + const SBool s50 = queue_6[50]; + const SBool s51 = queue_6[51]; + const SBool s52 = queue_6[52]; + const SBool s53 = queue_6[53]; + const SBool s54 = queue_6[54]; + const SBool s55 = queue_6[55]; + const SBool s56 = queue_6[56]; + const SBool s57 = queue_6[57]; + const SBool s58 = queue_6[58]; + const SBool s59 = queue_6[59]; + const SBool s60 = queue_6[60]; + const SBool s61 = queue_6[61]; + const SBool s62 = queue_6[62]; + const SBool s63 = queue_6[63]; + const SBool s64 = queue_6[64]; + const SBool s65 = queue_6[65]; + const SBool s66 = queue_6[66]; + const SBool s67 = queue_6[67]; + const SBool s68 = queue_6[68]; + const SBool s69 = queue_6[69]; + const SBool s70 = queue_6[70]; + const SBool s71 = queue_6[71]; + const SBool s72 = queue_6[72]; + const SBool s73 = queue_6[73]; + const SBool s74 = queue_6[74]; + const SBool s75 = queue_6[75]; + const SBool s76 = queue_6[76]; + const SBool s77 = queue_6[77]; + const SBool s78 = queue_6[78]; + const SBool s79 = queue_6[79]; + const SBool s80 = queue_6[80]; + const SBool s81 = queue_6[81]; + const SBool s82 = queue_6[82]; + const SBool s83 = queue_6[83]; + const SBool s84 = queue_6[84]; + const SBool s85 = queue_6[85]; + const SBool s86 = queue_6[86]; + const SBool s87 = queue_6[87]; + const SBool s88 = queue_6[88]; + const SBool s89 = queue_6[89]; + const SBool s90 = queue_6[90]; + const SBool s91 = queue_6[91]; + const SBool s92 = queue_6[92]; + const SBool s93 = queue_6[93]; + const SBool s94 = queue_6[94]; + const SBool s95 = queue_6[95]; + const SBool s96 = queue_6[96]; + const SBool s97 = queue_6[97]; + const SBool s98 = queue_6[98]; + const SBool s99 = queue_6[99]; + const SBool s100 = queue_6[100]; + const SBool s101 = queue_6[101]; + const SBool s102 = queue_6[102]; + const SBool s103 = queue_6[103]; + const SBool s104 = queue_6[104]; + const SBool s105 = queue_6[105]; + const SBool s106 = queue_6[106]; + const SBool s107 = queue_6[107]; + const SBool s108 = queue_6[108]; + const SBool s109 = queue_6[109]; + const SBool s110 = queue_6[110]; + const SBool s111 = queue_6[111]; + const SBool s112 = queue_6[112]; + const SBool s113 = queue_6[113]; + const SBool s114 = queue_6[114]; + const SBool s115 = queue_6[115]; + const SBool s116 = queue_6[116]; + const SBool s117 = queue_6[117]; + const SBool s118 = queue_6[118]; + const SBool s119 = queue_6[119]; + const SBool s120 = queue_6[120]; + const SBool s121 = queue_6[121]; + const SBool s122 = queue_6[122]; + const SBool s123 = queue_6[123]; + const SBool s124 = queue_6[124]; + const SBool s125 = queue_6[125]; + const SBool s126 = queue_6[126]; + const SBool s127 = queue_6[127]; + const SWord32 s128 = ptr_6; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127 + }; + const SWord32 s130 = (0x00000080UL == 0) ? s128 : (s128 % 0x00000080UL); + const SBool s131 = table0[s130]; + + return s131; +} diff --git a/example21/copilot-sbv-codegen/update_state_7.c b/example21/copilot-sbv-codegen/update_state_7.c new file mode 100644 index 00000000..94ae3838 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_7.c @@ -0,0 +1,307 @@ +/* File: "update_state_7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s7 +*/ +/*@ + assigns \nothing; + ensures \result == queue_7[ptr_7]; +*/ +SBool update_state_7(const SBool *queue_7, const SWord32 ptr_7) +{ + const SBool s0 = queue_7[0]; + const SBool s1 = queue_7[1]; + const SBool s2 = queue_7[2]; + const SBool s3 = queue_7[3]; + const SBool s4 = queue_7[4]; + const SBool s5 = queue_7[5]; + const SBool s6 = queue_7[6]; + const SBool s7 = queue_7[7]; + const SBool s8 = queue_7[8]; + const SBool s9 = queue_7[9]; + const SBool s10 = queue_7[10]; + const SBool s11 = queue_7[11]; + const SBool s12 = queue_7[12]; + const SBool s13 = queue_7[13]; + const SBool s14 = queue_7[14]; + const SBool s15 = queue_7[15]; + const SBool s16 = queue_7[16]; + const SBool s17 = queue_7[17]; + const SBool s18 = queue_7[18]; + const SBool s19 = queue_7[19]; + const SBool s20 = queue_7[20]; + const SBool s21 = queue_7[21]; + const SBool s22 = queue_7[22]; + const SBool s23 = queue_7[23]; + const SBool s24 = queue_7[24]; + const SBool s25 = queue_7[25]; + const SBool s26 = queue_7[26]; + const SBool s27 = queue_7[27]; + const SBool s28 = queue_7[28]; + const SBool s29 = queue_7[29]; + const SBool s30 = queue_7[30]; + const SBool s31 = queue_7[31]; + const SBool s32 = queue_7[32]; + const SBool s33 = queue_7[33]; + const SBool s34 = queue_7[34]; + const SBool s35 = queue_7[35]; + const SBool s36 = queue_7[36]; + const SBool s37 = queue_7[37]; + const SBool s38 = queue_7[38]; + const SBool s39 = queue_7[39]; + const SBool s40 = queue_7[40]; + const SBool s41 = queue_7[41]; + const SBool s42 = queue_7[42]; + const SBool s43 = queue_7[43]; + const SBool s44 = queue_7[44]; + const SBool s45 = queue_7[45]; + const SBool s46 = queue_7[46]; + const SBool s47 = queue_7[47]; + const SBool s48 = queue_7[48]; + const SBool s49 = queue_7[49]; + const SBool s50 = queue_7[50]; + const SBool s51 = queue_7[51]; + const SBool s52 = queue_7[52]; + const SBool s53 = queue_7[53]; + const SBool s54 = queue_7[54]; + const SBool s55 = queue_7[55]; + const SBool s56 = queue_7[56]; + const SBool s57 = queue_7[57]; + const SBool s58 = queue_7[58]; + const SBool s59 = queue_7[59]; + const SBool s60 = queue_7[60]; + const SBool s61 = queue_7[61]; + const SBool s62 = queue_7[62]; + const SBool s63 = queue_7[63]; + const SBool s64 = queue_7[64]; + const SBool s65 = queue_7[65]; + const SBool s66 = queue_7[66]; + const SBool s67 = queue_7[67]; + const SBool s68 = queue_7[68]; + const SBool s69 = queue_7[69]; + const SBool s70 = queue_7[70]; + const SBool s71 = queue_7[71]; + const SBool s72 = queue_7[72]; + const SBool s73 = queue_7[73]; + const SBool s74 = queue_7[74]; + const SBool s75 = queue_7[75]; + const SBool s76 = queue_7[76]; + const SBool s77 = queue_7[77]; + const SBool s78 = queue_7[78]; + const SBool s79 = queue_7[79]; + const SBool s80 = queue_7[80]; + const SBool s81 = queue_7[81]; + const SBool s82 = queue_7[82]; + const SBool s83 = queue_7[83]; + const SBool s84 = queue_7[84]; + const SBool s85 = queue_7[85]; + const SBool s86 = queue_7[86]; + const SBool s87 = queue_7[87]; + const SBool s88 = queue_7[88]; + const SBool s89 = queue_7[89]; + const SBool s90 = queue_7[90]; + const SBool s91 = queue_7[91]; + const SBool s92 = queue_7[92]; + const SBool s93 = queue_7[93]; + const SBool s94 = queue_7[94]; + const SBool s95 = queue_7[95]; + const SBool s96 = queue_7[96]; + const SBool s97 = queue_7[97]; + const SBool s98 = queue_7[98]; + const SBool s99 = queue_7[99]; + const SBool s100 = queue_7[100]; + const SBool s101 = queue_7[101]; + const SBool s102 = queue_7[102]; + const SBool s103 = queue_7[103]; + const SBool s104 = queue_7[104]; + const SBool s105 = queue_7[105]; + const SBool s106 = queue_7[106]; + const SBool s107 = queue_7[107]; + const SBool s108 = queue_7[108]; + const SBool s109 = queue_7[109]; + const SBool s110 = queue_7[110]; + const SBool s111 = queue_7[111]; + const SBool s112 = queue_7[112]; + const SBool s113 = queue_7[113]; + const SBool s114 = queue_7[114]; + const SBool s115 = queue_7[115]; + const SBool s116 = queue_7[116]; + const SBool s117 = queue_7[117]; + const SBool s118 = queue_7[118]; + const SBool s119 = queue_7[119]; + const SBool s120 = queue_7[120]; + const SBool s121 = queue_7[121]; + const SBool s122 = queue_7[122]; + const SBool s123 = queue_7[123]; + const SBool s124 = queue_7[124]; + const SBool s125 = queue_7[125]; + const SBool s126 = queue_7[126]; + const SBool s127 = queue_7[127]; + const SBool s128 = queue_7[128]; + const SBool s129 = queue_7[129]; + const SBool s130 = queue_7[130]; + const SBool s131 = queue_7[131]; + const SBool s132 = queue_7[132]; + const SBool s133 = queue_7[133]; + const SBool s134 = queue_7[134]; + const SBool s135 = queue_7[135]; + const SBool s136 = queue_7[136]; + const SBool s137 = queue_7[137]; + const SBool s138 = queue_7[138]; + const SBool s139 = queue_7[139]; + const SBool s140 = queue_7[140]; + const SBool s141 = queue_7[141]; + const SBool s142 = queue_7[142]; + const SBool s143 = queue_7[143]; + const SBool s144 = queue_7[144]; + const SBool s145 = queue_7[145]; + const SBool s146 = queue_7[146]; + const SBool s147 = queue_7[147]; + const SBool s148 = queue_7[148]; + const SBool s149 = queue_7[149]; + const SBool s150 = queue_7[150]; + const SBool s151 = queue_7[151]; + const SBool s152 = queue_7[152]; + const SBool s153 = queue_7[153]; + const SBool s154 = queue_7[154]; + const SBool s155 = queue_7[155]; + const SBool s156 = queue_7[156]; + const SBool s157 = queue_7[157]; + const SBool s158 = queue_7[158]; + const SBool s159 = queue_7[159]; + const SBool s160 = queue_7[160]; + const SBool s161 = queue_7[161]; + const SBool s162 = queue_7[162]; + const SBool s163 = queue_7[163]; + const SBool s164 = queue_7[164]; + const SBool s165 = queue_7[165]; + const SBool s166 = queue_7[166]; + const SBool s167 = queue_7[167]; + const SBool s168 = queue_7[168]; + const SBool s169 = queue_7[169]; + const SBool s170 = queue_7[170]; + const SBool s171 = queue_7[171]; + const SBool s172 = queue_7[172]; + const SBool s173 = queue_7[173]; + const SBool s174 = queue_7[174]; + const SBool s175 = queue_7[175]; + const SBool s176 = queue_7[176]; + const SBool s177 = queue_7[177]; + const SBool s178 = queue_7[178]; + const SBool s179 = queue_7[179]; + const SBool s180 = queue_7[180]; + const SBool s181 = queue_7[181]; + const SBool s182 = queue_7[182]; + const SBool s183 = queue_7[183]; + const SBool s184 = queue_7[184]; + const SBool s185 = queue_7[185]; + const SBool s186 = queue_7[186]; + const SBool s187 = queue_7[187]; + const SBool s188 = queue_7[188]; + const SBool s189 = queue_7[189]; + const SBool s190 = queue_7[190]; + const SBool s191 = queue_7[191]; + const SBool s192 = queue_7[192]; + const SBool s193 = queue_7[193]; + const SBool s194 = queue_7[194]; + const SBool s195 = queue_7[195]; + const SBool s196 = queue_7[196]; + const SBool s197 = queue_7[197]; + const SBool s198 = queue_7[198]; + const SBool s199 = queue_7[199]; + const SBool s200 = queue_7[200]; + const SBool s201 = queue_7[201]; + const SBool s202 = queue_7[202]; + const SBool s203 = queue_7[203]; + const SBool s204 = queue_7[204]; + const SBool s205 = queue_7[205]; + const SBool s206 = queue_7[206]; + const SBool s207 = queue_7[207]; + const SBool s208 = queue_7[208]; + const SBool s209 = queue_7[209]; + const SBool s210 = queue_7[210]; + const SBool s211 = queue_7[211]; + const SBool s212 = queue_7[212]; + const SBool s213 = queue_7[213]; + const SBool s214 = queue_7[214]; + const SBool s215 = queue_7[215]; + const SBool s216 = queue_7[216]; + const SBool s217 = queue_7[217]; + const SBool s218 = queue_7[218]; + const SBool s219 = queue_7[219]; + const SBool s220 = queue_7[220]; + const SBool s221 = queue_7[221]; + const SBool s222 = queue_7[222]; + const SBool s223 = queue_7[223]; + const SBool s224 = queue_7[224]; + const SBool s225 = queue_7[225]; + const SBool s226 = queue_7[226]; + const SBool s227 = queue_7[227]; + const SBool s228 = queue_7[228]; + const SBool s229 = queue_7[229]; + const SBool s230 = queue_7[230]; + const SBool s231 = queue_7[231]; + const SBool s232 = queue_7[232]; + const SBool s233 = queue_7[233]; + const SBool s234 = queue_7[234]; + const SBool s235 = queue_7[235]; + const SBool s236 = queue_7[236]; + const SBool s237 = queue_7[237]; + const SBool s238 = queue_7[238]; + const SBool s239 = queue_7[239]; + const SBool s240 = queue_7[240]; + const SBool s241 = queue_7[241]; + const SBool s242 = queue_7[242]; + const SBool s243 = queue_7[243]; + const SBool s244 = queue_7[244]; + const SBool s245 = queue_7[245]; + const SBool s246 = queue_7[246]; + const SBool s247 = queue_7[247]; + const SBool s248 = queue_7[248]; + const SBool s249 = queue_7[249]; + const SBool s250 = queue_7[250]; + const SBool s251 = queue_7[251]; + const SBool s252 = queue_7[252]; + const SBool s253 = queue_7[253]; + const SBool s254 = queue_7[254]; + const SBool s255 = queue_7[255]; + const SWord32 s256 = ptr_7; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255 + }; + const SWord32 s258 = (0x00000100UL == 0) ? s256 : (s256 % 0x00000100UL); + const SBool s259 = table0[s258]; + + return s259; +} diff --git a/example21/copilot-sbv-codegen/update_state_8.c b/example21/copilot-sbv-codegen/update_state_8.c new file mode 100644 index 00000000..ee806673 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_8.c @@ -0,0 +1,586 @@ +/* File: "update_state_8.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s8 +*/ +/*@ + assigns \nothing; + ensures \result == queue_8[ptr_8]; +*/ +SBool update_state_8(const SBool *queue_8, const SWord32 ptr_8) +{ + const SBool s0 = queue_8[0]; + const SBool s1 = queue_8[1]; + const SBool s2 = queue_8[2]; + const SBool s3 = queue_8[3]; + const SBool s4 = queue_8[4]; + const SBool s5 = queue_8[5]; + const SBool s6 = queue_8[6]; + const SBool s7 = queue_8[7]; + const SBool s8 = queue_8[8]; + const SBool s9 = queue_8[9]; + const SBool s10 = queue_8[10]; + const SBool s11 = queue_8[11]; + const SBool s12 = queue_8[12]; + const SBool s13 = queue_8[13]; + const SBool s14 = queue_8[14]; + const SBool s15 = queue_8[15]; + const SBool s16 = queue_8[16]; + const SBool s17 = queue_8[17]; + const SBool s18 = queue_8[18]; + const SBool s19 = queue_8[19]; + const SBool s20 = queue_8[20]; + const SBool s21 = queue_8[21]; + const SBool s22 = queue_8[22]; + const SBool s23 = queue_8[23]; + const SBool s24 = queue_8[24]; + const SBool s25 = queue_8[25]; + const SBool s26 = queue_8[26]; + const SBool s27 = queue_8[27]; + const SBool s28 = queue_8[28]; + const SBool s29 = queue_8[29]; + const SBool s30 = queue_8[30]; + const SBool s31 = queue_8[31]; + const SBool s32 = queue_8[32]; + const SBool s33 = queue_8[33]; + const SBool s34 = queue_8[34]; + const SBool s35 = queue_8[35]; + const SBool s36 = queue_8[36]; + const SBool s37 = queue_8[37]; + const SBool s38 = queue_8[38]; + const SBool s39 = queue_8[39]; + const SBool s40 = queue_8[40]; + const SBool s41 = queue_8[41]; + const SBool s42 = queue_8[42]; + const SBool s43 = queue_8[43]; + const SBool s44 = queue_8[44]; + const SBool s45 = queue_8[45]; + const SBool s46 = queue_8[46]; + const SBool s47 = queue_8[47]; + const SBool s48 = queue_8[48]; + const SBool s49 = queue_8[49]; + const SBool s50 = queue_8[50]; + const SBool s51 = queue_8[51]; + const SBool s52 = queue_8[52]; + const SBool s53 = queue_8[53]; + const SBool s54 = queue_8[54]; + const SBool s55 = queue_8[55]; + const SBool s56 = queue_8[56]; + const SBool s57 = queue_8[57]; + const SBool s58 = queue_8[58]; + const SBool s59 = queue_8[59]; + const SBool s60 = queue_8[60]; + const SBool s61 = queue_8[61]; + const SBool s62 = queue_8[62]; + const SBool s63 = queue_8[63]; + const SBool s64 = queue_8[64]; + const SBool s65 = queue_8[65]; + const SBool s66 = queue_8[66]; + const SBool s67 = queue_8[67]; + const SBool s68 = queue_8[68]; + const SBool s69 = queue_8[69]; + const SBool s70 = queue_8[70]; + const SBool s71 = queue_8[71]; + const SBool s72 = queue_8[72]; + const SBool s73 = queue_8[73]; + const SBool s74 = queue_8[74]; + const SBool s75 = queue_8[75]; + const SBool s76 = queue_8[76]; + const SBool s77 = queue_8[77]; + const SBool s78 = queue_8[78]; + const SBool s79 = queue_8[79]; + const SBool s80 = queue_8[80]; + const SBool s81 = queue_8[81]; + const SBool s82 = queue_8[82]; + const SBool s83 = queue_8[83]; + const SBool s84 = queue_8[84]; + const SBool s85 = queue_8[85]; + const SBool s86 = queue_8[86]; + const SBool s87 = queue_8[87]; + const SBool s88 = queue_8[88]; + const SBool s89 = queue_8[89]; + const SBool s90 = queue_8[90]; + const SBool s91 = queue_8[91]; + const SBool s92 = queue_8[92]; + const SBool s93 = queue_8[93]; + const SBool s94 = queue_8[94]; + const SBool s95 = queue_8[95]; + const SBool s96 = queue_8[96]; + const SBool s97 = queue_8[97]; + const SBool s98 = queue_8[98]; + const SBool s99 = queue_8[99]; + const SBool s100 = queue_8[100]; + const SBool s101 = queue_8[101]; + const SBool s102 = queue_8[102]; + const SBool s103 = queue_8[103]; + const SBool s104 = queue_8[104]; + const SBool s105 = queue_8[105]; + const SBool s106 = queue_8[106]; + const SBool s107 = queue_8[107]; + const SBool s108 = queue_8[108]; + const SBool s109 = queue_8[109]; + const SBool s110 = queue_8[110]; + const SBool s111 = queue_8[111]; + const SBool s112 = queue_8[112]; + const SBool s113 = queue_8[113]; + const SBool s114 = queue_8[114]; + const SBool s115 = queue_8[115]; + const SBool s116 = queue_8[116]; + const SBool s117 = queue_8[117]; + const SBool s118 = queue_8[118]; + const SBool s119 = queue_8[119]; + const SBool s120 = queue_8[120]; + const SBool s121 = queue_8[121]; + const SBool s122 = queue_8[122]; + const SBool s123 = queue_8[123]; + const SBool s124 = queue_8[124]; + const SBool s125 = queue_8[125]; + const SBool s126 = queue_8[126]; + const SBool s127 = queue_8[127]; + const SBool s128 = queue_8[128]; + const SBool s129 = queue_8[129]; + const SBool s130 = queue_8[130]; + const SBool s131 = queue_8[131]; + const SBool s132 = queue_8[132]; + const SBool s133 = queue_8[133]; + const SBool s134 = queue_8[134]; + const SBool s135 = queue_8[135]; + const SBool s136 = queue_8[136]; + const SBool s137 = queue_8[137]; + const SBool s138 = queue_8[138]; + const SBool s139 = queue_8[139]; + const SBool s140 = queue_8[140]; + const SBool s141 = queue_8[141]; + const SBool s142 = queue_8[142]; + const SBool s143 = queue_8[143]; + const SBool s144 = queue_8[144]; + const SBool s145 = queue_8[145]; + const SBool s146 = queue_8[146]; + const SBool s147 = queue_8[147]; + const SBool s148 = queue_8[148]; + const SBool s149 = queue_8[149]; + const SBool s150 = queue_8[150]; + const SBool s151 = queue_8[151]; + const SBool s152 = queue_8[152]; + const SBool s153 = queue_8[153]; + const SBool s154 = queue_8[154]; + const SBool s155 = queue_8[155]; + const SBool s156 = queue_8[156]; + const SBool s157 = queue_8[157]; + const SBool s158 = queue_8[158]; + const SBool s159 = queue_8[159]; + const SBool s160 = queue_8[160]; + const SBool s161 = queue_8[161]; + const SBool s162 = queue_8[162]; + const SBool s163 = queue_8[163]; + const SBool s164 = queue_8[164]; + const SBool s165 = queue_8[165]; + const SBool s166 = queue_8[166]; + const SBool s167 = queue_8[167]; + const SBool s168 = queue_8[168]; + const SBool s169 = queue_8[169]; + const SBool s170 = queue_8[170]; + const SBool s171 = queue_8[171]; + const SBool s172 = queue_8[172]; + const SBool s173 = queue_8[173]; + const SBool s174 = queue_8[174]; + const SBool s175 = queue_8[175]; + const SBool s176 = queue_8[176]; + const SBool s177 = queue_8[177]; + const SBool s178 = queue_8[178]; + const SBool s179 = queue_8[179]; + const SBool s180 = queue_8[180]; + const SBool s181 = queue_8[181]; + const SBool s182 = queue_8[182]; + const SBool s183 = queue_8[183]; + const SBool s184 = queue_8[184]; + const SBool s185 = queue_8[185]; + const SBool s186 = queue_8[186]; + const SBool s187 = queue_8[187]; + const SBool s188 = queue_8[188]; + const SBool s189 = queue_8[189]; + const SBool s190 = queue_8[190]; + const SBool s191 = queue_8[191]; + const SBool s192 = queue_8[192]; + const SBool s193 = queue_8[193]; + const SBool s194 = queue_8[194]; + const SBool s195 = queue_8[195]; + const SBool s196 = queue_8[196]; + const SBool s197 = queue_8[197]; + const SBool s198 = queue_8[198]; + const SBool s199 = queue_8[199]; + const SBool s200 = queue_8[200]; + const SBool s201 = queue_8[201]; + const SBool s202 = queue_8[202]; + const SBool s203 = queue_8[203]; + const SBool s204 = queue_8[204]; + const SBool s205 = queue_8[205]; + const SBool s206 = queue_8[206]; + const SBool s207 = queue_8[207]; + const SBool s208 = queue_8[208]; + const SBool s209 = queue_8[209]; + const SBool s210 = queue_8[210]; + const SBool s211 = queue_8[211]; + const SBool s212 = queue_8[212]; + const SBool s213 = queue_8[213]; + const SBool s214 = queue_8[214]; + const SBool s215 = queue_8[215]; + const SBool s216 = queue_8[216]; + const SBool s217 = queue_8[217]; + const SBool s218 = queue_8[218]; + const SBool s219 = queue_8[219]; + const SBool s220 = queue_8[220]; + const SBool s221 = queue_8[221]; + const SBool s222 = queue_8[222]; + const SBool s223 = queue_8[223]; + const SBool s224 = queue_8[224]; + const SBool s225 = queue_8[225]; + const SBool s226 = queue_8[226]; + const SBool s227 = queue_8[227]; + const SBool s228 = queue_8[228]; + const SBool s229 = queue_8[229]; + const SBool s230 = queue_8[230]; + const SBool s231 = queue_8[231]; + const SBool s232 = queue_8[232]; + const SBool s233 = queue_8[233]; + const SBool s234 = queue_8[234]; + const SBool s235 = queue_8[235]; + const SBool s236 = queue_8[236]; + const SBool s237 = queue_8[237]; + const SBool s238 = queue_8[238]; + const SBool s239 = queue_8[239]; + const SBool s240 = queue_8[240]; + const SBool s241 = queue_8[241]; + const SBool s242 = queue_8[242]; + const SBool s243 = queue_8[243]; + const SBool s244 = queue_8[244]; + const SBool s245 = queue_8[245]; + const SBool s246 = queue_8[246]; + const SBool s247 = queue_8[247]; + const SBool s248 = queue_8[248]; + const SBool s249 = queue_8[249]; + const SBool s250 = queue_8[250]; + const SBool s251 = queue_8[251]; + const SBool s252 = queue_8[252]; + const SBool s253 = queue_8[253]; + const SBool s254 = queue_8[254]; + const SBool s255 = queue_8[255]; + const SBool s256 = queue_8[256]; + const SBool s257 = queue_8[257]; + const SBool s258 = queue_8[258]; + const SBool s259 = queue_8[259]; + const SBool s260 = queue_8[260]; + const SBool s261 = queue_8[261]; + const SBool s262 = queue_8[262]; + const SBool s263 = queue_8[263]; + const SBool s264 = queue_8[264]; + const SBool s265 = queue_8[265]; + const SBool s266 = queue_8[266]; + const SBool s267 = queue_8[267]; + const SBool s268 = queue_8[268]; + const SBool s269 = queue_8[269]; + const SBool s270 = queue_8[270]; + const SBool s271 = queue_8[271]; + const SBool s272 = queue_8[272]; + const SBool s273 = queue_8[273]; + const SBool s274 = queue_8[274]; + const SBool s275 = queue_8[275]; + const SBool s276 = queue_8[276]; + const SBool s277 = queue_8[277]; + const SBool s278 = queue_8[278]; + const SBool s279 = queue_8[279]; + const SBool s280 = queue_8[280]; + const SBool s281 = queue_8[281]; + const SBool s282 = queue_8[282]; + const SBool s283 = queue_8[283]; + const SBool s284 = queue_8[284]; + const SBool s285 = queue_8[285]; + const SBool s286 = queue_8[286]; + const SBool s287 = queue_8[287]; + const SBool s288 = queue_8[288]; + const SBool s289 = queue_8[289]; + const SBool s290 = queue_8[290]; + const SBool s291 = queue_8[291]; + const SBool s292 = queue_8[292]; + const SBool s293 = queue_8[293]; + const SBool s294 = queue_8[294]; + const SBool s295 = queue_8[295]; + const SBool s296 = queue_8[296]; + const SBool s297 = queue_8[297]; + const SBool s298 = queue_8[298]; + const SBool s299 = queue_8[299]; + const SBool s300 = queue_8[300]; + const SBool s301 = queue_8[301]; + const SBool s302 = queue_8[302]; + const SBool s303 = queue_8[303]; + const SBool s304 = queue_8[304]; + const SBool s305 = queue_8[305]; + const SBool s306 = queue_8[306]; + const SBool s307 = queue_8[307]; + const SBool s308 = queue_8[308]; + const SBool s309 = queue_8[309]; + const SBool s310 = queue_8[310]; + const SBool s311 = queue_8[311]; + const SBool s312 = queue_8[312]; + const SBool s313 = queue_8[313]; + const SBool s314 = queue_8[314]; + const SBool s315 = queue_8[315]; + const SBool s316 = queue_8[316]; + const SBool s317 = queue_8[317]; + const SBool s318 = queue_8[318]; + const SBool s319 = queue_8[319]; + const SBool s320 = queue_8[320]; + const SBool s321 = queue_8[321]; + const SBool s322 = queue_8[322]; + const SBool s323 = queue_8[323]; + const SBool s324 = queue_8[324]; + const SBool s325 = queue_8[325]; + const SBool s326 = queue_8[326]; + const SBool s327 = queue_8[327]; + const SBool s328 = queue_8[328]; + const SBool s329 = queue_8[329]; + const SBool s330 = queue_8[330]; + const SBool s331 = queue_8[331]; + const SBool s332 = queue_8[332]; + const SBool s333 = queue_8[333]; + const SBool s334 = queue_8[334]; + const SBool s335 = queue_8[335]; + const SBool s336 = queue_8[336]; + const SBool s337 = queue_8[337]; + const SBool s338 = queue_8[338]; + const SBool s339 = queue_8[339]; + const SBool s340 = queue_8[340]; + const SBool s341 = queue_8[341]; + const SBool s342 = queue_8[342]; + const SBool s343 = queue_8[343]; + const SBool s344 = queue_8[344]; + const SBool s345 = queue_8[345]; + const SBool s346 = queue_8[346]; + const SBool s347 = queue_8[347]; + const SBool s348 = queue_8[348]; + const SBool s349 = queue_8[349]; + const SBool s350 = queue_8[350]; + const SBool s351 = queue_8[351]; + const SBool s352 = queue_8[352]; + const SBool s353 = queue_8[353]; + const SBool s354 = queue_8[354]; + const SBool s355 = queue_8[355]; + const SBool s356 = queue_8[356]; + const SBool s357 = queue_8[357]; + const SBool s358 = queue_8[358]; + const SBool s359 = queue_8[359]; + const SBool s360 = queue_8[360]; + const SBool s361 = queue_8[361]; + const SBool s362 = queue_8[362]; + const SBool s363 = queue_8[363]; + const SBool s364 = queue_8[364]; + const SBool s365 = queue_8[365]; + const SBool s366 = queue_8[366]; + const SBool s367 = queue_8[367]; + const SBool s368 = queue_8[368]; + const SBool s369 = queue_8[369]; + const SBool s370 = queue_8[370]; + const SBool s371 = queue_8[371]; + const SBool s372 = queue_8[372]; + const SBool s373 = queue_8[373]; + const SBool s374 = queue_8[374]; + const SBool s375 = queue_8[375]; + const SBool s376 = queue_8[376]; + const SBool s377 = queue_8[377]; + const SBool s378 = queue_8[378]; + const SBool s379 = queue_8[379]; + const SBool s380 = queue_8[380]; + const SBool s381 = queue_8[381]; + const SBool s382 = queue_8[382]; + const SBool s383 = queue_8[383]; + const SBool s384 = queue_8[384]; + const SBool s385 = queue_8[385]; + const SBool s386 = queue_8[386]; + const SBool s387 = queue_8[387]; + const SBool s388 = queue_8[388]; + const SBool s389 = queue_8[389]; + const SBool s390 = queue_8[390]; + const SBool s391 = queue_8[391]; + const SBool s392 = queue_8[392]; + const SBool s393 = queue_8[393]; + const SBool s394 = queue_8[394]; + const SBool s395 = queue_8[395]; + const SBool s396 = queue_8[396]; + const SBool s397 = queue_8[397]; + const SBool s398 = queue_8[398]; + const SBool s399 = queue_8[399]; + const SBool s400 = queue_8[400]; + const SBool s401 = queue_8[401]; + const SBool s402 = queue_8[402]; + const SBool s403 = queue_8[403]; + const SBool s404 = queue_8[404]; + const SBool s405 = queue_8[405]; + const SBool s406 = queue_8[406]; + const SBool s407 = queue_8[407]; + const SBool s408 = queue_8[408]; + const SBool s409 = queue_8[409]; + const SBool s410 = queue_8[410]; + const SBool s411 = queue_8[411]; + const SBool s412 = queue_8[412]; + const SBool s413 = queue_8[413]; + const SBool s414 = queue_8[414]; + const SBool s415 = queue_8[415]; + const SBool s416 = queue_8[416]; + const SBool s417 = queue_8[417]; + const SBool s418 = queue_8[418]; + const SBool s419 = queue_8[419]; + const SBool s420 = queue_8[420]; + const SBool s421 = queue_8[421]; + const SBool s422 = queue_8[422]; + const SBool s423 = queue_8[423]; + const SBool s424 = queue_8[424]; + const SBool s425 = queue_8[425]; + const SBool s426 = queue_8[426]; + const SBool s427 = queue_8[427]; + const SBool s428 = queue_8[428]; + const SBool s429 = queue_8[429]; + const SBool s430 = queue_8[430]; + const SBool s431 = queue_8[431]; + const SBool s432 = queue_8[432]; + const SBool s433 = queue_8[433]; + const SBool s434 = queue_8[434]; + const SBool s435 = queue_8[435]; + const SBool s436 = queue_8[436]; + const SBool s437 = queue_8[437]; + const SBool s438 = queue_8[438]; + const SBool s439 = queue_8[439]; + const SBool s440 = queue_8[440]; + const SBool s441 = queue_8[441]; + const SBool s442 = queue_8[442]; + const SBool s443 = queue_8[443]; + const SBool s444 = queue_8[444]; + const SBool s445 = queue_8[445]; + const SBool s446 = queue_8[446]; + const SBool s447 = queue_8[447]; + const SBool s448 = queue_8[448]; + const SBool s449 = queue_8[449]; + const SBool s450 = queue_8[450]; + const SBool s451 = queue_8[451]; + const SBool s452 = queue_8[452]; + const SBool s453 = queue_8[453]; + const SBool s454 = queue_8[454]; + const SBool s455 = queue_8[455]; + const SBool s456 = queue_8[456]; + const SBool s457 = queue_8[457]; + const SBool s458 = queue_8[458]; + const SBool s459 = queue_8[459]; + const SBool s460 = queue_8[460]; + const SBool s461 = queue_8[461]; + const SBool s462 = queue_8[462]; + const SBool s463 = queue_8[463]; + const SBool s464 = queue_8[464]; + const SBool s465 = queue_8[465]; + const SBool s466 = queue_8[466]; + const SBool s467 = queue_8[467]; + const SBool s468 = queue_8[468]; + const SBool s469 = queue_8[469]; + const SBool s470 = queue_8[470]; + const SBool s471 = queue_8[471]; + const SBool s472 = queue_8[472]; + const SBool s473 = queue_8[473]; + const SBool s474 = queue_8[474]; + const SBool s475 = queue_8[475]; + const SBool s476 = queue_8[476]; + const SBool s477 = queue_8[477]; + const SBool s478 = queue_8[478]; + const SBool s479 = queue_8[479]; + const SBool s480 = queue_8[480]; + const SBool s481 = queue_8[481]; + const SBool s482 = queue_8[482]; + const SBool s483 = queue_8[483]; + const SBool s484 = queue_8[484]; + const SBool s485 = queue_8[485]; + const SBool s486 = queue_8[486]; + const SBool s487 = queue_8[487]; + const SBool s488 = queue_8[488]; + const SBool s489 = queue_8[489]; + const SBool s490 = queue_8[490]; + const SBool s491 = queue_8[491]; + const SBool s492 = queue_8[492]; + const SBool s493 = queue_8[493]; + const SBool s494 = queue_8[494]; + const SBool s495 = queue_8[495]; + const SBool s496 = queue_8[496]; + const SBool s497 = queue_8[497]; + const SBool s498 = queue_8[498]; + const SBool s499 = queue_8[499]; + const SBool s500 = queue_8[500]; + const SBool s501 = queue_8[501]; + const SBool s502 = queue_8[502]; + const SBool s503 = queue_8[503]; + const SBool s504 = queue_8[504]; + const SBool s505 = queue_8[505]; + const SBool s506 = queue_8[506]; + const SBool s507 = queue_8[507]; + const SBool s508 = queue_8[508]; + const SBool s509 = queue_8[509]; + const SBool s510 = queue_8[510]; + const SBool s511 = queue_8[511]; + const SWord32 s512 = ptr_8; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, + s11, s12, s13, s14, s15, s16, s17, s18, s19, s20, s21, + s22, s23, s24, s25, s26, s27, s28, s29, s30, s31, s32, + s33, s34, s35, s36, s37, s38, s39, s40, s41, s42, s43, + s44, s45, s46, s47, s48, s49, s50, s51, s52, s53, s54, + s55, s56, s57, s58, s59, s60, s61, s62, s63, s64, s65, + s66, s67, s68, s69, s70, s71, s72, s73, s74, s75, s76, + s77, s78, s79, s80, s81, s82, s83, s84, s85, s86, s87, + s88, s89, s90, s91, s92, s93, s94, s95, s96, s97, s98, + s99, s100, s101, s102, s103, s104, s105, s106, s107, s108, s109, + s110, s111, s112, s113, s114, s115, s116, s117, s118, s119, s120, + s121, s122, s123, s124, s125, s126, s127, s128, s129, s130, s131, + s132, s133, s134, s135, s136, s137, s138, s139, s140, s141, s142, + s143, s144, s145, s146, s147, s148, s149, s150, s151, s152, s153, + s154, s155, s156, s157, s158, s159, s160, s161, s162, s163, s164, + s165, s166, s167, s168, s169, s170, s171, s172, s173, s174, s175, + s176, s177, s178, s179, s180, s181, s182, s183, s184, s185, s186, + s187, s188, s189, s190, s191, s192, s193, s194, s195, s196, s197, + s198, s199, s200, s201, s202, s203, s204, s205, s206, s207, s208, + s209, s210, s211, s212, s213, s214, s215, s216, s217, s218, s219, + s220, s221, s222, s223, s224, s225, s226, s227, s228, s229, s230, + s231, s232, s233, s234, s235, s236, s237, s238, s239, s240, s241, + s242, s243, s244, s245, s246, s247, s248, s249, s250, s251, s252, + s253, s254, s255, s256, s257, s258, s259, s260, s261, s262, s263, + s264, s265, s266, s267, s268, s269, s270, s271, s272, s273, s274, + s275, s276, s277, s278, s279, s280, s281, s282, s283, s284, s285, + s286, s287, s288, s289, s290, s291, s292, s293, s294, s295, s296, + s297, s298, s299, s300, s301, s302, s303, s304, s305, s306, s307, + s308, s309, s310, s311, s312, s313, s314, s315, s316, s317, s318, + s319, s320, s321, s322, s323, s324, s325, s326, s327, s328, s329, + s330, s331, s332, s333, s334, s335, s336, s337, s338, s339, s340, + s341, s342, s343, s344, s345, s346, s347, s348, s349, s350, s351, + s352, s353, s354, s355, s356, s357, s358, s359, s360, s361, s362, + s363, s364, s365, s366, s367, s368, s369, s370, s371, s372, s373, + s374, s375, s376, s377, s378, s379, s380, s381, s382, s383, s384, + s385, s386, s387, s388, s389, s390, s391, s392, s393, s394, s395, + s396, s397, s398, s399, s400, s401, s402, s403, s404, s405, s406, + s407, s408, s409, s410, s411, s412, s413, s414, s415, s416, s417, + s418, s419, s420, s421, s422, s423, s424, s425, s426, s427, s428, + s429, s430, s431, s432, s433, s434, s435, s436, s437, s438, s439, + s440, s441, s442, s443, s444, s445, s446, s447, s448, s449, s450, + s451, s452, s453, s454, s455, s456, s457, s458, s459, s460, s461, + s462, s463, s464, s465, s466, s467, s468, s469, s470, s471, s472, + s473, s474, s475, s476, s477, s478, s479, s480, s481, s482, s483, + s484, s485, s486, s487, s488, s489, s490, s491, s492, s493, s494, + s495, s496, s497, s498, s499, s500, s501, s502, s503, s504, s505, + s506, s507, s508, s509, s510, s511 + }; + const SWord32 s514 = (0x00000200UL == 0) ? s512 : (s512 % 0x00000200UL); + const SBool s515 = table0[s514]; + + return s515; +} diff --git a/example21/copilot-sbv-codegen/update_state_9.c b/example21/copilot-sbv-codegen/update_state_9.c new file mode 100644 index 00000000..ec8713a8 --- /dev/null +++ b/example21/copilot-sbv-codegen/update_state_9.c @@ -0,0 +1,25 @@ +/* File: "update_state_9.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s9 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_9[ptr_9] + 1); +*/ +SWord64 update_state_9(const SWord64 *queue_9, const SWord32 ptr_9) +{ + const SWord64 s0 = queue_9[0]; + const SWord32 s1 = ptr_9; + const SWord64 s3 = s0 + 0x0000000000000001ULL; + + return s3; +} diff --git a/example21/main.hs b/example21/main.hs new file mode 100644 index 00000000..12d2d053 --- /dev/null +++ b/example21/main.hs @@ -0,0 +1,70 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L +-- | Number of sat variables and a Boolean function over those variables. +type SatFunc = (Int, [Stream Bool] -> Stream Bool) + +-- Takes a Sat function and returns the stream of variables and a SAT function. +sat :: SatFunc -> ([Stream Bool], Stream Bool) +sat (i,f) = (xs, res) + where + -- If it becomes true, it stays true. + res = [False] ++ (f xs || res) + + xs = xs' i + + xs' 0 = [] + xs' n = clk (period $ 2 P.^ n) (phase (0 :: Int)) : xs' (n P.- 1) + +satSpec :: SatFunc -> Spec +satSpec f = do + observer "sat" (snd $ sat f) + observer "done" done + foldM_ mkObs (0 :: Int) xs + + where + xs = fst $ sat f + cnt :: Stream Word64 -- Would need to be extended depending on number of + -- variables. + cnt = [1] ++ cnt + 1 + done = cnt == (2 P.^ length xs) + mkObs idx strm = do observer ("obs" P.++ show idx) strm + return (idx P.+ 1) + + +f0 :: SatFunc +--f0 = (3, \[a,b,c] -> a && (b || (not c))) +f0 = (3, f) + where + f [a,b,c] = a && (b || (not c)) + f _ = error "Bad SAT function." + +f1 :: SatFunc +f1 = (9, f') + where + f' [a,b,c,d,e,f,g,h,i] = + a && b && c && d && e && + f && g && h && i && i && not i + f' _ = error "Bad SAT function." + + +spec :: Spec +spec = satSpec f1 + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example22/--list-options/add-source-timestamps b/example22/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example22/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example22/--list-options/packages/00-index.cache b/example22/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example22/--list-options/packages/00-index.tar b/example22/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example22/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example22/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example22/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example22/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example22/.cabal-sandbox/add-source-timestamps b/example22/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example22/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example22/.cabal-sandbox/packages/00-index.cache b/example22/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example22/.cabal-sandbox/packages/00-index.tar b/example22/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example22/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example22/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example22/Makefile b/example22/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example22/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example22/cabal.sandbox.config b/example22/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example22/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example22/copilot-sbv-codegen/Makefile b/example22/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..f8a09d38 --- /dev/null +++ b/example22/copilot-sbv-codegen/Makefile @@ -0,0 +1,47 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o update_state_6.o update_state_5.o update_state_4.o update_state_3.o update_state_2.o update_state_7.o update_state_0.o observer_stack.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_7.o: update_state_7.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_stack.o: observer_stack.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example22/copilot-sbv-codegen/README b/example22/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example22/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example22/copilot-sbv-codegen/copilot.h b/example22/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..d2afcd3b --- /dev/null +++ b/example22/copilot-sbv-codegen/copilot.h @@ -0,0 +1,24 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern uint16_t stack; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example22/copilot-sbv-codegen/copilot.mk b/example22/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example22/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example22/copilot-sbv-codegen/driver.c b/example22/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..192d865f --- /dev/null +++ b/example22/copilot-sbv-codegen/driver.c @@ -0,0 +1,172 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SWord16 stack; + +/* Variables */ +SWord16 tmp_0 = 0; +SBool tmp_1 = false; +SWord16 tmp_2 = 0; +SWord16 tmp_3 = 0; +SWord16 tmp_4 = 0; +SWord16 tmp_5 = 0; +SBool tmp_6 = true; +SWord16 tmp_7 = 1; +SWord16 queue_0[1] = { 0 }; +SBool queue_1[12] = { false, false, false, false, false, false, true, true, true, true, true, true }; +SWord16 queue_2[1] = { 0 }; +SWord16 queue_3[1] = { 0 }; +SWord16 queue_4[1] = { 0 }; +SWord16 queue_5[1] = { 0 }; +SBool queue_6[5] = { true, true, true, true, true }; +SWord16 queue_7[1] = { 1 }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord32 ptr_7 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 12 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 11 )); + global invariant a_bound_ptr_2: ptr_2 < 1 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 0 )); + global invariant a_bound_ptr_3: ptr_3 < 1 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 0 )); + global invariant a_bound_ptr_4: ptr_4 < 1 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 0 )); + global invariant a_bound_ptr_5: ptr_5 < 1 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 0 )); + global invariant a_bound_ptr_6: ptr_6 < 5 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 4 )); + global invariant a_bound_ptr_7: ptr_7 < 1 ; + global invariant a_pos_ptr_7: ptr_7 >= 0 ; + global invariant a_valid_ptr_7: \valid (queue_7 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns stack; + */ +void updateObservers(void) { + stack = observer_stack(queue_0, ptr_0); +} + +/*@ + assigns tmp_1; + assigns tmp_6; + assigns tmp_5; + assigns tmp_4; + assigns tmp_3; + assigns tmp_2; + assigns tmp_7; + assigns tmp_0; + */ +void updateStates(void) { + tmp_1 = update_state_1(); + tmp_6 = update_state_6(); + tmp_5 = update_state_5(queue_1, ptr_1, queue_6, ptr_6, queue_4, ptr_4, queue_5, ptr_5); + tmp_4 = update_state_4(queue_1, ptr_1, queue_5, ptr_5, queue_6, ptr_6, queue_3, ptr_3, queue_4, ptr_4); + tmp_3 = update_state_3(queue_1, ptr_1, queue_4, ptr_4, queue_6, ptr_6, queue_2, ptr_2, queue_3, ptr_3); + tmp_2 = update_state_2(queue_1, ptr_1, queue_3, ptr_3, queue_6, ptr_6, queue_0, ptr_0, queue_2, ptr_2); + tmp_7 = update_state_7(queue_7, ptr_7); + tmp_0 = update_state_0(queue_1, ptr_1, queue_2, ptr_2, queue_6, ptr_6, queue_7, ptr_7, queue_0, ptr_0); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + assigns queue_7[ptr_7]; + ensures queue_7[ptr_7] == tmp_7; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; + queue_7[ptr_7] = tmp_7; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 12; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 1; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 1; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 1; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 1; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 5; + assigns ptr_7; + ensures ptr_7 == (\old (ptr_7 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 12; + ptr_2 = (ptr_2 + 1) % 1; + ptr_3 = (ptr_3 + 1) % 1; + ptr_4 = (ptr_4 + 1) % 1; + ptr_5 = (ptr_5 + 1) % 1; + ptr_6 = (ptr_6 + 1) % 5; + ptr_7 = (ptr_7 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example22/copilot-sbv-codegen/internal.h b/example22/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..2e2174d5 --- /dev/null +++ b/example22/copilot-sbv-codegen/internal.h @@ -0,0 +1,59 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_1(); +SBool update_state_6(); +SWord16 update_state_5(const SBool *queue_1, const SWord32 ptr_1, + const SBool *queue_6, const SWord32 ptr_6, const SWord16 *queue_4, + const SWord32 ptr_4, const SWord16 *queue_5, const SWord32 ptr_5); +SWord16 update_state_4(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_5, const SWord32 ptr_5, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_3, const SWord32 ptr_3, + const SWord16 *queue_4, const SWord32 ptr_4); +SWord16 update_state_3(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_4, const SWord32 ptr_4, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_2, const SWord32 ptr_2, + const SWord16 *queue_3, const SWord32 ptr_3); +SWord16 update_state_2(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_3, const SWord32 ptr_3, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 *queue_2, const SWord32 ptr_2); +SWord16 update_state_7(const SWord16 *queue_7, + const SWord32 ptr_7); +SWord16 update_state_0(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_2, const SWord32 ptr_2, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_7, const SWord32 ptr_7, + const SWord16 *queue_0, const SWord32 ptr_0); +SWord16 observer_stack(const SWord16 *queue_0, + const SWord32 ptr_0); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example22/copilot-sbv-codegen/observer_stack.c b/example22/copilot-sbv-codegen/observer_stack.c new file mode 100644 index 00000000..4a0d9be6 --- /dev/null +++ b/example22/copilot-sbv-codegen/observer_stack.c @@ -0,0 +1,23 @@ +/* File: "observer_stack.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 observer_stack(const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example22/copilot-sbv-codegen/update_state_0.c b/example22/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..057197ca --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,62 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s1 then s2 else (if s6 then s7 else s0)) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_1[ptr_1] ? queue_2[ptr_2] : ( queue_6[ptr_6] ? queue_7[ptr_7] : queue_0[ptr_0])); +*/ +SWord16 update_state_0(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_2, const SWord32 ptr_2, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_7, const SWord32 ptr_7, + const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SBool s7 = queue_1[7]; + const SBool s8 = queue_1[8]; + const SBool s9 = queue_1[9]; + const SBool s10 = queue_1[10]; + const SBool s11 = queue_1[11]; + const SWord32 s12 = ptr_1; + const SWord16 s13 = queue_2[0]; + const SWord32 s14 = ptr_2; + const SBool s15 = queue_6[0]; + const SBool s16 = queue_6[1]; + const SBool s17 = queue_6[2]; + const SBool s18 = queue_6[3]; + const SBool s19 = queue_6[4]; + const SWord32 s20 = ptr_6; + const SWord16 s21 = queue_7[0]; + const SWord32 s22 = ptr_7; + const SWord16 s23 = queue_0[0]; + const SWord32 s24 = ptr_0; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 + }; + const SBool table1[] = { + s15, s16, s17, s18, s19 + }; + const SWord32 s26 = (0x0000000cUL == 0) ? s12 : (s12 % 0x0000000cUL); + const SBool s27 = table0[s26]; + const SWord32 s29 = (0x00000005UL == 0) ? s20 : (s20 % 0x00000005UL); + const SBool s30 = table1[s29]; + const SWord16 s31 = s30 ? s21 : s23; + const SWord16 s32 = s27 ? s13 : s31; + + return s32; +} diff --git a/example22/copilot-sbv-codegen/update_state_1.c b/example22/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..6fac0803 --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,21 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_1() +{ + return false; +} diff --git a/example22/copilot-sbv-codegen/update_state_2.c b/example22/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..f4552f4a --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,62 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s1 then s3 else (if s6 then s0 else s2)) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_1[ptr_1] ? queue_3[ptr_3] : ( queue_6[ptr_6] ? queue_0[ptr_0] : queue_2[ptr_2])); +*/ +SWord16 update_state_2(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_3, const SWord32 ptr_3, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SBool s7 = queue_1[7]; + const SBool s8 = queue_1[8]; + const SBool s9 = queue_1[9]; + const SBool s10 = queue_1[10]; + const SBool s11 = queue_1[11]; + const SWord32 s12 = ptr_1; + const SWord16 s13 = queue_3[0]; + const SWord32 s14 = ptr_3; + const SBool s15 = queue_6[0]; + const SBool s16 = queue_6[1]; + const SBool s17 = queue_6[2]; + const SBool s18 = queue_6[3]; + const SBool s19 = queue_6[4]; + const SWord32 s20 = ptr_6; + const SWord16 s21 = queue_0[0]; + const SWord32 s22 = ptr_0; + const SWord16 s23 = queue_2[0]; + const SWord32 s24 = ptr_2; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 + }; + const SBool table1[] = { + s15, s16, s17, s18, s19 + }; + const SWord32 s26 = (0x0000000cUL == 0) ? s12 : (s12 % 0x0000000cUL); + const SBool s27 = table0[s26]; + const SWord32 s29 = (0x00000005UL == 0) ? s20 : (s20 % 0x00000005UL); + const SBool s30 = table1[s29]; + const SWord16 s31 = s30 ? s21 : s23; + const SWord16 s32 = s27 ? s13 : s31; + + return s32; +} diff --git a/example22/copilot-sbv-codegen/update_state_3.c b/example22/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..b3412c74 --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,62 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s1 then s4 else (if s6 then s2 else s3)) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_1[ptr_1] ? queue_4[ptr_4] : ( queue_6[ptr_6] ? queue_2[ptr_2] : queue_3[ptr_3])); +*/ +SWord16 update_state_3(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_4, const SWord32 ptr_4, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_2, const SWord32 ptr_2, + const SWord16 *queue_3, const SWord32 ptr_3) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SBool s7 = queue_1[7]; + const SBool s8 = queue_1[8]; + const SBool s9 = queue_1[9]; + const SBool s10 = queue_1[10]; + const SBool s11 = queue_1[11]; + const SWord32 s12 = ptr_1; + const SWord16 s13 = queue_4[0]; + const SWord32 s14 = ptr_4; + const SBool s15 = queue_6[0]; + const SBool s16 = queue_6[1]; + const SBool s17 = queue_6[2]; + const SBool s18 = queue_6[3]; + const SBool s19 = queue_6[4]; + const SWord32 s20 = ptr_6; + const SWord16 s21 = queue_2[0]; + const SWord32 s22 = ptr_2; + const SWord16 s23 = queue_3[0]; + const SWord32 s24 = ptr_3; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 + }; + const SBool table1[] = { + s15, s16, s17, s18, s19 + }; + const SWord32 s26 = (0x0000000cUL == 0) ? s12 : (s12 % 0x0000000cUL); + const SBool s27 = table0[s26]; + const SWord32 s29 = (0x00000005UL == 0) ? s20 : (s20 % 0x00000005UL); + const SBool s30 = table1[s29]; + const SWord16 s31 = s30 ? s21 : s23; + const SWord16 s32 = s27 ? s13 : s31; + + return s32; +} diff --git a/example22/copilot-sbv-codegen/update_state_4.c b/example22/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..a036339b --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,62 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s1 then s5 else (if s6 then s3 else s4)) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_1[ptr_1] ? queue_5[ptr_5] : ( queue_6[ptr_6] ? queue_3[ptr_3] : queue_4[ptr_4])); +*/ +SWord16 update_state_4(const SBool *queue_1, const SWord32 ptr_1, + const SWord16 *queue_5, const SWord32 ptr_5, const SBool *queue_6, + const SWord32 ptr_6, const SWord16 *queue_3, const SWord32 ptr_3, + const SWord16 *queue_4, const SWord32 ptr_4) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SBool s7 = queue_1[7]; + const SBool s8 = queue_1[8]; + const SBool s9 = queue_1[9]; + const SBool s10 = queue_1[10]; + const SBool s11 = queue_1[11]; + const SWord32 s12 = ptr_1; + const SWord16 s13 = queue_5[0]; + const SWord32 s14 = ptr_5; + const SBool s15 = queue_6[0]; + const SBool s16 = queue_6[1]; + const SBool s17 = queue_6[2]; + const SBool s18 = queue_6[3]; + const SBool s19 = queue_6[4]; + const SWord32 s20 = ptr_6; + const SWord16 s21 = queue_3[0]; + const SWord32 s22 = ptr_3; + const SWord16 s23 = queue_4[0]; + const SWord32 s24 = ptr_4; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 + }; + const SBool table1[] = { + s15, s16, s17, s18, s19 + }; + const SWord32 s26 = (0x0000000cUL == 0) ? s12 : (s12 % 0x0000000cUL); + const SBool s27 = table0[s26]; + const SWord32 s29 = (0x00000005UL == 0) ? s20 : (s20 % 0x00000005UL); + const SBool s30 = table1[s29]; + const SWord16 s31 = s30 ? s21 : s23; + const SWord16 s32 = s27 ? s13 : s31; + + return s32; +} diff --git a/example22/copilot-sbv-codegen/update_state_5.c b/example22/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..f08479b5 --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,59 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s1 then 0 else (if s6 then s4 else s5)) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_1[ptr_1] ? 0 : ( queue_6[ptr_6] ? queue_4[ptr_4] : queue_5[ptr_5])); +*/ +SWord16 update_state_5(const SBool *queue_1, const SWord32 ptr_1, + const SBool *queue_6, const SWord32 ptr_6, const SWord16 *queue_4, + const SWord32 ptr_4, const SWord16 *queue_5, const SWord32 ptr_5) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SBool s5 = queue_1[5]; + const SBool s6 = queue_1[6]; + const SBool s7 = queue_1[7]; + const SBool s8 = queue_1[8]; + const SBool s9 = queue_1[9]; + const SBool s10 = queue_1[10]; + const SBool s11 = queue_1[11]; + const SWord32 s12 = ptr_1; + const SBool s13 = queue_6[0]; + const SBool s14 = queue_6[1]; + const SBool s15 = queue_6[2]; + const SBool s16 = queue_6[3]; + const SBool s17 = queue_6[4]; + const SWord32 s18 = ptr_6; + const SWord16 s19 = queue_4[0]; + const SWord32 s20 = ptr_4; + const SWord16 s21 = queue_5[0]; + const SWord32 s22 = ptr_5; + const SBool table0[] = { + s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11 + }; + const SBool table1[] = { + s13, s14, s15, s16, s17 + }; + const SWord32 s24 = (0x0000000cUL == 0) ? s12 : (s12 % 0x0000000cUL); + const SBool s25 = table0[s24]; + const SWord32 s28 = (0x00000005UL == 0) ? s18 : (s18 % 0x00000005UL); + const SBool s29 = table1[s28]; + const SWord16 s30 = s29 ? s19 : s21; + const SWord16 s31 = s25 ? 0x0000U : s30; + + return s31; +} diff --git a/example22/copilot-sbv-codegen/update_state_6.c b/example22/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..94542b17 --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,21 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + false +*/ +/*@ + assigns \nothing; + ensures \result == false; +*/ +SBool update_state_6() +{ + return false; +} diff --git a/example22/copilot-sbv-codegen/update_state_7.c b/example22/copilot-sbv-codegen/update_state_7.c new file mode 100644 index 00000000..a26c3e05 --- /dev/null +++ b/example22/copilot-sbv-codegen/update_state_7.c @@ -0,0 +1,25 @@ +/* File: "update_state_7.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s7 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_7[ptr_7] + 1); +*/ +SWord16 update_state_7(const SWord16 *queue_7, const SWord32 ptr_7) +{ + const SWord16 s0 = queue_7[0]; + const SWord32 s1 = ptr_7; + const SWord16 s3 = s0 + 0x0001U; + + return s3; +} diff --git a/example22/main.hs b/example22/main.hs new file mode 100644 index 00000000..6c04bca8 --- /dev/null +++ b/example22/main.hs @@ -0,0 +1,43 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.Stacks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +-- push a counter from 1 to 5 onto the stack +pushSignal :: Stream Bool +pushSignal = replicate 5 True ++ false + +pushValue :: Stream Word16 +pushValue = [ 1 ] ++ pushValue + 1 + +-- then wait one tick and pop 6 values off the stack again +-- ( leaving the default/start value ) +popSignal :: Stream Bool +popSignal = replicate 6 False P.++ replicate 6 True ++ false + +-- all operations on a stack of depth 5, of type Word16 and with +-- start/default value 0 +stackStream :: Stream Word16 +stackStream = stack (5::Int) 0 popSignal pushSignal pushValue + +spec :: Spec +spec = + observer "stack" stackStream + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example23/--list-options/add-source-timestamps b/example23/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example23/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example23/--list-options/packages/00-index.cache b/example23/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example23/--list-options/packages/00-index.tar b/example23/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example23/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example23/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example23/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example23/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example23/.cabal-sandbox/add-source-timestamps b/example23/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example23/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example23/.cabal-sandbox/packages/00-index.cache b/example23/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example23/.cabal-sandbox/packages/00-index.tar b/example23/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example23/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example23/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example23/Makefile b/example23/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example23/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example23/cabal.sandbox.config b/example23/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example23/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example23/main.hs b/example23/main.hs new file mode 100644 index 00000000..700735d2 --- /dev/null +++ b/example23/main.hs @@ -0,0 +1,50 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.Utils +import Copilot.Library.Statistics + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +inputData :: Stream Word16 +inputData = replicate 5 0 ++ inputData + 5 + +inputFData :: Stream Float +inputFData = replicate 5 0 ++ inputFData + 5 + + +minV :: Stream Word16 +minV = min 3 inputData + +maxV :: Stream Word16 +maxV = max 3 inputData + +sumV :: Stream Word16 +sumV = sum 3 inputData + +meanV :: Stream Float +meanV = mean 3 inputFData + + +spec :: Spec +spec = do + observer "minV" minV + observer "maxV" maxV + observer "sumV" sumV + observer "meanV" meanV + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example24/--list-options/add-source-timestamps b/example24/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example24/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example24/--list-options/packages/00-index.cache b/example24/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example24/--list-options/packages/00-index.tar b/example24/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example24/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example24/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example24/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example24/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example24/.cabal-sandbox/add-source-timestamps b/example24/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example24/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example24/.cabal-sandbox/packages/00-index.cache b/example24/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example24/.cabal-sandbox/packages/00-index.tar b/example24/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example24/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example24/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example24/Makefile b/example24/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example24/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example24/cabal.sandbox.config b/example24/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example24/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example24/copilot-sbv-codegen/Makefile b/example24/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..6a897f41 --- /dev/null +++ b/example24/copilot-sbv-codegen/Makefile @@ -0,0 +1,110 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_1.o update_state_4.o update_state_8.o update_state_12.o update_state_16.o update_state_20.o update_state_24.o update_state_28.o update_state_32.o update_state_36.o update_state_40.o update_state_44.o update_state_48.o update_state_52.o update_state_56.o update_state_60.o update_state_64.o update_state_68.o update_state_72.o update_state_76.o update_state_80.o update_state_84.o update_state_88.o update_state_92.o update_state_96.o update_state_100.o trigger_guard_aMaj.o trigger_aMaj_arg_0.o trigger_guard_maj.o trigger_maj_arg_0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_8.o: update_state_8.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_12.o: update_state_12.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_16.o: update_state_16.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_20.o: update_state_20.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_24.o: update_state_24.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_28.o: update_state_28.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_32.o: update_state_32.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_36.o: update_state_36.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_40.o: update_state_40.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_44.o: update_state_44.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_48.o: update_state_48.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_52.o: update_state_52.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_56.o: update_state_56.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_60.o: update_state_60.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_64.o: update_state_64.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_68.o: update_state_68.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_72.o: update_state_72.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_76.o: update_state_76.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_80.o: update_state_80.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_84.o: update_state_84.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_88.o: update_state_88.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_92.o: update_state_92.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_96.o: update_state_96.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_100.o: update_state_100.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_aMaj.o: trigger_guard_aMaj.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_aMaj_arg_0.o: trigger_aMaj_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_maj.o: trigger_guard_maj.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_maj_arg_0.o: trigger_maj_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example24/copilot-sbv-codegen/README b/example24/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example24/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example24/copilot-sbv-codegen/copilot.h b/example24/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..9874c74f --- /dev/null +++ b/example24/copilot-sbv-codegen/copilot.h @@ -0,0 +1,25 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void aMaj(bool); +void maj(uint32_t); + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example24/copilot-sbv-codegen/copilot.mk b/example24/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example24/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example24/copilot-sbv-codegen/driver.c b/example24/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..002b1821 --- /dev/null +++ b/example24/copilot-sbv-codegen/driver.c @@ -0,0 +1,427 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SWord32 tmp_1 = 0; +SWord32 tmp_4 = 0; +SWord32 tmp_8 = 0; +SWord32 tmp_12 = 0; +SWord32 tmp_16 = 1; +SWord32 tmp_20 = 1; +SWord32 tmp_24 = 1; +SWord32 tmp_28 = 1; +SWord32 tmp_32 = 1; +SWord32 tmp_36 = 1; +SWord32 tmp_40 = 1; +SWord32 tmp_44 = 1; +SWord32 tmp_48 = 1; +SWord32 tmp_52 = 1; +SWord32 tmp_56 = 1; +SWord32 tmp_60 = 1; +SWord32 tmp_64 = 1; +SWord32 tmp_68 = 1; +SWord32 tmp_72 = 1; +SWord32 tmp_76 = 1; +SWord32 tmp_80 = 1; +SWord32 tmp_84 = 1; +SWord32 tmp_88 = 1; +SWord32 tmp_92 = 1; +SWord32 tmp_96 = 1; +SWord32 tmp_100 = 1; +SWord32 queue_1[1] = { 0 }; +SWord32 queue_4[1] = { 0 }; +SWord32 queue_8[1] = { 0 }; +SWord32 queue_12[1] = { 0 }; +SWord32 queue_16[1] = { 1 }; +SWord32 queue_20[1] = { 1 }; +SWord32 queue_24[1] = { 1 }; +SWord32 queue_28[1] = { 1 }; +SWord32 queue_32[1] = { 1 }; +SWord32 queue_36[1] = { 1 }; +SWord32 queue_40[1] = { 1 }; +SWord32 queue_44[1] = { 1 }; +SWord32 queue_48[1] = { 1 }; +SWord32 queue_52[1] = { 1 }; +SWord32 queue_56[1] = { 1 }; +SWord32 queue_60[1] = { 1 }; +SWord32 queue_64[1] = { 1 }; +SWord32 queue_68[1] = { 1 }; +SWord32 queue_72[1] = { 1 }; +SWord32 queue_76[1] = { 1 }; +SWord32 queue_80[1] = { 1 }; +SWord32 queue_84[1] = { 1 }; +SWord32 queue_88[1] = { 1 }; +SWord32 queue_92[1] = { 1 }; +SWord32 queue_96[1] = { 1 }; +SWord32 queue_100[1] = { 1 }; +SWord32 ptr_1 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_8 = 0; +SWord32 ptr_12 = 0; +SWord32 ptr_16 = 0; +SWord32 ptr_20 = 0; +SWord32 ptr_24 = 0; +SWord32 ptr_28 = 0; +SWord32 ptr_32 = 0; +SWord32 ptr_36 = 0; +SWord32 ptr_40 = 0; +SWord32 ptr_44 = 0; +SWord32 ptr_48 = 0; +SWord32 ptr_52 = 0; +SWord32 ptr_56 = 0; +SWord32 ptr_60 = 0; +SWord32 ptr_64 = 0; +SWord32 ptr_68 = 0; +SWord32 ptr_72 = 0; +SWord32 ptr_76 = 0; +SWord32 ptr_80 = 0; +SWord32 ptr_84 = 0; +SWord32 ptr_88 = 0; +SWord32 ptr_92 = 0; +SWord32 ptr_96 = 0; +SWord32 ptr_100 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); + global invariant a_bound_ptr_4: ptr_4 < 1 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 0 )); + global invariant a_bound_ptr_8: ptr_8 < 1 ; + global invariant a_pos_ptr_8: ptr_8 >= 0 ; + global invariant a_valid_ptr_8: \valid (queue_8 + (0.. 0 )); + global invariant a_bound_ptr_12: ptr_12 < 1 ; + global invariant a_pos_ptr_12: ptr_12 >= 0 ; + global invariant a_valid_ptr_12: \valid (queue_12 + (0.. 0 )); + global invariant a_bound_ptr_16: ptr_16 < 1 ; + global invariant a_pos_ptr_16: ptr_16 >= 0 ; + global invariant a_valid_ptr_16: \valid (queue_16 + (0.. 0 )); + global invariant a_bound_ptr_20: ptr_20 < 1 ; + global invariant a_pos_ptr_20: ptr_20 >= 0 ; + global invariant a_valid_ptr_20: \valid (queue_20 + (0.. 0 )); + global invariant a_bound_ptr_24: ptr_24 < 1 ; + global invariant a_pos_ptr_24: ptr_24 >= 0 ; + global invariant a_valid_ptr_24: \valid (queue_24 + (0.. 0 )); + global invariant a_bound_ptr_28: ptr_28 < 1 ; + global invariant a_pos_ptr_28: ptr_28 >= 0 ; + global invariant a_valid_ptr_28: \valid (queue_28 + (0.. 0 )); + global invariant a_bound_ptr_32: ptr_32 < 1 ; + global invariant a_pos_ptr_32: ptr_32 >= 0 ; + global invariant a_valid_ptr_32: \valid (queue_32 + (0.. 0 )); + global invariant a_bound_ptr_36: ptr_36 < 1 ; + global invariant a_pos_ptr_36: ptr_36 >= 0 ; + global invariant a_valid_ptr_36: \valid (queue_36 + (0.. 0 )); + global invariant a_bound_ptr_40: ptr_40 < 1 ; + global invariant a_pos_ptr_40: ptr_40 >= 0 ; + global invariant a_valid_ptr_40: \valid (queue_40 + (0.. 0 )); + global invariant a_bound_ptr_44: ptr_44 < 1 ; + global invariant a_pos_ptr_44: ptr_44 >= 0 ; + global invariant a_valid_ptr_44: \valid (queue_44 + (0.. 0 )); + global invariant a_bound_ptr_48: ptr_48 < 1 ; + global invariant a_pos_ptr_48: ptr_48 >= 0 ; + global invariant a_valid_ptr_48: \valid (queue_48 + (0.. 0 )); + global invariant a_bound_ptr_52: ptr_52 < 1 ; + global invariant a_pos_ptr_52: ptr_52 >= 0 ; + global invariant a_valid_ptr_52: \valid (queue_52 + (0.. 0 )); + global invariant a_bound_ptr_56: ptr_56 < 1 ; + global invariant a_pos_ptr_56: ptr_56 >= 0 ; + global invariant a_valid_ptr_56: \valid (queue_56 + (0.. 0 )); + global invariant a_bound_ptr_60: ptr_60 < 1 ; + global invariant a_pos_ptr_60: ptr_60 >= 0 ; + global invariant a_valid_ptr_60: \valid (queue_60 + (0.. 0 )); + global invariant a_bound_ptr_64: ptr_64 < 1 ; + global invariant a_pos_ptr_64: ptr_64 >= 0 ; + global invariant a_valid_ptr_64: \valid (queue_64 + (0.. 0 )); + global invariant a_bound_ptr_68: ptr_68 < 1 ; + global invariant a_pos_ptr_68: ptr_68 >= 0 ; + global invariant a_valid_ptr_68: \valid (queue_68 + (0.. 0 )); + global invariant a_bound_ptr_72: ptr_72 < 1 ; + global invariant a_pos_ptr_72: ptr_72 >= 0 ; + global invariant a_valid_ptr_72: \valid (queue_72 + (0.. 0 )); + global invariant a_bound_ptr_76: ptr_76 < 1 ; + global invariant a_pos_ptr_76: ptr_76 >= 0 ; + global invariant a_valid_ptr_76: \valid (queue_76 + (0.. 0 )); + global invariant a_bound_ptr_80: ptr_80 < 1 ; + global invariant a_pos_ptr_80: ptr_80 >= 0 ; + global invariant a_valid_ptr_80: \valid (queue_80 + (0.. 0 )); + global invariant a_bound_ptr_84: ptr_84 < 1 ; + global invariant a_pos_ptr_84: ptr_84 >= 0 ; + global invariant a_valid_ptr_84: \valid (queue_84 + (0.. 0 )); + global invariant a_bound_ptr_88: ptr_88 < 1 ; + global invariant a_pos_ptr_88: ptr_88 >= 0 ; + global invariant a_valid_ptr_88: \valid (queue_88 + (0.. 0 )); + global invariant a_bound_ptr_92: ptr_92 < 1 ; + global invariant a_pos_ptr_92: ptr_92 >= 0 ; + global invariant a_valid_ptr_92: \valid (queue_92 + (0.. 0 )); + global invariant a_bound_ptr_96: ptr_96 < 1 ; + global invariant a_pos_ptr_96: ptr_96 >= 0 ; + global invariant a_valid_ptr_96: \valid (queue_96 + (0.. 0 )); + global invariant a_bound_ptr_100: ptr_100 < 1 ; + global invariant a_pos_ptr_100: ptr_100 >= 0 ; + global invariant a_valid_ptr_100: \valid (queue_100 + (0.. 0 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_aMaj()) + aMaj(trigger_aMaj_arg_0(queue_1, ptr_1, queue_4, ptr_4, queue_8, ptr_8, queue_12, ptr_12, queue_16, ptr_16, queue_20, ptr_20, queue_24, ptr_24, queue_28, ptr_28, queue_32, ptr_32, queue_36, ptr_36, queue_40, ptr_40, queue_44, ptr_44, queue_48, ptr_48, queue_52, ptr_52, queue_56, ptr_56, queue_60, ptr_60, queue_64, ptr_64, queue_68, ptr_68, queue_72, ptr_72, queue_76, ptr_76, queue_80, ptr_80, queue_84, ptr_84, queue_88, ptr_88, queue_92, ptr_92, queue_96, ptr_96, queue_100, ptr_100)); + if (trigger_guard_maj()) + maj(trigger_maj_arg_0(queue_4, ptr_4, queue_1, ptr_1, queue_8, ptr_8, queue_12, ptr_12, queue_16, ptr_16, queue_20, ptr_20, queue_24, ptr_24, queue_28, ptr_28, queue_32, ptr_32, queue_36, ptr_36, queue_40, ptr_40, queue_44, ptr_44, queue_48, ptr_48, queue_52, ptr_52, queue_56, ptr_56, queue_60, ptr_60, queue_64, ptr_64, queue_68, ptr_68, queue_72, ptr_72, queue_76, ptr_76, queue_80, ptr_80, queue_84, ptr_84, queue_88, ptr_88, queue_92, ptr_92, queue_96, ptr_96, queue_100, ptr_100)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_1; + assigns tmp_4; + assigns tmp_8; + assigns tmp_12; + assigns tmp_16; + assigns tmp_20; + assigns tmp_24; + assigns tmp_28; + assigns tmp_32; + assigns tmp_36; + assigns tmp_40; + assigns tmp_44; + assigns tmp_48; + assigns tmp_52; + assigns tmp_56; + assigns tmp_60; + assigns tmp_64; + assigns tmp_68; + assigns tmp_72; + assigns tmp_76; + assigns tmp_80; + assigns tmp_84; + assigns tmp_88; + assigns tmp_92; + assigns tmp_96; + assigns tmp_100; + */ +void updateStates(void) { + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_4 = update_state_4(queue_4, ptr_4); + tmp_8 = update_state_8(queue_8, ptr_8); + tmp_12 = update_state_12(queue_12, ptr_12); + tmp_16 = update_state_16(queue_16, ptr_16); + tmp_20 = update_state_20(queue_20, ptr_20); + tmp_24 = update_state_24(queue_24, ptr_24); + tmp_28 = update_state_28(queue_28, ptr_28); + tmp_32 = update_state_32(queue_32, ptr_32); + tmp_36 = update_state_36(queue_36, ptr_36); + tmp_40 = update_state_40(queue_40, ptr_40); + tmp_44 = update_state_44(queue_44, ptr_44); + tmp_48 = update_state_48(queue_48, ptr_48); + tmp_52 = update_state_52(queue_52, ptr_52); + tmp_56 = update_state_56(queue_56, ptr_56); + tmp_60 = update_state_60(queue_60, ptr_60); + tmp_64 = update_state_64(queue_64, ptr_64); + tmp_68 = update_state_68(queue_68, ptr_68); + tmp_72 = update_state_72(queue_72, ptr_72); + tmp_76 = update_state_76(queue_76, ptr_76); + tmp_80 = update_state_80(queue_80, ptr_80); + tmp_84 = update_state_84(queue_84, ptr_84); + tmp_88 = update_state_88(queue_88, ptr_88); + tmp_92 = update_state_92(queue_92, ptr_92); + tmp_96 = update_state_96(queue_96, ptr_96); + tmp_100 = update_state_100(queue_100, ptr_100); +} + +/*@ + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_8[ptr_8]; + ensures queue_8[ptr_8] == tmp_8; + assigns queue_12[ptr_12]; + ensures queue_12[ptr_12] == tmp_12; + assigns queue_16[ptr_16]; + ensures queue_16[ptr_16] == tmp_16; + assigns queue_20[ptr_20]; + ensures queue_20[ptr_20] == tmp_20; + assigns queue_24[ptr_24]; + ensures queue_24[ptr_24] == tmp_24; + assigns queue_28[ptr_28]; + ensures queue_28[ptr_28] == tmp_28; + assigns queue_32[ptr_32]; + ensures queue_32[ptr_32] == tmp_32; + assigns queue_36[ptr_36]; + ensures queue_36[ptr_36] == tmp_36; + assigns queue_40[ptr_40]; + ensures queue_40[ptr_40] == tmp_40; + assigns queue_44[ptr_44]; + ensures queue_44[ptr_44] == tmp_44; + assigns queue_48[ptr_48]; + ensures queue_48[ptr_48] == tmp_48; + assigns queue_52[ptr_52]; + ensures queue_52[ptr_52] == tmp_52; + assigns queue_56[ptr_56]; + ensures queue_56[ptr_56] == tmp_56; + assigns queue_60[ptr_60]; + ensures queue_60[ptr_60] == tmp_60; + assigns queue_64[ptr_64]; + ensures queue_64[ptr_64] == tmp_64; + assigns queue_68[ptr_68]; + ensures queue_68[ptr_68] == tmp_68; + assigns queue_72[ptr_72]; + ensures queue_72[ptr_72] == tmp_72; + assigns queue_76[ptr_76]; + ensures queue_76[ptr_76] == tmp_76; + assigns queue_80[ptr_80]; + ensures queue_80[ptr_80] == tmp_80; + assigns queue_84[ptr_84]; + ensures queue_84[ptr_84] == tmp_84; + assigns queue_88[ptr_88]; + ensures queue_88[ptr_88] == tmp_88; + assigns queue_92[ptr_92]; + ensures queue_92[ptr_92] == tmp_92; + assigns queue_96[ptr_96]; + ensures queue_96[ptr_96] == tmp_96; + assigns queue_100[ptr_100]; + ensures queue_100[ptr_100] == tmp_100; + */ +void updateBuffers(void) { + queue_1[ptr_1] = tmp_1; + queue_4[ptr_4] = tmp_4; + queue_8[ptr_8] = tmp_8; + queue_12[ptr_12] = tmp_12; + queue_16[ptr_16] = tmp_16; + queue_20[ptr_20] = tmp_20; + queue_24[ptr_24] = tmp_24; + queue_28[ptr_28] = tmp_28; + queue_32[ptr_32] = tmp_32; + queue_36[ptr_36] = tmp_36; + queue_40[ptr_40] = tmp_40; + queue_44[ptr_44] = tmp_44; + queue_48[ptr_48] = tmp_48; + queue_52[ptr_52] = tmp_52; + queue_56[ptr_56] = tmp_56; + queue_60[ptr_60] = tmp_60; + queue_64[ptr_64] = tmp_64; + queue_68[ptr_68] = tmp_68; + queue_72[ptr_72] = tmp_72; + queue_76[ptr_76] = tmp_76; + queue_80[ptr_80] = tmp_80; + queue_84[ptr_84] = tmp_84; + queue_88[ptr_88] = tmp_88; + queue_92[ptr_92] = tmp_92; + queue_96[ptr_96] = tmp_96; + queue_100[ptr_100] = tmp_100; +} + +/*@ + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 1; + assigns ptr_8; + ensures ptr_8 == (\old (ptr_8 ) + 1) % 1; + assigns ptr_12; + ensures ptr_12 == (\old (ptr_12 ) + 1) % 1; + assigns ptr_16; + ensures ptr_16 == (\old (ptr_16 ) + 1) % 1; + assigns ptr_20; + ensures ptr_20 == (\old (ptr_20 ) + 1) % 1; + assigns ptr_24; + ensures ptr_24 == (\old (ptr_24 ) + 1) % 1; + assigns ptr_28; + ensures ptr_28 == (\old (ptr_28 ) + 1) % 1; + assigns ptr_32; + ensures ptr_32 == (\old (ptr_32 ) + 1) % 1; + assigns ptr_36; + ensures ptr_36 == (\old (ptr_36 ) + 1) % 1; + assigns ptr_40; + ensures ptr_40 == (\old (ptr_40 ) + 1) % 1; + assigns ptr_44; + ensures ptr_44 == (\old (ptr_44 ) + 1) % 1; + assigns ptr_48; + ensures ptr_48 == (\old (ptr_48 ) + 1) % 1; + assigns ptr_52; + ensures ptr_52 == (\old (ptr_52 ) + 1) % 1; + assigns ptr_56; + ensures ptr_56 == (\old (ptr_56 ) + 1) % 1; + assigns ptr_60; + ensures ptr_60 == (\old (ptr_60 ) + 1) % 1; + assigns ptr_64; + ensures ptr_64 == (\old (ptr_64 ) + 1) % 1; + assigns ptr_68; + ensures ptr_68 == (\old (ptr_68 ) + 1) % 1; + assigns ptr_72; + ensures ptr_72 == (\old (ptr_72 ) + 1) % 1; + assigns ptr_76; + ensures ptr_76 == (\old (ptr_76 ) + 1) % 1; + assigns ptr_80; + ensures ptr_80 == (\old (ptr_80 ) + 1) % 1; + assigns ptr_84; + ensures ptr_84 == (\old (ptr_84 ) + 1) % 1; + assigns ptr_88; + ensures ptr_88 == (\old (ptr_88 ) + 1) % 1; + assigns ptr_92; + ensures ptr_92 == (\old (ptr_92 ) + 1) % 1; + assigns ptr_96; + ensures ptr_96 == (\old (ptr_96 ) + 1) % 1; + assigns ptr_100; + ensures ptr_100 == (\old (ptr_100 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_1 = (ptr_1 + 1) % 1; + ptr_4 = (ptr_4 + 1) % 1; + ptr_8 = (ptr_8 + 1) % 1; + ptr_12 = (ptr_12 + 1) % 1; + ptr_16 = (ptr_16 + 1) % 1; + ptr_20 = (ptr_20 + 1) % 1; + ptr_24 = (ptr_24 + 1) % 1; + ptr_28 = (ptr_28 + 1) % 1; + ptr_32 = (ptr_32 + 1) % 1; + ptr_36 = (ptr_36 + 1) % 1; + ptr_40 = (ptr_40 + 1) % 1; + ptr_44 = (ptr_44 + 1) % 1; + ptr_48 = (ptr_48 + 1) % 1; + ptr_52 = (ptr_52 + 1) % 1; + ptr_56 = (ptr_56 + 1) % 1; + ptr_60 = (ptr_60 + 1) % 1; + ptr_64 = (ptr_64 + 1) % 1; + ptr_68 = (ptr_68 + 1) % 1; + ptr_72 = (ptr_72 + 1) % 1; + ptr_76 = (ptr_76 + 1) % 1; + ptr_80 = (ptr_80 + 1) % 1; + ptr_84 = (ptr_84 + 1) % 1; + ptr_88 = (ptr_88 + 1) % 1; + ptr_92 = (ptr_92 + 1) % 1; + ptr_96 = (ptr_96 + 1) % 1; + ptr_100 = (ptr_100 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example24/copilot-sbv-codegen/internal.h b/example24/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..7aca8684 --- /dev/null +++ b/example24/copilot-sbv-codegen/internal.h @@ -0,0 +1,140 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord32 update_state_1(const SWord32 *queue_1, + const SWord32 ptr_1); +SWord32 update_state_4(const SWord32 *queue_4, + const SWord32 ptr_4); +SWord32 update_state_8(const SWord32 *queue_8, + const SWord32 ptr_8); +SWord32 update_state_12(const SWord32 *queue_12, + const SWord32 ptr_12); +SWord32 update_state_16(const SWord32 *queue_16, + const SWord32 ptr_16); +SWord32 update_state_20(const SWord32 *queue_20, + const SWord32 ptr_20); +SWord32 update_state_24(const SWord32 *queue_24, + const SWord32 ptr_24); +SWord32 update_state_28(const SWord32 *queue_28, + const SWord32 ptr_28); +SWord32 update_state_32(const SWord32 *queue_32, + const SWord32 ptr_32); +SWord32 update_state_36(const SWord32 *queue_36, + const SWord32 ptr_36); +SWord32 update_state_40(const SWord32 *queue_40, + const SWord32 ptr_40); +SWord32 update_state_44(const SWord32 *queue_44, + const SWord32 ptr_44); +SWord32 update_state_48(const SWord32 *queue_48, + const SWord32 ptr_48); +SWord32 update_state_52(const SWord32 *queue_52, + const SWord32 ptr_52); +SWord32 update_state_56(const SWord32 *queue_56, + const SWord32 ptr_56); +SWord32 update_state_60(const SWord32 *queue_60, + const SWord32 ptr_60); +SWord32 update_state_64(const SWord32 *queue_64, + const SWord32 ptr_64); +SWord32 update_state_68(const SWord32 *queue_68, + const SWord32 ptr_68); +SWord32 update_state_72(const SWord32 *queue_72, + const SWord32 ptr_72); +SWord32 update_state_76(const SWord32 *queue_76, + const SWord32 ptr_76); +SWord32 update_state_80(const SWord32 *queue_80, + const SWord32 ptr_80); +SWord32 update_state_84(const SWord32 *queue_84, + const SWord32 ptr_84); +SWord32 update_state_88(const SWord32 *queue_88, + const SWord32 ptr_88); +SWord32 update_state_92(const SWord32 *queue_92, + const SWord32 ptr_92); +SWord32 update_state_96(const SWord32 *queue_96, + const SWord32 ptr_96); +SWord32 update_state_100(const SWord32 *queue_100, + const SWord32 ptr_100); +SBool trigger_guard_aMaj(); +SBool trigger_aMaj_arg_0(const SWord32 *queue_1, + const SWord32 ptr_1, const SWord32 *queue_4, const SWord32 ptr_4, + const SWord32 *queue_8, const SWord32 ptr_8, + const SWord32 *queue_12, const SWord32 ptr_12, + const SWord32 *queue_16, const SWord32 ptr_16, + const SWord32 *queue_20, const SWord32 ptr_20, + const SWord32 *queue_24, const SWord32 ptr_24, + const SWord32 *queue_28, const SWord32 ptr_28, + const SWord32 *queue_32, const SWord32 ptr_32, + const SWord32 *queue_36, const SWord32 ptr_36, + const SWord32 *queue_40, const SWord32 ptr_40, + const SWord32 *queue_44, const SWord32 ptr_44, + const SWord32 *queue_48, const SWord32 ptr_48, + const SWord32 *queue_52, const SWord32 ptr_52, + const SWord32 *queue_56, const SWord32 ptr_56, + const SWord32 *queue_60, const SWord32 ptr_60, + const SWord32 *queue_64, const SWord32 ptr_64, + const SWord32 *queue_68, const SWord32 ptr_68, + const SWord32 *queue_72, const SWord32 ptr_72, + const SWord32 *queue_76, const SWord32 ptr_76, + const SWord32 *queue_80, const SWord32 ptr_80, + const SWord32 *queue_84, const SWord32 ptr_84, + const SWord32 *queue_88, const SWord32 ptr_88, + const SWord32 *queue_92, const SWord32 ptr_92, + const SWord32 *queue_96, const SWord32 ptr_96, + const SWord32 *queue_100, const SWord32 ptr_100); +SBool trigger_guard_maj(); +SWord32 trigger_maj_arg_0(const SWord32 *queue_4, + const SWord32 ptr_4, const SWord32 *queue_1, const SWord32 ptr_1, + const SWord32 *queue_8, const SWord32 ptr_8, + const SWord32 *queue_12, const SWord32 ptr_12, + const SWord32 *queue_16, const SWord32 ptr_16, + const SWord32 *queue_20, const SWord32 ptr_20, + const SWord32 *queue_24, const SWord32 ptr_24, + const SWord32 *queue_28, const SWord32 ptr_28, + const SWord32 *queue_32, const SWord32 ptr_32, + const SWord32 *queue_36, const SWord32 ptr_36, + const SWord32 *queue_40, const SWord32 ptr_40, + const SWord32 *queue_44, const SWord32 ptr_44, + const SWord32 *queue_48, const SWord32 ptr_48, + const SWord32 *queue_52, const SWord32 ptr_52, + const SWord32 *queue_56, const SWord32 ptr_56, + const SWord32 *queue_60, const SWord32 ptr_60, + const SWord32 *queue_64, const SWord32 ptr_64, + const SWord32 *queue_68, const SWord32 ptr_68, + const SWord32 *queue_72, const SWord32 ptr_72, + const SWord32 *queue_76, const SWord32 ptr_76, + const SWord32 *queue_80, const SWord32 ptr_80, + const SWord32 *queue_84, const SWord32 ptr_84, + const SWord32 *queue_88, const SWord32 ptr_88, + const SWord32 *queue_92, const SWord32 ptr_92, + const SWord32 *queue_96, const SWord32 ptr_96, + const SWord32 *queue_100, const SWord32 ptr_100); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example24/copilot-sbv-codegen/trigger_aMaj_arg_0.c b/example24/copilot-sbv-codegen/trigger_aMaj_arg_0.c new file mode 100644 index 00000000..a44b3177 --- /dev/null +++ b/example24/copilot-sbv-codegen/trigger_aMaj_arg_0.c @@ -0,0 +1,2319 @@ +/* File: "trigger_aMaj_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + ((local "local_0" = (if (s1 == local "local_2" = false + in local "local_3" = (if var "local_2" then s4 else s1) + in local "local_5" = (if (var "local_2" || (s4 == s1)) then 2 else 0) + in local "local_6" = (var "local_5" == 0) + in local "local_7" = (if var "local_6" then s8 else var "local_3") + in local "local_9" = (if (var "local_6" || (s8 == var "local_3")) then (var "local_5" + 1) else (var "local_5" - 1)) + in local "local_10" = (var "local_9" == 0) + in local "local_11" = (if var "local_10" then s12 else var "local_7") + in local "local_13" = (if (var "local_10" || (s12 == var "local_7")) then (var "local_9" + 1) else (var "local_9" - 1)) + in local "local_14" = (var "local_13" == 0) + in local "local_15" = (if var "local_14" then s16 else var "local_11") + in local "local_17" = (if (var "local_14" || (s16 == var "local_11")) then (var "local_13" + 1) else (var "local_13" - 1)) + in local "local_18" = (var "local_17" == 0) + in local "local_19" = (if var "local_18" then s20 else var "local_15") + in local "local_21" = (if (var "local_18" || (s20 == var "local_15")) then (var "local_17" + 1) else (var "local_17" - 1)) + in local "local_22" = (var "local_21" == 0) + in local "local_23" = (if var "local_22" then s24 else var "local_19") + in local "local_25" = (if (var "local_22" || (s24 == var "local_19")) then (var "local_21" + 1) else (var "local_21" - 1)) + in local "local_26" = (var "local_25" == 0) + in local "local_27" = (if var "local_26" then s28 else var "local_23") + in local "local_29" = (if (var "local_26" || (s28 == var "local_23")) then (var "local_25" + 1) else (var "local_25" - 1)) + in local "local_30" = (var "local_29" == 0) + in local "local_31" = (if var "local_30" then s32 else var "local_27") + in local "local_33" = (if (var "local_30" || (s32 == var "local_27")) then (var "local_29" + 1) else (var "local_29" - 1)) + in local "local_34" = (var "local_33" == 0) + in local "local_35" = (if var "local_34" then s36 else var "local_31") + in local "local_37" = (if (var "local_34" || (s36 == var "local_31")) then (var "local_33" + 1) else (var "local_33" - 1)) + in local "local_38" = (var "local_37" == 0) + in local "local_39" = (if var "local_38" then s40 else var "local_35") + in local "local_41" = (if (var "local_38" || (s40 == var "local_35")) then (var "local_37" + 1) else (var "local_37" - 1)) + in local "local_42" = (var "local_41" == 0) + in local "local_43" = (if var "local_42" then s44 else var "local_39") + in local "local_45" = (if (var "local_42" || (s44 == var "local_39")) then (var "local_41" + 1) else (var "local_41" - 1)) + in local "local_46" = (var "local_45" == 0) + in local "local_47" = (if var "local_46" then s48 else var "local_43") + in local "local_49" = (if (var "local_46" || (s48 == var "local_43")) then (var "local_45" + 1) else (var "local_45" - 1)) + in local "local_50" = (var "local_49" == 0) + in local "local_51" = (if var "local_50" then s52 else var "local_47") + in local "local_53" = (if (var "local_50" || (s52 == var "local_47")) then (var "local_49" + 1) else (var "local_49" - 1)) + in local "local_54" = (var "local_53" == 0) + in local "local_55" = (if var "local_54" then s56 else var "local_51") + in local "local_57" = (if (var "local_54" || (s56 == var "local_51")) then (var "local_53" + 1) else (var "local_53" - 1)) + in local "local_58" = (var "local_57" == 0) + in local "local_59" = (if var "local_58" then s60 else var "local_55") + in local "local_61" = (if (var "local_58" || (s60 == var "local_55")) then (var "local_57" + 1) else (var "local_57" - 1)) + in local "local_62" = (var "local_61" == 0) + in local "local_63" = (if var "local_62" then s64 else var "local_59") + in local "local_65" = (if (var "local_62" || (s64 == var "local_59")) then (var "local_61" + 1) else (var "local_61" - 1)) + in local "local_66" = (var "local_65" == 0) + in local "local_67" = (if var "local_66" then s68 else var "local_63") + in local "local_69" = (if (var "local_66" || (s68 == var "local_63")) then (var "local_65" + 1) else (var "local_65" - 1)) + in local "local_70" = (var "local_69" == 0) + in local "local_71" = (if var "local_70" then s72 else var "local_67") + in local "local_73" = (if (var "local_70" || (s72 == var "local_67")) then (var "local_69" + 1) else (var "local_69" - 1)) + in local "local_74" = (var "local_73" == 0) + in local "local_75" = (if var "local_74" then s76 else var "local_71") + in local "local_77" = (if (var "local_74" || (s76 == var "local_71")) then (var "local_73" + 1) else (var "local_73" - 1)) + in local "local_78" = (var "local_77" == 0) + in local "local_79" = (if var "local_78" then s80 else var "local_75") + in local "local_81" = (if (var "local_78" || (s80 == var "local_75")) then (var "local_77" + 1) else (var "local_77" - 1)) + in local "local_82" = (var "local_81" == 0) + in local "local_83" = (if var "local_82" then s84 else var "local_79") + in local "local_85" = (if (var "local_82" || (s84 == var "local_79")) then (var "local_81" + 1) else (var "local_81" - 1)) + in local "local_86" = (var "local_85" == 0) + in local "local_87" = (if var "local_86" then s88 else var "local_83") + in local "local_89" = (if (var "local_86" || (s88 == var "local_83")) then (var "local_85" + 1) else (var "local_85" - 1)) + in local "local_90" = (var "local_89" == 0) + in local "local_91" = (if var "local_90" then s92 else var "local_87") + in local "local_93" = (if (var "local_90" || (s92 == var "local_87")) then (var "local_89" + 1) else (var "local_89" - 1)) + in local "local_94" = (var "local_93" == 0) + in local "local_95" = (if var "local_94" then s96 else var "local_91") + in local "local_97" = (if (var "local_94" || (s96 == var "local_91")) then (var "local_93" + 1) else (var "local_93" - 1)) + in local "local_98" = (var "local_97" == 0) + in local "local_99" = (if var "local_98" then s100 else var "local_95") + in local "local_101" = (if (var "local_98" || (s100 == var "local_95")) then (var "local_97" + 1) else (var "local_97" - 1)) + in var "local_99") then 1 else 0) + in local "local_102" = (if (s4 == local "local_103" = false + in local "local_104" = (if var "local_103" then s4 else s1) + in local "local_105" = (if (var "local_103" || (s4 == s1)) then 2 else 0) + in local "local_106" = (var "local_105" == 0) + in local "local_107" = (if var "local_106" then s8 else var "local_104") + in local "local_108" = (if (var "local_106" || (s8 == var "local_104")) then (var "local_105" + 1) else (var "local_105" - 1)) + in local "local_109" = (var "local_108" == 0) + in local "local_110" = (if var "local_109" then s12 else var "local_107") + in local "local_111" = (if (var "local_109" || (s12 == var "local_107")) then (var "local_108" + 1) else (var "local_108" - 1)) + in local "local_112" = (var "local_111" == 0) + in local "local_113" = (if var "local_112" then s16 else var "local_110") + in local "local_114" = (if (var "local_112" || (s16 == var "local_110")) then (var "local_111" + 1) else (var "local_111" - 1)) + in local "local_115" = (var "local_114" == 0) + in local "local_116" = (if var "local_115" then s20 else var "local_113") + in local "local_117" = (if (var "local_115" || (s20 == var "local_113")) then (var "local_114" + 1) else (var "local_114" - 1)) + in local "local_118" = (var "local_117" == 0) + in local "local_119" = (if var "local_118" then s24 else var "local_116") + in local "local_120" = (if (var "local_118" || (s24 == var "local_116")) then (var "local_117" + 1) else (var "local_117" - 1)) + in local "local_121" = (var "local_120" == 0) + in local "local_122" = (if var "local_121" then s28 else var "local_119") + in local "local_123" = (if (var "local_121" || (s28 == var "local_119")) then (var "local_120" + 1) else (var "local_120" - 1)) + in local "local_124" = (var "local_123" == 0) + in local "local_125" = (if var "local_124" then s32 else var "local_122") + in local "local_126" = (if (var "local_124" || (s32 == var "local_122")) then (var "local_123" + 1) else (var "local_123" - 1)) + in local "local_127" = (var "local_126" == 0) + in local "local_128" = (if var "local_127" then s36 else var "local_125") + in local "local_129" = (if (var "local_127" || (s36 == var "local_125")) then (var "local_126" + 1) else (var "local_126" - 1)) + in local "local_130" = (var "local_129" == 0) + in local "local_131" = (if var "local_130" then s40 else var "local_128") + in local "local_132" = (if (var "local_130" || (s40 == var "local_128")) then (var "local_129" + 1) else (var "local_129" - 1)) + in local "local_133" = (var "local_132" == 0) + in local "local_134" = (if var "local_133" then s44 else var "local_131") + in local "local_135" = (if (var "local_133" || (s44 == var "local_131")) then (var "local_132" + 1) else (var "local_132" - 1)) + in local "local_136" = (var "local_135" == 0) + in local "local_137" = (if var "local_136" then s48 else var "local_134") + in local "local_138" = (if (var "local_136" || (s48 == var "local_134")) then (var "local_135" + 1) else (var "local_135" - 1)) + in local "local_139" = (var "local_138" == 0) + in local "local_140" = (if var "local_139" then s52 else var "local_137") + in local "local_141" = (if (var "local_139" || (s52 == var "local_137")) then (var "local_138" + 1) else (var "local_138" - 1)) + in local "local_142" = (var "local_141" == 0) + in local "local_143" = (if var "local_142" then s56 else var "local_140") + in local "local_144" = (if (var "local_142" || (s56 == var "local_140")) then (var "local_141" + 1) else (var "local_141" - 1)) + in local "local_145" = (var "local_144" == 0) + in local "local_146" = (if var "local_145" then s60 else var "local_143") + in local "local_147" = (if (var "local_145" || (s60 == var "local_143")) then (var "local_144" + 1) else (var "local_144" - 1)) + in local "local_148" = (var "local_147" == 0) + in local "local_149" = (if var "local_148" then s64 else var "local_146") + in local "local_150" = (if (var "local_148" || (s64 == var "local_146")) then (var "local_147" + 1) else (var "local_147" - 1)) + in local "local_151" = (var "local_150" == 0) + in local "local_152" = (if var "local_151" then s68 else var "local_149") + in local "local_153" = (if (var "local_151" || (s68 == var "local_149")) then (var "local_150" + 1) else (var "local_150" - 1)) + in local "local_154" = (var "local_153" == 0) + in local "local_155" = (if var "local_154" then s72 else var "local_152") + in local "local_156" = (if (var "local_154" || (s72 == var "local_152")) then (var "local_153" + 1) else (var "local_153" - 1)) + in local "local_157" = (var "local_156" == 0) + in local "local_158" = (if var "local_157" then s76 else var "local_155") + in local "local_159" = (if (var "local_157" || (s76 == var "local_155")) then (var "local_156" + 1) else (var "local_156" - 1)) + in local "local_160" = (var "local_159" == 0) + in local "local_161" = (if var "local_160" then s80 else var "local_158") + in local "local_162" = (if (var "local_160" || (s80 == var "local_158")) then (var "local_159" + 1) else (var "local_159" - 1)) + in local "local_163" = (var "local_162" == 0) + in local "local_164" = (if var "local_163" then s84 else var "local_161") + in local "local_165" = (if (var "local_163" || (s84 == var "local_161")) then (var "local_162" + 1) else (var "local_162" - 1)) + in local "local_166" = (var "local_165" == 0) + in local "local_167" = (if var "local_166" then s88 else var "local_164") + in local "local_168" = (if (var "local_166" || (s88 == var "local_164")) then (var "local_165" + 1) else (var "local_165" - 1)) + in local "local_169" = (var "local_168" == 0) + in local "local_170" = (if var "local_169" then s92 else var "local_167") + in local "local_171" = (if (var "local_169" || (s92 == var "local_167")) then (var "local_168" + 1) else (var "local_168" - 1)) + in local "local_172" = (var "local_171" == 0) + in local "local_173" = (if var "local_172" then s96 else var "local_170") + in local "local_174" = (if (var "local_172" || (s96 == var "local_170")) then (var "local_171" + 1) else (var "local_171" - 1)) + in local "local_175" = (var "local_174" == 0) + in local "local_176" = (if var "local_175" then s100 else var "local_173") + in local "local_177" = (if (var "local_175" || (s100 == var "local_173")) then (var "local_174" + 1) else (var "local_174" - 1)) + in var "local_176") then (var "local_0" + 1) else var "local_0") + in local "local_178" = (if (s8 == local "local_179" = false + in local "local_180" = (if var "local_179" then s4 else s1) + in local "local_181" = (if (var "local_179" || (s4 == s1)) then 2 else 0) + in local "local_182" = (var "local_181" == 0) + in local "local_183" = (if var "local_182" then s8 else var "local_180") + in local "local_184" = (if (var "local_182" || (s8 == var "local_180")) then (var "local_181" + 1) else (var "local_181" - 1)) + in local "local_185" = (var "local_184" == 0) + in local "local_186" = (if var "local_185" then s12 else var "local_183") + in local "local_187" = (if (var "local_185" || (s12 == var "local_183")) then (var "local_184" + 1) else (var "local_184" - 1)) + in local "local_188" = (var "local_187" == 0) + in local "local_189" = (if var "local_188" then s16 else var "local_186") + in local "local_190" = (if (var "local_188" || (s16 == var "local_186")) then (var "local_187" + 1) else (var "local_187" - 1)) + in local "local_191" = (var "local_190" == 0) + in local "local_192" = (if var "local_191" then s20 else var "local_189") + in local "local_193" = (if (var "local_191" || (s20 == var "local_189")) then (var "local_190" + 1) else (var "local_190" - 1)) + in local "local_194" = (var "local_193" == 0) + in local "local_195" = (if var "local_194" then s24 else var "local_192") + in local "local_196" = (if (var "local_194" || (s24 == var "local_192")) then (var "local_193" + 1) else (var "local_193" - 1)) + in local "local_197" = (var "local_196" == 0) + in local "local_198" = (if var "local_197" then s28 else var "local_195") + in local "local_199" = (if (var "local_197" || (s28 == var "local_195")) then (var "local_196" + 1) else (var "local_196" - 1)) + in local "local_200" = (var "local_199" == 0) + in local "local_201" = (if var "local_200" then s32 else var "local_198") + in local "local_202" = (if (var "local_200" || (s32 == var "local_198")) then (var "local_199" + 1) else (var "local_199" - 1)) + in local "local_203" = (var "local_202" == 0) + in local "local_204" = (if var "local_203" then s36 else var "local_201") + in local "local_205" = (if (var "local_203" || (s36 == var "local_201")) then (var "local_202" + 1) else (var "local_202" - 1)) + in local "local_206" = (var "local_205" == 0) + in local "local_207" = (if var "local_206" then s40 else var "local_204") + in local "local_208" = (if (var "local_206" || (s40 == var "local_204")) then (var "local_205" + 1) else (var "local_205" - 1)) + in local "local_209" = (var "local_208" == 0) + in local "local_210" = (if var "local_209" then s44 else var "local_207") + in local "local_211" = (if (var "local_209" || (s44 == var "local_207")) then (var "local_208" + 1) else (var "local_208" - 1)) + in local "local_212" = (var "local_211" == 0) + in local "local_213" = (if var "local_212" then s48 else var "local_210") + in local "local_214" = (if (var "local_212" || (s48 == var "local_210")) then (var "local_211" + 1) else (var "local_211" - 1)) + in local "local_215" = (var "local_214" == 0) + in local "local_216" = (if var "local_215" then s52 else var "local_213") + in local "local_217" = (if (var "local_215" || (s52 == var "local_213")) then (var "local_214" + 1) else (var "local_214" - 1)) + in local "local_218" = (var "local_217" == 0) + in local "local_219" = (if var "local_218" then s56 else var "local_216") + in local "local_220" = (if (var "local_218" || (s56 == var "local_216")) then (var "local_217" + 1) else (var "local_217" - 1)) + in local "local_221" = (var "local_220" == 0) + in local "local_222" = (if var "local_221" then s60 else var "local_219") + in local "local_223" = (if (var "local_221" || (s60 == var "local_219")) then (var "local_220" + 1) else (var "local_220" - 1)) + in local "local_224" = (var "local_223" == 0) + in local "local_225" = (if var "local_224" then s64 else var "local_222") + in local "local_226" = (if (var "local_224" || (s64 == var "local_222")) then (var "local_223" + 1) else (var "local_223" - 1)) + in local "local_227" = (var "local_226" == 0) + in local "local_228" = (if var "local_227" then s68 else var "local_225") + in local "local_229" = (if (var "local_227" || (s68 == var "local_225")) then (var "local_226" + 1) else (var "local_226" - 1)) + in local "local_230" = (var "local_229" == 0) + in local "local_231" = (if var "local_230" then s72 else var "local_228") + in local "local_232" = (if (var "local_230" || (s72 == var "local_228")) then (var "local_229" + 1) else (var "local_229" - 1)) + in local "local_233" = (var "local_232" == 0) + in local "local_234" = (if var "local_233" then s76 else var "local_231") + in local "local_235" = (if (var "local_233" || (s76 == var "local_231")) then (var "local_232" + 1) else (var "local_232" - 1)) + in local "local_236" = (var "local_235" == 0) + in local "local_237" = (if var "local_236" then s80 else var "local_234") + in local "local_238" = (if (var "local_236" || (s80 == var "local_234")) then (var "local_235" + 1) else (var "local_235" - 1)) + in local "local_239" = (var "local_238" == 0) + in local "local_240" = (if var "local_239" then s84 else var "local_237") + in local "local_241" = (if (var "local_239" || (s84 == var "local_237")) then (var "local_238" + 1) else (var "local_238" - 1)) + in local "local_242" = (var "local_241" == 0) + in local "local_243" = (if var "local_242" then s88 else var "local_240") + in local "local_244" = (if (var "local_242" || (s88 == var "local_240")) then (var "local_241" + 1) else (var "local_241" - 1)) + in local "local_245" = (var "local_244" == 0) + in local "local_246" = (if var "local_245" then s92 else var "local_243") + in local "local_247" = (if (var "local_245" || (s92 == var "local_243")) then (var "local_244" + 1) else (var "local_244" - 1)) + in local "local_248" = (var "local_247" == 0) + in local "local_249" = (if var "local_248" then s96 else var "local_246") + in local "local_250" = (if (var "local_248" || (s96 == var "local_246")) then (var "local_247" + 1) else (var "local_247" - 1)) + in local "local_251" = (var "local_250" == 0) + in local "local_252" = (if var "local_251" then s100 else var "local_249") + in local "local_253" = (if (var "local_251" || (s100 == var "local_249")) then (var "local_250" + 1) else (var "local_250" - 1)) + in var "local_252") then (var "local_102" + 1) else var "local_102") + in local "local_254" = (if (s12 == local "local_255" = false + in local "local_256" = (if var "local_255" then s4 else s1) + in local "local_257" = (if (var "local_255" || (s4 == s1)) then 2 else 0) + in local "local_258" = (var "local_257" == 0) + in local "local_259" = (if var "local_258" then s8 else var "local_256") + in local "local_260" = (if (var "local_258" || (s8 == var "local_256")) then (var "local_257" + 1) else (var "local_257" - 1)) + in local "local_261" = (var "local_260" == 0) + in local "local_262" = (if var "local_261" then s12 else var "local_259") + in local "local_263" = (if (var "local_261" || (s12 == var "local_259")) then (var "local_260" + 1) else (var "local_260" - 1)) + in local "local_264" = (var "local_263" == 0) + in local "local_265" = (if var "local_264" then s16 else var "local_262") + in local "local_266" = (if (var "local_264" || (s16 == var "local_262")) then (var "local_263" + 1) else (var "local_263" - 1)) + in local "local_267" = (var "local_266" == 0) + in local "local_268" = (if var "local_267" then s20 else var "local_265") + in local "local_269" = (if (var "local_267" || (s20 == var "local_265")) then (var "local_266" + 1) else (var "local_266" - 1)) + in local "local_270" = (var "local_269" == 0) + in local "local_271" = (if var "local_270" then s24 else var "local_268") + in local "local_272" = (if (var "local_270" || (s24 == var "local_268")) then (var "local_269" + 1) else (var "local_269" - 1)) + in local "local_273" = (var "local_272" == 0) + in local "local_274" = (if var "local_273" then s28 else var "local_271") + in local "local_275" = (if (var "local_273" || (s28 == var "local_271")) then (var "local_272" + 1) else (var "local_272" - 1)) + in local "local_276" = (var "local_275" == 0) + in local "local_277" = (if var "local_276" then s32 else var "local_274") + in local "local_278" = (if (var "local_276" || (s32 == var "local_274")) then (var "local_275" + 1) else (var "local_275" - 1)) + in local "local_279" = (var "local_278" == 0) + in local "local_280" = (if var "local_279" then s36 else var "local_277") + in local "local_281" = (if (var "local_279" || (s36 == var "local_277")) then (var "local_278" + 1) else (var "local_278" - 1)) + in local "local_282" = (var "local_281" == 0) + in local "local_283" = (if var "local_282" then s40 else var "local_280") + in local "local_284" = (if (var "local_282" || (s40 == var "local_280")) then (var "local_281" + 1) else (var "local_281" - 1)) + in local "local_285" = (var "local_284" == 0) + in local "local_286" = (if var "local_285" then s44 else var "local_283") + in local "local_287" = (if (var "local_285" || (s44 == var "local_283")) then (var "local_284" + 1) else (var "local_284" - 1)) + in local "local_288" = (var "local_287" == 0) + in local "local_289" = (if var "local_288" then s48 else var "local_286") + in local "local_290" = (if (var "local_288" || (s48 == var "local_286")) then (var "local_287" + 1) else (var "local_287" - 1)) + in local "local_291" = (var "local_290" == 0) + in local "local_292" = (if var "local_291" then s52 else var "local_289") + in local "local_293" = (if (var "local_291" || (s52 == var "local_289")) then (var "local_290" + 1) else (var "local_290" - 1)) + in local "local_294" = (var "local_293" == 0) + in local "local_295" = (if var "local_294" then s56 else var "local_292") + in local "local_296" = (if (var "local_294" || (s56 == var "local_292")) then (var "local_293" + 1) else (var "local_293" - 1)) + in local "local_297" = (var "local_296" == 0) + in local "local_298" = (if var "local_297" then s60 else var "local_295") + in local "local_299" = (if (var "local_297" || (s60 == var "local_295")) then (var "local_296" + 1) else (var "local_296" - 1)) + in local "local_300" = (var "local_299" == 0) + in local "local_301" = (if var "local_300" then s64 else var "local_298") + in local "local_302" = (if (var "local_300" || (s64 == var "local_298")) then (var "local_299" + 1) else (var "local_299" - 1)) + in local "local_303" = (var "local_302" == 0) + in local "local_304" = (if var "local_303" then s68 else var "local_301") + in local "local_305" = (if (var "local_303" || (s68 == var "local_301")) then (var "local_302" + 1) else (var "local_302" - 1)) + in local "local_306" = (var "local_305" == 0) + in local "local_307" = (if var "local_306" then s72 else var "local_304") + in local "local_308" = (if (var "local_306" || (s72 == var "local_304")) then (var "local_305" + 1) else (var "local_305" - 1)) + in local "local_309" = (var "local_308" == 0) + in local "local_310" = (if var "local_309" then s76 else var "local_307") + in local "local_311" = (if (var "local_309" || (s76 == var "local_307")) then (var "local_308" + 1) else (var "local_308" - 1)) + in local "local_312" = (var "local_311" == 0) + in local "local_313" = (if var "local_312" then s80 else var "local_310") + in local "local_314" = (if (var "local_312" || (s80 == var "local_310")) then (var "local_311" + 1) else (var "local_311" - 1)) + in local "local_315" = (var "local_314" == 0) + in local "local_316" = (if var "local_315" then s84 else var "local_313") + in local "local_317" = (if (var "local_315" || (s84 == var "local_313")) then (var "local_314" + 1) else (var "local_314" - 1)) + in local "local_318" = (var "local_317" == 0) + in local "local_319" = (if var "local_318" then s88 else var "local_316") + in local "local_320" = (if (var "local_318" || (s88 == var "local_316")) then (var "local_317" + 1) else (var "local_317" - 1)) + in local "local_321" = (var "local_320" == 0) + in local "local_322" = (if var "local_321" then s92 else var "local_319") + in local "local_323" = (if (var "local_321" || (s92 == var "local_319")) then (var "local_320" + 1) else (var "local_320" - 1)) + in local "local_324" = (var "local_323" == 0) + in local "local_325" = (if var "local_324" then s96 else var "local_322") + in local "local_326" = (if (var "local_324" || (s96 == var "local_322")) then (var "local_323" + 1) else (var "local_323" - 1)) + in local "local_327" = (var "local_326" == 0) + in local "local_328" = (if var "local_327" then s100 else var "local_325") + in local "local_329" = (if (var "local_327" || (s100 == var "local_325")) then (var "local_326" + 1) else (var "local_326" - 1)) + in var "local_328") then (var "local_178" + 1) else var "local_178") + in local "local_330" = (if (s16 == local "local_331" = false + in local "local_332" = (if var "local_331" then s4 else s1) + in local "local_333" = (if (var "local_331" || (s4 == s1)) then 2 else 0) + in local "local_334" = (var "local_333" == 0) + in local "local_335" = (if var "local_334" then s8 else var "local_332") + in local "local_336" = (if (var "local_334" || (s8 == var "local_332")) then (var "local_333" + 1) else (var "local_333" - 1)) + in local "local_337" = (var "local_336" == 0) + in local "local_338" = (if var "local_337" then s12 else var "local_335") + in local "local_339" = (if (var "local_337" || (s12 == var "local_335")) then (var "local_336" + 1) else (var "local_336" - 1)) + in local "local_340" = (var "local_339" == 0) + in local "local_341" = (if var "local_340" then s16 else var "local_338") + in local "local_342" = (if (var "local_340" || (s16 == var "local_338")) then (var "local_339" + 1) else (var "local_339" - 1)) + in local "local_343" = (var "local_342" == 0) + in local "local_344" = (if var "local_343" then s20 else var "local_341") + in local "local_345" = (if (var "local_343" || (s20 == var "local_341")) then (var "local_342" + 1) else (var "local_342" - 1)) + in local "local_346" = (var "local_345" == 0) + in local "local_347" = (if var "local_346" then s24 else var "local_344") + in local "local_348" = (if (var "local_346" || (s24 == var "local_344")) then (var "local_345" + 1) else (var "local_345" - 1)) + in local "local_349" = (var "local_348" == 0) + in local "local_350" = (if var "local_349" then s28 else var "local_347") + in local "local_351" = (if (var "local_349" || (s28 == var "local_347")) then (var "local_348" + 1) else (var "local_348" - 1)) + in local "local_352" = (var "local_351" == 0) + in local "local_353" = (if var "local_352" then s32 else var "local_350") + in local "local_354" = (if (var "local_352" || (s32 == var "local_350")) then (var "local_351" + 1) else (var "local_351" - 1)) + in local "local_355" = (var "local_354" == 0) + in local "local_356" = (if var "local_355" then s36 else var "local_353") + in local "local_357" = (if (var "local_355" || (s36 == var "local_353")) then (var "local_354" + 1) else (var "local_354" - 1)) + in local "local_358" = (var "local_357" == 0) + in local "local_359" = (if var "local_358" then s40 else var "local_356") + in local "local_360" = (if (var "local_358" || (s40 == var "local_356")) then (var "local_357" + 1) else (var "local_357" - 1)) + in local "local_361" = (var "local_360" == 0) + in local "local_362" = (if var "local_361" then s44 else var "local_359") + in local "local_363" = (if (var "local_361" || (s44 == var "local_359")) then (var "local_360" + 1) else (var "local_360" - 1)) + in local "local_364" = (var "local_363" == 0) + in local "local_365" = (if var "local_364" then s48 else var "local_362") + in local "local_366" = (if (var "local_364" || (s48 == var "local_362")) then (var "local_363" + 1) else (var "local_363" - 1)) + in local "local_367" = (var "local_366" == 0) + in local "local_368" = (if var "local_367" then s52 else var "local_365") + in local "local_369" = (if (var "local_367" || (s52 == var "local_365")) then (var "local_366" + 1) else (var "local_366" - 1)) + in local "local_370" = (var "local_369" == 0) + in local "local_371" = (if var "local_370" then s56 else var "local_368") + in local "local_372" = (if (var "local_370" || (s56 == var "local_368")) then (var "local_369" + 1) else (var "local_369" - 1)) + in local "local_373" = (var "local_372" == 0) + in local "local_374" = (if var "local_373" then s60 else var "local_371") + in local "local_375" = (if (var "local_373" || (s60 == var "local_371")) then (var "local_372" + 1) else (var "local_372" - 1)) + in local "local_376" = (var "local_375" == 0) + in local "local_377" = (if var "local_376" then s64 else var "local_374") + in local "local_378" = (if (var "local_376" || (s64 == var "local_374")) then (var "local_375" + 1) else (var "local_375" - 1)) + in local "local_379" = (var "local_378" == 0) + in local "local_380" = (if var "local_379" then s68 else var "local_377") + in local "local_381" = (if (var "local_379" || (s68 == var "local_377")) then (var "local_378" + 1) else (var "local_378" - 1)) + in local "local_382" = (var "local_381" == 0) + in local "local_383" = (if var "local_382" then s72 else var "local_380") + in local "local_384" = (if (var "local_382" || (s72 == var "local_380")) then (var "local_381" + 1) else (var "local_381" - 1)) + in local "local_385" = (var "local_384" == 0) + in local "local_386" = (if var "local_385" then s76 else var "local_383") + in local "local_387" = (if (var "local_385" || (s76 == var "local_383")) then (var "local_384" + 1) else (var "local_384" - 1)) + in local "local_388" = (var "local_387" == 0) + in local "local_389" = (if var "local_388" then s80 else var "local_386") + in local "local_390" = (if (var "local_388" || (s80 == var "local_386")) then (var "local_387" + 1) else (var "local_387" - 1)) + in local "local_391" = (var "local_390" == 0) + in local "local_392" = (if var "local_391" then s84 else var "local_389") + in local "local_393" = (if (var "local_391" || (s84 == var "local_389")) then (var "local_390" + 1) else (var "local_390" - 1)) + in local "local_394" = (var "local_393" == 0) + in local "local_395" = (if var "local_394" then s88 else var "local_392") + in local "local_396" = (if (var "local_394" || (s88 == var "local_392")) then (var "local_393" + 1) else (var "local_393" - 1)) + in local "local_397" = (var "local_396" == 0) + in local "local_398" = (if var "local_397" then s92 else var "local_395") + in local "local_399" = (if (var "local_397" || (s92 == var "local_395")) then (var "local_396" + 1) else (var "local_396" - 1)) + in local "local_400" = (var "local_399" == 0) + in local "local_401" = (if var "local_400" then s96 else var "local_398") + in local "local_402" = (if (var "local_400" || (s96 == var "local_398")) then (var "local_399" + 1) else (var "local_399" - 1)) + in local "local_403" = (var "local_402" == 0) + in local "local_404" = (if var "local_403" then s100 else var "local_401") + in local "local_405" = (if (var "local_403" || (s100 == var "local_401")) then (var "local_402" + 1) else (var "local_402" - 1)) + in var "local_404") then (var "local_254" + 1) else var "local_254") + in local "local_406" = (if (s20 == local "local_407" = false + in local "local_408" = (if var "local_407" then s4 else s1) + in local "local_409" = (if (var "local_407" || (s4 == s1)) then 2 else 0) + in local "local_410" = (var "local_409" == 0) + in local "local_411" = (if var "local_410" then s8 else var "local_408") + in local "local_412" = (if (var "local_410" || (s8 == var "local_408")) then (var "local_409" + 1) else (var "local_409" - 1)) + in local "local_413" = (var "local_412" == 0) + in local "local_414" = (if var "local_413" then s12 else var "local_411") + in local "local_415" = (if (var "local_413" || (s12 == var "local_411")) then (var "local_412" + 1) else (var "local_412" - 1)) + in local "local_416" = (var "local_415" == 0) + in local "local_417" = (if var "local_416" then s16 else var "local_414") + in local "local_418" = (if (var "local_416" || (s16 == var "local_414")) then (var "local_415" + 1) else (var "local_415" - 1)) + in local "local_419" = (var "local_418" == 0) + in local "local_420" = (if var "local_419" then s20 else var "local_417") + in local "local_421" = (if (var "local_419" || (s20 == var "local_417")) then (var "local_418" + 1) else (var "local_418" - 1)) + in local "local_422" = (var "local_421" == 0) + in local "local_423" = (if var "local_422" then s24 else var "local_420") + in local "local_424" = (if (var "local_422" || (s24 == var "local_420")) then (var "local_421" + 1) else (var "local_421" - 1)) + in local "local_425" = (var "local_424" == 0) + in local "local_426" = (if var "local_425" then s28 else var "local_423") + in local "local_427" = (if (var "local_425" || (s28 == var "local_423")) then (var "local_424" + 1) else (var "local_424" - 1)) + in local "local_428" = (var "local_427" == 0) + in local "local_429" = (if var "local_428" then s32 else var "local_426") + in local "local_430" = (if (var "local_428" || (s32 == var "local_426")) then (var "local_427" + 1) else (var "local_427" - 1)) + in local "local_431" = (var "local_430" == 0) + in local "local_432" = (if var "local_431" then s36 else var "local_429") + in local "local_433" = (if (var "local_431" || (s36 == var "local_429")) then (var "local_430" + 1) else (var "local_430" - 1)) + in local "local_434" = (var "local_433" == 0) + in local "local_435" = (if var "local_434" then s40 else var "local_432") + in local "local_436" = (if (var "local_434" || (s40 == var "local_432")) then (var "local_433" + 1) else (var "local_433" - 1)) + in local "local_437" = (var "local_436" == 0) + in local "local_438" = (if var "local_437" then s44 else var "local_435") + in local "local_439" = (if (var "local_437" || (s44 == var "local_435")) then (var "local_436" + 1) else (var "local_436" - 1)) + in local "local_440" = (var "local_439" == 0) + in local "local_441" = (if var "local_440" then s48 else var "local_438") + in local "local_442" = (if (var "local_440" || (s48 == var "local_438")) then (var "local_439" + 1) else (var "local_439" - 1)) + in local "local_443" = (var "local_442" == 0) + in local "local_444" = (if var "local_443" then s52 else var "local_441") + in local "local_445" = (if (var "local_443" || (s52 == var "local_441")) then (var "local_442" + 1) else (var "local_442" - 1)) + in local "local_446" = (var "local_445" == 0) + in local "local_447" = (if var "local_446" then s56 else var "local_444") + in local "local_448" = (if (var "local_446" || (s56 == var "local_444")) then (var "local_445" + 1) else (var "local_445" - 1)) + in local "local_449" = (var "local_448" == 0) + in local "local_450" = (if var "local_449" then s60 else var "local_447") + in local "local_451" = (if (var "local_449" || (s60 == var "local_447")) then (var "local_448" + 1) else (var "local_448" - 1)) + in local "local_452" = (var "local_451" == 0) + in local "local_453" = (if var "local_452" then s64 else var "local_450") + in local "local_454" = (if (var "local_452" || (s64 == var "local_450")) then (var "local_451" + 1) else (var "local_451" - 1)) + in local "local_455" = (var "local_454" == 0) + in local "local_456" = (if var "local_455" then s68 else var "local_453") + in local "local_457" = (if (var "local_455" || (s68 == var "local_453")) then (var "local_454" + 1) else (var "local_454" - 1)) + in local "local_458" = (var "local_457" == 0) + in local "local_459" = (if var "local_458" then s72 else var "local_456") + in local "local_460" = (if (var "local_458" || (s72 == var "local_456")) then (var "local_457" + 1) else (var "local_457" - 1)) + in local "local_461" = (var "local_460" == 0) + in local "local_462" = (if var "local_461" then s76 else var "local_459") + in local "local_463" = (if (var "local_461" || (s76 == var "local_459")) then (var "local_460" + 1) else (var "local_460" - 1)) + in local "local_464" = (var "local_463" == 0) + in local "local_465" = (if var "local_464" then s80 else var "local_462") + in local "local_466" = (if (var "local_464" || (s80 == var "local_462")) then (var "local_463" + 1) else (var "local_463" - 1)) + in local "local_467" = (var "local_466" == 0) + in local "local_468" = (if var "local_467" then s84 else var "local_465") + in local "local_469" = (if (var "local_467" || (s84 == var "local_465")) then (var "local_466" + 1) else (var "local_466" - 1)) + in local "local_470" = (var "local_469" == 0) + in local "local_471" = (if var "local_470" then s88 else var "local_468") + in local "local_472" = (if (var "local_470" || (s88 == var "local_468")) then (var "local_469" + 1) else (var "local_469" - 1)) + in local "local_473" = (var "local_472" == 0) + in local "local_474" = (if var "local_473" then s92 else var "local_471") + in local "local_475" = (if (var "local_473" || (s92 == var "local_471")) then (var "local_472" + 1) else (var "local_472" - 1)) + in local "local_476" = (var "local_475" == 0) + in local "local_477" = (if var "local_476" then s96 else var "local_474") + in local "local_478" = (if (var "local_476" || (s96 == var "local_474")) then (var "local_475" + 1) else (var "local_475" - 1)) + in local "local_479" = (var "local_478" == 0) + in local "local_480" = (if var "local_479" then s100 else var "local_477") + in local "local_481" = (if (var "local_479" || (s100 == var "local_477")) then (var "local_478" + 1) else (var "local_478" - 1)) + in var "local_480") then (var "local_330" + 1) else var "local_330") + in local "local_482" = (if (s24 == local "local_483" = false + in local "local_484" = (if var "local_483" then s4 else s1) + in local "local_485" = (if (var "local_483" || (s4 == s1)) then 2 else 0) + in local "local_486" = (var "local_485" == 0) + in local "local_487" = (if var "local_486" then s8 else var "local_484") + in local "local_488" = (if (var "local_486" || (s8 == var "local_484")) then (var "local_485" + 1) else (var "local_485" - 1)) + in local "local_489" = (var "local_488" == 0) + in local "local_490" = (if var "local_489" then s12 else var "local_487") + in local "local_491" = (if (var "local_489" || (s12 == var "local_487")) then (var "local_488" + 1) else (var "local_488" - 1)) + in local "local_492" = (var "local_491" == 0) + in local "local_493" = (if var "local_492" then s16 else var "local_490") + in local "local_494" = (if (var "local_492" || (s16 == var "local_490")) then (var "local_491" + 1) else (var "local_491" - 1)) + in local "local_495" = (var "local_494" == 0) + in local "local_496" = (if var "local_495" then s20 else var "local_493") + in local "local_497" = (if (var "local_495" || (s20 == var "local_493")) then (var "local_494" + 1) else (var "local_494" - 1)) + in local "local_498" = (var "local_497" == 0) + in local "local_499" = (if var "local_498" then s24 else var "local_496") + in local "local_500" = (if (var "local_498" || (s24 == var "local_496")) then (var "local_497" + 1) else (var "local_497" - 1)) + in local "local_501" = (var "local_500" == 0) + in local "local_502" = (if var "local_501" then s28 else var "local_499") + in local "local_503" = (if (var "local_501" || (s28 == var "local_499")) then (var "local_500" + 1) else (var "local_500" - 1)) + in local "local_504" = (var "local_503" == 0) + in local "local_505" = (if var "local_504" then s32 else var "local_502") + in local "local_506" = (if (var "local_504" || (s32 == var "local_502")) then (var "local_503" + 1) else (var "local_503" - 1)) + in local "local_507" = (var "local_506" == 0) + in local "local_508" = (if var "local_507" then s36 else var "local_505") + in local "local_509" = (if (var "local_507" || (s36 == var "local_505")) then (var "local_506" + 1) else (var "local_506" - 1)) + in local "local_510" = (var "local_509" == 0) + in local "local_511" = (if var "local_510" then s40 else var "local_508") + in local "local_512" = (if (var "local_510" || (s40 == var "local_508")) then (var "local_509" + 1) else (var "local_509" - 1)) + in local "local_513" = (var "local_512" == 0) + in local "local_514" = (if var "local_513" then s44 else var "local_511") + in local "local_515" = (if (var "local_513" || (s44 == var "local_511")) then (var "local_512" + 1) else (var "local_512" - 1)) + in local "local_516" = (var "local_515" == 0) + in local "local_517" = (if var "local_516" then s48 else var "local_514") + in local "local_518" = (if (var "local_516" || (s48 == var "local_514")) then (var "local_515" + 1) else (var "local_515" - 1)) + in local "local_519" = (var "local_518" == 0) + in local "local_520" = (if var "local_519" then s52 else var "local_517") + in local "local_521" = (if (var "local_519" || (s52 == var "local_517")) then (var "local_518" + 1) else (var "local_518" - 1)) + in local "local_522" = (var "local_521" == 0) + in local "local_523" = (if var "local_522" then s56 else var "local_520") + in local "local_524" = (if (var "local_522" || (s56 == var "local_520")) then (var "local_521" + 1) else (var "local_521" - 1)) + in local "local_525" = (var "local_524" == 0) + in local "local_526" = (if var "local_525" then s60 else var "local_523") + in local "local_527" = (if (var "local_525" || (s60 == var "local_523")) then (var "local_524" + 1) else (var "local_524" - 1)) + in local "local_528" = (var "local_527" == 0) + in local "local_529" = (if var "local_528" then s64 else var "local_526") + in local "local_530" = (if (var "local_528" || (s64 == var "local_526")) then (var "local_527" + 1) else (var "local_527" - 1)) + in local "local_531" = (var "local_530" == 0) + in local "local_532" = (if var "local_531" then s68 else var "local_529") + in local "local_533" = (if (var "local_531" || (s68 == var "local_529")) then (var "local_530" + 1) else (var "local_530" - 1)) + in local "local_534" = (var "local_533" == 0) + in local "local_535" = (if var "local_534" then s72 else var "local_532") + in local "local_536" = (if (var "local_534" || (s72 == var "local_532")) then (var "local_533" + 1) else (var "local_533" - 1)) + in local "local_537" = (var "local_536" == 0) + in local "local_538" = (if var "local_537" then s76 else var "local_535") + in local "local_539" = (if (var "local_537" || (s76 == var "local_535")) then (var "local_536" + 1) else (var "local_536" - 1)) + in local "local_540" = (var "local_539" == 0) + in local "local_541" = (if var "local_540" then s80 else var "local_538") + in local "local_542" = (if (var "local_540" || (s80 == var "local_538")) then (var "local_539" + 1) else (var "local_539" - 1)) + in local "local_543" = (var "local_542" == 0) + in local "local_544" = (if var "local_543" then s84 else var "local_541") + in local "local_545" = (if (var "local_543" || (s84 == var "local_541")) then (var "local_542" + 1) else (var "local_542" - 1)) + in local "local_546" = (var "local_545" == 0) + in local "local_547" = (if var "local_546" then s88 else var "local_544") + in local "local_548" = (if (var "local_546" || (s88 == var "local_544")) then (var "local_545" + 1) else (var "local_545" - 1)) + in local "local_549" = (var "local_548" == 0) + in local "local_550" = (if var "local_549" then s92 else var "local_547") + in local "local_551" = (if (var "local_549" || (s92 == var "local_547")) then (var "local_548" + 1) else (var "local_548" - 1)) + in local "local_552" = (var "local_551" == 0) + in local "local_553" = (if var "local_552" then s96 else var "local_550") + in local "local_554" = (if (var "local_552" || (s96 == var "local_550")) then (var "local_551" + 1) else (var "local_551" - 1)) + in local "local_555" = (var "local_554" == 0) + in local "local_556" = (if var "local_555" then s100 else var "local_553") + in local "local_557" = (if (var "local_555" || (s100 == var "local_553")) then (var "local_554" + 1) else (var "local_554" - 1)) + in var "local_556") then (var "local_406" + 1) else var "local_406") + in local "local_558" = (if (s28 == local "local_559" = false + in local "local_560" = (if var "local_559" then s4 else s1) + in local "local_561" = (if (var "local_559" || (s4 == s1)) then 2 else 0) + in local "local_562" = (var "local_561" == 0) + in local "local_563" = (if var "local_562" then s8 else var "local_560") + in local "local_564" = (if (var "local_562" || (s8 == var "local_560")) then (var "local_561" + 1) else (var "local_561" - 1)) + in local "local_565" = (var "local_564" == 0) + in local "local_566" = (if var "local_565" then s12 else var "local_563") + in local "local_567" = (if (var "local_565" || (s12 == var "local_563")) then (var "local_564" + 1) else (var "local_564" - 1)) + in local "local_568" = (var "local_567" == 0) + in local "local_569" = (if var "local_568" then s16 else var "local_566") + in local "local_570" = (if (var "local_568" || (s16 == var "local_566")) then (var "local_567" + 1) else (var "local_567" - 1)) + in local "local_571" = (var "local_570" == 0) + in local "local_572" = (if var "local_571" then s20 else var "local_569") + in local "local_573" = (if (var "local_571" || (s20 == var "local_569")) then (var "local_570" + 1) else (var "local_570" - 1)) + in local "local_574" = (var "local_573" == 0) + in local "local_575" = (if var "local_574" then s24 else var "local_572") + in local "local_576" = (if (var "local_574" || (s24 == var "local_572")) then (var "local_573" + 1) else (var "local_573" - 1)) + in local "local_577" = (var "local_576" == 0) + in local "local_578" = (if var "local_577" then s28 else var "local_575") + in local "local_579" = (if (var "local_577" || (s28 == var "local_575")) then (var "local_576" + 1) else (var "local_576" - 1)) + in local "local_580" = (var "local_579" == 0) + in local "local_581" = (if var "local_580" then s32 else var "local_578") + in local "local_582" = (if (var "local_580" || (s32 == var "local_578")) then (var "local_579" + 1) else (var "local_579" - 1)) + in local "local_583" = (var "local_582" == 0) + in local "local_584" = (if var "local_583" then s36 else var "local_581") + in local "local_585" = (if (var "local_583" || (s36 == var "local_581")) then (var "local_582" + 1) else (var "local_582" - 1)) + in local "local_586" = (var "local_585" == 0) + in local "local_587" = (if var "local_586" then s40 else var "local_584") + in local "local_588" = (if (var "local_586" || (s40 == var "local_584")) then (var "local_585" + 1) else (var "local_585" - 1)) + in local "local_589" = (var "local_588" == 0) + in local "local_590" = (if var "local_589" then s44 else var "local_587") + in local "local_591" = (if (var "local_589" || (s44 == var "local_587")) then (var "local_588" + 1) else (var "local_588" - 1)) + in local "local_592" = (var "local_591" == 0) + in local "local_593" = (if var "local_592" then s48 else var "local_590") + in local "local_594" = (if (var "local_592" || (s48 == var "local_590")) then (var "local_591" + 1) else (var "local_591" - 1)) + in local "local_595" = (var "local_594" == 0) + in local "local_596" = (if var "local_595" then s52 else var "local_593") + in local "local_597" = (if (var "local_595" || (s52 == var "local_593")) then (var "local_594" + 1) else (var "local_594" - 1)) + in local "local_598" = (var "local_597" == 0) + in local "local_599" = (if var "local_598" then s56 else var "local_596") + in local "local_600" = (if (var "local_598" || (s56 == var "local_596")) then (var "local_597" + 1) else (var "local_597" - 1)) + in local "local_601" = (var "local_600" == 0) + in local "local_602" = (if var "local_601" then s60 else var "local_599") + in local "local_603" = (if (var "local_601" || (s60 == var "local_599")) then (var "local_600" + 1) else (var "local_600" - 1)) + in local "local_604" = (var "local_603" == 0) + in local "local_605" = (if var "local_604" then s64 else var "local_602") + in local "local_606" = (if (var "local_604" || (s64 == var "local_602")) then (var "local_603" + 1) else (var "local_603" - 1)) + in local "local_607" = (var "local_606" == 0) + in local "local_608" = (if var "local_607" then s68 else var "local_605") + in local "local_609" = (if (var "local_607" || (s68 == var "local_605")) then (var "local_606" + 1) else (var "local_606" - 1)) + in local "local_610" = (var "local_609" == 0) + in local "local_611" = (if var "local_610" then s72 else var "local_608") + in local "local_612" = (if (var "local_610" || (s72 == var "local_608")) then (var "local_609" + 1) else (var "local_609" - 1)) + in local "local_613" = (var "local_612" == 0) + in local "local_614" = (if var "local_613" then s76 else var "local_611") + in local "local_615" = (if (var "local_613" || (s76 == var "local_611")) then (var "local_612" + 1) else (var "local_612" - 1)) + in local "local_616" = (var "local_615" == 0) + in local "local_617" = (if var "local_616" then s80 else var "local_614") + in local "local_618" = (if (var "local_616" || (s80 == var "local_614")) then (var "local_615" + 1) else (var "local_615" - 1)) + in local "local_619" = (var "local_618" == 0) + in local "local_620" = (if var "local_619" then s84 else var "local_617") + in local "local_621" = (if (var "local_619" || (s84 == var "local_617")) then (var "local_618" + 1) else (var "local_618" - 1)) + in local "local_622" = (var "local_621" == 0) + in local "local_623" = (if var "local_622" then s88 else var "local_620") + in local "local_624" = (if (var "local_622" || (s88 == var "local_620")) then (var "local_621" + 1) else (var "local_621" - 1)) + in local "local_625" = (var "local_624" == 0) + in local "local_626" = (if var "local_625" then s92 else var "local_623") + in local "local_627" = (if (var "local_625" || (s92 == var "local_623")) then (var "local_624" + 1) else (var "local_624" - 1)) + in local "local_628" = (var "local_627" == 0) + in local "local_629" = (if var "local_628" then s96 else var "local_626") + in local "local_630" = (if (var "local_628" || (s96 == var "local_626")) then (var "local_627" + 1) else (var "local_627" - 1)) + in local "local_631" = (var "local_630" == 0) + in local "local_632" = (if var "local_631" then s100 else var "local_629") + in local "local_633" = (if (var "local_631" || (s100 == var "local_629")) then (var "local_630" + 1) else (var "local_630" - 1)) + in var "local_632") then (var "local_482" + 1) else var "local_482") + in local "local_634" = (if (s32 == local "local_635" = false + in local "local_636" = (if var "local_635" then s4 else s1) + in local "local_637" = (if (var "local_635" || (s4 == s1)) then 2 else 0) + in local "local_638" = (var "local_637" == 0) + in local "local_639" = (if var "local_638" then s8 else var "local_636") + in local "local_640" = (if (var "local_638" || (s8 == var "local_636")) then (var "local_637" + 1) else (var "local_637" - 1)) + in local "local_641" = (var "local_640" == 0) + in local "local_642" = (if var "local_641" then s12 else var "local_639") + in local "local_643" = (if (var "local_641" || (s12 == var "local_639")) then (var "local_640" + 1) else (var "local_640" - 1)) + in local "local_644" = (var "local_643" == 0) + in local "local_645" = (if var "local_644" then s16 else var "local_642") + in local "local_646" = (if (var "local_644" || (s16 == var "local_642")) then (var "local_643" + 1) else (var "local_643" - 1)) + in local "local_647" = (var "local_646" == 0) + in local "local_648" = (if var "local_647" then s20 else var "local_645") + in local "local_649" = (if (var "local_647" || (s20 == var "local_645")) then (var "local_646" + 1) else (var "local_646" - 1)) + in local "local_650" = (var "local_649" == 0) + in local "local_651" = (if var "local_650" then s24 else var "local_648") + in local "local_652" = (if (var "local_650" || (s24 == var "local_648")) then (var "local_649" + 1) else (var "local_649" - 1)) + in local "local_653" = (var "local_652" == 0) + in local "local_654" = (if var "local_653" then s28 else var "local_651") + in local "local_655" = (if (var "local_653" || (s28 == var "local_651")) then (var "local_652" + 1) else (var "local_652" - 1)) + in local "local_656" = (var "local_655" == 0) + in local "local_657" = (if var "local_656" then s32 else var "local_654") + in local "local_658" = (if (var "local_656" || (s32 == var "local_654")) then (var "local_655" + 1) else (var "local_655" - 1)) + in local "local_659" = (var "local_658" == 0) + in local "local_660" = (if var "local_659" then s36 else var "local_657") + in local "local_661" = (if (var "local_659" || (s36 == var "local_657")) then (var "local_658" + 1) else (var "local_658" - 1)) + in local "local_662" = (var "local_661" == 0) + in local "local_663" = (if var "local_662" then s40 else var "local_660") + in local "local_664" = (if (var "local_662" || (s40 == var "local_660")) then (var "local_661" + 1) else (var "local_661" - 1)) + in local "local_665" = (var "local_664" == 0) + in local "local_666" = (if var "local_665" then s44 else var "local_663") + in local "local_667" = (if (var "local_665" || (s44 == var "local_663")) then (var "local_664" + 1) else (var "local_664" - 1)) + in local "local_668" = (var "local_667" == 0) + in local "local_669" = (if var "local_668" then s48 else var "local_666") + in local "local_670" = (if (var "local_668" || (s48 == var "local_666")) then (var "local_667" + 1) else (var "local_667" - 1)) + in local "local_671" = (var "local_670" == 0) + in local "local_672" = (if var "local_671" then s52 else var "local_669") + in local "local_673" = (if (var "local_671" || (s52 == var "local_669")) then (var "local_670" + 1) else (var "local_670" - 1)) + in local "local_674" = (var "local_673" == 0) + in local "local_675" = (if var "local_674" then s56 else var "local_672") + in local "local_676" = (if (var "local_674" || (s56 == var "local_672")) then (var "local_673" + 1) else (var "local_673" - 1)) + in local "local_677" = (var "local_676" == 0) + in local "local_678" = (if var "local_677" then s60 else var "local_675") + in local "local_679" = (if (var "local_677" || (s60 == var "local_675")) then (var "local_676" + 1) else (var "local_676" - 1)) + in local "local_680" = (var "local_679" == 0) + in local "local_681" = (if var "local_680" then s64 else var "local_678") + in local "local_682" = (if (var "local_680" || (s64 == var "local_678")) then (var "local_679" + 1) else (var "local_679" - 1)) + in local "local_683" = (var "local_682" == 0) + in local "local_684" = (if var "local_683" then s68 else var "local_681") + in local "local_685" = (if (var "local_683" || (s68 == var "local_681")) then (var "local_682" + 1) else (var "local_682" - 1)) + in local "local_686" = (var "local_685" == 0) + in local "local_687" = (if var "local_686" then s72 else var "local_684") + in local "local_688" = (if (var "local_686" || (s72 == var "local_684")) then (var "local_685" + 1) else (var "local_685" - 1)) + in local "local_689" = (var "local_688" == 0) + in local "local_690" = (if var "local_689" then s76 else var "local_687") + in local "local_691" = (if (var "local_689" || (s76 == var "local_687")) then (var "local_688" + 1) else (var "local_688" - 1)) + in local "local_692" = (var "local_691" == 0) + in local "local_693" = (if var "local_692" then s80 else var "local_690") + in local "local_694" = (if (var "local_692" || (s80 == var "local_690")) then (var "local_691" + 1) else (var "local_691" - 1)) + in local "local_695" = (var "local_694" == 0) + in local "local_696" = (if var "local_695" then s84 else var "local_693") + in local "local_697" = (if (var "local_695" || (s84 == var "local_693")) then (var "local_694" + 1) else (var "local_694" - 1)) + in local "local_698" = (var "local_697" == 0) + in local "local_699" = (if var "local_698" then s88 else var "local_696") + in local "local_700" = (if (var "local_698" || (s88 == var "local_696")) then (var "local_697" + 1) else (var "local_697" - 1)) + in local "local_701" = (var "local_700" == 0) + in local "local_702" = (if var "local_701" then s92 else var "local_699") + in local "local_703" = (if (var "local_701" || (s92 == var "local_699")) then (var "local_700" + 1) else (var "local_700" - 1)) + in local "local_704" = (var "local_703" == 0) + in local "local_705" = (if var "local_704" then s96 else var "local_702") + in local "local_706" = (if (var "local_704" || (s96 == var "local_702")) then (var "local_703" + 1) else (var "local_703" - 1)) + in local "local_707" = (var "local_706" == 0) + in local "local_708" = (if var "local_707" then s100 else var "local_705") + in local "local_709" = (if (var "local_707" || (s100 == var "local_705")) then (var "local_706" + 1) else (var "local_706" - 1)) + in var "local_708") then (var "local_558" + 1) else var "local_558") + in local "local_710" = (if (s36 == local "local_711" = false + in local "local_712" = (if var "local_711" then s4 else s1) + in local "local_713" = (if (var "local_711" || (s4 == s1)) then 2 else 0) + in local "local_714" = (var "local_713" == 0) + in local "local_715" = (if var "local_714" then s8 else var "local_712") + in local "local_716" = (if (var "local_714" || (s8 == var "local_712")) then (var "local_713" + 1) else (var "local_713" - 1)) + in local "local_717" = (var "local_716" == 0) + in local "local_718" = (if var "local_717" then s12 else var "local_715") + in local "local_719" = (if (var "local_717" || (s12 == var "local_715")) then (var "local_716" + 1) else (var "local_716" - 1)) + in local "local_720" = (var "local_719" == 0) + in local "local_721" = (if var "local_720" then s16 else var "local_718") + in local "local_722" = (if (var "local_720" || (s16 == var "local_718")) then (var "local_719" + 1) else (var "local_719" - 1)) + in local "local_723" = (var "local_722" == 0) + in local "local_724" = (if var "local_723" then s20 else var "local_721") + in local "local_725" = (if (var "local_723" || (s20 == var "local_721")) then (var "local_722" + 1) else (var "local_722" - 1)) + in local "local_726" = (var "local_725" == 0) + in local "local_727" = (if var "local_726" then s24 else var "local_724") + in local "local_728" = (if (var "local_726" || (s24 == var "local_724")) then (var "local_725" + 1) else (var "local_725" - 1)) + in local "local_729" = (var "local_728" == 0) + in local "local_730" = (if var "local_729" then s28 else var "local_727") + in local "local_731" = (if (var "local_729" || (s28 == var "local_727")) then (var "local_728" + 1) else (var "local_728" - 1)) + in local "local_732" = (var "local_731" == 0) + in local "local_733" = (if var "local_732" then s32 else var "local_730") + in local "local_734" = (if (var "local_732" || (s32 == var "local_730")) then (var "local_731" + 1) else (var "local_731" - 1)) + in local "local_735" = (var "local_734" == 0) + in local "local_736" = (if var "local_735" then s36 else var "local_733") + in local "local_737" = (if (var "local_735" || (s36 == var "local_733")) then (var "local_734" + 1) else (var "local_734" - 1)) + in local "local_738" = (var "local_737" == 0) + in local "local_739" = (if var "local_738" then s40 else var "local_736") + in local "local_740" = (if (var "local_738" || (s40 == var "local_736")) then (var "local_737" + 1) else (var "local_737" - 1)) + in local "local_741" = (var "local_740" == 0) + in local "local_742" = (if var "local_741" then s44 else var "local_739") + in local "local_743" = (if (var "local_741" || (s44 == var "local_739")) then (var "local_740" + 1) else (var "local_740" - 1)) + in local "local_744" = (var "local_743" == 0) + in local "local_745" = (if var "local_744" then s48 else var "local_742") + in local "local_746" = (if (var "local_744" || (s48 == var "local_742")) then (var "local_743" + 1) else (var "local_743" - 1)) + in local "local_747" = (var "local_746" == 0) + in local "local_748" = (if var "local_747" then s52 else var "local_745") + in local "local_749" = (if (var "local_747" || (s52 == var "local_745")) then (var "local_746" + 1) else (var "local_746" - 1)) + in local "local_750" = (var "local_749" == 0) + in local "local_751" = (if var "local_750" then s56 else var "local_748") + in local "local_752" = (if (var "local_750" || (s56 == var "local_748")) then (var "local_749" + 1) else (var "local_749" - 1)) + in local "local_753" = (var "local_752" == 0) + in local "local_754" = (if var "local_753" then s60 else var "local_751") + in local "local_755" = (if (var "local_753" || (s60 == var "local_751")) then (var "local_752" + 1) else (var "local_752" - 1)) + in local "local_756" = (var "local_755" == 0) + in local "local_757" = (if var "local_756" then s64 else var "local_754") + in local "local_758" = (if (var "local_756" || (s64 == var "local_754")) then (var "local_755" + 1) else (var "local_755" - 1)) + in local "local_759" = (var "local_758" == 0) + in local "local_760" = (if var "local_759" then s68 else var "local_757") + in local "local_761" = (if (var "local_759" || (s68 == var "local_757")) then (var "local_758" + 1) else (var "local_758" - 1)) + in local "local_762" = (var "local_761" == 0) + in local "local_763" = (if var "local_762" then s72 else var "local_760") + in local "local_764" = (if (var "local_762" || (s72 == var "local_760")) then (var "local_761" + 1) else (var "local_761" - 1)) + in local "local_765" = (var "local_764" == 0) + in local "local_766" = (if var "local_765" then s76 else var "local_763") + in local "local_767" = (if (var "local_765" || (s76 == var "local_763")) then (var "local_764" + 1) else (var "local_764" - 1)) + in local "local_768" = (var "local_767" == 0) + in local "local_769" = (if var "local_768" then s80 else var "local_766") + in local "local_770" = (if (var "local_768" || (s80 == var "local_766")) then (var "local_767" + 1) else (var "local_767" - 1)) + in local "local_771" = (var "local_770" == 0) + in local "local_772" = (if var "local_771" then s84 else var "local_769") + in local "local_773" = (if (var "local_771" || (s84 == var "local_769")) then (var "local_770" + 1) else (var "local_770" - 1)) + in local "local_774" = (var "local_773" == 0) + in local "local_775" = (if var "local_774" then s88 else var "local_772") + in local "local_776" = (if (var "local_774" || (s88 == var "local_772")) then (var "local_773" + 1) else (var "local_773" - 1)) + in local "local_777" = (var "local_776" == 0) + in local "local_778" = (if var "local_777" then s92 else var "local_775") + in local "local_779" = (if (var "local_777" || (s92 == var "local_775")) then (var "local_776" + 1) else (var "local_776" - 1)) + in local "local_780" = (var "local_779" == 0) + in local "local_781" = (if var "local_780" then s96 else var "local_778") + in local "local_782" = (if (var "local_780" || (s96 == var "local_778")) then (var "local_779" + 1) else (var "local_779" - 1)) + in local "local_783" = (var "local_782" == 0) + in local "local_784" = (if var "local_783" then s100 else var "local_781") + in local "local_785" = (if (var "local_783" || (s100 == var "local_781")) then (var "local_782" + 1) else (var "local_782" - 1)) + in var "local_784") then (var "local_634" + 1) else var "local_634") + in local "local_786" = (if (s40 == local "local_787" = false + in local "local_788" = (if var "local_787" then s4 else s1) + in local "local_789" = (if (var "local_787" || (s4 == s1)) then 2 else 0) + in local "local_790" = (var "local_789" == 0) + in local "local_791" = (if var "local_790" then s8 else var "local_788") + in local "local_792" = (if (var "local_790" || (s8 == var "local_788")) then (var "local_789" + 1) else (var "local_789" - 1)) + in local "local_793" = (var "local_792" == 0) + in local "local_794" = (if var "local_793" then s12 else var "local_791") + in local "local_795" = (if (var "local_793" || (s12 == var "local_791")) then (var "local_792" + 1) else (var "local_792" - 1)) + in local "local_796" = (var "local_795" == 0) + in local "local_797" = (if var "local_796" then s16 else var "local_794") + in local "local_798" = (if (var "local_796" || (s16 == var "local_794")) then (var "local_795" + 1) else (var "local_795" - 1)) + in local "local_799" = (var "local_798" == 0) + in local "local_800" = (if var "local_799" then s20 else var "local_797") + in local "local_801" = (if (var "local_799" || (s20 == var "local_797")) then (var "local_798" + 1) else (var "local_798" - 1)) + in local "local_802" = (var "local_801" == 0) + in local "local_803" = (if var "local_802" then s24 else var "local_800") + in local "local_804" = (if (var "local_802" || (s24 == var "local_800")) then (var "local_801" + 1) else (var "local_801" - 1)) + in local "local_805" = (var "local_804" == 0) + in local "local_806" = (if var "local_805" then s28 else var "local_803") + in local "local_807" = (if (var "local_805" || (s28 == var "local_803")) then (var "local_804" + 1) else (var "local_804" - 1)) + in local "local_808" = (var "local_807" == 0) + in local "local_809" = (if var "local_808" then s32 else var "local_806") + in local "local_810" = (if (var "local_808" || (s32 == var "local_806")) then (var "local_807" + 1) else (var "local_807" - 1)) + in local "local_811" = (var "local_810" == 0) + in local "local_812" = (if var "local_811" then s36 else var "local_809") + in local "local_813" = (if (var "local_811" || (s36 == var "local_809")) then (var "local_810" + 1) else (var "local_810" - 1)) + in local "local_814" = (var "local_813" == 0) + in local "local_815" = (if var "local_814" then s40 else var "local_812") + in local "local_816" = (if (var "local_814" || (s40 == var "local_812")) then (var "local_813" + 1) else (var "local_813" - 1)) + in local "local_817" = (var "local_816" == 0) + in local "local_818" = (if var "local_817" then s44 else var "local_815") + in local "local_819" = (if (var "local_817" || (s44 == var "local_815")) then (var "local_816" + 1) else (var "local_816" - 1)) + in local "local_820" = (var "local_819" == 0) + in local "local_821" = (if var "local_820" then s48 else var "local_818") + in local "local_822" = (if (var "local_820" || (s48 == var "local_818")) then (var "local_819" + 1) else (var "local_819" - 1)) + in local "local_823" = (var "local_822" == 0) + in local "local_824" = (if var "local_823" then s52 else var "local_821") + in local "local_825" = (if (var "local_823" || (s52 == var "local_821")) then (var "local_822" + 1) else (var "local_822" - 1)) + in local "local_826" = (var "local_825" == 0) + in local "local_827" = (if var "local_826" then s56 else var "local_824") + in local "local_828" = (if (var "local_826" || (s56 == var "local_824")) then (var "local_825" + 1) else (var "local_825" - 1)) + in local "local_829" = (var "local_828" == 0) + in local "local_830" = (if var "local_829" then s60 else var "local_827") + in local "local_831" = (if (var "local_829" || (s60 == var "local_827")) then (var "local_828" + 1) else (var "local_828" - 1)) + in local "local_832" = (var "local_831" == 0) + in local "local_833" = (if var "local_832" then s64 else var "local_830") + in local "local_834" = (if (var "local_832" || (s64 == var "local_830")) then (var "local_831" + 1) else (var "local_831" - 1)) + in local "local_835" = (var "local_834" == 0) + in local "local_836" = (if var "local_835" then s68 else var "local_833") + in local "local_837" = (if (var "local_835" || (s68 == var "local_833")) then (var "local_834" + 1) else (var "local_834" - 1)) + in local "local_838" = (var "local_837" == 0) + in local "local_839" = (if var "local_838" then s72 else var "local_836") + in local "local_840" = (if (var "local_838" || (s72 == var "local_836")) then (var "local_837" + 1) else (var "local_837" - 1)) + in local "local_841" = (var "local_840" == 0) + in local "local_842" = (if var "local_841" then s76 else var "local_839") + in local "local_843" = (if (var "local_841" || (s76 == var "local_839")) then (var "local_840" + 1) else (var "local_840" - 1)) + in local "local_844" = (var "local_843" == 0) + in local "local_845" = (if var "local_844" then s80 else var "local_842") + in local "local_846" = (if (var "local_844" || (s80 == var "local_842")) then (var "local_843" + 1) else (var "local_843" - 1)) + in local "local_847" = (var "local_846" == 0) + in local "local_848" = (if var "local_847" then s84 else var "local_845") + in local "local_849" = (if (var "local_847" || (s84 == var "local_845")) then (var "local_846" + 1) else (var "local_846" - 1)) + in local "local_850" = (var "local_849" == 0) + in local "local_851" = (if var "local_850" then s88 else var "local_848") + in local "local_852" = (if (var "local_850" || (s88 == var "local_848")) then (var "local_849" + 1) else (var "local_849" - 1)) + in local "local_853" = (var "local_852" == 0) + in local "local_854" = (if var "local_853" then s92 else var "local_851") + in local "local_855" = (if (var "local_853" || (s92 == var "local_851")) then (var "local_852" + 1) else (var "local_852" - 1)) + in local "local_856" = (var "local_855" == 0) + in local "local_857" = (if var "local_856" then s96 else var "local_854") + in local "local_858" = (if (var "local_856" || (s96 == var "local_854")) then (var "local_855" + 1) else (var "local_855" - 1)) + in local "local_859" = (var "local_858" == 0) + in local "local_860" = (if var "local_859" then s100 else var "local_857") + in local "local_861" = (if (var "local_859" || (s100 == var "local_857")) then (var "local_858" + 1) else (var "local_858" - 1)) + in var "local_860") then (var "local_710" + 1) else var "local_710") + in local "local_862" = (if (s44 == local "local_863" = false + in local "local_864" = (if var "local_863" then s4 else s1) + in local "local_865" = (if (var "local_863" || (s4 == s1)) then 2 else 0) + in local "local_866" = (var "local_865" == 0) + in local "local_867" = (if var "local_866" then s8 else var "local_864") + in local "local_868" = (if (var "local_866" || (s8 == var "local_864")) then (var "local_865" + 1) else (var "local_865" - 1)) + in local "local_869" = (var "local_868" == 0) + in local "local_870" = (if var "local_869" then s12 else var "local_867") + in local "local_871" = (if (var "local_869" || (s12 == var "local_867")) then (var "local_868" + 1) else (var "local_868" - 1)) + in local "local_872" = (var "local_871" == 0) + in local "local_873" = (if var "local_872" then s16 else var "local_870") + in local "local_874" = (if (var "local_872" || (s16 == var "local_870")) then (var "local_871" + 1) else (var "local_871" - 1)) + in local "local_875" = (var "local_874" == 0) + in local "local_876" = (if var "local_875" then s20 else var "local_873") + in local "local_877" = (if (var "local_875" || (s20 == var "local_873")) then (var "local_874" + 1) else (var "local_874" - 1)) + in local "local_878" = (var "local_877" == 0) + in local "local_879" = (if var "local_878" then s24 else var "local_876") + in local "local_880" = (if (var "local_878" || (s24 == var "local_876")) then (var "local_877" + 1) else (var "local_877" - 1)) + in local "local_881" = (var "local_880" == 0) + in local "local_882" = (if var "local_881" then s28 else var "local_879") + in local "local_883" = (if (var "local_881" || (s28 == var "local_879")) then (var "local_880" + 1) else (var "local_880" - 1)) + in local "local_884" = (var "local_883" == 0) + in local "local_885" = (if var "local_884" then s32 else var "local_882") + in local "local_886" = (if (var "local_884" || (s32 == var "local_882")) then (var "local_883" + 1) else (var "local_883" - 1)) + in local "local_887" = (var "local_886" == 0) + in local "local_888" = (if var "local_887" then s36 else var "local_885") + in local "local_889" = (if (var "local_887" || (s36 == var "local_885")) then (var "local_886" + 1) else (var "local_886" - 1)) + in local "local_890" = (var "local_889" == 0) + in local "local_891" = (if var "local_890" then s40 else var "local_888") + in local "local_892" = (if (var "local_890" || (s40 == var "local_888")) then (var "local_889" + 1) else (var "local_889" - 1)) + in local "local_893" = (var "local_892" == 0) + in local "local_894" = (if var "local_893" then s44 else var "local_891") + in local "local_895" = (if (var "local_893" || (s44 == var "local_891")) then (var "local_892" + 1) else (var "local_892" - 1)) + in local "local_896" = (var "local_895" == 0) + in local "local_897" = (if var "local_896" then s48 else var "local_894") + in local "local_898" = (if (var "local_896" || (s48 == var "local_894")) then (var "local_895" + 1) else (var "local_895" - 1)) + in local "local_899" = (var "local_898" == 0) + in local "local_900" = (if var "local_899" then s52 else var "local_897") + in local "local_901" = (if (var "local_899" || (s52 == var "local_897")) then (var "local_898" + 1) else (var "local_898" - 1)) + in local "local_902" = (var "local_901" == 0) + in local "local_903" = (if var "local_902" then s56 else var "local_900") + in local "local_904" = (if (var "local_902" || (s56 == var "local_900")) then (var "local_901" + 1) else (var "local_901" - 1)) + in local "local_905" = (var "local_904" == 0) + in local "local_906" = (if var "local_905" then s60 else var "local_903") + in local "local_907" = (if (var "local_905" || (s60 == var "local_903")) then (var "local_904" + 1) else (var "local_904" - 1)) + in local "local_908" = (var "local_907" == 0) + in local "local_909" = (if var "local_908" then s64 else var "local_906") + in local "local_910" = (if (var "local_908" || (s64 == var "local_906")) then (var "local_907" + 1) else (var "local_907" - 1)) + in local "local_911" = (var "local_910" == 0) + in local "local_912" = (if var "local_911" then s68 else var "local_909") + in local "local_913" = (if (var "local_911" || (s68 == var "local_909")) then (var "local_910" + 1) else (var "local_910" - 1)) + in local "local_914" = (var "local_913" == 0) + in local "local_915" = (if var "local_914" then s72 else var "local_912") + in local "local_916" = (if (var "local_914" || (s72 == var "local_912")) then (var "local_913" + 1) else (var "local_913" - 1)) + in local "local_917" = (var "local_916" == 0) + in local "local_918" = (if var "local_917" then s76 else var "local_915") + in local "local_919" = (if (var "local_917" || (s76 == var "local_915")) then (var "local_916" + 1) else (var "local_916" - 1)) + in local "local_920" = (var "local_919" == 0) + in local "local_921" = (if var "local_920" then s80 else var "local_918") + in local "local_922" = (if (var "local_920" || (s80 == var "local_918")) then (var "local_919" + 1) else (var "local_919" - 1)) + in local "local_923" = (var "local_922" == 0) + in local "local_924" = (if var "local_923" then s84 else var "local_921") + in local "local_925" = (if (var "local_923" || (s84 == var "local_921")) then (var "local_922" + 1) else (var "local_922" - 1)) + in local "local_926" = (var "local_925" == 0) + in local "local_927" = (if var "local_926" then s88 else var "local_924") + in local "local_928" = (if (var "local_926" || (s88 == var "local_924")) then (var "local_925" + 1) else (var "local_925" - 1)) + in local "local_929" = (var "local_928" == 0) + in local "local_930" = (if var "local_929" then s92 else var "local_927") + in local "local_931" = (if (var "local_929" || (s92 == var "local_927")) then (var "local_928" + 1) else (var "local_928" - 1)) + in local "local_932" = (var "local_931" == 0) + in local "local_933" = (if var "local_932" then s96 else var "local_930") + in local "local_934" = (if (var "local_932" || (s96 == var "local_930")) then (var "local_931" + 1) else (var "local_931" - 1)) + in local "local_935" = (var "local_934" == 0) + in local "local_936" = (if var "local_935" then s100 else var "local_933") + in local "local_937" = (if (var "local_935" || (s100 == var "local_933")) then (var "local_934" + 1) else (var "local_934" - 1)) + in var "local_936") then (var "local_786" + 1) else var "local_786") + in local "local_938" = (if (s48 == local "local_939" = false + in local "local_940" = (if var "local_939" then s4 else s1) + in local "local_941" = (if (var "local_939" || (s4 == s1)) then 2 else 0) + in local "local_942" = (var "local_941" == 0) + in local "local_943" = (if var "local_942" then s8 else var "local_940") + in local "local_944" = (if (var "local_942" || (s8 == var "local_940")) then (var "local_941" + 1) else (var "local_941" - 1)) + in local "local_945" = (var "local_944" == 0) + in local "local_946" = (if var "local_945" then s12 else var "local_943") + in local "local_947" = (if (var "local_945" || (s12 == var "local_943")) then (var "local_944" + 1) else (var "local_944" - 1)) + in local "local_948" = (var "local_947" == 0) + in local "local_949" = (if var "local_948" then s16 else var "local_946") + in local "local_950" = (if (var "local_948" || (s16 == var "local_946")) then (var "local_947" + 1) else (var "local_947" - 1)) + in local "local_951" = (var "local_950" == 0) + in local "local_952" = (if var "local_951" then s20 else var "local_949") + in local "local_953" = (if (var "local_951" || (s20 == var "local_949")) then (var "local_950" + 1) else (var "local_950" - 1)) + in local "local_954" = (var "local_953" == 0) + in local "local_955" = (if var "local_954" then s24 else var "local_952") + in local "local_956" = (if (var "local_954" || (s24 == var "local_952")) then (var "local_953" + 1) else (var "local_953" - 1)) + in local "local_957" = (var "local_956" == 0) + in local "local_958" = (if var "local_957" then s28 else var "local_955") + in local "local_959" = (if (var "local_957" || (s28 == var "local_955")) then (var "local_956" + 1) else (var "local_956" - 1)) + in local "local_960" = (var "local_959" == 0) + in local "local_961" = (if var "local_960" then s32 else var "local_958") + in local "local_962" = (if (var "local_960" || (s32 == var "local_958")) then (var "local_959" + 1) else (var "local_959" - 1)) + in local "local_963" = (var "local_962" == 0) + in local "local_964" = (if var "local_963" then s36 else var "local_961") + in local "local_965" = (if (var "local_963" || (s36 == var "local_961")) then (var "local_962" + 1) else (var "local_962" - 1)) + in local "local_966" = (var "local_965" == 0) + in local "local_967" = (if var "local_966" then s40 else var "local_964") + in local "local_968" = (if (var "local_966" || (s40 == var "local_964")) then (var "local_965" + 1) else (var "local_965" - 1)) + in local "local_969" = (var "local_968" == 0) + in local "local_970" = (if var "local_969" then s44 else var "local_967") + in local "local_971" = (if (var "local_969" || (s44 == var "local_967")) then (var "local_968" + 1) else (var "local_968" - 1)) + in local "local_972" = (var "local_971" == 0) + in local "local_973" = (if var "local_972" then s48 else var "local_970") + in local "local_974" = (if (var "local_972" || (s48 == var "local_970")) then (var "local_971" + 1) else (var "local_971" - 1)) + in local "local_975" = (var "local_974" == 0) + in local "local_976" = (if var "local_975" then s52 else var "local_973") + in local "local_977" = (if (var "local_975" || (s52 == var "local_973")) then (var "local_974" + 1) else (var "local_974" - 1)) + in local "local_978" = (var "local_977" == 0) + in local "local_979" = (if var "local_978" then s56 else var "local_976") + in local "local_980" = (if (var "local_978" || (s56 == var "local_976")) then (var "local_977" + 1) else (var "local_977" - 1)) + in local "local_981" = (var "local_980" == 0) + in local "local_982" = (if var "local_981" then s60 else var "local_979") + in local "local_983" = (if (var "local_981" || (s60 == var "local_979")) then (var "local_980" + 1) else (var "local_980" - 1)) + in local "local_984" = (var "local_983" == 0) + in local "local_985" = (if var "local_984" then s64 else var "local_982") + in local "local_986" = (if (var "local_984" || (s64 == var "local_982")) then (var "local_983" + 1) else (var "local_983" - 1)) + in local "local_987" = (var "local_986" == 0) + in local "local_988" = (if var "local_987" then s68 else var "local_985") + in local "local_989" = (if (var "local_987" || (s68 == var "local_985")) then (var "local_986" + 1) else (var "local_986" - 1)) + in local "local_990" = (var "local_989" == 0) + in local "local_991" = (if var "local_990" then s72 else var "local_988") + in local "local_992" = (if (var "local_990" || (s72 == var "local_988")) then (var "local_989" + 1) else (var "local_989" - 1)) + in local "local_993" = (var "local_992" == 0) + in local "local_994" = (if var "local_993" then s76 else var "local_991") + in local "local_995" = (if (var "local_993" || (s76 == var "local_991")) then (var "local_992" + 1) else (var "local_992" - 1)) + in local "local_996" = (var "local_995" == 0) + in local "local_997" = (if var "local_996" then s80 else var "local_994") + in local "local_998" = (if (var "local_996" || (s80 == var "local_994")) then (var "local_995" + 1) else (var "local_995" - 1)) + in local "local_999" = (var "local_998" == 0) + in local "local_1000" = (if var "local_999" then s84 else var "local_997") + in local "local_1001" = (if (var "local_999" || (s84 == var "local_997")) then (var "local_998" + 1) else (var "local_998" - 1)) + in local "local_1002" = (var "local_1001" == 0) + in local "local_1003" = (if var "local_1002" then s88 else var "local_1000") + in local "local_1004" = (if (var "local_1002" || (s88 == var "local_1000")) then (var "local_1001" + 1) else (var "local_1001" - 1)) + in local "local_1005" = (var "local_1004" == 0) + in local "local_1006" = (if var "local_1005" then s92 else var "local_1003") + in local "local_1007" = (if (var "local_1005" || (s92 == var "local_1003")) then (var "local_1004" + 1) else (var "local_1004" - 1)) + in local "local_1008" = (var "local_1007" == 0) + in local "local_1009" = (if var "local_1008" then s96 else var "local_1006") + in local "local_1010" = (if (var "local_1008" || (s96 == var "local_1006")) then (var "local_1007" + 1) else (var "local_1007" - 1)) + in local "local_1011" = (var "local_1010" == 0) + in local "local_1012" = (if var "local_1011" then s100 else var "local_1009") + in local "local_1013" = (if (var "local_1011" || (s100 == var "local_1009")) then (var "local_1010" + 1) else (var "local_1010" - 1)) + in var "local_1012") then (var "local_862" + 1) else var "local_862") + in local "local_1014" = (if (s52 == local "local_1015" = false + in local "local_1016" = (if var "local_1015" then s4 else s1) + in local "local_1017" = (if (var "local_1015" || (s4 == s1)) then 2 else 0) + in local "local_1018" = (var "local_1017" == 0) + in local "local_1019" = (if var "local_1018" then s8 else var "local_1016") + in local "local_1020" = (if (var "local_1018" || (s8 == var "local_1016")) then (var "local_1017" + 1) else (var "local_1017" - 1)) + in local "local_1021" = (var "local_1020" == 0) + in local "local_1022" = (if var "local_1021" then s12 else var "local_1019") + in local "local_1023" = (if (var "local_1021" || (s12 == var "local_1019")) then (var "local_1020" + 1) else (var "local_1020" - 1)) + in local "local_1024" = (var "local_1023" == 0) + in local "local_1025" = (if var "local_1024" then s16 else var "local_1022") + in local "local_1026" = (if (var "local_1024" || (s16 == var "local_1022")) then (var "local_1023" + 1) else (var "local_1023" - 1)) + in local "local_1027" = (var "local_1026" == 0) + in local "local_1028" = (if var "local_1027" then s20 else var "local_1025") + in local "local_1029" = (if (var "local_1027" || (s20 == var "local_1025")) then (var "local_1026" + 1) else (var "local_1026" - 1)) + in local "local_1030" = (var "local_1029" == 0) + in local "local_1031" = (if var "local_1030" then s24 else var "local_1028") + in local "local_1032" = (if (var "local_1030" || (s24 == var "local_1028")) then (var "local_1029" + 1) else (var "local_1029" - 1)) + in local "local_1033" = (var "local_1032" == 0) + in local "local_1034" = (if var "local_1033" then s28 else var "local_1031") + in local "local_1035" = (if (var "local_1033" || (s28 == var "local_1031")) then (var "local_1032" + 1) else (var "local_1032" - 1)) + in local "local_1036" = (var "local_1035" == 0) + in local "local_1037" = (if var "local_1036" then s32 else var "local_1034") + in local "local_1038" = (if (var "local_1036" || (s32 == var "local_1034")) then (var "local_1035" + 1) else (var "local_1035" - 1)) + in local "local_1039" = (var "local_1038" == 0) + in local "local_1040" = (if var "local_1039" then s36 else var "local_1037") + in local "local_1041" = (if (var "local_1039" || (s36 == var "local_1037")) then (var "local_1038" + 1) else (var "local_1038" - 1)) + in local "local_1042" = (var "local_1041" == 0) + in local "local_1043" = (if var "local_1042" then s40 else var "local_1040") + in local "local_1044" = (if (var "local_1042" || (s40 == var "local_1040")) then (var "local_1041" + 1) else (var "local_1041" - 1)) + in local "local_1045" = (var "local_1044" == 0) + in local "local_1046" = (if var "local_1045" then s44 else var "local_1043") + in local "local_1047" = (if (var "local_1045" || (s44 == var "local_1043")) then (var "local_1044" + 1) else (var "local_1044" - 1)) + in local "local_1048" = (var "local_1047" == 0) + in local "local_1049" = (if var "local_1048" then s48 else var "local_1046") + in local "local_1050" = (if (var "local_1048" || (s48 == var "local_1046")) then (var "local_1047" + 1) else (var "local_1047" - 1)) + in local "local_1051" = (var "local_1050" == 0) + in local "local_1052" = (if var "local_1051" then s52 else var "local_1049") + in local "local_1053" = (if (var "local_1051" || (s52 == var "local_1049")) then (var "local_1050" + 1) else (var "local_1050" - 1)) + in local "local_1054" = (var "local_1053" == 0) + in local "local_1055" = (if var "local_1054" then s56 else var "local_1052") + in local "local_1056" = (if (var "local_1054" || (s56 == var "local_1052")) then (var "local_1053" + 1) else (var "local_1053" - 1)) + in local "local_1057" = (var "local_1056" == 0) + in local "local_1058" = (if var "local_1057" then s60 else var "local_1055") + in local "local_1059" = (if (var "local_1057" || (s60 == var "local_1055")) then (var "local_1056" + 1) else (var "local_1056" - 1)) + in local "local_1060" = (var "local_1059" == 0) + in local "local_1061" = (if var "local_1060" then s64 else var "local_1058") + in local "local_1062" = (if (var "local_1060" || (s64 == var "local_1058")) then (var "local_1059" + 1) else (var "local_1059" - 1)) + in local "local_1063" = (var "local_1062" == 0) + in local "local_1064" = (if var "local_1063" then s68 else var "local_1061") + in local "local_1065" = (if (var "local_1063" || (s68 == var "local_1061")) then (var "local_1062" + 1) else (var "local_1062" - 1)) + in local "local_1066" = (var "local_1065" == 0) + in local "local_1067" = (if var "local_1066" then s72 else var "local_1064") + in local "local_1068" = (if (var "local_1066" || (s72 == var "local_1064")) then (var "local_1065" + 1) else (var "local_1065" - 1)) + in local "local_1069" = (var "local_1068" == 0) + in local "local_1070" = (if var "local_1069" then s76 else var "local_1067") + in local "local_1071" = (if (var "local_1069" || (s76 == var "local_1067")) then (var "local_1068" + 1) else (var "local_1068" - 1)) + in local "local_1072" = (var "local_1071" == 0) + in local "local_1073" = (if var "local_1072" then s80 else var "local_1070") + in local "local_1074" = (if (var "local_1072" || (s80 == var "local_1070")) then (var "local_1071" + 1) else (var "local_1071" - 1)) + in local "local_1075" = (var "local_1074" == 0) + in local "local_1076" = (if var "local_1075" then s84 else var "local_1073") + in local "local_1077" = (if (var "local_1075" || (s84 == var "local_1073")) then (var "local_1074" + 1) else (var "local_1074" - 1)) + in local "local_1078" = (var "local_1077" == 0) + in local "local_1079" = (if var "local_1078" then s88 else var "local_1076") + in local "local_1080" = (if (var "local_1078" || (s88 == var "local_1076")) then (var "local_1077" + 1) else (var "local_1077" - 1)) + in local "local_1081" = (var "local_1080" == 0) + in local "local_1082" = (if var "local_1081" then s92 else var "local_1079") + in local "local_1083" = (if (var "local_1081" || (s92 == var "local_1079")) then (var "local_1080" + 1) else (var "local_1080" - 1)) + in local "local_1084" = (var "local_1083" == 0) + in local "local_1085" = (if var "local_1084" then s96 else var "local_1082") + in local "local_1086" = (if (var "local_1084" || (s96 == var "local_1082")) then (var "local_1083" + 1) else (var "local_1083" - 1)) + in local "local_1087" = (var "local_1086" == 0) + in local "local_1088" = (if var "local_1087" then s100 else var "local_1085") + in local "local_1089" = (if (var "local_1087" || (s100 == var "local_1085")) then (var "local_1086" + 1) else (var "local_1086" - 1)) + in var "local_1088") then (var "local_938" + 1) else var "local_938") + in local "local_1090" = (if (s56 == local "local_1091" = false + in local "local_1092" = (if var "local_1091" then s4 else s1) + in local "local_1093" = (if (var "local_1091" || (s4 == s1)) then 2 else 0) + in local "local_1094" = (var "local_1093" == 0) + in local "local_1095" = (if var "local_1094" then s8 else var "local_1092") + in local "local_1096" = (if (var "local_1094" || (s8 == var "local_1092")) then (var "local_1093" + 1) else (var "local_1093" - 1)) + in local "local_1097" = (var "local_1096" == 0) + in local "local_1098" = (if var "local_1097" then s12 else var "local_1095") + in local "local_1099" = (if (var "local_1097" || (s12 == var "local_1095")) then (var "local_1096" + 1) else (var "local_1096" - 1)) + in local "local_1100" = (var "local_1099" == 0) + in local "local_1101" = (if var "local_1100" then s16 else var "local_1098") + in local "local_1102" = (if (var "local_1100" || (s16 == var "local_1098")) then (var "local_1099" + 1) else (var "local_1099" - 1)) + in local "local_1103" = (var "local_1102" == 0) + in local "local_1104" = (if var "local_1103" then s20 else var "local_1101") + in local "local_1105" = (if (var "local_1103" || (s20 == var "local_1101")) then (var "local_1102" + 1) else (var "local_1102" - 1)) + in local "local_1106" = (var "local_1105" == 0) + in local "local_1107" = (if var "local_1106" then s24 else var "local_1104") + in local "local_1108" = (if (var "local_1106" || (s24 == var "local_1104")) then (var "local_1105" + 1) else (var "local_1105" - 1)) + in local "local_1109" = (var "local_1108" == 0) + in local "local_1110" = (if var "local_1109" then s28 else var "local_1107") + in local "local_1111" = (if (var "local_1109" || (s28 == var "local_1107")) then (var "local_1108" + 1) else (var "local_1108" - 1)) + in local "local_1112" = (var "local_1111" == 0) + in local "local_1113" = (if var "local_1112" then s32 else var "local_1110") + in local "local_1114" = (if (var "local_1112" || (s32 == var "local_1110")) then (var "local_1111" + 1) else (var "local_1111" - 1)) + in local "local_1115" = (var "local_1114" == 0) + in local "local_1116" = (if var "local_1115" then s36 else var "local_1113") + in local "local_1117" = (if (var "local_1115" || (s36 == var "local_1113")) then (var "local_1114" + 1) else (var "local_1114" - 1)) + in local "local_1118" = (var "local_1117" == 0) + in local "local_1119" = (if var "local_1118" then s40 else var "local_1116") + in local "local_1120" = (if (var "local_1118" || (s40 == var "local_1116")) then (var "local_1117" + 1) else (var "local_1117" - 1)) + in local "local_1121" = (var "local_1120" == 0) + in local "local_1122" = (if var "local_1121" then s44 else var "local_1119") + in local "local_1123" = (if (var "local_1121" || (s44 == var "local_1119")) then (var "local_1120" + 1) else (var "local_1120" - 1)) + in local "local_1124" = (var "local_1123" == 0) + in local "local_1125" = (if var "local_1124" then s48 else var "local_1122") + in local "local_1126" = (if (var "local_1124" || (s48 == var "local_1122")) then (var "local_1123" + 1) else (var "local_1123" - 1)) + in local "local_1127" = (var "local_1126" == 0) + in local "local_1128" = (if var "local_1127" then s52 else var "local_1125") + in local "local_1129" = (if (var "local_1127" || (s52 == var "local_1125")) then (var "local_1126" + 1) else (var "local_1126" - 1)) + in local "local_1130" = (var "local_1129" == 0) + in local "local_1131" = (if var "local_1130" then s56 else var "local_1128") + in local "local_1132" = (if (var "local_1130" || (s56 == var "local_1128")) then (var "local_1129" + 1) else (var "local_1129" - 1)) + in local "local_1133" = (var "local_1132" == 0) + in local "local_1134" = (if var "local_1133" then s60 else var "local_1131") + in local "local_1135" = (if (var "local_1133" || (s60 == var "local_1131")) then (var "local_1132" + 1) else (var "local_1132" - 1)) + in local "local_1136" = (var "local_1135" == 0) + in local "local_1137" = (if var "local_1136" then s64 else var "local_1134") + in local "local_1138" = (if (var "local_1136" || (s64 == var "local_1134")) then (var "local_1135" + 1) else (var "local_1135" - 1)) + in local "local_1139" = (var "local_1138" == 0) + in local "local_1140" = (if var "local_1139" then s68 else var "local_1137") + in local "local_1141" = (if (var "local_1139" || (s68 == var "local_1137")) then (var "local_1138" + 1) else (var "local_1138" - 1)) + in local "local_1142" = (var "local_1141" == 0) + in local "local_1143" = (if var "local_1142" then s72 else var "local_1140") + in local "local_1144" = (if (var "local_1142" || (s72 == var "local_1140")) then (var "local_1141" + 1) else (var "local_1141" - 1)) + in local "local_1145" = (var "local_1144" == 0) + in local "local_1146" = (if var "local_1145" then s76 else var "local_1143") + in local "local_1147" = (if (var "local_1145" || (s76 == var "local_1143")) then (var "local_1144" + 1) else (var "local_1144" - 1)) + in local "local_1148" = (var "local_1147" == 0) + in local "local_1149" = (if var "local_1148" then s80 else var "local_1146") + in local "local_1150" = (if (var "local_1148" || (s80 == var "local_1146")) then (var "local_1147" + 1) else (var "local_1147" - 1)) + in local "local_1151" = (var "local_1150" == 0) + in local "local_1152" = (if var "local_1151" then s84 else var "local_1149") + in local "local_1153" = (if (var "local_1151" || (s84 == var "local_1149")) then (var "local_1150" + 1) else (var "local_1150" - 1)) + in local "local_1154" = (var "local_1153" == 0) + in local "local_1155" = (if var "local_1154" then s88 else var "local_1152") + in local "local_1156" = (if (var "local_1154" || (s88 == var "local_1152")) then (var "local_1153" + 1) else (var "local_1153" - 1)) + in local "local_1157" = (var "local_1156" == 0) + in local "local_1158" = (if var "local_1157" then s92 else var "local_1155") + in local "local_1159" = (if (var "local_1157" || (s92 == var "local_1155")) then (var "local_1156" + 1) else (var "local_1156" - 1)) + in local "local_1160" = (var "local_1159" == 0) + in local "local_1161" = (if var "local_1160" then s96 else var "local_1158") + in local "local_1162" = (if (var "local_1160" || (s96 == var "local_1158")) then (var "local_1159" + 1) else (var "local_1159" - 1)) + in local "local_1163" = (var "local_1162" == 0) + in local "local_1164" = (if var "local_1163" then s100 else var "local_1161") + in local "local_1165" = (if (var "local_1163" || (s100 == var "local_1161")) then (var "local_1162" + 1) else (var "local_1162" - 1)) + in var "local_1164") then (var "local_1014" + 1) else var "local_1014") + in local "local_1166" = (if (s60 == local "local_1167" = false + in local "local_1168" = (if var "local_1167" then s4 else s1) + in local "local_1169" = (if (var "local_1167" || (s4 == s1)) then 2 else 0) + in local "local_1170" = (var "local_1169" == 0) + in local "local_1171" = (if var "local_1170" then s8 else var "local_1168") + in local "local_1172" = (if (var "local_1170" || (s8 == var "local_1168")) then (var "local_1169" + 1) else (var "local_1169" - 1)) + in local "local_1173" = (var "local_1172" == 0) + in local "local_1174" = (if var "local_1173" then s12 else var "local_1171") + in local "local_1175" = (if (var "local_1173" || (s12 == var "local_1171")) then (var "local_1172" + 1) else (var "local_1172" - 1)) + in local "local_1176" = (var "local_1175" == 0) + in local "local_1177" = (if var "local_1176" then s16 else var "local_1174") + in local "local_1178" = (if (var "local_1176" || (s16 == var "local_1174")) then (var "local_1175" + 1) else (var "local_1175" - 1)) + in local "local_1179" = (var "local_1178" == 0) + in local "local_1180" = (if var "local_1179" then s20 else var "local_1177") + in local "local_1181" = (if (var "local_1179" || (s20 == var "local_1177")) then (var "local_1178" + 1) else (var "local_1178" - 1)) + in local "local_1182" = (var "local_1181" == 0) + in local "local_1183" = (if var "local_1182" then s24 else var "local_1180") + in local "local_1184" = (if (var "local_1182" || (s24 == var "local_1180")) then (var "local_1181" + 1) else (var "local_1181" - 1)) + in local "local_1185" = (var "local_1184" == 0) + in local "local_1186" = (if var "local_1185" then s28 else var "local_1183") + in local "local_1187" = (if (var "local_1185" || (s28 == var "local_1183")) then (var "local_1184" + 1) else (var "local_1184" - 1)) + in local "local_1188" = (var "local_1187" == 0) + in local "local_1189" = (if var "local_1188" then s32 else var "local_1186") + in local "local_1190" = (if (var "local_1188" || (s32 == var "local_1186")) then (var "local_1187" + 1) else (var "local_1187" - 1)) + in local "local_1191" = (var "local_1190" == 0) + in local "local_1192" = (if var "local_1191" then s36 else var "local_1189") + in local "local_1193" = (if (var "local_1191" || (s36 == var "local_1189")) then (var "local_1190" + 1) else (var "local_1190" - 1)) + in local "local_1194" = (var "local_1193" == 0) + in local "local_1195" = (if var "local_1194" then s40 else var "local_1192") + in local "local_1196" = (if (var "local_1194" || (s40 == var "local_1192")) then (var "local_1193" + 1) else (var "local_1193" - 1)) + in local "local_1197" = (var "local_1196" == 0) + in local "local_1198" = (if var "local_1197" then s44 else var "local_1195") + in local "local_1199" = (if (var "local_1197" || (s44 == var "local_1195")) then (var "local_1196" + 1) else (var "local_1196" - 1)) + in local "local_1200" = (var "local_1199" == 0) + in local "local_1201" = (if var "local_1200" then s48 else var "local_1198") + in local "local_1202" = (if (var "local_1200" || (s48 == var "local_1198")) then (var "local_1199" + 1) else (var "local_1199" - 1)) + in local "local_1203" = (var "local_1202" == 0) + in local "local_1204" = (if var "local_1203" then s52 else var "local_1201") + in local "local_1205" = (if (var "local_1203" || (s52 == var "local_1201")) then (var "local_1202" + 1) else (var "local_1202" - 1)) + in local "local_1206" = (var "local_1205" == 0) + in local "local_1207" = (if var "local_1206" then s56 else var "local_1204") + in local "local_1208" = (if (var "local_1206" || (s56 == var "local_1204")) then (var "local_1205" + 1) else (var "local_1205" - 1)) + in local "local_1209" = (var "local_1208" == 0) + in local "local_1210" = (if var "local_1209" then s60 else var "local_1207") + in local "local_1211" = (if (var "local_1209" || (s60 == var "local_1207")) then (var "local_1208" + 1) else (var "local_1208" - 1)) + in local "local_1212" = (var "local_1211" == 0) + in local "local_1213" = (if var "local_1212" then s64 else var "local_1210") + in local "local_1214" = (if (var "local_1212" || (s64 == var "local_1210")) then (var "local_1211" + 1) else (var "local_1211" - 1)) + in local "local_1215" = (var "local_1214" == 0) + in local "local_1216" = (if var "local_1215" then s68 else var "local_1213") + in local "local_1217" = (if (var "local_1215" || (s68 == var "local_1213")) then (var "local_1214" + 1) else (var "local_1214" - 1)) + in local "local_1218" = (var "local_1217" == 0) + in local "local_1219" = (if var "local_1218" then s72 else var "local_1216") + in local "local_1220" = (if (var "local_1218" || (s72 == var "local_1216")) then (var "local_1217" + 1) else (var "local_1217" - 1)) + in local "local_1221" = (var "local_1220" == 0) + in local "local_1222" = (if var "local_1221" then s76 else var "local_1219") + in local "local_1223" = (if (var "local_1221" || (s76 == var "local_1219")) then (var "local_1220" + 1) else (var "local_1220" - 1)) + in local "local_1224" = (var "local_1223" == 0) + in local "local_1225" = (if var "local_1224" then s80 else var "local_1222") + in local "local_1226" = (if (var "local_1224" || (s80 == var "local_1222")) then (var "local_1223" + 1) else (var "local_1223" - 1)) + in local "local_1227" = (var "local_1226" == 0) + in local "local_1228" = (if var "local_1227" then s84 else var "local_1225") + in local "local_1229" = (if (var "local_1227" || (s84 == var "local_1225")) then (var "local_1226" + 1) else (var "local_1226" - 1)) + in local "local_1230" = (var "local_1229" == 0) + in local "local_1231" = (if var "local_1230" then s88 else var "local_1228") + in local "local_1232" = (if (var "local_1230" || (s88 == var "local_1228")) then (var "local_1229" + 1) else (var "local_1229" - 1)) + in local "local_1233" = (var "local_1232" == 0) + in local "local_1234" = (if var "local_1233" then s92 else var "local_1231") + in local "local_1235" = (if (var "local_1233" || (s92 == var "local_1231")) then (var "local_1232" + 1) else (var "local_1232" - 1)) + in local "local_1236" = (var "local_1235" == 0) + in local "local_1237" = (if var "local_1236" then s96 else var "local_1234") + in local "local_1238" = (if (var "local_1236" || (s96 == var "local_1234")) then (var "local_1235" + 1) else (var "local_1235" - 1)) + in local "local_1239" = (var "local_1238" == 0) + in local "local_1240" = (if var "local_1239" then s100 else var "local_1237") + in local "local_1241" = (if (var "local_1239" || (s100 == var "local_1237")) then (var "local_1238" + 1) else (var "local_1238" - 1)) + in var "local_1240") then (var "local_1090" + 1) else var "local_1090") + in local "local_1242" = (if (s64 == local "local_1243" = false + in local "local_1244" = (if var "local_1243" then s4 else s1) + in local "local_1245" = (if (var "local_1243" || (s4 == s1)) then 2 else 0) + in local "local_1246" = (var "local_1245" == 0) + in local "local_1247" = (if var "local_1246" then s8 else var "local_1244") + in local "local_1248" = (if (var "local_1246" || (s8 == var "local_1244")) then (var "local_1245" + 1) else (var "local_1245" - 1)) + in local "local_1249" = (var "local_1248" == 0) + in local "local_1250" = (if var "local_1249" then s12 else var "local_1247") + in local "local_1251" = (if (var "local_1249" || (s12 == var "local_1247")) then (var "local_1248" + 1) else (var "local_1248" - 1)) + in local "local_1252" = (var "local_1251" == 0) + in local "local_1253" = (if var "local_1252" then s16 else var "local_1250") + in local "local_1254" = (if (var "local_1252" || (s16 == var "local_1250")) then (var "local_1251" + 1) else (var "local_1251" - 1)) + in local "local_1255" = (var "local_1254" == 0) + in local "local_1256" = (if var "local_1255" then s20 else var "local_1253") + in local "local_1257" = (if (var "local_1255" || (s20 == var "local_1253")) then (var "local_1254" + 1) else (var "local_1254" - 1)) + in local "local_1258" = (var "local_1257" == 0) + in local "local_1259" = (if var "local_1258" then s24 else var "local_1256") + in local "local_1260" = (if (var "local_1258" || (s24 == var "local_1256")) then (var "local_1257" + 1) else (var "local_1257" - 1)) + in local "local_1261" = (var "local_1260" == 0) + in local "local_1262" = (if var "local_1261" then s28 else var "local_1259") + in local "local_1263" = (if (var "local_1261" || (s28 == var "local_1259")) then (var "local_1260" + 1) else (var "local_1260" - 1)) + in local "local_1264" = (var "local_1263" == 0) + in local "local_1265" = (if var "local_1264" then s32 else var "local_1262") + in local "local_1266" = (if (var "local_1264" || (s32 == var "local_1262")) then (var "local_1263" + 1) else (var "local_1263" - 1)) + in local "local_1267" = (var "local_1266" == 0) + in local "local_1268" = (if var "local_1267" then s36 else var "local_1265") + in local "local_1269" = (if (var "local_1267" || (s36 == var "local_1265")) then (var "local_1266" + 1) else (var "local_1266" - 1)) + in local "local_1270" = (var "local_1269" == 0) + in local "local_1271" = (if var "local_1270" then s40 else var "local_1268") + in local "local_1272" = (if (var "local_1270" || (s40 == var "local_1268")) then (var "local_1269" + 1) else (var "local_1269" - 1)) + in local "local_1273" = (var "local_1272" == 0) + in local "local_1274" = (if var "local_1273" then s44 else var "local_1271") + in local "local_1275" = (if (var "local_1273" || (s44 == var "local_1271")) then (var "local_1272" + 1) else (var "local_1272" - 1)) + in local "local_1276" = (var "local_1275" == 0) + in local "local_1277" = (if var "local_1276" then s48 else var "local_1274") + in local "local_1278" = (if (var "local_1276" || (s48 == var "local_1274")) then (var "local_1275" + 1) else (var "local_1275" - 1)) + in local "local_1279" = (var "local_1278" == 0) + in local "local_1280" = (if var "local_1279" then s52 else var "local_1277") + in local "local_1281" = (if (var "local_1279" || (s52 == var "local_1277")) then (var "local_1278" + 1) else (var "local_1278" - 1)) + in local "local_1282" = (var "local_1281" == 0) + in local "local_1283" = (if var "local_1282" then s56 else var "local_1280") + in local "local_1284" = (if (var "local_1282" || (s56 == var "local_1280")) then (var "local_1281" + 1) else (var "local_1281" - 1)) + in local "local_1285" = (var "local_1284" == 0) + in local "local_1286" = (if var "local_1285" then s60 else var "local_1283") + in local "local_1287" = (if (var "local_1285" || (s60 == var "local_1283")) then (var "local_1284" + 1) else (var "local_1284" - 1)) + in local "local_1288" = (var "local_1287" == 0) + in local "local_1289" = (if var "local_1288" then s64 else var "local_1286") + in local "local_1290" = (if (var "local_1288" || (s64 == var "local_1286")) then (var "local_1287" + 1) else (var "local_1287" - 1)) + in local "local_1291" = (var "local_1290" == 0) + in local "local_1292" = (if var "local_1291" then s68 else var "local_1289") + in local "local_1293" = (if (var "local_1291" || (s68 == var "local_1289")) then (var "local_1290" + 1) else (var "local_1290" - 1)) + in local "local_1294" = (var "local_1293" == 0) + in local "local_1295" = (if var "local_1294" then s72 else var "local_1292") + in local "local_1296" = (if (var "local_1294" || (s72 == var "local_1292")) then (var "local_1293" + 1) else (var "local_1293" - 1)) + in local "local_1297" = (var "local_1296" == 0) + in local "local_1298" = (if var "local_1297" then s76 else var "local_1295") + in local "local_1299" = (if (var "local_1297" || (s76 == var "local_1295")) then (var "local_1296" + 1) else (var "local_1296" - 1)) + in local "local_1300" = (var "local_1299" == 0) + in local "local_1301" = (if var "local_1300" then s80 else var "local_1298") + in local "local_1302" = (if (var "local_1300" || (s80 == var "local_1298")) then (var "local_1299" + 1) else (var "local_1299" - 1)) + in local "local_1303" = (var "local_1302" == 0) + in local "local_1304" = (if var "local_1303" then s84 else var "local_1301") + in local "local_1305" = (if (var "local_1303" || (s84 == var "local_1301")) then (var "local_1302" + 1) else (var "local_1302" - 1)) + in local "local_1306" = (var "local_1305" == 0) + in local "local_1307" = (if var "local_1306" then s88 else var "local_1304") + in local "local_1308" = (if (var "local_1306" || (s88 == var "local_1304")) then (var "local_1305" + 1) else (var "local_1305" - 1)) + in local "local_1309" = (var "local_1308" == 0) + in local "local_1310" = (if var "local_1309" then s92 else var "local_1307") + in local "local_1311" = (if (var "local_1309" || (s92 == var "local_1307")) then (var "local_1308" + 1) else (var "local_1308" - 1)) + in local "local_1312" = (var "local_1311" == 0) + in local "local_1313" = (if var "local_1312" then s96 else var "local_1310") + in local "local_1314" = (if (var "local_1312" || (s96 == var "local_1310")) then (var "local_1311" + 1) else (var "local_1311" - 1)) + in local "local_1315" = (var "local_1314" == 0) + in local "local_1316" = (if var "local_1315" then s100 else var "local_1313") + in local "local_1317" = (if (var "local_1315" || (s100 == var "local_1313")) then (var "local_1314" + 1) else (var "local_1314" - 1)) + in var "local_1316") then (var "local_1166" + 1) else var "local_1166") + in local "local_1318" = (if (s68 == local "local_1319" = false + in local "local_1320" = (if var "local_1319" then s4 else s1) + in local "local_1321" = (if (var "local_1319" || (s4 == s1)) then 2 else 0) + in local "local_1322" = (var "local_1321" == 0) + in local "local_1323" = (if var "local_1322" then s8 else var "local_1320") + in local "local_1324" = (if (var "local_1322" || (s8 == var "local_1320")) then (var "local_1321" + 1) else (var "local_1321" - 1)) + in local "local_1325" = (var "local_1324" == 0) + in local "local_1326" = (if var "local_1325" then s12 else var "local_1323") + in local "local_1327" = (if (var "local_1325" || (s12 == var "local_1323")) then (var "local_1324" + 1) else (var "local_1324" - 1)) + in local "local_1328" = (var "local_1327" == 0) + in local "local_1329" = (if var "local_1328" then s16 else var "local_1326") + in local "local_1330" = (if (var "local_1328" || (s16 == var "local_1326")) then (var "local_1327" + 1) else (var "local_1327" - 1)) + in local "local_1331" = (var "local_1330" == 0) + in local "local_1332" = (if var "local_1331" then s20 else var "local_1329") + in local "local_1333" = (if (var "local_1331" || (s20 == var "local_1329")) then (var "local_1330" + 1) else (var "local_1330" - 1)) + in local "local_1334" = (var "local_1333" == 0) + in local "local_1335" = (if var "local_1334" then s24 else var "local_1332") + in local "local_1336" = (if (var "local_1334" || (s24 == var "local_1332")) then (var "local_1333" + 1) else (var "local_1333" - 1)) + in local "local_1337" = (var "local_1336" == 0) + in local "local_1338" = (if var "local_1337" then s28 else var "local_1335") + in local "local_1339" = (if (var "local_1337" || (s28 == var "local_1335")) then (var "local_1336" + 1) else (var "local_1336" - 1)) + in local "local_1340" = (var "local_1339" == 0) + in local "local_1341" = (if var "local_1340" then s32 else var "local_1338") + in local "local_1342" = (if (var "local_1340" || (s32 == var "local_1338")) then (var "local_1339" + 1) else (var "local_1339" - 1)) + in local "local_1343" = (var "local_1342" == 0) + in local "local_1344" = (if var "local_1343" then s36 else var "local_1341") + in local "local_1345" = (if (var "local_1343" || (s36 == var "local_1341")) then (var "local_1342" + 1) else (var "local_1342" - 1)) + in local "local_1346" = (var "local_1345" == 0) + in local "local_1347" = (if var "local_1346" then s40 else var "local_1344") + in local "local_1348" = (if (var "local_1346" || (s40 == var "local_1344")) then (var "local_1345" + 1) else (var "local_1345" - 1)) + in local "local_1349" = (var "local_1348" == 0) + in local "local_1350" = (if var "local_1349" then s44 else var "local_1347") + in local "local_1351" = (if (var "local_1349" || (s44 == var "local_1347")) then (var "local_1348" + 1) else (var "local_1348" - 1)) + in local "local_1352" = (var "local_1351" == 0) + in local "local_1353" = (if var "local_1352" then s48 else var "local_1350") + in local "local_1354" = (if (var "local_1352" || (s48 == var "local_1350")) then (var "local_1351" + 1) else (var "local_1351" - 1)) + in local "local_1355" = (var "local_1354" == 0) + in local "local_1356" = (if var "local_1355" then s52 else var "local_1353") + in local "local_1357" = (if (var "local_1355" || (s52 == var "local_1353")) then (var "local_1354" + 1) else (var "local_1354" - 1)) + in local "local_1358" = (var "local_1357" == 0) + in local "local_1359" = (if var "local_1358" then s56 else var "local_1356") + in local "local_1360" = (if (var "local_1358" || (s56 == var "local_1356")) then (var "local_1357" + 1) else (var "local_1357" - 1)) + in local "local_1361" = (var "local_1360" == 0) + in local "local_1362" = (if var "local_1361" then s60 else var "local_1359") + in local "local_1363" = (if (var "local_1361" || (s60 == var "local_1359")) then (var "local_1360" + 1) else (var "local_1360" - 1)) + in local "local_1364" = (var "local_1363" == 0) + in local "local_1365" = (if var "local_1364" then s64 else var "local_1362") + in local "local_1366" = (if (var "local_1364" || (s64 == var "local_1362")) then (var "local_1363" + 1) else (var "local_1363" - 1)) + in local "local_1367" = (var "local_1366" == 0) + in local "local_1368" = (if var "local_1367" then s68 else var "local_1365") + in local "local_1369" = (if (var "local_1367" || (s68 == var "local_1365")) then (var "local_1366" + 1) else (var "local_1366" - 1)) + in local "local_1370" = (var "local_1369" == 0) + in local "local_1371" = (if var "local_1370" then s72 else var "local_1368") + in local "local_1372" = (if (var "local_1370" || (s72 == var "local_1368")) then (var "local_1369" + 1) else (var "local_1369" - 1)) + in local "local_1373" = (var "local_1372" == 0) + in local "local_1374" = (if var "local_1373" then s76 else var "local_1371") + in local "local_1375" = (if (var "local_1373" || (s76 == var "local_1371")) then (var "local_1372" + 1) else (var "local_1372" - 1)) + in local "local_1376" = (var "local_1375" == 0) + in local "local_1377" = (if var "local_1376" then s80 else var "local_1374") + in local "local_1378" = (if (var "local_1376" || (s80 == var "local_1374")) then (var "local_1375" + 1) else (var "local_1375" - 1)) + in local "local_1379" = (var "local_1378" == 0) + in local "local_1380" = (if var "local_1379" then s84 else var "local_1377") + in local "local_1381" = (if (var "local_1379" || (s84 == var "local_1377")) then (var "local_1378" + 1) else (var "local_1378" - 1)) + in local "local_1382" = (var "local_1381" == 0) + in local "local_1383" = (if var "local_1382" then s88 else var "local_1380") + in local "local_1384" = (if (var "local_1382" || (s88 == var "local_1380")) then (var "local_1381" + 1) else (var "local_1381" - 1)) + in local "local_1385" = (var "local_1384" == 0) + in local "local_1386" = (if var "local_1385" then s92 else var "local_1383") + in local "local_1387" = (if (var "local_1385" || (s92 == var "local_1383")) then (var "local_1384" + 1) else (var "local_1384" - 1)) + in local "local_1388" = (var "local_1387" == 0) + in local "local_1389" = (if var "local_1388" then s96 else var "local_1386") + in local "local_1390" = (if (var "local_1388" || (s96 == var "local_1386")) then (var "local_1387" + 1) else (var "local_1387" - 1)) + in local "local_1391" = (var "local_1390" == 0) + in local "local_1392" = (if var "local_1391" then s100 else var "local_1389") + in local "local_1393" = (if (var "local_1391" || (s100 == var "local_1389")) then (var "local_1390" + 1) else (var "local_1390" - 1)) + in var "local_1392") then (var "local_1242" + 1) else var "local_1242") + in local "local_1394" = (if (s72 == local "local_1395" = false + in local "local_1396" = (if var "local_1395" then s4 else s1) + in local "local_1397" = (if (var "local_1395" || (s4 == s1)) then 2 else 0) + in local "local_1398" = (var "local_1397" == 0) + in local "local_1399" = (if var "local_1398" then s8 else var "local_1396") + in local "local_1400" = (if (var "local_1398" || (s8 == var "local_1396")) then (var "local_1397" + 1) else (var "local_1397" - 1)) + in local "local_1401" = (var "local_1400" == 0) + in local "local_1402" = (if var "local_1401" then s12 else var "local_1399") + in local "local_1403" = (if (var "local_1401" || (s12 == var "local_1399")) then (var "local_1400" + 1) else (var "local_1400" - 1)) + in local "local_1404" = (var "local_1403" == 0) + in local "local_1405" = (if var "local_1404" then s16 else var "local_1402") + in local "local_1406" = (if (var "local_1404" || (s16 == var "local_1402")) then (var "local_1403" + 1) else (var "local_1403" - 1)) + in local "local_1407" = (var "local_1406" == 0) + in local "local_1408" = (if var "local_1407" then s20 else var "local_1405") + in local "local_1409" = (if (var "local_1407" || (s20 == var "local_1405")) then (var "local_1406" + 1) else (var "local_1406" - 1)) + in local "local_1410" = (var "local_1409" == 0) + in local "local_1411" = (if var "local_1410" then s24 else var "local_1408") + in local "local_1412" = (if (var "local_1410" || (s24 == var "local_1408")) then (var "local_1409" + 1) else (var "local_1409" - 1)) + in local "local_1413" = (var "local_1412" == 0) + in local "local_1414" = (if var "local_1413" then s28 else var "local_1411") + in local "local_1415" = (if (var "local_1413" || (s28 == var "local_1411")) then (var "local_1412" + 1) else (var "local_1412" - 1)) + in local "local_1416" = (var "local_1415" == 0) + in local "local_1417" = (if var "local_1416" then s32 else var "local_1414") + in local "local_1418" = (if (var "local_1416" || (s32 == var "local_1414")) then (var "local_1415" + 1) else (var "local_1415" - 1)) + in local "local_1419" = (var "local_1418" == 0) + in local "local_1420" = (if var "local_1419" then s36 else var "local_1417") + in local "local_1421" = (if (var "local_1419" || (s36 == var "local_1417")) then (var "local_1418" + 1) else (var "local_1418" - 1)) + in local "local_1422" = (var "local_1421" == 0) + in local "local_1423" = (if var "local_1422" then s40 else var "local_1420") + in local "local_1424" = (if (var "local_1422" || (s40 == var "local_1420")) then (var "local_1421" + 1) else (var "local_1421" - 1)) + in local "local_1425" = (var "local_1424" == 0) + in local "local_1426" = (if var "local_1425" then s44 else var "local_1423") + in local "local_1427" = (if (var "local_1425" || (s44 == var "local_1423")) then (var "local_1424" + 1) else (var "local_1424" - 1)) + in local "local_1428" = (var "local_1427" == 0) + in local "local_1429" = (if var "local_1428" then s48 else var "local_1426") + in local "local_1430" = (if (var "local_1428" || (s48 == var "local_1426")) then (var "local_1427" + 1) else (var "local_1427" - 1)) + in local "local_1431" = (var "local_1430" == 0) + in local "local_1432" = (if var "local_1431" then s52 else var "local_1429") + in local "local_1433" = (if (var "local_1431" || (s52 == var "local_1429")) then (var "local_1430" + 1) else (var "local_1430" - 1)) + in local "local_1434" = (var "local_1433" == 0) + in local "local_1435" = (if var "local_1434" then s56 else var "local_1432") + in local "local_1436" = (if (var "local_1434" || (s56 == var "local_1432")) then (var "local_1433" + 1) else (var "local_1433" - 1)) + in local "local_1437" = (var "local_1436" == 0) + in local "local_1438" = (if var "local_1437" then s60 else var "local_1435") + in local "local_1439" = (if (var "local_1437" || (s60 == var "local_1435")) then (var "local_1436" + 1) else (var "local_1436" - 1)) + in local "local_1440" = (var "local_1439" == 0) + in local "local_1441" = (if var "local_1440" then s64 else var "local_1438") + in local "local_1442" = (if (var "local_1440" || (s64 == var "local_1438")) then (var "local_1439" + 1) else (var "local_1439" - 1)) + in local "local_1443" = (var "local_1442" == 0) + in local "local_1444" = (if var "local_1443" then s68 else var "local_1441") + in local "local_1445" = (if (var "local_1443" || (s68 == var "local_1441")) then (var "local_1442" + 1) else (var "local_1442" - 1)) + in local "local_1446" = (var "local_1445" == 0) + in local "local_1447" = (if var "local_1446" then s72 else var "local_1444") + in local "local_1448" = (if (var "local_1446" || (s72 == var "local_1444")) then (var "local_1445" + 1) else (var "local_1445" - 1)) + in local "local_1449" = (var "local_1448" == 0) + in local "local_1450" = (if var "local_1449" then s76 else var "local_1447") + in local "local_1451" = (if (var "local_1449" || (s76 == var "local_1447")) then (var "local_1448" + 1) else (var "local_1448" - 1)) + in local "local_1452" = (var "local_1451" == 0) + in local "local_1453" = (if var "local_1452" then s80 else var "local_1450") + in local "local_1454" = (if (var "local_1452" || (s80 == var "local_1450")) then (var "local_1451" + 1) else (var "local_1451" - 1)) + in local "local_1455" = (var "local_1454" == 0) + in local "local_1456" = (if var "local_1455" then s84 else var "local_1453") + in local "local_1457" = (if (var "local_1455" || (s84 == var "local_1453")) then (var "local_1454" + 1) else (var "local_1454" - 1)) + in local "local_1458" = (var "local_1457" == 0) + in local "local_1459" = (if var "local_1458" then s88 else var "local_1456") + in local "local_1460" = (if (var "local_1458" || (s88 == var "local_1456")) then (var "local_1457" + 1) else (var "local_1457" - 1)) + in local "local_1461" = (var "local_1460" == 0) + in local "local_1462" = (if var "local_1461" then s92 else var "local_1459") + in local "local_1463" = (if (var "local_1461" || (s92 == var "local_1459")) then (var "local_1460" + 1) else (var "local_1460" - 1)) + in local "local_1464" = (var "local_1463" == 0) + in local "local_1465" = (if var "local_1464" then s96 else var "local_1462") + in local "local_1466" = (if (var "local_1464" || (s96 == var "local_1462")) then (var "local_1463" + 1) else (var "local_1463" - 1)) + in local "local_1467" = (var "local_1466" == 0) + in local "local_1468" = (if var "local_1467" then s100 else var "local_1465") + in local "local_1469" = (if (var "local_1467" || (s100 == var "local_1465")) then (var "local_1466" + 1) else (var "local_1466" - 1)) + in var "local_1468") then (var "local_1318" + 1) else var "local_1318") + in local "local_1470" = (if (s76 == local "local_1471" = false + in local "local_1472" = (if var "local_1471" then s4 else s1) + in local "local_1473" = (if (var "local_1471" || (s4 == s1)) then 2 else 0) + in local "local_1474" = (var "local_1473" == 0) + in local "local_1475" = (if var "local_1474" then s8 else var "local_1472") + in local "local_1476" = (if (var "local_1474" || (s8 == var "local_1472")) then (var "local_1473" + 1) else (var "local_1473" - 1)) + in local "local_1477" = (var "local_1476" == 0) + in local "local_1478" = (if var "local_1477" then s12 else var "local_1475") + in local "local_1479" = (if (var "local_1477" || (s12 == var "local_1475")) then (var "local_1476" + 1) else (var "local_1476" - 1)) + in local "local_1480" = (var "local_1479" == 0) + in local "local_1481" = (if var "local_1480" then s16 else var "local_1478") + in local "local_1482" = (if (var "local_1480" || (s16 == var "local_1478")) then (var "local_1479" + 1) else (var "local_1479" - 1)) + in local "local_1483" = (var "local_1482" == 0) + in local "local_1484" = (if var "local_1483" then s20 else var "local_1481") + in local "local_1485" = (if (var "local_1483" || (s20 == var "local_1481")) then (var "local_1482" + 1) else (var "local_1482" - 1)) + in local "local_1486" = (var "local_1485" == 0) + in local "local_1487" = (if var "local_1486" then s24 else var "local_1484") + in local "local_1488" = (if (var "local_1486" || (s24 == var "local_1484")) then (var "local_1485" + 1) else (var "local_1485" - 1)) + in local "local_1489" = (var "local_1488" == 0) + in local "local_1490" = (if var "local_1489" then s28 else var "local_1487") + in local "local_1491" = (if (var "local_1489" || (s28 == var "local_1487")) then (var "local_1488" + 1) else (var "local_1488" - 1)) + in local "local_1492" = (var "local_1491" == 0) + in local "local_1493" = (if var "local_1492" then s32 else var "local_1490") + in local "local_1494" = (if (var "local_1492" || (s32 == var "local_1490")) then (var "local_1491" + 1) else (var "local_1491" - 1)) + in local "local_1495" = (var "local_1494" == 0) + in local "local_1496" = (if var "local_1495" then s36 else var "local_1493") + in local "local_1497" = (if (var "local_1495" || (s36 == var "local_1493")) then (var "local_1494" + 1) else (var "local_1494" - 1)) + in local "local_1498" = (var "local_1497" == 0) + in local "local_1499" = (if var "local_1498" then s40 else var "local_1496") + in local "local_1500" = (if (var "local_1498" || (s40 == var "local_1496")) then (var "local_1497" + 1) else (var "local_1497" - 1)) + in local "local_1501" = (var "local_1500" == 0) + in local "local_1502" = (if var "local_1501" then s44 else var "local_1499") + in local "local_1503" = (if (var "local_1501" || (s44 == var "local_1499")) then (var "local_1500" + 1) else (var "local_1500" - 1)) + in local "local_1504" = (var "local_1503" == 0) + in local "local_1505" = (if var "local_1504" then s48 else var "local_1502") + in local "local_1506" = (if (var "local_1504" || (s48 == var "local_1502")) then (var "local_1503" + 1) else (var "local_1503" - 1)) + in local "local_1507" = (var "local_1506" == 0) + in local "local_1508" = (if var "local_1507" then s52 else var "local_1505") + in local "local_1509" = (if (var "local_1507" || (s52 == var "local_1505")) then (var "local_1506" + 1) else (var "local_1506" - 1)) + in local "local_1510" = (var "local_1509" == 0) + in local "local_1511" = (if var "local_1510" then s56 else var "local_1508") + in local "local_1512" = (if (var "local_1510" || (s56 == var "local_1508")) then (var "local_1509" + 1) else (var "local_1509" - 1)) + in local "local_1513" = (var "local_1512" == 0) + in local "local_1514" = (if var "local_1513" then s60 else var "local_1511") + in local "local_1515" = (if (var "local_1513" || (s60 == var "local_1511")) then (var "local_1512" + 1) else (var "local_1512" - 1)) + in local "local_1516" = (var "local_1515" == 0) + in local "local_1517" = (if var "local_1516" then s64 else var "local_1514") + in local "local_1518" = (if (var "local_1516" || (s64 == var "local_1514")) then (var "local_1515" + 1) else (var "local_1515" - 1)) + in local "local_1519" = (var "local_1518" == 0) + in local "local_1520" = (if var "local_1519" then s68 else var "local_1517") + in local "local_1521" = (if (var "local_1519" || (s68 == var "local_1517")) then (var "local_1518" + 1) else (var "local_1518" - 1)) + in local "local_1522" = (var "local_1521" == 0) + in local "local_1523" = (if var "local_1522" then s72 else var "local_1520") + in local "local_1524" = (if (var "local_1522" || (s72 == var "local_1520")) then (var "local_1521" + 1) else (var "local_1521" - 1)) + in local "local_1525" = (var "local_1524" == 0) + in local "local_1526" = (if var "local_1525" then s76 else var "local_1523") + in local "local_1527" = (if (var "local_1525" || (s76 == var "local_1523")) then (var "local_1524" + 1) else (var "local_1524" - 1)) + in local "local_1528" = (var "local_1527" == 0) + in local "local_1529" = (if var "local_1528" then s80 else var "local_1526") + in local "local_1530" = (if (var "local_1528" || (s80 == var "local_1526")) then (var "local_1527" + 1) else (var "local_1527" - 1)) + in local "local_1531" = (var "local_1530" == 0) + in local "local_1532" = (if var "local_1531" then s84 else var "local_1529") + in local "local_1533" = (if (var "local_1531" || (s84 == var "local_1529")) then (var "local_1530" + 1) else (var "local_1530" - 1)) + in local "local_1534" = (var "local_1533" == 0) + in local "local_1535" = (if var "local_1534" then s88 else var "local_1532") + in local "local_1536" = (if (var "local_1534" || (s88 == var "local_1532")) then (var "local_1533" + 1) else (var "local_1533" - 1)) + in local "local_1537" = (var "local_1536" == 0) + in local "local_1538" = (if var "local_1537" then s92 else var "local_1535") + in local "local_1539" = (if (var "local_1537" || (s92 == var "local_1535")) then (var "local_1536" + 1) else (var "local_1536" - 1)) + in local "local_1540" = (var "local_1539" == 0) + in local "local_1541" = (if var "local_1540" then s96 else var "local_1538") + in local "local_1542" = (if (var "local_1540" || (s96 == var "local_1538")) then (var "local_1539" + 1) else (var "local_1539" - 1)) + in local "local_1543" = (var "local_1542" == 0) + in local "local_1544" = (if var "local_1543" then s100 else var "local_1541") + in local "local_1545" = (if (var "local_1543" || (s100 == var "local_1541")) then (var "local_1542" + 1) else (var "local_1542" - 1)) + in var "local_1544") then (var "local_1394" + 1) else var "local_1394") + in local "local_1546" = (if (s80 == local "local_1547" = false + in local "local_1548" = (if var "local_1547" then s4 else s1) + in local "local_1549" = (if (var "local_1547" || (s4 == s1)) then 2 else 0) + in local "local_1550" = (var "local_1549" == 0) + in local "local_1551" = (if var "local_1550" then s8 else var "local_1548") + in local "local_1552" = (if (var "local_1550" || (s8 == var "local_1548")) then (var "local_1549" + 1) else (var "local_1549" - 1)) + in local "local_1553" = (var "local_1552" == 0) + in local "local_1554" = (if var "local_1553" then s12 else var "local_1551") + in local "local_1555" = (if (var "local_1553" || (s12 == var "local_1551")) then (var "local_1552" + 1) else (var "local_1552" - 1)) + in local "local_1556" = (var "local_1555" == 0) + in local "local_1557" = (if var "local_1556" then s16 else var "local_1554") + in local "local_1558" = (if (var "local_1556" || (s16 == var "local_1554")) then (var "local_1555" + 1) else (var "local_1555" - 1)) + in local "local_1559" = (var "local_1558" == 0) + in local "local_1560" = (if var "local_1559" then s20 else var "local_1557") + in local "local_1561" = (if (var "local_1559" || (s20 == var "local_1557")) then (var "local_1558" + 1) else (var "local_1558" - 1)) + in local "local_1562" = (var "local_1561" == 0) + in local "local_1563" = (if var "local_1562" then s24 else var "local_1560") + in local "local_1564" = (if (var "local_1562" || (s24 == var "local_1560")) then (var "local_1561" + 1) else (var "local_1561" - 1)) + in local "local_1565" = (var "local_1564" == 0) + in local "local_1566" = (if var "local_1565" then s28 else var "local_1563") + in local "local_1567" = (if (var "local_1565" || (s28 == var "local_1563")) then (var "local_1564" + 1) else (var "local_1564" - 1)) + in local "local_1568" = (var "local_1567" == 0) + in local "local_1569" = (if var "local_1568" then s32 else var "local_1566") + in local "local_1570" = (if (var "local_1568" || (s32 == var "local_1566")) then (var "local_1567" + 1) else (var "local_1567" - 1)) + in local "local_1571" = (var "local_1570" == 0) + in local "local_1572" = (if var "local_1571" then s36 else var "local_1569") + in local "local_1573" = (if (var "local_1571" || (s36 == var "local_1569")) then (var "local_1570" + 1) else (var "local_1570" - 1)) + in local "local_1574" = (var "local_1573" == 0) + in local "local_1575" = (if var "local_1574" then s40 else var "local_1572") + in local "local_1576" = (if (var "local_1574" || (s40 == var "local_1572")) then (var "local_1573" + 1) else (var "local_1573" - 1)) + in local "local_1577" = (var "local_1576" == 0) + in local "local_1578" = (if var "local_1577" then s44 else var "local_1575") + in local "local_1579" = (if (var "local_1577" || (s44 == var "local_1575")) then (var "local_1576" + 1) else (var "local_1576" - 1)) + in local "local_1580" = (var "local_1579" == 0) + in local "local_1581" = (if var "local_1580" then s48 else var "local_1578") + in local "local_1582" = (if (var "local_1580" || (s48 == var "local_1578")) then (var "local_1579" + 1) else (var "local_1579" - 1)) + in local "local_1583" = (var "local_1582" == 0) + in local "local_1584" = (if var "local_1583" then s52 else var "local_1581") + in local "local_1585" = (if (var "local_1583" || (s52 == var "local_1581")) then (var "local_1582" + 1) else (var "local_1582" - 1)) + in local "local_1586" = (var "local_1585" == 0) + in local "local_1587" = (if var "local_1586" then s56 else var "local_1584") + in local "local_1588" = (if (var "local_1586" || (s56 == var "local_1584")) then (var "local_1585" + 1) else (var "local_1585" - 1)) + in local "local_1589" = (var "local_1588" == 0) + in local "local_1590" = (if var "local_1589" then s60 else var "local_1587") + in local "local_1591" = (if (var "local_1589" || (s60 == var "local_1587")) then (var "local_1588" + 1) else (var "local_1588" - 1)) + in local "local_1592" = (var "local_1591" == 0) + in local "local_1593" = (if var "local_1592" then s64 else var "local_1590") + in local "local_1594" = (if (var "local_1592" || (s64 == var "local_1590")) then (var "local_1591" + 1) else (var "local_1591" - 1)) + in local "local_1595" = (var "local_1594" == 0) + in local "local_1596" = (if var "local_1595" then s68 else var "local_1593") + in local "local_1597" = (if (var "local_1595" || (s68 == var "local_1593")) then (var "local_1594" + 1) else (var "local_1594" - 1)) + in local "local_1598" = (var "local_1597" == 0) + in local "local_1599" = (if var "local_1598" then s72 else var "local_1596") + in local "local_1600" = (if (var "local_1598" || (s72 == var "local_1596")) then (var "local_1597" + 1) else (var "local_1597" - 1)) + in local "local_1601" = (var "local_1600" == 0) + in local "local_1602" = (if var "local_1601" then s76 else var "local_1599") + in local "local_1603" = (if (var "local_1601" || (s76 == var "local_1599")) then (var "local_1600" + 1) else (var "local_1600" - 1)) + in local "local_1604" = (var "local_1603" == 0) + in local "local_1605" = (if var "local_1604" then s80 else var "local_1602") + in local "local_1606" = (if (var "local_1604" || (s80 == var "local_1602")) then (var "local_1603" + 1) else (var "local_1603" - 1)) + in local "local_1607" = (var "local_1606" == 0) + in local "local_1608" = (if var "local_1607" then s84 else var "local_1605") + in local "local_1609" = (if (var "local_1607" || (s84 == var "local_1605")) then (var "local_1606" + 1) else (var "local_1606" - 1)) + in local "local_1610" = (var "local_1609" == 0) + in local "local_1611" = (if var "local_1610" then s88 else var "local_1608") + in local "local_1612" = (if (var "local_1610" || (s88 == var "local_1608")) then (var "local_1609" + 1) else (var "local_1609" - 1)) + in local "local_1613" = (var "local_1612" == 0) + in local "local_1614" = (if var "local_1613" then s92 else var "local_1611") + in local "local_1615" = (if (var "local_1613" || (s92 == var "local_1611")) then (var "local_1612" + 1) else (var "local_1612" - 1)) + in local "local_1616" = (var "local_1615" == 0) + in local "local_1617" = (if var "local_1616" then s96 else var "local_1614") + in local "local_1618" = (if (var "local_1616" || (s96 == var "local_1614")) then (var "local_1615" + 1) else (var "local_1615" - 1)) + in local "local_1619" = (var "local_1618" == 0) + in local "local_1620" = (if var "local_1619" then s100 else var "local_1617") + in local "local_1621" = (if (var "local_1619" || (s100 == var "local_1617")) then (var "local_1618" + 1) else (var "local_1618" - 1)) + in var "local_1620") then (var "local_1470" + 1) else var "local_1470") + in local "local_1622" = (if (s84 == local "local_1623" = false + in local "local_1624" = (if var "local_1623" then s4 else s1) + in local "local_1625" = (if (var "local_1623" || (s4 == s1)) then 2 else 0) + in local "local_1626" = (var "local_1625" == 0) + in local "local_1627" = (if var "local_1626" then s8 else var "local_1624") + in local "local_1628" = (if (var "local_1626" || (s8 == var "local_1624")) then (var "local_1625" + 1) else (var "local_1625" - 1)) + in local "local_1629" = (var "local_1628" == 0) + in local "local_1630" = (if var "local_1629" then s12 else var "local_1627") + in local "local_1631" = (if (var "local_1629" || (s12 == var "local_1627")) then (var "local_1628" + 1) else (var "local_1628" - 1)) + in local "local_1632" = (var "local_1631" == 0) + in local "local_1633" = (if var "local_1632" then s16 else var "local_1630") + in local "local_1634" = (if (var "local_1632" || (s16 == var "local_1630")) then (var "local_1631" + 1) else (var "local_1631" - 1)) + in local "local_1635" = (var "local_1634" == 0) + in local "local_1636" = (if var "local_1635" then s20 else var "local_1633") + in local "local_1637" = (if (var "local_1635" || (s20 == var "local_1633")) then (var "local_1634" + 1) else (var "local_1634" - 1)) + in local "local_1638" = (var "local_1637" == 0) + in local "local_1639" = (if var "local_1638" then s24 else var "local_1636") + in local "local_1640" = (if (var "local_1638" || (s24 == var "local_1636")) then (var "local_1637" + 1) else (var "local_1637" - 1)) + in local "local_1641" = (var "local_1640" == 0) + in local "local_1642" = (if var "local_1641" then s28 else var "local_1639") + in local "local_1643" = (if (var "local_1641" || (s28 == var "local_1639")) then (var "local_1640" + 1) else (var "local_1640" - 1)) + in local "local_1644" = (var "local_1643" == 0) + in local "local_1645" = (if var "local_1644" then s32 else var "local_1642") + in local "local_1646" = (if (var "local_1644" || (s32 == var "local_1642")) then (var "local_1643" + 1) else (var "local_1643" - 1)) + in local "local_1647" = (var "local_1646" == 0) + in local "local_1648" = (if var "local_1647" then s36 else var "local_1645") + in local "local_1649" = (if (var "local_1647" || (s36 == var "local_1645")) then (var "local_1646" + 1) else (var "local_1646" - 1)) + in local "local_1650" = (var "local_1649" == 0) + in local "local_1651" = (if var "local_1650" then s40 else var "local_1648") + in local "local_1652" = (if (var "local_1650" || (s40 == var "local_1648")) then (var "local_1649" + 1) else (var "local_1649" - 1)) + in local "local_1653" = (var "local_1652" == 0) + in local "local_1654" = (if var "local_1653" then s44 else var "local_1651") + in local "local_1655" = (if (var "local_1653" || (s44 == var "local_1651")) then (var "local_1652" + 1) else (var "local_1652" - 1)) + in local "local_1656" = (var "local_1655" == 0) + in local "local_1657" = (if var "local_1656" then s48 else var "local_1654") + in local "local_1658" = (if (var "local_1656" || (s48 == var "local_1654")) then (var "local_1655" + 1) else (var "local_1655" - 1)) + in local "local_1659" = (var "local_1658" == 0) + in local "local_1660" = (if var "local_1659" then s52 else var "local_1657") + in local "local_1661" = (if (var "local_1659" || (s52 == var "local_1657")) then (var "local_1658" + 1) else (var "local_1658" - 1)) + in local "local_1662" = (var "local_1661" == 0) + in local "local_1663" = (if var "local_1662" then s56 else var "local_1660") + in local "local_1664" = (if (var "local_1662" || (s56 == var "local_1660")) then (var "local_1661" + 1) else (var "local_1661" - 1)) + in local "local_1665" = (var "local_1664" == 0) + in local "local_1666" = (if var "local_1665" then s60 else var "local_1663") + in local "local_1667" = (if (var "local_1665" || (s60 == var "local_1663")) then (var "local_1664" + 1) else (var "local_1664" - 1)) + in local "local_1668" = (var "local_1667" == 0) + in local "local_1669" = (if var "local_1668" then s64 else var "local_1666") + in local "local_1670" = (if (var "local_1668" || (s64 == var "local_1666")) then (var "local_1667" + 1) else (var "local_1667" - 1)) + in local "local_1671" = (var "local_1670" == 0) + in local "local_1672" = (if var "local_1671" then s68 else var "local_1669") + in local "local_1673" = (if (var "local_1671" || (s68 == var "local_1669")) then (var "local_1670" + 1) else (var "local_1670" - 1)) + in local "local_1674" = (var "local_1673" == 0) + in local "local_1675" = (if var "local_1674" then s72 else var "local_1672") + in local "local_1676" = (if (var "local_1674" || (s72 == var "local_1672")) then (var "local_1673" + 1) else (var "local_1673" - 1)) + in local "local_1677" = (var "local_1676" == 0) + in local "local_1678" = (if var "local_1677" then s76 else var "local_1675") + in local "local_1679" = (if (var "local_1677" || (s76 == var "local_1675")) then (var "local_1676" + 1) else (var "local_1676" - 1)) + in local "local_1680" = (var "local_1679" == 0) + in local "local_1681" = (if var "local_1680" then s80 else var "local_1678") + in local "local_1682" = (if (var "local_1680" || (s80 == var "local_1678")) then (var "local_1679" + 1) else (var "local_1679" - 1)) + in local "local_1683" = (var "local_1682" == 0) + in local "local_1684" = (if var "local_1683" then s84 else var "local_1681") + in local "local_1685" = (if (var "local_1683" || (s84 == var "local_1681")) then (var "local_1682" + 1) else (var "local_1682" - 1)) + in local "local_1686" = (var "local_1685" == 0) + in local "local_1687" = (if var "local_1686" then s88 else var "local_1684") + in local "local_1688" = (if (var "local_1686" || (s88 == var "local_1684")) then (var "local_1685" + 1) else (var "local_1685" - 1)) + in local "local_1689" = (var "local_1688" == 0) + in local "local_1690" = (if var "local_1689" then s92 else var "local_1687") + in local "local_1691" = (if (var "local_1689" || (s92 == var "local_1687")) then (var "local_1688" + 1) else (var "local_1688" - 1)) + in local "local_1692" = (var "local_1691" == 0) + in local "local_1693" = (if var "local_1692" then s96 else var "local_1690") + in local "local_1694" = (if (var "local_1692" || (s96 == var "local_1690")) then (var "local_1691" + 1) else (var "local_1691" - 1)) + in local "local_1695" = (var "local_1694" == 0) + in local "local_1696" = (if var "local_1695" then s100 else var "local_1693") + in local "local_1697" = (if (var "local_1695" || (s100 == var "local_1693")) then (var "local_1694" + 1) else (var "local_1694" - 1)) + in var "local_1696") then (var "local_1546" + 1) else var "local_1546") + in local "local_1698" = (if (s88 == local "local_1699" = false + in local "local_1700" = (if var "local_1699" then s4 else s1) + in local "local_1701" = (if (var "local_1699" || (s4 == s1)) then 2 else 0) + in local "local_1702" = (var "local_1701" == 0) + in local "local_1703" = (if var "local_1702" then s8 else var "local_1700") + in local "local_1704" = (if (var "local_1702" || (s8 == var "local_1700")) then (var "local_1701" + 1) else (var "local_1701" - 1)) + in local "local_1705" = (var "local_1704" == 0) + in local "local_1706" = (if var "local_1705" then s12 else var "local_1703") + in local "local_1707" = (if (var "local_1705" || (s12 == var "local_1703")) then (var "local_1704" + 1) else (var "local_1704" - 1)) + in local "local_1708" = (var "local_1707" == 0) + in local "local_1709" = (if var "local_1708" then s16 else var "local_1706") + in local "local_1710" = (if (var "local_1708" || (s16 == var "local_1706")) then (var "local_1707" + 1) else (var "local_1707" - 1)) + in local "local_1711" = (var "local_1710" == 0) + in local "local_1712" = (if var "local_1711" then s20 else var "local_1709") + in local "local_1713" = (if (var "local_1711" || (s20 == var "local_1709")) then (var "local_1710" + 1) else (var "local_1710" - 1)) + in local "local_1714" = (var "local_1713" == 0) + in local "local_1715" = (if var "local_1714" then s24 else var "local_1712") + in local "local_1716" = (if (var "local_1714" || (s24 == var "local_1712")) then (var "local_1713" + 1) else (var "local_1713" - 1)) + in local "local_1717" = (var "local_1716" == 0) + in local "local_1718" = (if var "local_1717" then s28 else var "local_1715") + in local "local_1719" = (if (var "local_1717" || (s28 == var "local_1715")) then (var "local_1716" + 1) else (var "local_1716" - 1)) + in local "local_1720" = (var "local_1719" == 0) + in local "local_1721" = (if var "local_1720" then s32 else var "local_1718") + in local "local_1722" = (if (var "local_1720" || (s32 == var "local_1718")) then (var "local_1719" + 1) else (var "local_1719" - 1)) + in local "local_1723" = (var "local_1722" == 0) + in local "local_1724" = (if var "local_1723" then s36 else var "local_1721") + in local "local_1725" = (if (var "local_1723" || (s36 == var "local_1721")) then (var "local_1722" + 1) else (var "local_1722" - 1)) + in local "local_1726" = (var "local_1725" == 0) + in local "local_1727" = (if var "local_1726" then s40 else var "local_1724") + in local "local_1728" = (if (var "local_1726" || (s40 == var "local_1724")) then (var "local_1725" + 1) else (var "local_1725" - 1)) + in local "local_1729" = (var "local_1728" == 0) + in local "local_1730" = (if var "local_1729" then s44 else var "local_1727") + in local "local_1731" = (if (var "local_1729" || (s44 == var "local_1727")) then (var "local_1728" + 1) else (var "local_1728" - 1)) + in local "local_1732" = (var "local_1731" == 0) + in local "local_1733" = (if var "local_1732" then s48 else var "local_1730") + in local "local_1734" = (if (var "local_1732" || (s48 == var "local_1730")) then (var "local_1731" + 1) else (var "local_1731" - 1)) + in local "local_1735" = (var "local_1734" == 0) + in local "local_1736" = (if var "local_1735" then s52 else var "local_1733") + in local "local_1737" = (if (var "local_1735" || (s52 == var "local_1733")) then (var "local_1734" + 1) else (var "local_1734" - 1)) + in local "local_1738" = (var "local_1737" == 0) + in local "local_1739" = (if var "local_1738" then s56 else var "local_1736") + in local "local_1740" = (if (var "local_1738" || (s56 == var "local_1736")) then (var "local_1737" + 1) else (var "local_1737" - 1)) + in local "local_1741" = (var "local_1740" == 0) + in local "local_1742" = (if var "local_1741" then s60 else var "local_1739") + in local "local_1743" = (if (var "local_1741" || (s60 == var "local_1739")) then (var "local_1740" + 1) else (var "local_1740" - 1)) + in local "local_1744" = (var "local_1743" == 0) + in local "local_1745" = (if var "local_1744" then s64 else var "local_1742") + in local "local_1746" = (if (var "local_1744" || (s64 == var "local_1742")) then (var "local_1743" + 1) else (var "local_1743" - 1)) + in local "local_1747" = (var "local_1746" == 0) + in local "local_1748" = (if var "local_1747" then s68 else var "local_1745") + in local "local_1749" = (if (var "local_1747" || (s68 == var "local_1745")) then (var "local_1746" + 1) else (var "local_1746" - 1)) + in local "local_1750" = (var "local_1749" == 0) + in local "local_1751" = (if var "local_1750" then s72 else var "local_1748") + in local "local_1752" = (if (var "local_1750" || (s72 == var "local_1748")) then (var "local_1749" + 1) else (var "local_1749" - 1)) + in local "local_1753" = (var "local_1752" == 0) + in local "local_1754" = (if var "local_1753" then s76 else var "local_1751") + in local "local_1755" = (if (var "local_1753" || (s76 == var "local_1751")) then (var "local_1752" + 1) else (var "local_1752" - 1)) + in local "local_1756" = (var "local_1755" == 0) + in local "local_1757" = (if var "local_1756" then s80 else var "local_1754") + in local "local_1758" = (if (var "local_1756" || (s80 == var "local_1754")) then (var "local_1755" + 1) else (var "local_1755" - 1)) + in local "local_1759" = (var "local_1758" == 0) + in local "local_1760" = (if var "local_1759" then s84 else var "local_1757") + in local "local_1761" = (if (var "local_1759" || (s84 == var "local_1757")) then (var "local_1758" + 1) else (var "local_1758" - 1)) + in local "local_1762" = (var "local_1761" == 0) + in local "local_1763" = (if var "local_1762" then s88 else var "local_1760") + in local "local_1764" = (if (var "local_1762" || (s88 == var "local_1760")) then (var "local_1761" + 1) else (var "local_1761" - 1)) + in local "local_1765" = (var "local_1764" == 0) + in local "local_1766" = (if var "local_1765" then s92 else var "local_1763") + in local "local_1767" = (if (var "local_1765" || (s92 == var "local_1763")) then (var "local_1764" + 1) else (var "local_1764" - 1)) + in local "local_1768" = (var "local_1767" == 0) + in local "local_1769" = (if var "local_1768" then s96 else var "local_1766") + in local "local_1770" = (if (var "local_1768" || (s96 == var "local_1766")) then (var "local_1767" + 1) else (var "local_1767" - 1)) + in local "local_1771" = (var "local_1770" == 0) + in local "local_1772" = (if var "local_1771" then s100 else var "local_1769") + in local "local_1773" = (if (var "local_1771" || (s100 == var "local_1769")) then (var "local_1770" + 1) else (var "local_1770" - 1)) + in var "local_1772") then (var "local_1622" + 1) else var "local_1622") + in local "local_1774" = (if (s92 == local "local_1775" = false + in local "local_1776" = (if var "local_1775" then s4 else s1) + in local "local_1777" = (if (var "local_1775" || (s4 == s1)) then 2 else 0) + in local "local_1778" = (var "local_1777" == 0) + in local "local_1779" = (if var "local_1778" then s8 else var "local_1776") + in local "local_1780" = (if (var "local_1778" || (s8 == var "local_1776")) then (var "local_1777" + 1) else (var "local_1777" - 1)) + in local "local_1781" = (var "local_1780" == 0) + in local "local_1782" = (if var "local_1781" then s12 else var "local_1779") + in local "local_1783" = (if (var "local_1781" || (s12 == var "local_1779")) then (var "local_1780" + 1) else (var "local_1780" - 1)) + in local "local_1784" = (var "local_1783" == 0) + in local "local_1785" = (if var "local_1784" then s16 else var "local_1782") + in local "local_1786" = (if (var "local_1784" || (s16 == var "local_1782")) then (var "local_1783" + 1) else (var "local_1783" - 1)) + in local "local_1787" = (var "local_1786" == 0) + in local "local_1788" = (if var "local_1787" then s20 else var "local_1785") + in local "local_1789" = (if (var "local_1787" || (s20 == var "local_1785")) then (var "local_1786" + 1) else (var "local_1786" - 1)) + in local "local_1790" = (var "local_1789" == 0) + in local "local_1791" = (if var "local_1790" then s24 else var "local_1788") + in local "local_1792" = (if (var "local_1790" || (s24 == var "local_1788")) then (var "local_1789" + 1) else (var "local_1789" - 1)) + in local "local_1793" = (var "local_1792" == 0) + in local "local_1794" = (if var "local_1793" then s28 else var "local_1791") + in local "local_1795" = (if (var "local_1793" || (s28 == var "local_1791")) then (var "local_1792" + 1) else (var "local_1792" - 1)) + in local "local_1796" = (var "local_1795" == 0) + in local "local_1797" = (if var "local_1796" then s32 else var "local_1794") + in local "local_1798" = (if (var "local_1796" || (s32 == var "local_1794")) then (var "local_1795" + 1) else (var "local_1795" - 1)) + in local "local_1799" = (var "local_1798" == 0) + in local "local_1800" = (if var "local_1799" then s36 else var "local_1797") + in local "local_1801" = (if (var "local_1799" || (s36 == var "local_1797")) then (var "local_1798" + 1) else (var "local_1798" - 1)) + in local "local_1802" = (var "local_1801" == 0) + in local "local_1803" = (if var "local_1802" then s40 else var "local_1800") + in local "local_1804" = (if (var "local_1802" || (s40 == var "local_1800")) then (var "local_1801" + 1) else (var "local_1801" - 1)) + in local "local_1805" = (var "local_1804" == 0) + in local "local_1806" = (if var "local_1805" then s44 else var "local_1803") + in local "local_1807" = (if (var "local_1805" || (s44 == var "local_1803")) then (var "local_1804" + 1) else (var "local_1804" - 1)) + in local "local_1808" = (var "local_1807" == 0) + in local "local_1809" = (if var "local_1808" then s48 else var "local_1806") + in local "local_1810" = (if (var "local_1808" || (s48 == var "local_1806")) then (var "local_1807" + 1) else (var "local_1807" - 1)) + in local "local_1811" = (var "local_1810" == 0) + in local "local_1812" = (if var "local_1811" then s52 else var "local_1809") + in local "local_1813" = (if (var "local_1811" || (s52 == var "local_1809")) then (var "local_1810" + 1) else (var "local_1810" - 1)) + in local "local_1814" = (var "local_1813" == 0) + in local "local_1815" = (if var "local_1814" then s56 else var "local_1812") + in local "local_1816" = (if (var "local_1814" || (s56 == var "local_1812")) then (var "local_1813" + 1) else (var "local_1813" - 1)) + in local "local_1817" = (var "local_1816" == 0) + in local "local_1818" = (if var "local_1817" then s60 else var "local_1815") + in local "local_1819" = (if (var "local_1817" || (s60 == var "local_1815")) then (var "local_1816" + 1) else (var "local_1816" - 1)) + in local "local_1820" = (var "local_1819" == 0) + in local "local_1821" = (if var "local_1820" then s64 else var "local_1818") + in local "local_1822" = (if (var "local_1820" || (s64 == var "local_1818")) then (var "local_1819" + 1) else (var "local_1819" - 1)) + in local "local_1823" = (var "local_1822" == 0) + in local "local_1824" = (if var "local_1823" then s68 else var "local_1821") + in local "local_1825" = (if (var "local_1823" || (s68 == var "local_1821")) then (var "local_1822" + 1) else (var "local_1822" - 1)) + in local "local_1826" = (var "local_1825" == 0) + in local "local_1827" = (if var "local_1826" then s72 else var "local_1824") + in local "local_1828" = (if (var "local_1826" || (s72 == var "local_1824")) then (var "local_1825" + 1) else (var "local_1825" - 1)) + in local "local_1829" = (var "local_1828" == 0) + in local "local_1830" = (if var "local_1829" then s76 else var "local_1827") + in local "local_1831" = (if (var "local_1829" || (s76 == var "local_1827")) then (var "local_1828" + 1) else (var "local_1828" - 1)) + in local "local_1832" = (var "local_1831" == 0) + in local "local_1833" = (if var "local_1832" then s80 else var "local_1830") + in local "local_1834" = (if (var "local_1832" || (s80 == var "local_1830")) then (var "local_1831" + 1) else (var "local_1831" - 1)) + in local "local_1835" = (var "local_1834" == 0) + in local "local_1836" = (if var "local_1835" then s84 else var "local_1833") + in local "local_1837" = (if (var "local_1835" || (s84 == var "local_1833")) then (var "local_1834" + 1) else (var "local_1834" - 1)) + in local "local_1838" = (var "local_1837" == 0) + in local "local_1839" = (if var "local_1838" then s88 else var "local_1836") + in local "local_1840" = (if (var "local_1838" || (s88 == var "local_1836")) then (var "local_1837" + 1) else (var "local_1837" - 1)) + in local "local_1841" = (var "local_1840" == 0) + in local "local_1842" = (if var "local_1841" then s92 else var "local_1839") + in local "local_1843" = (if (var "local_1841" || (s92 == var "local_1839")) then (var "local_1840" + 1) else (var "local_1840" - 1)) + in local "local_1844" = (var "local_1843" == 0) + in local "local_1845" = (if var "local_1844" then s96 else var "local_1842") + in local "local_1846" = (if (var "local_1844" || (s96 == var "local_1842")) then (var "local_1843" + 1) else (var "local_1843" - 1)) + in local "local_1847" = (var "local_1846" == 0) + in local "local_1848" = (if var "local_1847" then s100 else var "local_1845") + in local "local_1849" = (if (var "local_1847" || (s100 == var "local_1845")) then (var "local_1846" + 1) else (var "local_1846" - 1)) + in var "local_1848") then (var "local_1698" + 1) else var "local_1698") + in local "local_1850" = (if (s96 == local "local_1851" = false + in local "local_1852" = (if var "local_1851" then s4 else s1) + in local "local_1853" = (if (var "local_1851" || (s4 == s1)) then 2 else 0) + in local "local_1854" = (var "local_1853" == 0) + in local "local_1855" = (if var "local_1854" then s8 else var "local_1852") + in local "local_1856" = (if (var "local_1854" || (s8 == var "local_1852")) then (var "local_1853" + 1) else (var "local_1853" - 1)) + in local "local_1857" = (var "local_1856" == 0) + in local "local_1858" = (if var "local_1857" then s12 else var "local_1855") + in local "local_1859" = (if (var "local_1857" || (s12 == var "local_1855")) then (var "local_1856" + 1) else (var "local_1856" - 1)) + in local "local_1860" = (var "local_1859" == 0) + in local "local_1861" = (if var "local_1860" then s16 else var "local_1858") + in local "local_1862" = (if (var "local_1860" || (s16 == var "local_1858")) then (var "local_1859" + 1) else (var "local_1859" - 1)) + in local "local_1863" = (var "local_1862" == 0) + in local "local_1864" = (if var "local_1863" then s20 else var "local_1861") + in local "local_1865" = (if (var "local_1863" || (s20 == var "local_1861")) then (var "local_1862" + 1) else (var "local_1862" - 1)) + in local "local_1866" = (var "local_1865" == 0) + in local "local_1867" = (if var "local_1866" then s24 else var "local_1864") + in local "local_1868" = (if (var "local_1866" || (s24 == var "local_1864")) then (var "local_1865" + 1) else (var "local_1865" - 1)) + in local "local_1869" = (var "local_1868" == 0) + in local "local_1870" = (if var "local_1869" then s28 else var "local_1867") + in local "local_1871" = (if (var "local_1869" || (s28 == var "local_1867")) then (var "local_1868" + 1) else (var "local_1868" - 1)) + in local "local_1872" = (var "local_1871" == 0) + in local "local_1873" = (if var "local_1872" then s32 else var "local_1870") + in local "local_1874" = (if (var "local_1872" || (s32 == var "local_1870")) then (var "local_1871" + 1) else (var "local_1871" - 1)) + in local "local_1875" = (var "local_1874" == 0) + in local "local_1876" = (if var "local_1875" then s36 else var "local_1873") + in local "local_1877" = (if (var "local_1875" || (s36 == var "local_1873")) then (var "local_1874" + 1) else (var "local_1874" - 1)) + in local "local_1878" = (var "local_1877" == 0) + in local "local_1879" = (if var "local_1878" then s40 else var "local_1876") + in local "local_1880" = (if (var "local_1878" || (s40 == var "local_1876")) then (var "local_1877" + 1) else (var "local_1877" - 1)) + in local "local_1881" = (var "local_1880" == 0) + in local "local_1882" = (if var "local_1881" then s44 else var "local_1879") + in local "local_1883" = (if (var "local_1881" || (s44 == var "local_1879")) then (var "local_1880" + 1) else (var "local_1880" - 1)) + in local "local_1884" = (var "local_1883" == 0) + in local "local_1885" = (if var "local_1884" then s48 else var "local_1882") + in local "local_1886" = (if (var "local_1884" || (s48 == var "local_1882")) then (var "local_1883" + 1) else (var "local_1883" - 1)) + in local "local_1887" = (var "local_1886" == 0) + in local "local_1888" = (if var "local_1887" then s52 else var "local_1885") + in local "local_1889" = (if (var "local_1887" || (s52 == var "local_1885")) then (var "local_1886" + 1) else (var "local_1886" - 1)) + in local "local_1890" = (var "local_1889" == 0) + in local "local_1891" = (if var "local_1890" then s56 else var "local_1888") + in local "local_1892" = (if (var "local_1890" || (s56 == var "local_1888")) then (var "local_1889" + 1) else (var "local_1889" - 1)) + in local "local_1893" = (var "local_1892" == 0) + in local "local_1894" = (if var "local_1893" then s60 else var "local_1891") + in local "local_1895" = (if (var "local_1893" || (s60 == var "local_1891")) then (var "local_1892" + 1) else (var "local_1892" - 1)) + in local "local_1896" = (var "local_1895" == 0) + in local "local_1897" = (if var "local_1896" then s64 else var "local_1894") + in local "local_1898" = (if (var "local_1896" || (s64 == var "local_1894")) then (var "local_1895" + 1) else (var "local_1895" - 1)) + in local "local_1899" = (var "local_1898" == 0) + in local "local_1900" = (if var "local_1899" then s68 else var "local_1897") + in local "local_1901" = (if (var "local_1899" || (s68 == var "local_1897")) then (var "local_1898" + 1) else (var "local_1898" - 1)) + in local "local_1902" = (var "local_1901" == 0) + in local "local_1903" = (if var "local_1902" then s72 else var "local_1900") + in local "local_1904" = (if (var "local_1902" || (s72 == var "local_1900")) then (var "local_1901" + 1) else (var "local_1901" - 1)) + in local "local_1905" = (var "local_1904" == 0) + in local "local_1906" = (if var "local_1905" then s76 else var "local_1903") + in local "local_1907" = (if (var "local_1905" || (s76 == var "local_1903")) then (var "local_1904" + 1) else (var "local_1904" - 1)) + in local "local_1908" = (var "local_1907" == 0) + in local "local_1909" = (if var "local_1908" then s80 else var "local_1906") + in local "local_1910" = (if (var "local_1908" || (s80 == var "local_1906")) then (var "local_1907" + 1) else (var "local_1907" - 1)) + in local "local_1911" = (var "local_1910" == 0) + in local "local_1912" = (if var "local_1911" then s84 else var "local_1909") + in local "local_1913" = (if (var "local_1911" || (s84 == var "local_1909")) then (var "local_1910" + 1) else (var "local_1910" - 1)) + in local "local_1914" = (var "local_1913" == 0) + in local "local_1915" = (if var "local_1914" then s88 else var "local_1912") + in local "local_1916" = (if (var "local_1914" || (s88 == var "local_1912")) then (var "local_1913" + 1) else (var "local_1913" - 1)) + in local "local_1917" = (var "local_1916" == 0) + in local "local_1918" = (if var "local_1917" then s92 else var "local_1915") + in local "local_1919" = (if (var "local_1917" || (s92 == var "local_1915")) then (var "local_1916" + 1) else (var "local_1916" - 1)) + in local "local_1920" = (var "local_1919" == 0) + in local "local_1921" = (if var "local_1920" then s96 else var "local_1918") + in local "local_1922" = (if (var "local_1920" || (s96 == var "local_1918")) then (var "local_1919" + 1) else (var "local_1919" - 1)) + in local "local_1923" = (var "local_1922" == 0) + in local "local_1924" = (if var "local_1923" then s100 else var "local_1921") + in local "local_1925" = (if (var "local_1923" || (s100 == var "local_1921")) then (var "local_1922" + 1) else (var "local_1922" - 1)) + in var "local_1924") then (var "local_1774" + 1) else var "local_1774") + in local "local_1926" = (if (s100 == local "local_1927" = false + in local "local_1928" = (if var "local_1927" then s4 else s1) + in local "local_1929" = (if (var "local_1927" || (s4 == s1)) then 2 else 0) + in local "local_1930" = (var "local_1929" == 0) + in local "local_1931" = (if var "local_1930" then s8 else var "local_1928") + in local "local_1932" = (if (var "local_1930" || (s8 == var "local_1928")) then (var "local_1929" + 1) else (var "local_1929" - 1)) + in local "local_1933" = (var "local_1932" == 0) + in local "local_1934" = (if var "local_1933" then s12 else var "local_1931") + in local "local_1935" = (if (var "local_1933" || (s12 == var "local_1931")) then (var "local_1932" + 1) else (var "local_1932" - 1)) + in local "local_1936" = (var "local_1935" == 0) + in local "local_1937" = (if var "local_1936" then s16 else var "local_1934") + in local "local_1938" = (if (var "local_1936" || (s16 == var "local_1934")) then (var "local_1935" + 1) else (var "local_1935" - 1)) + in local "local_1939" = (var "local_1938" == 0) + in local "local_1940" = (if var "local_1939" then s20 else var "local_1937") + in local "local_1941" = (if (var "local_1939" || (s20 == var "local_1937")) then (var "local_1938" + 1) else (var "local_1938" - 1)) + in local "local_1942" = (var "local_1941" == 0) + in local "local_1943" = (if var "local_1942" then s24 else var "local_1940") + in local "local_1944" = (if (var "local_1942" || (s24 == var "local_1940")) then (var "local_1941" + 1) else (var "local_1941" - 1)) + in local "local_1945" = (var "local_1944" == 0) + in local "local_1946" = (if var "local_1945" then s28 else var "local_1943") + in local "local_1947" = (if (var "local_1945" || (s28 == var "local_1943")) then (var "local_1944" + 1) else (var "local_1944" - 1)) + in local "local_1948" = (var "local_1947" == 0) + in local "local_1949" = (if var "local_1948" then s32 else var "local_1946") + in local "local_1950" = (if (var "local_1948" || (s32 == var "local_1946")) then (var "local_1947" + 1) else (var "local_1947" - 1)) + in local "local_1951" = (var "local_1950" == 0) + in local "local_1952" = (if var "local_1951" then s36 else var "local_1949") + in local "local_1953" = (if (var "local_1951" || (s36 == var "local_1949")) then (var "local_1950" + 1) else (var "local_1950" - 1)) + in local "local_1954" = (var "local_1953" == 0) + in local "local_1955" = (if var "local_1954" then s40 else var "local_1952") + in local "local_1956" = (if (var "local_1954" || (s40 == var "local_1952")) then (var "local_1953" + 1) else (var "local_1953" - 1)) + in local "local_1957" = (var "local_1956" == 0) + in local "local_1958" = (if var "local_1957" then s44 else var "local_1955") + in local "local_1959" = (if (var "local_1957" || (s44 == var "local_1955")) then (var "local_1956" + 1) else (var "local_1956" - 1)) + in local "local_1960" = (var "local_1959" == 0) + in local "local_1961" = (if var "local_1960" then s48 else var "local_1958") + in local "local_1962" = (if (var "local_1960" || (s48 == var "local_1958")) then (var "local_1959" + 1) else (var "local_1959" - 1)) + in local "local_1963" = (var "local_1962" == 0) + in local "local_1964" = (if var "local_1963" then s52 else var "local_1961") + in local "local_1965" = (if (var "local_1963" || (s52 == var "local_1961")) then (var "local_1962" + 1) else (var "local_1962" - 1)) + in local "local_1966" = (var "local_1965" == 0) + in local "local_1967" = (if var "local_1966" then s56 else var "local_1964") + in local "local_1968" = (if (var "local_1966" || (s56 == var "local_1964")) then (var "local_1965" + 1) else (var "local_1965" - 1)) + in local "local_1969" = (var "local_1968" == 0) + in local "local_1970" = (if var "local_1969" then s60 else var "local_1967") + in local "local_1971" = (if (var "local_1969" || (s60 == var "local_1967")) then (var "local_1968" + 1) else (var "local_1968" - 1)) + in local "local_1972" = (var "local_1971" == 0) + in local "local_1973" = (if var "local_1972" then s64 else var "local_1970") + in local "local_1974" = (if (var "local_1972" || (s64 == var "local_1970")) then (var "local_1971" + 1) else (var "local_1971" - 1)) + in local "local_1975" = (var "local_1974" == 0) + in local "local_1976" = (if var "local_1975" then s68 else var "local_1973") + in local "local_1977" = (if (var "local_1975" || (s68 == var "local_1973")) then (var "local_1974" + 1) else (var "local_1974" - 1)) + in local "local_1978" = (var "local_1977" == 0) + in local "local_1979" = (if var "local_1978" then s72 else var "local_1976") + in local "local_1980" = (if (var "local_1978" || (s72 == var "local_1976")) then (var "local_1977" + 1) else (var "local_1977" - 1)) + in local "local_1981" = (var "local_1980" == 0) + in local "local_1982" = (if var "local_1981" then s76 else var "local_1979") + in local "local_1983" = (if (var "local_1981" || (s76 == var "local_1979")) then (var "local_1980" + 1) else (var "local_1980" - 1)) + in local "local_1984" = (var "local_1983" == 0) + in local "local_1985" = (if var "local_1984" then s80 else var "local_1982") + in local "local_1986" = (if (var "local_1984" || (s80 == var "local_1982")) then (var "local_1983" + 1) else (var "local_1983" - 1)) + in local "local_1987" = (var "local_1986" == 0) + in local "local_1988" = (if var "local_1987" then s84 else var "local_1985") + in local "local_1989" = (if (var "local_1987" || (s84 == var "local_1985")) then (var "local_1986" + 1) else (var "local_1986" - 1)) + in local "local_1990" = (var "local_1989" == 0) + in local "local_1991" = (if var "local_1990" then s88 else var "local_1988") + in local "local_1992" = (if (var "local_1990" || (s88 == var "local_1988")) then (var "local_1989" + 1) else (var "local_1989" - 1)) + in local "local_1993" = (var "local_1992" == 0) + in local "local_1994" = (if var "local_1993" then s92 else var "local_1991") + in local "local_1995" = (if (var "local_1993" || (s92 == var "local_1991")) then (var "local_1992" + 1) else (var "local_1992" - 1)) + in local "local_1996" = (var "local_1995" == 0) + in local "local_1997" = (if var "local_1996" then s96 else var "local_1994") + in local "local_1998" = (if (var "local_1996" || (s96 == var "local_1994")) then (var "local_1995" + 1) else (var "local_1995" - 1)) + in local "local_1999" = (var "local_1998" == 0) + in local "local_2000" = (if var "local_1999" then s100 else var "local_1997") + in local "local_2001" = (if (var "local_1999" || (s100 == var "local_1997")) then (var "local_1998" + 1) else (var "local_1998" - 1)) + in var "local_2000") then (var "local_1850" + 1) else var "local_1850") + in var "local_1926" * 2) > 26) +*/ +/*@ + assigns \nothing; + ensures \result == (((\let local_0 = ( (queue_1[ptr_1] == (\let local_2 = false ; (\let local_3 = ( local_2 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_5 = ( (local_2 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_6 = (local_5 == 0) ; (\let local_7 = ( local_6 ? queue_8[ptr_8] : local_3) ; (\let local_9 = ( (local_6 || (queue_8[ptr_8] == local_3)) ? (local_5 + 1) : (local_5 - 1)) ; (\let local_10 = (local_9 == 0) ; (\let local_11 = ( local_10 ? queue_12[ptr_12] : local_7) ; (\let local_13 = ( (local_10 || (queue_12[ptr_12] == local_7)) ? (local_9 + 1) : (local_9 - 1)) ; (\let local_14 = (local_13 == 0) ; (\let local_15 = ( local_14 ? queue_16[ptr_16] : local_11) ; (\let local_17 = ( (local_14 || (queue_16[ptr_16] == local_11)) ? (local_13 + 1) : (local_13 - 1)) ; (\let local_18 = (local_17 == 0) ; (\let local_19 = ( local_18 ? queue_20[ptr_20] : local_15) ; (\let local_21 = ( (local_18 || (queue_20[ptr_20] == local_15)) ? (local_17 + 1) : (local_17 - 1)) ; (\let local_22 = (local_21 == 0) ; (\let local_23 = ( local_22 ? queue_24[ptr_24] : local_19) ; (\let local_25 = ( (local_22 || (queue_24[ptr_24] == local_19)) ? (local_21 + 1) : (local_21 - 1)) ; (\let local_26 = (local_25 == 0) ; (\let local_27 = ( local_26 ? queue_28[ptr_28] : local_23) ; (\let local_29 = ( (local_26 || (queue_28[ptr_28] == local_23)) ? (local_25 + 1) : (local_25 - 1)) ; (\let local_30 = (local_29 == 0) ; (\let local_31 = ( local_30 ? queue_32[ptr_32] : local_27) ; (\let local_33 = ( (local_30 || (queue_32[ptr_32] == local_27)) ? (local_29 + 1) : (local_29 - 1)) ; (\let local_34 = (local_33 == 0) ; (\let local_35 = ( local_34 ? queue_36[ptr_36] : local_31) ; (\let local_37 = ( (local_34 || (queue_36[ptr_36] == local_31)) ? (local_33 + 1) : (local_33 - 1)) ; (\let local_38 = (local_37 == 0) ; (\let local_39 = ( local_38 ? queue_40[ptr_40] : local_35) ; (\let local_41 = ( (local_38 || (queue_40[ptr_40] == local_35)) ? (local_37 + 1) : (local_37 - 1)) ; (\let local_42 = (local_41 == 0) ; (\let local_43 = ( local_42 ? queue_44[ptr_44] : local_39) ; (\let local_45 = ( (local_42 || (queue_44[ptr_44] == local_39)) ? (local_41 + 1) : (local_41 - 1)) ; (\let local_46 = (local_45 == 0) ; (\let local_47 = ( local_46 ? queue_48[ptr_48] : local_43) ; (\let local_49 = ( (local_46 || (queue_48[ptr_48] == local_43)) ? (local_45 + 1) : (local_45 - 1)) ; (\let local_50 = (local_49 == 0) ; (\let local_51 = ( local_50 ? queue_52[ptr_52] : local_47) ; (\let local_53 = ( (local_50 || (queue_52[ptr_52] == local_47)) ? (local_49 + 1) : (local_49 - 1)) ; (\let local_54 = (local_53 == 0) ; (\let local_55 = ( local_54 ? queue_56[ptr_56] : local_51) ; (\let local_57 = ( (local_54 || (queue_56[ptr_56] == local_51)) ? (local_53 + 1) : (local_53 - 1)) ; (\let local_58 = (local_57 == 0) ; (\let local_59 = ( local_58 ? queue_60[ptr_60] : local_55) ; (\let local_61 = ( (local_58 || (queue_60[ptr_60] == local_55)) ? (local_57 + 1) : (local_57 - 1)) ; (\let local_62 = (local_61 == 0) ; (\let local_63 = ( local_62 ? queue_64[ptr_64] : local_59) ; (\let local_65 = ( (local_62 || (queue_64[ptr_64] == local_59)) ? (local_61 + 1) : (local_61 - 1)) ; (\let local_66 = (local_65 == 0) ; (\let local_67 = ( local_66 ? queue_68[ptr_68] : local_63) ; (\let local_69 = ( (local_66 || (queue_68[ptr_68] == local_63)) ? (local_65 + 1) : (local_65 - 1)) ; (\let local_70 = (local_69 == 0) ; (\let local_71 = ( local_70 ? queue_72[ptr_72] : local_67) ; (\let local_73 = ( (local_70 || (queue_72[ptr_72] == local_67)) ? (local_69 + 1) : (local_69 - 1)) ; (\let local_74 = (local_73 == 0) ; (\let local_75 = ( local_74 ? queue_76[ptr_76] : local_71) ; (\let local_77 = ( (local_74 || (queue_76[ptr_76] == local_71)) ? (local_73 + 1) : (local_73 - 1)) ; (\let local_78 = (local_77 == 0) ; (\let local_79 = ( local_78 ? queue_80[ptr_80] : local_75) ; (\let local_81 = ( (local_78 || (queue_80[ptr_80] == local_75)) ? (local_77 + 1) : (local_77 - 1)) ; (\let local_82 = (local_81 == 0) ; (\let local_83 = ( local_82 ? queue_84[ptr_84] : local_79) ; (\let local_85 = ( (local_82 || (queue_84[ptr_84] == local_79)) ? (local_81 + 1) : (local_81 - 1)) ; (\let local_86 = (local_85 == 0) ; (\let local_87 = ( local_86 ? queue_88[ptr_88] : local_83) ; (\let local_89 = ( (local_86 || (queue_88[ptr_88] == local_83)) ? (local_85 + 1) : (local_85 - 1)) ; (\let local_90 = (local_89 == 0) ; (\let local_91 = ( local_90 ? queue_92[ptr_92] : local_87) ; (\let local_93 = ( (local_90 || (queue_92[ptr_92] == local_87)) ? (local_89 + 1) : (local_89 - 1)) ; (\let local_94 = (local_93 == 0) ; (\let local_95 = ( local_94 ? queue_96[ptr_96] : local_91) ; (\let local_97 = ( (local_94 || (queue_96[ptr_96] == local_91)) ? (local_93 + 1) : (local_93 - 1)) ; (\let local_98 = (local_97 == 0) ; (\let local_99 = ( local_98 ? queue_100[ptr_100] : local_95) ; (\let local_101 = ( (local_98 || (queue_100[ptr_100] == local_95)) ? (local_97 + 1) : (local_97 - 1)) ; local_99 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? 1 : 0) ; (\let local_102 = ( (queue_4[ptr_4] == (\let local_103 = false ; (\let local_104 = ( local_103 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_105 = ( (local_103 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_106 = (local_105 == 0) ; (\let local_107 = ( local_106 ? queue_8[ptr_8] : local_104) ; (\let local_108 = ( (local_106 || (queue_8[ptr_8] == local_104)) ? (local_105 + 1) : (local_105 - 1)) ; (\let local_109 = (local_108 == 0) ; (\let local_110 = ( local_109 ? queue_12[ptr_12] : local_107) ; (\let local_111 = ( (local_109 || (queue_12[ptr_12] == local_107)) ? (local_108 + 1) : (local_108 - 1)) ; (\let local_112 = (local_111 == 0) ; (\let local_113 = ( local_112 ? queue_16[ptr_16] : local_110) ; (\let local_114 = ( (local_112 || (queue_16[ptr_16] == local_110)) ? (local_111 + 1) : (local_111 - 1)) ; (\let local_115 = (local_114 == 0) ; (\let local_116 = ( local_115 ? queue_20[ptr_20] : local_113) ; (\let local_117 = ( (local_115 || (queue_20[ptr_20] == local_113)) ? (local_114 + 1) : (local_114 - 1)) ; (\let local_118 = (local_117 == 0) ; (\let local_119 = ( local_118 ? queue_24[ptr_24] : local_116) ; (\let local_120 = ( (local_118 || (queue_24[ptr_24] == local_116)) ? (local_117 + 1) : (local_117 - 1)) ; (\let local_121 = (local_120 == 0) ; (\let local_122 = ( local_121 ? queue_28[ptr_28] : local_119) ; (\let local_123 = ( (local_121 || (queue_28[ptr_28] == local_119)) ? (local_120 + 1) : (local_120 - 1)) ; (\let local_124 = (local_123 == 0) ; (\let local_125 = ( local_124 ? queue_32[ptr_32] : local_122) ; (\let local_126 = ( (local_124 || (queue_32[ptr_32] == local_122)) ? (local_123 + 1) : (local_123 - 1)) ; (\let local_127 = (local_126 == 0) ; (\let local_128 = ( local_127 ? queue_36[ptr_36] : local_125) ; (\let local_129 = ( (local_127 || (queue_36[ptr_36] == local_125)) ? (local_126 + 1) : (local_126 - 1)) ; (\let local_130 = (local_129 == 0) ; (\let local_131 = ( local_130 ? queue_40[ptr_40] : local_128) ; (\let local_132 = ( (local_130 || (queue_40[ptr_40] == local_128)) ? (local_129 + 1) : (local_129 - 1)) ; (\let local_133 = (local_132 == 0) ; (\let local_134 = ( local_133 ? queue_44[ptr_44] : local_131) ; (\let local_135 = ( (local_133 || (queue_44[ptr_44] == local_131)) ? (local_132 + 1) : (local_132 - 1)) ; (\let local_136 = (local_135 == 0) ; (\let local_137 = ( local_136 ? queue_48[ptr_48] : local_134) ; (\let local_138 = ( (local_136 || (queue_48[ptr_48] == local_134)) ? (local_135 + 1) : (local_135 - 1)) ; (\let local_139 = (local_138 == 0) ; (\let local_140 = ( local_139 ? queue_52[ptr_52] : local_137) ; (\let local_141 = ( (local_139 || (queue_52[ptr_52] == local_137)) ? (local_138 + 1) : (local_138 - 1)) ; (\let local_142 = (local_141 == 0) ; (\let local_143 = ( local_142 ? queue_56[ptr_56] : local_140) ; (\let local_144 = ( (local_142 || (queue_56[ptr_56] == local_140)) ? (local_141 + 1) : (local_141 - 1)) ; (\let local_145 = (local_144 == 0) ; (\let local_146 = ( local_145 ? queue_60[ptr_60] : local_143) ; (\let local_147 = ( (local_145 || (queue_60[ptr_60] == local_143)) ? (local_144 + 1) : (local_144 - 1)) ; (\let local_148 = (local_147 == 0) ; (\let local_149 = ( local_148 ? queue_64[ptr_64] : local_146) ; (\let local_150 = ( (local_148 || (queue_64[ptr_64] == local_146)) ? (local_147 + 1) : (local_147 - 1)) ; (\let local_151 = (local_150 == 0) ; (\let local_152 = ( local_151 ? queue_68[ptr_68] : local_149) ; (\let local_153 = ( (local_151 || (queue_68[ptr_68] == local_149)) ? (local_150 + 1) : (local_150 - 1)) ; (\let local_154 = (local_153 == 0) ; (\let local_155 = ( local_154 ? queue_72[ptr_72] : local_152) ; (\let local_156 = ( (local_154 || (queue_72[ptr_72] == local_152)) ? (local_153 + 1) : (local_153 - 1)) ; (\let local_157 = (local_156 == 0) ; (\let local_158 = ( local_157 ? queue_76[ptr_76] : local_155) ; (\let local_159 = ( (local_157 || (queue_76[ptr_76] == local_155)) ? (local_156 + 1) : (local_156 - 1)) ; (\let local_160 = (local_159 == 0) ; (\let local_161 = ( local_160 ? queue_80[ptr_80] : local_158) ; (\let local_162 = ( (local_160 || (queue_80[ptr_80] == local_158)) ? (local_159 + 1) : (local_159 - 1)) ; (\let local_163 = (local_162 == 0) ; (\let local_164 = ( local_163 ? queue_84[ptr_84] : local_161) ; (\let local_165 = ( (local_163 || (queue_84[ptr_84] == local_161)) ? (local_162 + 1) : (local_162 - 1)) ; (\let local_166 = (local_165 == 0) ; (\let local_167 = ( local_166 ? queue_88[ptr_88] : local_164) ; (\let local_168 = ( (local_166 || (queue_88[ptr_88] == local_164)) ? (local_165 + 1) : (local_165 - 1)) ; (\let local_169 = (local_168 == 0) ; (\let local_170 = ( local_169 ? queue_92[ptr_92] : local_167) ; (\let local_171 = ( (local_169 || (queue_92[ptr_92] == local_167)) ? (local_168 + 1) : (local_168 - 1)) ; (\let local_172 = (local_171 == 0) ; (\let local_173 = ( local_172 ? queue_96[ptr_96] : local_170) ; (\let local_174 = ( (local_172 || (queue_96[ptr_96] == local_170)) ? (local_171 + 1) : (local_171 - 1)) ; (\let local_175 = (local_174 == 0) ; (\let local_176 = ( local_175 ? queue_100[ptr_100] : local_173) ; (\let local_177 = ( (local_175 || (queue_100[ptr_100] == local_173)) ? (local_174 + 1) : (local_174 - 1)) ; local_176 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_0 + 1) : local_0) ; (\let local_178 = ( (queue_8[ptr_8] == (\let local_179 = false ; (\let local_180 = ( local_179 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_181 = ( (local_179 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_182 = (local_181 == 0) ; (\let local_183 = ( local_182 ? queue_8[ptr_8] : local_180) ; (\let local_184 = ( (local_182 || (queue_8[ptr_8] == local_180)) ? (local_181 + 1) : (local_181 - 1)) ; (\let local_185 = (local_184 == 0) ; (\let local_186 = ( local_185 ? queue_12[ptr_12] : local_183) ; (\let local_187 = ( (local_185 || (queue_12[ptr_12] == local_183)) ? (local_184 + 1) : (local_184 - 1)) ; (\let local_188 = (local_187 == 0) ; (\let local_189 = ( local_188 ? queue_16[ptr_16] : local_186) ; (\let local_190 = ( (local_188 || (queue_16[ptr_16] == local_186)) ? (local_187 + 1) : (local_187 - 1)) ; (\let local_191 = (local_190 == 0) ; (\let local_192 = ( local_191 ? queue_20[ptr_20] : local_189) ; (\let local_193 = ( (local_191 || (queue_20[ptr_20] == local_189)) ? (local_190 + 1) : (local_190 - 1)) ; (\let local_194 = (local_193 == 0) ; (\let local_195 = ( local_194 ? queue_24[ptr_24] : local_192) ; (\let local_196 = ( (local_194 || (queue_24[ptr_24] == local_192)) ? (local_193 + 1) : (local_193 - 1)) ; (\let local_197 = (local_196 == 0) ; (\let local_198 = ( local_197 ? queue_28[ptr_28] : local_195) ; (\let local_199 = ( (local_197 || (queue_28[ptr_28] == local_195)) ? (local_196 + 1) : (local_196 - 1)) ; (\let local_200 = (local_199 == 0) ; (\let local_201 = ( local_200 ? queue_32[ptr_32] : local_198) ; (\let local_202 = ( (local_200 || (queue_32[ptr_32] == local_198)) ? (local_199 + 1) : (local_199 - 1)) ; (\let local_203 = (local_202 == 0) ; (\let local_204 = ( local_203 ? queue_36[ptr_36] : local_201) ; (\let local_205 = ( (local_203 || (queue_36[ptr_36] == local_201)) ? (local_202 + 1) : (local_202 - 1)) ; (\let local_206 = (local_205 == 0) ; (\let local_207 = ( local_206 ? queue_40[ptr_40] : local_204) ; (\let local_208 = ( (local_206 || (queue_40[ptr_40] == local_204)) ? (local_205 + 1) : (local_205 - 1)) ; (\let local_209 = (local_208 == 0) ; (\let local_210 = ( local_209 ? queue_44[ptr_44] : local_207) ; (\let local_211 = ( (local_209 || (queue_44[ptr_44] == local_207)) ? (local_208 + 1) : (local_208 - 1)) ; (\let local_212 = (local_211 == 0) ; (\let local_213 = ( local_212 ? queue_48[ptr_48] : local_210) ; (\let local_214 = ( (local_212 || (queue_48[ptr_48] == local_210)) ? (local_211 + 1) : (local_211 - 1)) ; (\let local_215 = (local_214 == 0) ; (\let local_216 = ( local_215 ? queue_52[ptr_52] : local_213) ; (\let local_217 = ( (local_215 || (queue_52[ptr_52] == local_213)) ? (local_214 + 1) : (local_214 - 1)) ; (\let local_218 = (local_217 == 0) ; (\let local_219 = ( local_218 ? queue_56[ptr_56] : local_216) ; (\let local_220 = ( (local_218 || (queue_56[ptr_56] == local_216)) ? (local_217 + 1) : (local_217 - 1)) ; (\let local_221 = (local_220 == 0) ; (\let local_222 = ( local_221 ? queue_60[ptr_60] : local_219) ; (\let local_223 = ( (local_221 || (queue_60[ptr_60] == local_219)) ? (local_220 + 1) : (local_220 - 1)) ; (\let local_224 = (local_223 == 0) ; (\let local_225 = ( local_224 ? queue_64[ptr_64] : local_222) ; (\let local_226 = ( (local_224 || (queue_64[ptr_64] == local_222)) ? (local_223 + 1) : (local_223 - 1)) ; (\let local_227 = (local_226 == 0) ; (\let local_228 = ( local_227 ? queue_68[ptr_68] : local_225) ; (\let local_229 = ( (local_227 || (queue_68[ptr_68] == local_225)) ? (local_226 + 1) : (local_226 - 1)) ; (\let local_230 = (local_229 == 0) ; (\let local_231 = ( local_230 ? queue_72[ptr_72] : local_228) ; (\let local_232 = ( (local_230 || (queue_72[ptr_72] == local_228)) ? (local_229 + 1) : (local_229 - 1)) ; (\let local_233 = (local_232 == 0) ; (\let local_234 = ( local_233 ? queue_76[ptr_76] : local_231) ; (\let local_235 = ( (local_233 || (queue_76[ptr_76] == local_231)) ? (local_232 + 1) : (local_232 - 1)) ; (\let local_236 = (local_235 == 0) ; (\let local_237 = ( local_236 ? queue_80[ptr_80] : local_234) ; (\let local_238 = ( (local_236 || (queue_80[ptr_80] == local_234)) ? (local_235 + 1) : (local_235 - 1)) ; (\let local_239 = (local_238 == 0) ; (\let local_240 = ( local_239 ? queue_84[ptr_84] : local_237) ; (\let local_241 = ( (local_239 || (queue_84[ptr_84] == local_237)) ? (local_238 + 1) : (local_238 - 1)) ; (\let local_242 = (local_241 == 0) ; (\let local_243 = ( local_242 ? queue_88[ptr_88] : local_240) ; (\let local_244 = ( (local_242 || (queue_88[ptr_88] == local_240)) ? (local_241 + 1) : (local_241 - 1)) ; (\let local_245 = (local_244 == 0) ; (\let local_246 = ( local_245 ? queue_92[ptr_92] : local_243) ; (\let local_247 = ( (local_245 || (queue_92[ptr_92] == local_243)) ? (local_244 + 1) : (local_244 - 1)) ; (\let local_248 = (local_247 == 0) ; (\let local_249 = ( local_248 ? queue_96[ptr_96] : local_246) ; (\let local_250 = ( (local_248 || (queue_96[ptr_96] == local_246)) ? (local_247 + 1) : (local_247 - 1)) ; (\let local_251 = (local_250 == 0) ; (\let local_252 = ( local_251 ? queue_100[ptr_100] : local_249) ; (\let local_253 = ( (local_251 || (queue_100[ptr_100] == local_249)) ? (local_250 + 1) : (local_250 - 1)) ; local_252 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_102 + 1) : local_102) ; (\let local_254 = ( (queue_12[ptr_12] == (\let local_255 = false ; (\let local_256 = ( local_255 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_257 = ( (local_255 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_258 = (local_257 == 0) ; (\let local_259 = ( local_258 ? queue_8[ptr_8] : local_256) ; (\let local_260 = ( (local_258 || (queue_8[ptr_8] == local_256)) ? (local_257 + 1) : (local_257 - 1)) ; (\let local_261 = (local_260 == 0) ; (\let local_262 = ( local_261 ? queue_12[ptr_12] : local_259) ; (\let local_263 = ( (local_261 || (queue_12[ptr_12] == local_259)) ? (local_260 + 1) : (local_260 - 1)) ; (\let local_264 = (local_263 == 0) ; (\let local_265 = ( local_264 ? queue_16[ptr_16] : local_262) ; (\let local_266 = ( (local_264 || (queue_16[ptr_16] == local_262)) ? (local_263 + 1) : (local_263 - 1)) ; (\let local_267 = (local_266 == 0) ; (\let local_268 = ( local_267 ? queue_20[ptr_20] : local_265) ; (\let local_269 = ( (local_267 || (queue_20[ptr_20] == local_265)) ? (local_266 + 1) : (local_266 - 1)) ; (\let local_270 = (local_269 == 0) ; (\let local_271 = ( local_270 ? queue_24[ptr_24] : local_268) ; (\let local_272 = ( (local_270 || (queue_24[ptr_24] == local_268)) ? (local_269 + 1) : (local_269 - 1)) ; (\let local_273 = (local_272 == 0) ; (\let local_274 = ( local_273 ? queue_28[ptr_28] : local_271) ; (\let local_275 = ( (local_273 || (queue_28[ptr_28] == local_271)) ? (local_272 + 1) : (local_272 - 1)) ; (\let local_276 = (local_275 == 0) ; (\let local_277 = ( local_276 ? queue_32[ptr_32] : local_274) ; (\let local_278 = ( (local_276 || (queue_32[ptr_32] == local_274)) ? (local_275 + 1) : (local_275 - 1)) ; (\let local_279 = (local_278 == 0) ; (\let local_280 = ( local_279 ? queue_36[ptr_36] : local_277) ; (\let local_281 = ( (local_279 || (queue_36[ptr_36] == local_277)) ? (local_278 + 1) : (local_278 - 1)) ; (\let local_282 = (local_281 == 0) ; (\let local_283 = ( local_282 ? queue_40[ptr_40] : local_280) ; (\let local_284 = ( (local_282 || (queue_40[ptr_40] == local_280)) ? (local_281 + 1) : (local_281 - 1)) ; (\let local_285 = (local_284 == 0) ; (\let local_286 = ( local_285 ? queue_44[ptr_44] : local_283) ; (\let local_287 = ( (local_285 || (queue_44[ptr_44] == local_283)) ? (local_284 + 1) : (local_284 - 1)) ; (\let local_288 = (local_287 == 0) ; (\let local_289 = ( local_288 ? queue_48[ptr_48] : local_286) ; (\let local_290 = ( (local_288 || (queue_48[ptr_48] == local_286)) ? (local_287 + 1) : (local_287 - 1)) ; (\let local_291 = (local_290 == 0) ; (\let local_292 = ( local_291 ? queue_52[ptr_52] : local_289) ; (\let local_293 = ( (local_291 || (queue_52[ptr_52] == local_289)) ? (local_290 + 1) : (local_290 - 1)) ; (\let local_294 = (local_293 == 0) ; (\let local_295 = ( local_294 ? queue_56[ptr_56] : local_292) ; (\let local_296 = ( (local_294 || (queue_56[ptr_56] == local_292)) ? (local_293 + 1) : (local_293 - 1)) ; (\let local_297 = (local_296 == 0) ; (\let local_298 = ( local_297 ? queue_60[ptr_60] : local_295) ; (\let local_299 = ( (local_297 || (queue_60[ptr_60] == local_295)) ? (local_296 + 1) : (local_296 - 1)) ; (\let local_300 = (local_299 == 0) ; (\let local_301 = ( local_300 ? queue_64[ptr_64] : local_298) ; (\let local_302 = ( (local_300 || (queue_64[ptr_64] == local_298)) ? (local_299 + 1) : (local_299 - 1)) ; (\let local_303 = (local_302 == 0) ; (\let local_304 = ( local_303 ? queue_68[ptr_68] : local_301) ; (\let local_305 = ( (local_303 || (queue_68[ptr_68] == local_301)) ? (local_302 + 1) : (local_302 - 1)) ; (\let local_306 = (local_305 == 0) ; (\let local_307 = ( local_306 ? queue_72[ptr_72] : local_304) ; (\let local_308 = ( (local_306 || (queue_72[ptr_72] == local_304)) ? (local_305 + 1) : (local_305 - 1)) ; (\let local_309 = (local_308 == 0) ; (\let local_310 = ( local_309 ? queue_76[ptr_76] : local_307) ; (\let local_311 = ( (local_309 || (queue_76[ptr_76] == local_307)) ? (local_308 + 1) : (local_308 - 1)) ; (\let local_312 = (local_311 == 0) ; (\let local_313 = ( local_312 ? queue_80[ptr_80] : local_310) ; (\let local_314 = ( (local_312 || (queue_80[ptr_80] == local_310)) ? (local_311 + 1) : (local_311 - 1)) ; (\let local_315 = (local_314 == 0) ; (\let local_316 = ( local_315 ? queue_84[ptr_84] : local_313) ; (\let local_317 = ( (local_315 || (queue_84[ptr_84] == local_313)) ? (local_314 + 1) : (local_314 - 1)) ; (\let local_318 = (local_317 == 0) ; (\let local_319 = ( local_318 ? queue_88[ptr_88] : local_316) ; (\let local_320 = ( (local_318 || (queue_88[ptr_88] == local_316)) ? (local_317 + 1) : (local_317 - 1)) ; (\let local_321 = (local_320 == 0) ; (\let local_322 = ( local_321 ? queue_92[ptr_92] : local_319) ; (\let local_323 = ( (local_321 || (queue_92[ptr_92] == local_319)) ? (local_320 + 1) : (local_320 - 1)) ; (\let local_324 = (local_323 == 0) ; (\let local_325 = ( local_324 ? queue_96[ptr_96] : local_322) ; (\let local_326 = ( (local_324 || (queue_96[ptr_96] == local_322)) ? (local_323 + 1) : (local_323 - 1)) ; (\let local_327 = (local_326 == 0) ; (\let local_328 = ( local_327 ? queue_100[ptr_100] : local_325) ; (\let local_329 = ( (local_327 || (queue_100[ptr_100] == local_325)) ? (local_326 + 1) : (local_326 - 1)) ; local_328 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_178 + 1) : local_178) ; (\let local_330 = ( (queue_16[ptr_16] == (\let local_331 = false ; (\let local_332 = ( local_331 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_333 = ( (local_331 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_334 = (local_333 == 0) ; (\let local_335 = ( local_334 ? queue_8[ptr_8] : local_332) ; (\let local_336 = ( (local_334 || (queue_8[ptr_8] == local_332)) ? (local_333 + 1) : (local_333 - 1)) ; (\let local_337 = (local_336 == 0) ; (\let local_338 = ( local_337 ? queue_12[ptr_12] : local_335) ; (\let local_339 = ( (local_337 || (queue_12[ptr_12] == local_335)) ? (local_336 + 1) : (local_336 - 1)) ; (\let local_340 = (local_339 == 0) ; (\let local_341 = ( local_340 ? queue_16[ptr_16] : local_338) ; (\let local_342 = ( (local_340 || (queue_16[ptr_16] == local_338)) ? (local_339 + 1) : (local_339 - 1)) ; (\let local_343 = (local_342 == 0) ; (\let local_344 = ( local_343 ? queue_20[ptr_20] : local_341) ; (\let local_345 = ( (local_343 || (queue_20[ptr_20] == local_341)) ? (local_342 + 1) : (local_342 - 1)) ; (\let local_346 = (local_345 == 0) ; (\let local_347 = ( local_346 ? queue_24[ptr_24] : local_344) ; (\let local_348 = ( (local_346 || (queue_24[ptr_24] == local_344)) ? (local_345 + 1) : (local_345 - 1)) ; (\let local_349 = (local_348 == 0) ; (\let local_350 = ( local_349 ? queue_28[ptr_28] : local_347) ; (\let local_351 = ( (local_349 || (queue_28[ptr_28] == local_347)) ? (local_348 + 1) : (local_348 - 1)) ; (\let local_352 = (local_351 == 0) ; (\let local_353 = ( local_352 ? queue_32[ptr_32] : local_350) ; (\let local_354 = ( (local_352 || (queue_32[ptr_32] == local_350)) ? (local_351 + 1) : (local_351 - 1)) ; (\let local_355 = (local_354 == 0) ; (\let local_356 = ( local_355 ? queue_36[ptr_36] : local_353) ; (\let local_357 = ( (local_355 || (queue_36[ptr_36] == local_353)) ? (local_354 + 1) : (local_354 - 1)) ; (\let local_358 = (local_357 == 0) ; (\let local_359 = ( local_358 ? queue_40[ptr_40] : local_356) ; (\let local_360 = ( (local_358 || (queue_40[ptr_40] == local_356)) ? (local_357 + 1) : (local_357 - 1)) ; (\let local_361 = (local_360 == 0) ; (\let local_362 = ( local_361 ? queue_44[ptr_44] : local_359) ; (\let local_363 = ( (local_361 || (queue_44[ptr_44] == local_359)) ? (local_360 + 1) : (local_360 - 1)) ; (\let local_364 = (local_363 == 0) ; (\let local_365 = ( local_364 ? queue_48[ptr_48] : local_362) ; (\let local_366 = ( (local_364 || (queue_48[ptr_48] == local_362)) ? (local_363 + 1) : (local_363 - 1)) ; (\let local_367 = (local_366 == 0) ; (\let local_368 = ( local_367 ? queue_52[ptr_52] : local_365) ; (\let local_369 = ( (local_367 || (queue_52[ptr_52] == local_365)) ? (local_366 + 1) : (local_366 - 1)) ; (\let local_370 = (local_369 == 0) ; (\let local_371 = ( local_370 ? queue_56[ptr_56] : local_368) ; (\let local_372 = ( (local_370 || (queue_56[ptr_56] == local_368)) ? (local_369 + 1) : (local_369 - 1)) ; (\let local_373 = (local_372 == 0) ; (\let local_374 = ( local_373 ? queue_60[ptr_60] : local_371) ; (\let local_375 = ( (local_373 || (queue_60[ptr_60] == local_371)) ? (local_372 + 1) : (local_372 - 1)) ; (\let local_376 = (local_375 == 0) ; (\let local_377 = ( local_376 ? queue_64[ptr_64] : local_374) ; (\let local_378 = ( (local_376 || (queue_64[ptr_64] == local_374)) ? (local_375 + 1) : (local_375 - 1)) ; (\let local_379 = (local_378 == 0) ; (\let local_380 = ( local_379 ? queue_68[ptr_68] : local_377) ; (\let local_381 = ( (local_379 || (queue_68[ptr_68] == local_377)) ? (local_378 + 1) : (local_378 - 1)) ; (\let local_382 = (local_381 == 0) ; (\let local_383 = ( local_382 ? queue_72[ptr_72] : local_380) ; (\let local_384 = ( (local_382 || (queue_72[ptr_72] == local_380)) ? (local_381 + 1) : (local_381 - 1)) ; (\let local_385 = (local_384 == 0) ; (\let local_386 = ( local_385 ? queue_76[ptr_76] : local_383) ; (\let local_387 = ( (local_385 || (queue_76[ptr_76] == local_383)) ? (local_384 + 1) : (local_384 - 1)) ; (\let local_388 = (local_387 == 0) ; (\let local_389 = ( local_388 ? queue_80[ptr_80] : local_386) ; (\let local_390 = ( (local_388 || (queue_80[ptr_80] == local_386)) ? (local_387 + 1) : (local_387 - 1)) ; (\let local_391 = (local_390 == 0) ; (\let local_392 = ( local_391 ? queue_84[ptr_84] : local_389) ; (\let local_393 = ( (local_391 || (queue_84[ptr_84] == local_389)) ? (local_390 + 1) : (local_390 - 1)) ; (\let local_394 = (local_393 == 0) ; (\let local_395 = ( local_394 ? queue_88[ptr_88] : local_392) ; (\let local_396 = ( (local_394 || (queue_88[ptr_88] == local_392)) ? (local_393 + 1) : (local_393 - 1)) ; (\let local_397 = (local_396 == 0) ; (\let local_398 = ( local_397 ? queue_92[ptr_92] : local_395) ; (\let local_399 = ( (local_397 || (queue_92[ptr_92] == local_395)) ? (local_396 + 1) : (local_396 - 1)) ; (\let local_400 = (local_399 == 0) ; (\let local_401 = ( local_400 ? queue_96[ptr_96] : local_398) ; (\let local_402 = ( (local_400 || (queue_96[ptr_96] == local_398)) ? (local_399 + 1) : (local_399 - 1)) ; (\let local_403 = (local_402 == 0) ; (\let local_404 = ( local_403 ? queue_100[ptr_100] : local_401) ; (\let local_405 = ( (local_403 || (queue_100[ptr_100] == local_401)) ? (local_402 + 1) : (local_402 - 1)) ; local_404 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_254 + 1) : local_254) ; (\let local_406 = ( (queue_20[ptr_20] == (\let local_407 = false ; (\let local_408 = ( local_407 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_409 = ( (local_407 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_410 = (local_409 == 0) ; (\let local_411 = ( local_410 ? queue_8[ptr_8] : local_408) ; (\let local_412 = ( (local_410 || (queue_8[ptr_8] == local_408)) ? (local_409 + 1) : (local_409 - 1)) ; (\let local_413 = (local_412 == 0) ; (\let local_414 = ( local_413 ? queue_12[ptr_12] : local_411) ; (\let local_415 = ( (local_413 || (queue_12[ptr_12] == local_411)) ? (local_412 + 1) : (local_412 - 1)) ; (\let local_416 = (local_415 == 0) ; (\let local_417 = ( local_416 ? queue_16[ptr_16] : local_414) ; (\let local_418 = ( (local_416 || (queue_16[ptr_16] == local_414)) ? (local_415 + 1) : (local_415 - 1)) ; (\let local_419 = (local_418 == 0) ; (\let local_420 = ( local_419 ? queue_20[ptr_20] : local_417) ; (\let local_421 = ( (local_419 || (queue_20[ptr_20] == local_417)) ? (local_418 + 1) : (local_418 - 1)) ; (\let local_422 = (local_421 == 0) ; (\let local_423 = ( local_422 ? queue_24[ptr_24] : local_420) ; (\let local_424 = ( (local_422 || (queue_24[ptr_24] == local_420)) ? (local_421 + 1) : (local_421 - 1)) ; (\let local_425 = (local_424 == 0) ; (\let local_426 = ( local_425 ? queue_28[ptr_28] : local_423) ; (\let local_427 = ( (local_425 || (queue_28[ptr_28] == local_423)) ? (local_424 + 1) : (local_424 - 1)) ; (\let local_428 = (local_427 == 0) ; (\let local_429 = ( local_428 ? queue_32[ptr_32] : local_426) ; (\let local_430 = ( (local_428 || (queue_32[ptr_32] == local_426)) ? (local_427 + 1) : (local_427 - 1)) ; (\let local_431 = (local_430 == 0) ; (\let local_432 = ( local_431 ? queue_36[ptr_36] : local_429) ; (\let local_433 = ( (local_431 || (queue_36[ptr_36] == local_429)) ? (local_430 + 1) : (local_430 - 1)) ; (\let local_434 = (local_433 == 0) ; (\let local_435 = ( local_434 ? queue_40[ptr_40] : local_432) ; (\let local_436 = ( (local_434 || (queue_40[ptr_40] == local_432)) ? (local_433 + 1) : (local_433 - 1)) ; (\let local_437 = (local_436 == 0) ; (\let local_438 = ( local_437 ? queue_44[ptr_44] : local_435) ; (\let local_439 = ( (local_437 || (queue_44[ptr_44] == local_435)) ? (local_436 + 1) : (local_436 - 1)) ; (\let local_440 = (local_439 == 0) ; (\let local_441 = ( local_440 ? queue_48[ptr_48] : local_438) ; (\let local_442 = ( (local_440 || (queue_48[ptr_48] == local_438)) ? (local_439 + 1) : (local_439 - 1)) ; (\let local_443 = (local_442 == 0) ; (\let local_444 = ( local_443 ? queue_52[ptr_52] : local_441) ; (\let local_445 = ( (local_443 || (queue_52[ptr_52] == local_441)) ? (local_442 + 1) : (local_442 - 1)) ; (\let local_446 = (local_445 == 0) ; (\let local_447 = ( local_446 ? queue_56[ptr_56] : local_444) ; (\let local_448 = ( (local_446 || (queue_56[ptr_56] == local_444)) ? (local_445 + 1) : (local_445 - 1)) ; (\let local_449 = (local_448 == 0) ; (\let local_450 = ( local_449 ? queue_60[ptr_60] : local_447) ; (\let local_451 = ( (local_449 || (queue_60[ptr_60] == local_447)) ? (local_448 + 1) : (local_448 - 1)) ; (\let local_452 = (local_451 == 0) ; (\let local_453 = ( local_452 ? queue_64[ptr_64] : local_450) ; (\let local_454 = ( (local_452 || (queue_64[ptr_64] == local_450)) ? (local_451 + 1) : (local_451 - 1)) ; (\let local_455 = (local_454 == 0) ; (\let local_456 = ( local_455 ? queue_68[ptr_68] : local_453) ; (\let local_457 = ( (local_455 || (queue_68[ptr_68] == local_453)) ? (local_454 + 1) : (local_454 - 1)) ; (\let local_458 = (local_457 == 0) ; (\let local_459 = ( local_458 ? queue_72[ptr_72] : local_456) ; (\let local_460 = ( (local_458 || (queue_72[ptr_72] == local_456)) ? (local_457 + 1) : (local_457 - 1)) ; (\let local_461 = (local_460 == 0) ; (\let local_462 = ( local_461 ? queue_76[ptr_76] : local_459) ; (\let local_463 = ( (local_461 || (queue_76[ptr_76] == local_459)) ? (local_460 + 1) : (local_460 - 1)) ; (\let local_464 = (local_463 == 0) ; (\let local_465 = ( local_464 ? queue_80[ptr_80] : local_462) ; (\let local_466 = ( (local_464 || (queue_80[ptr_80] == local_462)) ? (local_463 + 1) : (local_463 - 1)) ; (\let local_467 = (local_466 == 0) ; (\let local_468 = ( local_467 ? queue_84[ptr_84] : local_465) ; (\let local_469 = ( (local_467 || (queue_84[ptr_84] == local_465)) ? (local_466 + 1) : (local_466 - 1)) ; (\let local_470 = (local_469 == 0) ; (\let local_471 = ( local_470 ? queue_88[ptr_88] : local_468) ; (\let local_472 = ( (local_470 || (queue_88[ptr_88] == local_468)) ? (local_469 + 1) : (local_469 - 1)) ; (\let local_473 = (local_472 == 0) ; (\let local_474 = ( local_473 ? queue_92[ptr_92] : local_471) ; (\let local_475 = ( (local_473 || (queue_92[ptr_92] == local_471)) ? (local_472 + 1) : (local_472 - 1)) ; (\let local_476 = (local_475 == 0) ; (\let local_477 = ( local_476 ? queue_96[ptr_96] : local_474) ; (\let local_478 = ( (local_476 || (queue_96[ptr_96] == local_474)) ? (local_475 + 1) : (local_475 - 1)) ; (\let local_479 = (local_478 == 0) ; (\let local_480 = ( local_479 ? queue_100[ptr_100] : local_477) ; (\let local_481 = ( (local_479 || (queue_100[ptr_100] == local_477)) ? (local_478 + 1) : (local_478 - 1)) ; local_480 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_330 + 1) : local_330) ; (\let local_482 = ( (queue_24[ptr_24] == (\let local_483 = false ; (\let local_484 = ( local_483 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_485 = ( (local_483 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_486 = (local_485 == 0) ; (\let local_487 = ( local_486 ? queue_8[ptr_8] : local_484) ; (\let local_488 = ( (local_486 || (queue_8[ptr_8] == local_484)) ? (local_485 + 1) : (local_485 - 1)) ; (\let local_489 = (local_488 == 0) ; (\let local_490 = ( local_489 ? queue_12[ptr_12] : local_487) ; (\let local_491 = ( (local_489 || (queue_12[ptr_12] == local_487)) ? (local_488 + 1) : (local_488 - 1)) ; (\let local_492 = (local_491 == 0) ; (\let local_493 = ( local_492 ? queue_16[ptr_16] : local_490) ; (\let local_494 = ( (local_492 || (queue_16[ptr_16] == local_490)) ? (local_491 + 1) : (local_491 - 1)) ; (\let local_495 = (local_494 == 0) ; (\let local_496 = ( local_495 ? queue_20[ptr_20] : local_493) ; (\let local_497 = ( (local_495 || (queue_20[ptr_20] == local_493)) ? (local_494 + 1) : (local_494 - 1)) ; (\let local_498 = (local_497 == 0) ; (\let local_499 = ( local_498 ? queue_24[ptr_24] : local_496) ; (\let local_500 = ( (local_498 || (queue_24[ptr_24] == local_496)) ? (local_497 + 1) : (local_497 - 1)) ; (\let local_501 = (local_500 == 0) ; (\let local_502 = ( local_501 ? queue_28[ptr_28] : local_499) ; (\let local_503 = ( (local_501 || (queue_28[ptr_28] == local_499)) ? (local_500 + 1) : (local_500 - 1)) ; (\let local_504 = (local_503 == 0) ; (\let local_505 = ( local_504 ? queue_32[ptr_32] : local_502) ; (\let local_506 = ( (local_504 || (queue_32[ptr_32] == local_502)) ? (local_503 + 1) : (local_503 - 1)) ; (\let local_507 = (local_506 == 0) ; (\let local_508 = ( local_507 ? queue_36[ptr_36] : local_505) ; (\let local_509 = ( (local_507 || (queue_36[ptr_36] == local_505)) ? (local_506 + 1) : (local_506 - 1)) ; (\let local_510 = (local_509 == 0) ; (\let local_511 = ( local_510 ? queue_40[ptr_40] : local_508) ; (\let local_512 = ( (local_510 || (queue_40[ptr_40] == local_508)) ? (local_509 + 1) : (local_509 - 1)) ; (\let local_513 = (local_512 == 0) ; (\let local_514 = ( local_513 ? queue_44[ptr_44] : local_511) ; (\let local_515 = ( (local_513 || (queue_44[ptr_44] == local_511)) ? (local_512 + 1) : (local_512 - 1)) ; (\let local_516 = (local_515 == 0) ; (\let local_517 = ( local_516 ? queue_48[ptr_48] : local_514) ; (\let local_518 = ( (local_516 || (queue_48[ptr_48] == local_514)) ? (local_515 + 1) : (local_515 - 1)) ; (\let local_519 = (local_518 == 0) ; (\let local_520 = ( local_519 ? queue_52[ptr_52] : local_517) ; (\let local_521 = ( (local_519 || (queue_52[ptr_52] == local_517)) ? (local_518 + 1) : (local_518 - 1)) ; (\let local_522 = (local_521 == 0) ; (\let local_523 = ( local_522 ? queue_56[ptr_56] : local_520) ; (\let local_524 = ( (local_522 || (queue_56[ptr_56] == local_520)) ? (local_521 + 1) : (local_521 - 1)) ; (\let local_525 = (local_524 == 0) ; (\let local_526 = ( local_525 ? queue_60[ptr_60] : local_523) ; (\let local_527 = ( (local_525 || (queue_60[ptr_60] == local_523)) ? (local_524 + 1) : (local_524 - 1)) ; (\let local_528 = (local_527 == 0) ; (\let local_529 = ( local_528 ? queue_64[ptr_64] : local_526) ; (\let local_530 = ( (local_528 || (queue_64[ptr_64] == local_526)) ? (local_527 + 1) : (local_527 - 1)) ; (\let local_531 = (local_530 == 0) ; (\let local_532 = ( local_531 ? queue_68[ptr_68] : local_529) ; (\let local_533 = ( (local_531 || (queue_68[ptr_68] == local_529)) ? (local_530 + 1) : (local_530 - 1)) ; (\let local_534 = (local_533 == 0) ; (\let local_535 = ( local_534 ? queue_72[ptr_72] : local_532) ; (\let local_536 = ( (local_534 || (queue_72[ptr_72] == local_532)) ? (local_533 + 1) : (local_533 - 1)) ; (\let local_537 = (local_536 == 0) ; (\let local_538 = ( local_537 ? queue_76[ptr_76] : local_535) ; (\let local_539 = ( (local_537 || (queue_76[ptr_76] == local_535)) ? (local_536 + 1) : (local_536 - 1)) ; (\let local_540 = (local_539 == 0) ; (\let local_541 = ( local_540 ? queue_80[ptr_80] : local_538) ; (\let local_542 = ( (local_540 || (queue_80[ptr_80] == local_538)) ? (local_539 + 1) : (local_539 - 1)) ; (\let local_543 = (local_542 == 0) ; (\let local_544 = ( local_543 ? queue_84[ptr_84] : local_541) ; (\let local_545 = ( (local_543 || (queue_84[ptr_84] == local_541)) ? (local_542 + 1) : (local_542 - 1)) ; (\let local_546 = (local_545 == 0) ; (\let local_547 = ( local_546 ? queue_88[ptr_88] : local_544) ; (\let local_548 = ( (local_546 || (queue_88[ptr_88] == local_544)) ? (local_545 + 1) : (local_545 - 1)) ; (\let local_549 = (local_548 == 0) ; (\let local_550 = ( local_549 ? queue_92[ptr_92] : local_547) ; (\let local_551 = ( (local_549 || (queue_92[ptr_92] == local_547)) ? (local_548 + 1) : (local_548 - 1)) ; (\let local_552 = (local_551 == 0) ; (\let local_553 = ( local_552 ? queue_96[ptr_96] : local_550) ; (\let local_554 = ( (local_552 || (queue_96[ptr_96] == local_550)) ? (local_551 + 1) : (local_551 - 1)) ; (\let local_555 = (local_554 == 0) ; (\let local_556 = ( local_555 ? queue_100[ptr_100] : local_553) ; (\let local_557 = ( (local_555 || (queue_100[ptr_100] == local_553)) ? (local_554 + 1) : (local_554 - 1)) ; local_556 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_406 + 1) : local_406) ; (\let local_558 = ( (queue_28[ptr_28] == (\let local_559 = false ; (\let local_560 = ( local_559 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_561 = ( (local_559 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_562 = (local_561 == 0) ; (\let local_563 = ( local_562 ? queue_8[ptr_8] : local_560) ; (\let local_564 = ( (local_562 || (queue_8[ptr_8] == local_560)) ? (local_561 + 1) : (local_561 - 1)) ; (\let local_565 = (local_564 == 0) ; (\let local_566 = ( local_565 ? queue_12[ptr_12] : local_563) ; (\let local_567 = ( (local_565 || (queue_12[ptr_12] == local_563)) ? (local_564 + 1) : (local_564 - 1)) ; (\let local_568 = (local_567 == 0) ; (\let local_569 = ( local_568 ? queue_16[ptr_16] : local_566) ; (\let local_570 = ( (local_568 || (queue_16[ptr_16] == local_566)) ? (local_567 + 1) : (local_567 - 1)) ; (\let local_571 = (local_570 == 0) ; (\let local_572 = ( local_571 ? queue_20[ptr_20] : local_569) ; (\let local_573 = ( (local_571 || (queue_20[ptr_20] == local_569)) ? (local_570 + 1) : (local_570 - 1)) ; (\let local_574 = (local_573 == 0) ; (\let local_575 = ( local_574 ? queue_24[ptr_24] : local_572) ; (\let local_576 = ( (local_574 || (queue_24[ptr_24] == local_572)) ? (local_573 + 1) : (local_573 - 1)) ; (\let local_577 = (local_576 == 0) ; (\let local_578 = ( local_577 ? queue_28[ptr_28] : local_575) ; (\let local_579 = ( (local_577 || (queue_28[ptr_28] == local_575)) ? (local_576 + 1) : (local_576 - 1)) ; (\let local_580 = (local_579 == 0) ; (\let local_581 = ( local_580 ? queue_32[ptr_32] : local_578) ; (\let local_582 = ( (local_580 || (queue_32[ptr_32] == local_578)) ? (local_579 + 1) : (local_579 - 1)) ; (\let local_583 = (local_582 == 0) ; (\let local_584 = ( local_583 ? queue_36[ptr_36] : local_581) ; (\let local_585 = ( (local_583 || (queue_36[ptr_36] == local_581)) ? (local_582 + 1) : (local_582 - 1)) ; (\let local_586 = (local_585 == 0) ; (\let local_587 = ( local_586 ? queue_40[ptr_40] : local_584) ; (\let local_588 = ( (local_586 || (queue_40[ptr_40] == local_584)) ? (local_585 + 1) : (local_585 - 1)) ; (\let local_589 = (local_588 == 0) ; (\let local_590 = ( local_589 ? queue_44[ptr_44] : local_587) ; (\let local_591 = ( (local_589 || (queue_44[ptr_44] == local_587)) ? (local_588 + 1) : (local_588 - 1)) ; (\let local_592 = (local_591 == 0) ; (\let local_593 = ( local_592 ? queue_48[ptr_48] : local_590) ; (\let local_594 = ( (local_592 || (queue_48[ptr_48] == local_590)) ? (local_591 + 1) : (local_591 - 1)) ; (\let local_595 = (local_594 == 0) ; (\let local_596 = ( local_595 ? queue_52[ptr_52] : local_593) ; (\let local_597 = ( (local_595 || (queue_52[ptr_52] == local_593)) ? (local_594 + 1) : (local_594 - 1)) ; (\let local_598 = (local_597 == 0) ; (\let local_599 = ( local_598 ? queue_56[ptr_56] : local_596) ; (\let local_600 = ( (local_598 || (queue_56[ptr_56] == local_596)) ? (local_597 + 1) : (local_597 - 1)) ; (\let local_601 = (local_600 == 0) ; (\let local_602 = ( local_601 ? queue_60[ptr_60] : local_599) ; (\let local_603 = ( (local_601 || (queue_60[ptr_60] == local_599)) ? (local_600 + 1) : (local_600 - 1)) ; (\let local_604 = (local_603 == 0) ; (\let local_605 = ( local_604 ? queue_64[ptr_64] : local_602) ; (\let local_606 = ( (local_604 || (queue_64[ptr_64] == local_602)) ? (local_603 + 1) : (local_603 - 1)) ; (\let local_607 = (local_606 == 0) ; (\let local_608 = ( local_607 ? queue_68[ptr_68] : local_605) ; (\let local_609 = ( (local_607 || (queue_68[ptr_68] == local_605)) ? (local_606 + 1) : (local_606 - 1)) ; (\let local_610 = (local_609 == 0) ; (\let local_611 = ( local_610 ? queue_72[ptr_72] : local_608) ; (\let local_612 = ( (local_610 || (queue_72[ptr_72] == local_608)) ? (local_609 + 1) : (local_609 - 1)) ; (\let local_613 = (local_612 == 0) ; (\let local_614 = ( local_613 ? queue_76[ptr_76] : local_611) ; (\let local_615 = ( (local_613 || (queue_76[ptr_76] == local_611)) ? (local_612 + 1) : (local_612 - 1)) ; (\let local_616 = (local_615 == 0) ; (\let local_617 = ( local_616 ? queue_80[ptr_80] : local_614) ; (\let local_618 = ( (local_616 || (queue_80[ptr_80] == local_614)) ? (local_615 + 1) : (local_615 - 1)) ; (\let local_619 = (local_618 == 0) ; (\let local_620 = ( local_619 ? queue_84[ptr_84] : local_617) ; (\let local_621 = ( (local_619 || (queue_84[ptr_84] == local_617)) ? (local_618 + 1) : (local_618 - 1)) ; (\let local_622 = (local_621 == 0) ; (\let local_623 = ( local_622 ? queue_88[ptr_88] : local_620) ; (\let local_624 = ( (local_622 || (queue_88[ptr_88] == local_620)) ? (local_621 + 1) : (local_621 - 1)) ; (\let local_625 = (local_624 == 0) ; (\let local_626 = ( local_625 ? queue_92[ptr_92] : local_623) ; (\let local_627 = ( (local_625 || (queue_92[ptr_92] == local_623)) ? (local_624 + 1) : (local_624 - 1)) ; (\let local_628 = (local_627 == 0) ; (\let local_629 = ( local_628 ? queue_96[ptr_96] : local_626) ; (\let local_630 = ( (local_628 || (queue_96[ptr_96] == local_626)) ? (local_627 + 1) : (local_627 - 1)) ; (\let local_631 = (local_630 == 0) ; (\let local_632 = ( local_631 ? queue_100[ptr_100] : local_629) ; (\let local_633 = ( (local_631 || (queue_100[ptr_100] == local_629)) ? (local_630 + 1) : (local_630 - 1)) ; local_632 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_482 + 1) : local_482) ; (\let local_634 = ( (queue_32[ptr_32] == (\let local_635 = false ; (\let local_636 = ( local_635 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_637 = ( (local_635 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_638 = (local_637 == 0) ; (\let local_639 = ( local_638 ? queue_8[ptr_8] : local_636) ; (\let local_640 = ( (local_638 || (queue_8[ptr_8] == local_636)) ? (local_637 + 1) : (local_637 - 1)) ; (\let local_641 = (local_640 == 0) ; (\let local_642 = ( local_641 ? queue_12[ptr_12] : local_639) ; (\let local_643 = ( (local_641 || (queue_12[ptr_12] == local_639)) ? (local_640 + 1) : (local_640 - 1)) ; (\let local_644 = (local_643 == 0) ; (\let local_645 = ( local_644 ? queue_16[ptr_16] : local_642) ; (\let local_646 = ( (local_644 || (queue_16[ptr_16] == local_642)) ? (local_643 + 1) : (local_643 - 1)) ; (\let local_647 = (local_646 == 0) ; (\let local_648 = ( local_647 ? queue_20[ptr_20] : local_645) ; (\let local_649 = ( (local_647 || (queue_20[ptr_20] == local_645)) ? (local_646 + 1) : (local_646 - 1)) ; (\let local_650 = (local_649 == 0) ; (\let local_651 = ( local_650 ? queue_24[ptr_24] : local_648) ; (\let local_652 = ( (local_650 || (queue_24[ptr_24] == local_648)) ? (local_649 + 1) : (local_649 - 1)) ; (\let local_653 = (local_652 == 0) ; (\let local_654 = ( local_653 ? queue_28[ptr_28] : local_651) ; (\let local_655 = ( (local_653 || (queue_28[ptr_28] == local_651)) ? (local_652 + 1) : (local_652 - 1)) ; (\let local_656 = (local_655 == 0) ; (\let local_657 = ( local_656 ? queue_32[ptr_32] : local_654) ; (\let local_658 = ( (local_656 || (queue_32[ptr_32] == local_654)) ? (local_655 + 1) : (local_655 - 1)) ; (\let local_659 = (local_658 == 0) ; (\let local_660 = ( local_659 ? queue_36[ptr_36] : local_657) ; (\let local_661 = ( (local_659 || (queue_36[ptr_36] == local_657)) ? (local_658 + 1) : (local_658 - 1)) ; (\let local_662 = (local_661 == 0) ; (\let local_663 = ( local_662 ? queue_40[ptr_40] : local_660) ; (\let local_664 = ( (local_662 || (queue_40[ptr_40] == local_660)) ? (local_661 + 1) : (local_661 - 1)) ; (\let local_665 = (local_664 == 0) ; (\let local_666 = ( local_665 ? queue_44[ptr_44] : local_663) ; (\let local_667 = ( (local_665 || (queue_44[ptr_44] == local_663)) ? (local_664 + 1) : (local_664 - 1)) ; (\let local_668 = (local_667 == 0) ; (\let local_669 = ( local_668 ? queue_48[ptr_48] : local_666) ; (\let local_670 = ( (local_668 || (queue_48[ptr_48] == local_666)) ? (local_667 + 1) : (local_667 - 1)) ; (\let local_671 = (local_670 == 0) ; (\let local_672 = ( local_671 ? queue_52[ptr_52] : local_669) ; (\let local_673 = ( (local_671 || (queue_52[ptr_52] == local_669)) ? (local_670 + 1) : (local_670 - 1)) ; (\let local_674 = (local_673 == 0) ; (\let local_675 = ( local_674 ? queue_56[ptr_56] : local_672) ; (\let local_676 = ( (local_674 || (queue_56[ptr_56] == local_672)) ? (local_673 + 1) : (local_673 - 1)) ; (\let local_677 = (local_676 == 0) ; (\let local_678 = ( local_677 ? queue_60[ptr_60] : local_675) ; (\let local_679 = ( (local_677 || (queue_60[ptr_60] == local_675)) ? (local_676 + 1) : (local_676 - 1)) ; (\let local_680 = (local_679 == 0) ; (\let local_681 = ( local_680 ? queue_64[ptr_64] : local_678) ; (\let local_682 = ( (local_680 || (queue_64[ptr_64] == local_678)) ? (local_679 + 1) : (local_679 - 1)) ; (\let local_683 = (local_682 == 0) ; (\let local_684 = ( local_683 ? queue_68[ptr_68] : local_681) ; (\let local_685 = ( (local_683 || (queue_68[ptr_68] == local_681)) ? (local_682 + 1) : (local_682 - 1)) ; (\let local_686 = (local_685 == 0) ; (\let local_687 = ( local_686 ? queue_72[ptr_72] : local_684) ; (\let local_688 = ( (local_686 || (queue_72[ptr_72] == local_684)) ? (local_685 + 1) : (local_685 - 1)) ; (\let local_689 = (local_688 == 0) ; (\let local_690 = ( local_689 ? queue_76[ptr_76] : local_687) ; (\let local_691 = ( (local_689 || (queue_76[ptr_76] == local_687)) ? (local_688 + 1) : (local_688 - 1)) ; (\let local_692 = (local_691 == 0) ; (\let local_693 = ( local_692 ? queue_80[ptr_80] : local_690) ; (\let local_694 = ( (local_692 || (queue_80[ptr_80] == local_690)) ? (local_691 + 1) : (local_691 - 1)) ; (\let local_695 = (local_694 == 0) ; (\let local_696 = ( local_695 ? queue_84[ptr_84] : local_693) ; (\let local_697 = ( (local_695 || (queue_84[ptr_84] == local_693)) ? (local_694 + 1) : (local_694 - 1)) ; (\let local_698 = (local_697 == 0) ; (\let local_699 = ( local_698 ? queue_88[ptr_88] : local_696) ; (\let local_700 = ( (local_698 || (queue_88[ptr_88] == local_696)) ? (local_697 + 1) : (local_697 - 1)) ; (\let local_701 = (local_700 == 0) ; (\let local_702 = ( local_701 ? queue_92[ptr_92] : local_699) ; (\let local_703 = ( (local_701 || (queue_92[ptr_92] == local_699)) ? (local_700 + 1) : (local_700 - 1)) ; (\let local_704 = (local_703 == 0) ; (\let local_705 = ( local_704 ? queue_96[ptr_96] : local_702) ; (\let local_706 = ( (local_704 || (queue_96[ptr_96] == local_702)) ? (local_703 + 1) : (local_703 - 1)) ; (\let local_707 = (local_706 == 0) ; (\let local_708 = ( local_707 ? queue_100[ptr_100] : local_705) ; (\let local_709 = ( (local_707 || (queue_100[ptr_100] == local_705)) ? (local_706 + 1) : (local_706 - 1)) ; local_708 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_558 + 1) : local_558) ; (\let local_710 = ( (queue_36[ptr_36] == (\let local_711 = false ; (\let local_712 = ( local_711 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_713 = ( (local_711 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_714 = (local_713 == 0) ; (\let local_715 = ( local_714 ? queue_8[ptr_8] : local_712) ; (\let local_716 = ( (local_714 || (queue_8[ptr_8] == local_712)) ? (local_713 + 1) : (local_713 - 1)) ; (\let local_717 = (local_716 == 0) ; (\let local_718 = ( local_717 ? queue_12[ptr_12] : local_715) ; (\let local_719 = ( (local_717 || (queue_12[ptr_12] == local_715)) ? (local_716 + 1) : (local_716 - 1)) ; (\let local_720 = (local_719 == 0) ; (\let local_721 = ( local_720 ? queue_16[ptr_16] : local_718) ; (\let local_722 = ( (local_720 || (queue_16[ptr_16] == local_718)) ? (local_719 + 1) : (local_719 - 1)) ; (\let local_723 = (local_722 == 0) ; (\let local_724 = ( local_723 ? queue_20[ptr_20] : local_721) ; (\let local_725 = ( (local_723 || (queue_20[ptr_20] == local_721)) ? (local_722 + 1) : (local_722 - 1)) ; (\let local_726 = (local_725 == 0) ; (\let local_727 = ( local_726 ? queue_24[ptr_24] : local_724) ; (\let local_728 = ( (local_726 || (queue_24[ptr_24] == local_724)) ? (local_725 + 1) : (local_725 - 1)) ; (\let local_729 = (local_728 == 0) ; (\let local_730 = ( local_729 ? queue_28[ptr_28] : local_727) ; (\let local_731 = ( (local_729 || (queue_28[ptr_28] == local_727)) ? (local_728 + 1) : (local_728 - 1)) ; (\let local_732 = (local_731 == 0) ; (\let local_733 = ( local_732 ? queue_32[ptr_32] : local_730) ; (\let local_734 = ( (local_732 || (queue_32[ptr_32] == local_730)) ? (local_731 + 1) : (local_731 - 1)) ; (\let local_735 = (local_734 == 0) ; (\let local_736 = ( local_735 ? queue_36[ptr_36] : local_733) ; (\let local_737 = ( (local_735 || (queue_36[ptr_36] == local_733)) ? (local_734 + 1) : (local_734 - 1)) ; (\let local_738 = (local_737 == 0) ; (\let local_739 = ( local_738 ? queue_40[ptr_40] : local_736) ; (\let local_740 = ( (local_738 || (queue_40[ptr_40] == local_736)) ? (local_737 + 1) : (local_737 - 1)) ; (\let local_741 = (local_740 == 0) ; (\let local_742 = ( local_741 ? queue_44[ptr_44] : local_739) ; (\let local_743 = ( (local_741 || (queue_44[ptr_44] == local_739)) ? (local_740 + 1) : (local_740 - 1)) ; (\let local_744 = (local_743 == 0) ; (\let local_745 = ( local_744 ? queue_48[ptr_48] : local_742) ; (\let local_746 = ( (local_744 || (queue_48[ptr_48] == local_742)) ? (local_743 + 1) : (local_743 - 1)) ; (\let local_747 = (local_746 == 0) ; (\let local_748 = ( local_747 ? queue_52[ptr_52] : local_745) ; (\let local_749 = ( (local_747 || (queue_52[ptr_52] == local_745)) ? (local_746 + 1) : (local_746 - 1)) ; (\let local_750 = (local_749 == 0) ; (\let local_751 = ( local_750 ? queue_56[ptr_56] : local_748) ; (\let local_752 = ( (local_750 || (queue_56[ptr_56] == local_748)) ? (local_749 + 1) : (local_749 - 1)) ; (\let local_753 = (local_752 == 0) ; (\let local_754 = ( local_753 ? queue_60[ptr_60] : local_751) ; (\let local_755 = ( (local_753 || (queue_60[ptr_60] == local_751)) ? (local_752 + 1) : (local_752 - 1)) ; (\let local_756 = (local_755 == 0) ; (\let local_757 = ( local_756 ? queue_64[ptr_64] : local_754) ; (\let local_758 = ( (local_756 || (queue_64[ptr_64] == local_754)) ? (local_755 + 1) : (local_755 - 1)) ; (\let local_759 = (local_758 == 0) ; (\let local_760 = ( local_759 ? queue_68[ptr_68] : local_757) ; (\let local_761 = ( (local_759 || (queue_68[ptr_68] == local_757)) ? (local_758 + 1) : (local_758 - 1)) ; (\let local_762 = (local_761 == 0) ; (\let local_763 = ( local_762 ? queue_72[ptr_72] : local_760) ; (\let local_764 = ( (local_762 || (queue_72[ptr_72] == local_760)) ? (local_761 + 1) : (local_761 - 1)) ; (\let local_765 = (local_764 == 0) ; (\let local_766 = ( local_765 ? queue_76[ptr_76] : local_763) ; (\let local_767 = ( (local_765 || (queue_76[ptr_76] == local_763)) ? (local_764 + 1) : (local_764 - 1)) ; (\let local_768 = (local_767 == 0) ; (\let local_769 = ( local_768 ? queue_80[ptr_80] : local_766) ; (\let local_770 = ( (local_768 || (queue_80[ptr_80] == local_766)) ? (local_767 + 1) : (local_767 - 1)) ; (\let local_771 = (local_770 == 0) ; (\let local_772 = ( local_771 ? queue_84[ptr_84] : local_769) ; (\let local_773 = ( (local_771 || (queue_84[ptr_84] == local_769)) ? (local_770 + 1) : (local_770 - 1)) ; (\let local_774 = (local_773 == 0) ; (\let local_775 = ( local_774 ? queue_88[ptr_88] : local_772) ; (\let local_776 = ( (local_774 || (queue_88[ptr_88] == local_772)) ? (local_773 + 1) : (local_773 - 1)) ; (\let local_777 = (local_776 == 0) ; (\let local_778 = ( local_777 ? queue_92[ptr_92] : local_775) ; (\let local_779 = ( (local_777 || (queue_92[ptr_92] == local_775)) ? (local_776 + 1) : (local_776 - 1)) ; (\let local_780 = (local_779 == 0) ; (\let local_781 = ( local_780 ? queue_96[ptr_96] : local_778) ; (\let local_782 = ( (local_780 || (queue_96[ptr_96] == local_778)) ? (local_779 + 1) : (local_779 - 1)) ; (\let local_783 = (local_782 == 0) ; (\let local_784 = ( local_783 ? queue_100[ptr_100] : local_781) ; (\let local_785 = ( (local_783 || (queue_100[ptr_100] == local_781)) ? (local_782 + 1) : (local_782 - 1)) ; local_784 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_634 + 1) : local_634) ; (\let local_786 = ( (queue_40[ptr_40] == (\let local_787 = false ; (\let local_788 = ( local_787 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_789 = ( (local_787 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_790 = (local_789 == 0) ; (\let local_791 = ( local_790 ? queue_8[ptr_8] : local_788) ; (\let local_792 = ( (local_790 || (queue_8[ptr_8] == local_788)) ? (local_789 + 1) : (local_789 - 1)) ; (\let local_793 = (local_792 == 0) ; (\let local_794 = ( local_793 ? queue_12[ptr_12] : local_791) ; (\let local_795 = ( (local_793 || (queue_12[ptr_12] == local_791)) ? (local_792 + 1) : (local_792 - 1)) ; (\let local_796 = (local_795 == 0) ; (\let local_797 = ( local_796 ? queue_16[ptr_16] : local_794) ; (\let local_798 = ( (local_796 || (queue_16[ptr_16] == local_794)) ? (local_795 + 1) : (local_795 - 1)) ; (\let local_799 = (local_798 == 0) ; (\let local_800 = ( local_799 ? queue_20[ptr_20] : local_797) ; (\let local_801 = ( (local_799 || (queue_20[ptr_20] == local_797)) ? (local_798 + 1) : (local_798 - 1)) ; (\let local_802 = (local_801 == 0) ; (\let local_803 = ( local_802 ? queue_24[ptr_24] : local_800) ; (\let local_804 = ( (local_802 || (queue_24[ptr_24] == local_800)) ? (local_801 + 1) : (local_801 - 1)) ; (\let local_805 = (local_804 == 0) ; (\let local_806 = ( local_805 ? queue_28[ptr_28] : local_803) ; (\let local_807 = ( (local_805 || (queue_28[ptr_28] == local_803)) ? (local_804 + 1) : (local_804 - 1)) ; (\let local_808 = (local_807 == 0) ; (\let local_809 = ( local_808 ? queue_32[ptr_32] : local_806) ; (\let local_810 = ( (local_808 || (queue_32[ptr_32] == local_806)) ? (local_807 + 1) : (local_807 - 1)) ; (\let local_811 = (local_810 == 0) ; (\let local_812 = ( local_811 ? queue_36[ptr_36] : local_809) ; (\let local_813 = ( (local_811 || (queue_36[ptr_36] == local_809)) ? (local_810 + 1) : (local_810 - 1)) ; (\let local_814 = (local_813 == 0) ; (\let local_815 = ( local_814 ? queue_40[ptr_40] : local_812) ; (\let local_816 = ( (local_814 || (queue_40[ptr_40] == local_812)) ? (local_813 + 1) : (local_813 - 1)) ; (\let local_817 = (local_816 == 0) ; (\let local_818 = ( local_817 ? queue_44[ptr_44] : local_815) ; (\let local_819 = ( (local_817 || (queue_44[ptr_44] == local_815)) ? (local_816 + 1) : (local_816 - 1)) ; (\let local_820 = (local_819 == 0) ; (\let local_821 = ( local_820 ? queue_48[ptr_48] : local_818) ; (\let local_822 = ( (local_820 || (queue_48[ptr_48] == local_818)) ? (local_819 + 1) : (local_819 - 1)) ; (\let local_823 = (local_822 == 0) ; (\let local_824 = ( local_823 ? queue_52[ptr_52] : local_821) ; (\let local_825 = ( (local_823 || (queue_52[ptr_52] == local_821)) ? (local_822 + 1) : (local_822 - 1)) ; (\let local_826 = (local_825 == 0) ; (\let local_827 = ( local_826 ? queue_56[ptr_56] : local_824) ; (\let local_828 = ( (local_826 || (queue_56[ptr_56] == local_824)) ? (local_825 + 1) : (local_825 - 1)) ; (\let local_829 = (local_828 == 0) ; (\let local_830 = ( local_829 ? queue_60[ptr_60] : local_827) ; (\let local_831 = ( (local_829 || (queue_60[ptr_60] == local_827)) ? (local_828 + 1) : (local_828 - 1)) ; (\let local_832 = (local_831 == 0) ; (\let local_833 = ( local_832 ? queue_64[ptr_64] : local_830) ; (\let local_834 = ( (local_832 || (queue_64[ptr_64] == local_830)) ? (local_831 + 1) : (local_831 - 1)) ; (\let local_835 = (local_834 == 0) ; (\let local_836 = ( local_835 ? queue_68[ptr_68] : local_833) ; (\let local_837 = ( (local_835 || (queue_68[ptr_68] == local_833)) ? (local_834 + 1) : (local_834 - 1)) ; (\let local_838 = (local_837 == 0) ; (\let local_839 = ( local_838 ? queue_72[ptr_72] : local_836) ; (\let local_840 = ( (local_838 || (queue_72[ptr_72] == local_836)) ? (local_837 + 1) : (local_837 - 1)) ; (\let local_841 = (local_840 == 0) ; (\let local_842 = ( local_841 ? queue_76[ptr_76] : local_839) ; (\let local_843 = ( (local_841 || (queue_76[ptr_76] == local_839)) ? (local_840 + 1) : (local_840 - 1)) ; (\let local_844 = (local_843 == 0) ; (\let local_845 = ( local_844 ? queue_80[ptr_80] : local_842) ; (\let local_846 = ( (local_844 || (queue_80[ptr_80] == local_842)) ? (local_843 + 1) : (local_843 - 1)) ; (\let local_847 = (local_846 == 0) ; (\let local_848 = ( local_847 ? queue_84[ptr_84] : local_845) ; (\let local_849 = ( (local_847 || (queue_84[ptr_84] == local_845)) ? (local_846 + 1) : (local_846 - 1)) ; (\let local_850 = (local_849 == 0) ; (\let local_851 = ( local_850 ? queue_88[ptr_88] : local_848) ; (\let local_852 = ( (local_850 || (queue_88[ptr_88] == local_848)) ? (local_849 + 1) : (local_849 - 1)) ; (\let local_853 = (local_852 == 0) ; (\let local_854 = ( local_853 ? queue_92[ptr_92] : local_851) ; (\let local_855 = ( (local_853 || (queue_92[ptr_92] == local_851)) ? (local_852 + 1) : (local_852 - 1)) ; (\let local_856 = (local_855 == 0) ; (\let local_857 = ( local_856 ? queue_96[ptr_96] : local_854) ; (\let local_858 = ( (local_856 || (queue_96[ptr_96] == local_854)) ? (local_855 + 1) : (local_855 - 1)) ; (\let local_859 = (local_858 == 0) ; (\let local_860 = ( local_859 ? queue_100[ptr_100] : local_857) ; (\let local_861 = ( (local_859 || (queue_100[ptr_100] == local_857)) ? (local_858 + 1) : (local_858 - 1)) ; local_860 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_710 + 1) : local_710) ; (\let local_862 = ( (queue_44[ptr_44] == (\let local_863 = false ; (\let local_864 = ( local_863 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_865 = ( (local_863 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_866 = (local_865 == 0) ; (\let local_867 = ( local_866 ? queue_8[ptr_8] : local_864) ; (\let local_868 = ( (local_866 || (queue_8[ptr_8] == local_864)) ? (local_865 + 1) : (local_865 - 1)) ; (\let local_869 = (local_868 == 0) ; (\let local_870 = ( local_869 ? queue_12[ptr_12] : local_867) ; (\let local_871 = ( (local_869 || (queue_12[ptr_12] == local_867)) ? (local_868 + 1) : (local_868 - 1)) ; (\let local_872 = (local_871 == 0) ; (\let local_873 = ( local_872 ? queue_16[ptr_16] : local_870) ; (\let local_874 = ( (local_872 || (queue_16[ptr_16] == local_870)) ? (local_871 + 1) : (local_871 - 1)) ; (\let local_875 = (local_874 == 0) ; (\let local_876 = ( local_875 ? queue_20[ptr_20] : local_873) ; (\let local_877 = ( (local_875 || (queue_20[ptr_20] == local_873)) ? (local_874 + 1) : (local_874 - 1)) ; (\let local_878 = (local_877 == 0) ; (\let local_879 = ( local_878 ? queue_24[ptr_24] : local_876) ; (\let local_880 = ( (local_878 || (queue_24[ptr_24] == local_876)) ? (local_877 + 1) : (local_877 - 1)) ; (\let local_881 = (local_880 == 0) ; (\let local_882 = ( local_881 ? queue_28[ptr_28] : local_879) ; (\let local_883 = ( (local_881 || (queue_28[ptr_28] == local_879)) ? (local_880 + 1) : (local_880 - 1)) ; (\let local_884 = (local_883 == 0) ; (\let local_885 = ( local_884 ? queue_32[ptr_32] : local_882) ; (\let local_886 = ( (local_884 || (queue_32[ptr_32] == local_882)) ? (local_883 + 1) : (local_883 - 1)) ; (\let local_887 = (local_886 == 0) ; (\let local_888 = ( local_887 ? queue_36[ptr_36] : local_885) ; (\let local_889 = ( (local_887 || (queue_36[ptr_36] == local_885)) ? (local_886 + 1) : (local_886 - 1)) ; (\let local_890 = (local_889 == 0) ; (\let local_891 = ( local_890 ? queue_40[ptr_40] : local_888) ; (\let local_892 = ( (local_890 || (queue_40[ptr_40] == local_888)) ? (local_889 + 1) : (local_889 - 1)) ; (\let local_893 = (local_892 == 0) ; (\let local_894 = ( local_893 ? queue_44[ptr_44] : local_891) ; (\let local_895 = ( (local_893 || (queue_44[ptr_44] == local_891)) ? (local_892 + 1) : (local_892 - 1)) ; (\let local_896 = (local_895 == 0) ; (\let local_897 = ( local_896 ? queue_48[ptr_48] : local_894) ; (\let local_898 = ( (local_896 || (queue_48[ptr_48] == local_894)) ? (local_895 + 1) : (local_895 - 1)) ; (\let local_899 = (local_898 == 0) ; (\let local_900 = ( local_899 ? queue_52[ptr_52] : local_897) ; (\let local_901 = ( (local_899 || (queue_52[ptr_52] == local_897)) ? (local_898 + 1) : (local_898 - 1)) ; (\let local_902 = (local_901 == 0) ; (\let local_903 = ( local_902 ? queue_56[ptr_56] : local_900) ; (\let local_904 = ( (local_902 || (queue_56[ptr_56] == local_900)) ? (local_901 + 1) : (local_901 - 1)) ; (\let local_905 = (local_904 == 0) ; (\let local_906 = ( local_905 ? queue_60[ptr_60] : local_903) ; (\let local_907 = ( (local_905 || (queue_60[ptr_60] == local_903)) ? (local_904 + 1) : (local_904 - 1)) ; (\let local_908 = (local_907 == 0) ; (\let local_909 = ( local_908 ? queue_64[ptr_64] : local_906) ; (\let local_910 = ( (local_908 || (queue_64[ptr_64] == local_906)) ? (local_907 + 1) : (local_907 - 1)) ; (\let local_911 = (local_910 == 0) ; (\let local_912 = ( local_911 ? queue_68[ptr_68] : local_909) ; (\let local_913 = ( (local_911 || (queue_68[ptr_68] == local_909)) ? (local_910 + 1) : (local_910 - 1)) ; (\let local_914 = (local_913 == 0) ; (\let local_915 = ( local_914 ? queue_72[ptr_72] : local_912) ; (\let local_916 = ( (local_914 || (queue_72[ptr_72] == local_912)) ? (local_913 + 1) : (local_913 - 1)) ; (\let local_917 = (local_916 == 0) ; (\let local_918 = ( local_917 ? queue_76[ptr_76] : local_915) ; (\let local_919 = ( (local_917 || (queue_76[ptr_76] == local_915)) ? (local_916 + 1) : (local_916 - 1)) ; (\let local_920 = (local_919 == 0) ; (\let local_921 = ( local_920 ? queue_80[ptr_80] : local_918) ; (\let local_922 = ( (local_920 || (queue_80[ptr_80] == local_918)) ? (local_919 + 1) : (local_919 - 1)) ; (\let local_923 = (local_922 == 0) ; (\let local_924 = ( local_923 ? queue_84[ptr_84] : local_921) ; (\let local_925 = ( (local_923 || (queue_84[ptr_84] == local_921)) ? (local_922 + 1) : (local_922 - 1)) ; (\let local_926 = (local_925 == 0) ; (\let local_927 = ( local_926 ? queue_88[ptr_88] : local_924) ; (\let local_928 = ( (local_926 || (queue_88[ptr_88] == local_924)) ? (local_925 + 1) : (local_925 - 1)) ; (\let local_929 = (local_928 == 0) ; (\let local_930 = ( local_929 ? queue_92[ptr_92] : local_927) ; (\let local_931 = ( (local_929 || (queue_92[ptr_92] == local_927)) ? (local_928 + 1) : (local_928 - 1)) ; (\let local_932 = (local_931 == 0) ; (\let local_933 = ( local_932 ? queue_96[ptr_96] : local_930) ; (\let local_934 = ( (local_932 || (queue_96[ptr_96] == local_930)) ? (local_931 + 1) : (local_931 - 1)) ; (\let local_935 = (local_934 == 0) ; (\let local_936 = ( local_935 ? queue_100[ptr_100] : local_933) ; (\let local_937 = ( (local_935 || (queue_100[ptr_100] == local_933)) ? (local_934 + 1) : (local_934 - 1)) ; local_936 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_786 + 1) : local_786) ; (\let local_938 = ( (queue_48[ptr_48] == (\let local_939 = false ; (\let local_940 = ( local_939 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_941 = ( (local_939 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_942 = (local_941 == 0) ; (\let local_943 = ( local_942 ? queue_8[ptr_8] : local_940) ; (\let local_944 = ( (local_942 || (queue_8[ptr_8] == local_940)) ? (local_941 + 1) : (local_941 - 1)) ; (\let local_945 = (local_944 == 0) ; (\let local_946 = ( local_945 ? queue_12[ptr_12] : local_943) ; (\let local_947 = ( (local_945 || (queue_12[ptr_12] == local_943)) ? (local_944 + 1) : (local_944 - 1)) ; (\let local_948 = (local_947 == 0) ; (\let local_949 = ( local_948 ? queue_16[ptr_16] : local_946) ; (\let local_950 = ( (local_948 || (queue_16[ptr_16] == local_946)) ? (local_947 + 1) : (local_947 - 1)) ; (\let local_951 = (local_950 == 0) ; (\let local_952 = ( local_951 ? queue_20[ptr_20] : local_949) ; (\let local_953 = ( (local_951 || (queue_20[ptr_20] == local_949)) ? (local_950 + 1) : (local_950 - 1)) ; (\let local_954 = (local_953 == 0) ; (\let local_955 = ( local_954 ? queue_24[ptr_24] : local_952) ; (\let local_956 = ( (local_954 || (queue_24[ptr_24] == local_952)) ? (local_953 + 1) : (local_953 - 1)) ; (\let local_957 = (local_956 == 0) ; (\let local_958 = ( local_957 ? queue_28[ptr_28] : local_955) ; (\let local_959 = ( (local_957 || (queue_28[ptr_28] == local_955)) ? (local_956 + 1) : (local_956 - 1)) ; (\let local_960 = (local_959 == 0) ; (\let local_961 = ( local_960 ? queue_32[ptr_32] : local_958) ; (\let local_962 = ( (local_960 || (queue_32[ptr_32] == local_958)) ? (local_959 + 1) : (local_959 - 1)) ; (\let local_963 = (local_962 == 0) ; (\let local_964 = ( local_963 ? queue_36[ptr_36] : local_961) ; (\let local_965 = ( (local_963 || (queue_36[ptr_36] == local_961)) ? (local_962 + 1) : (local_962 - 1)) ; (\let local_966 = (local_965 == 0) ; (\let local_967 = ( local_966 ? queue_40[ptr_40] : local_964) ; (\let local_968 = ( (local_966 || (queue_40[ptr_40] == local_964)) ? (local_965 + 1) : (local_965 - 1)) ; (\let local_969 = (local_968 == 0) ; (\let local_970 = ( local_969 ? queue_44[ptr_44] : local_967) ; (\let local_971 = ( (local_969 || (queue_44[ptr_44] == local_967)) ? (local_968 + 1) : (local_968 - 1)) ; (\let local_972 = (local_971 == 0) ; (\let local_973 = ( local_972 ? queue_48[ptr_48] : local_970) ; (\let local_974 = ( (local_972 || (queue_48[ptr_48] == local_970)) ? (local_971 + 1) : (local_971 - 1)) ; (\let local_975 = (local_974 == 0) ; (\let local_976 = ( local_975 ? queue_52[ptr_52] : local_973) ; (\let local_977 = ( (local_975 || (queue_52[ptr_52] == local_973)) ? (local_974 + 1) : (local_974 - 1)) ; (\let local_978 = (local_977 == 0) ; (\let local_979 = ( local_978 ? queue_56[ptr_56] : local_976) ; (\let local_980 = ( (local_978 || (queue_56[ptr_56] == local_976)) ? (local_977 + 1) : (local_977 - 1)) ; (\let local_981 = (local_980 == 0) ; (\let local_982 = ( local_981 ? queue_60[ptr_60] : local_979) ; (\let local_983 = ( (local_981 || (queue_60[ptr_60] == local_979)) ? (local_980 + 1) : (local_980 - 1)) ; (\let local_984 = (local_983 == 0) ; (\let local_985 = ( local_984 ? queue_64[ptr_64] : local_982) ; (\let local_986 = ( (local_984 || (queue_64[ptr_64] == local_982)) ? (local_983 + 1) : (local_983 - 1)) ; (\let local_987 = (local_986 == 0) ; (\let local_988 = ( local_987 ? queue_68[ptr_68] : local_985) ; (\let local_989 = ( (local_987 || (queue_68[ptr_68] == local_985)) ? (local_986 + 1) : (local_986 - 1)) ; (\let local_990 = (local_989 == 0) ; (\let local_991 = ( local_990 ? queue_72[ptr_72] : local_988) ; (\let local_992 = ( (local_990 || (queue_72[ptr_72] == local_988)) ? (local_989 + 1) : (local_989 - 1)) ; (\let local_993 = (local_992 == 0) ; (\let local_994 = ( local_993 ? queue_76[ptr_76] : local_991) ; (\let local_995 = ( (local_993 || (queue_76[ptr_76] == local_991)) ? (local_992 + 1) : (local_992 - 1)) ; (\let local_996 = (local_995 == 0) ; (\let local_997 = ( local_996 ? queue_80[ptr_80] : local_994) ; (\let local_998 = ( (local_996 || (queue_80[ptr_80] == local_994)) ? (local_995 + 1) : (local_995 - 1)) ; (\let local_999 = (local_998 == 0) ; (\let local_1000 = ( local_999 ? queue_84[ptr_84] : local_997) ; (\let local_1001 = ( (local_999 || (queue_84[ptr_84] == local_997)) ? (local_998 + 1) : (local_998 - 1)) ; (\let local_1002 = (local_1001 == 0) ; (\let local_1003 = ( local_1002 ? queue_88[ptr_88] : local_1000) ; (\let local_1004 = ( (local_1002 || (queue_88[ptr_88] == local_1000)) ? (local_1001 + 1) : (local_1001 - 1)) ; (\let local_1005 = (local_1004 == 0) ; (\let local_1006 = ( local_1005 ? queue_92[ptr_92] : local_1003) ; (\let local_1007 = ( (local_1005 || (queue_92[ptr_92] == local_1003)) ? (local_1004 + 1) : (local_1004 - 1)) ; (\let local_1008 = (local_1007 == 0) ; (\let local_1009 = ( local_1008 ? queue_96[ptr_96] : local_1006) ; (\let local_1010 = ( (local_1008 || (queue_96[ptr_96] == local_1006)) ? (local_1007 + 1) : (local_1007 - 1)) ; (\let local_1011 = (local_1010 == 0) ; (\let local_1012 = ( local_1011 ? queue_100[ptr_100] : local_1009) ; (\let local_1013 = ( (local_1011 || (queue_100[ptr_100] == local_1009)) ? (local_1010 + 1) : (local_1010 - 1)) ; local_1012 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_862 + 1) : local_862) ; (\let local_1014 = ( (queue_52[ptr_52] == (\let local_1015 = false ; (\let local_1016 = ( local_1015 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1017 = ( (local_1015 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1018 = (local_1017 == 0) ; (\let local_1019 = ( local_1018 ? queue_8[ptr_8] : local_1016) ; (\let local_1020 = ( (local_1018 || (queue_8[ptr_8] == local_1016)) ? (local_1017 + 1) : (local_1017 - 1)) ; (\let local_1021 = (local_1020 == 0) ; (\let local_1022 = ( local_1021 ? queue_12[ptr_12] : local_1019) ; (\let local_1023 = ( (local_1021 || (queue_12[ptr_12] == local_1019)) ? (local_1020 + 1) : (local_1020 - 1)) ; (\let local_1024 = (local_1023 == 0) ; (\let local_1025 = ( local_1024 ? queue_16[ptr_16] : local_1022) ; (\let local_1026 = ( (local_1024 || (queue_16[ptr_16] == local_1022)) ? (local_1023 + 1) : (local_1023 - 1)) ; (\let local_1027 = (local_1026 == 0) ; (\let local_1028 = ( local_1027 ? queue_20[ptr_20] : local_1025) ; (\let local_1029 = ( (local_1027 || (queue_20[ptr_20] == local_1025)) ? (local_1026 + 1) : (local_1026 - 1)) ; (\let local_1030 = (local_1029 == 0) ; (\let local_1031 = ( local_1030 ? queue_24[ptr_24] : local_1028) ; (\let local_1032 = ( (local_1030 || (queue_24[ptr_24] == local_1028)) ? (local_1029 + 1) : (local_1029 - 1)) ; (\let local_1033 = (local_1032 == 0) ; (\let local_1034 = ( local_1033 ? queue_28[ptr_28] : local_1031) ; (\let local_1035 = ( (local_1033 || (queue_28[ptr_28] == local_1031)) ? (local_1032 + 1) : (local_1032 - 1)) ; (\let local_1036 = (local_1035 == 0) ; (\let local_1037 = ( local_1036 ? queue_32[ptr_32] : local_1034) ; (\let local_1038 = ( (local_1036 || (queue_32[ptr_32] == local_1034)) ? (local_1035 + 1) : (local_1035 - 1)) ; (\let local_1039 = (local_1038 == 0) ; (\let local_1040 = ( local_1039 ? queue_36[ptr_36] : local_1037) ; (\let local_1041 = ( (local_1039 || (queue_36[ptr_36] == local_1037)) ? (local_1038 + 1) : (local_1038 - 1)) ; (\let local_1042 = (local_1041 == 0) ; (\let local_1043 = ( local_1042 ? queue_40[ptr_40] : local_1040) ; (\let local_1044 = ( (local_1042 || (queue_40[ptr_40] == local_1040)) ? (local_1041 + 1) : (local_1041 - 1)) ; (\let local_1045 = (local_1044 == 0) ; (\let local_1046 = ( local_1045 ? queue_44[ptr_44] : local_1043) ; (\let local_1047 = ( (local_1045 || (queue_44[ptr_44] == local_1043)) ? (local_1044 + 1) : (local_1044 - 1)) ; (\let local_1048 = (local_1047 == 0) ; (\let local_1049 = ( local_1048 ? queue_48[ptr_48] : local_1046) ; (\let local_1050 = ( (local_1048 || (queue_48[ptr_48] == local_1046)) ? (local_1047 + 1) : (local_1047 - 1)) ; (\let local_1051 = (local_1050 == 0) ; (\let local_1052 = ( local_1051 ? queue_52[ptr_52] : local_1049) ; (\let local_1053 = ( (local_1051 || (queue_52[ptr_52] == local_1049)) ? (local_1050 + 1) : (local_1050 - 1)) ; (\let local_1054 = (local_1053 == 0) ; (\let local_1055 = ( local_1054 ? queue_56[ptr_56] : local_1052) ; (\let local_1056 = ( (local_1054 || (queue_56[ptr_56] == local_1052)) ? (local_1053 + 1) : (local_1053 - 1)) ; (\let local_1057 = (local_1056 == 0) ; (\let local_1058 = ( local_1057 ? queue_60[ptr_60] : local_1055) ; (\let local_1059 = ( (local_1057 || (queue_60[ptr_60] == local_1055)) ? (local_1056 + 1) : (local_1056 - 1)) ; (\let local_1060 = (local_1059 == 0) ; (\let local_1061 = ( local_1060 ? queue_64[ptr_64] : local_1058) ; (\let local_1062 = ( (local_1060 || (queue_64[ptr_64] == local_1058)) ? (local_1059 + 1) : (local_1059 - 1)) ; (\let local_1063 = (local_1062 == 0) ; (\let local_1064 = ( local_1063 ? queue_68[ptr_68] : local_1061) ; (\let local_1065 = ( (local_1063 || (queue_68[ptr_68] == local_1061)) ? (local_1062 + 1) : (local_1062 - 1)) ; (\let local_1066 = (local_1065 == 0) ; (\let local_1067 = ( local_1066 ? queue_72[ptr_72] : local_1064) ; (\let local_1068 = ( (local_1066 || (queue_72[ptr_72] == local_1064)) ? (local_1065 + 1) : (local_1065 - 1)) ; (\let local_1069 = (local_1068 == 0) ; (\let local_1070 = ( local_1069 ? queue_76[ptr_76] : local_1067) ; (\let local_1071 = ( (local_1069 || (queue_76[ptr_76] == local_1067)) ? (local_1068 + 1) : (local_1068 - 1)) ; (\let local_1072 = (local_1071 == 0) ; (\let local_1073 = ( local_1072 ? queue_80[ptr_80] : local_1070) ; (\let local_1074 = ( (local_1072 || (queue_80[ptr_80] == local_1070)) ? (local_1071 + 1) : (local_1071 - 1)) ; (\let local_1075 = (local_1074 == 0) ; (\let local_1076 = ( local_1075 ? queue_84[ptr_84] : local_1073) ; (\let local_1077 = ( (local_1075 || (queue_84[ptr_84] == local_1073)) ? (local_1074 + 1) : (local_1074 - 1)) ; (\let local_1078 = (local_1077 == 0) ; (\let local_1079 = ( local_1078 ? queue_88[ptr_88] : local_1076) ; (\let local_1080 = ( (local_1078 || (queue_88[ptr_88] == local_1076)) ? (local_1077 + 1) : (local_1077 - 1)) ; (\let local_1081 = (local_1080 == 0) ; (\let local_1082 = ( local_1081 ? queue_92[ptr_92] : local_1079) ; (\let local_1083 = ( (local_1081 || (queue_92[ptr_92] == local_1079)) ? (local_1080 + 1) : (local_1080 - 1)) ; (\let local_1084 = (local_1083 == 0) ; (\let local_1085 = ( local_1084 ? queue_96[ptr_96] : local_1082) ; (\let local_1086 = ( (local_1084 || (queue_96[ptr_96] == local_1082)) ? (local_1083 + 1) : (local_1083 - 1)) ; (\let local_1087 = (local_1086 == 0) ; (\let local_1088 = ( local_1087 ? queue_100[ptr_100] : local_1085) ; (\let local_1089 = ( (local_1087 || (queue_100[ptr_100] == local_1085)) ? (local_1086 + 1) : (local_1086 - 1)) ; local_1088 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_938 + 1) : local_938) ; (\let local_1090 = ( (queue_56[ptr_56] == (\let local_1091 = false ; (\let local_1092 = ( local_1091 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1093 = ( (local_1091 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1094 = (local_1093 == 0) ; (\let local_1095 = ( local_1094 ? queue_8[ptr_8] : local_1092) ; (\let local_1096 = ( (local_1094 || (queue_8[ptr_8] == local_1092)) ? (local_1093 + 1) : (local_1093 - 1)) ; (\let local_1097 = (local_1096 == 0) ; (\let local_1098 = ( local_1097 ? queue_12[ptr_12] : local_1095) ; (\let local_1099 = ( (local_1097 || (queue_12[ptr_12] == local_1095)) ? (local_1096 + 1) : (local_1096 - 1)) ; (\let local_1100 = (local_1099 == 0) ; (\let local_1101 = ( local_1100 ? queue_16[ptr_16] : local_1098) ; (\let local_1102 = ( (local_1100 || (queue_16[ptr_16] == local_1098)) ? (local_1099 + 1) : (local_1099 - 1)) ; (\let local_1103 = (local_1102 == 0) ; (\let local_1104 = ( local_1103 ? queue_20[ptr_20] : local_1101) ; (\let local_1105 = ( (local_1103 || (queue_20[ptr_20] == local_1101)) ? (local_1102 + 1) : (local_1102 - 1)) ; (\let local_1106 = (local_1105 == 0) ; (\let local_1107 = ( local_1106 ? queue_24[ptr_24] : local_1104) ; (\let local_1108 = ( (local_1106 || (queue_24[ptr_24] == local_1104)) ? (local_1105 + 1) : (local_1105 - 1)) ; (\let local_1109 = (local_1108 == 0) ; (\let local_1110 = ( local_1109 ? queue_28[ptr_28] : local_1107) ; (\let local_1111 = ( (local_1109 || (queue_28[ptr_28] == local_1107)) ? (local_1108 + 1) : (local_1108 - 1)) ; (\let local_1112 = (local_1111 == 0) ; (\let local_1113 = ( local_1112 ? queue_32[ptr_32] : local_1110) ; (\let local_1114 = ( (local_1112 || (queue_32[ptr_32] == local_1110)) ? (local_1111 + 1) : (local_1111 - 1)) ; (\let local_1115 = (local_1114 == 0) ; (\let local_1116 = ( local_1115 ? queue_36[ptr_36] : local_1113) ; (\let local_1117 = ( (local_1115 || (queue_36[ptr_36] == local_1113)) ? (local_1114 + 1) : (local_1114 - 1)) ; (\let local_1118 = (local_1117 == 0) ; (\let local_1119 = ( local_1118 ? queue_40[ptr_40] : local_1116) ; (\let local_1120 = ( (local_1118 || (queue_40[ptr_40] == local_1116)) ? (local_1117 + 1) : (local_1117 - 1)) ; (\let local_1121 = (local_1120 == 0) ; (\let local_1122 = ( local_1121 ? queue_44[ptr_44] : local_1119) ; (\let local_1123 = ( (local_1121 || (queue_44[ptr_44] == local_1119)) ? (local_1120 + 1) : (local_1120 - 1)) ; (\let local_1124 = (local_1123 == 0) ; (\let local_1125 = ( local_1124 ? queue_48[ptr_48] : local_1122) ; (\let local_1126 = ( (local_1124 || (queue_48[ptr_48] == local_1122)) ? (local_1123 + 1) : (local_1123 - 1)) ; (\let local_1127 = (local_1126 == 0) ; (\let local_1128 = ( local_1127 ? queue_52[ptr_52] : local_1125) ; (\let local_1129 = ( (local_1127 || (queue_52[ptr_52] == local_1125)) ? (local_1126 + 1) : (local_1126 - 1)) ; (\let local_1130 = (local_1129 == 0) ; (\let local_1131 = ( local_1130 ? queue_56[ptr_56] : local_1128) ; (\let local_1132 = ( (local_1130 || (queue_56[ptr_56] == local_1128)) ? (local_1129 + 1) : (local_1129 - 1)) ; (\let local_1133 = (local_1132 == 0) ; (\let local_1134 = ( local_1133 ? queue_60[ptr_60] : local_1131) ; (\let local_1135 = ( (local_1133 || (queue_60[ptr_60] == local_1131)) ? (local_1132 + 1) : (local_1132 - 1)) ; (\let local_1136 = (local_1135 == 0) ; (\let local_1137 = ( local_1136 ? queue_64[ptr_64] : local_1134) ; (\let local_1138 = ( (local_1136 || (queue_64[ptr_64] == local_1134)) ? (local_1135 + 1) : (local_1135 - 1)) ; (\let local_1139 = (local_1138 == 0) ; (\let local_1140 = ( local_1139 ? queue_68[ptr_68] : local_1137) ; (\let local_1141 = ( (local_1139 || (queue_68[ptr_68] == local_1137)) ? (local_1138 + 1) : (local_1138 - 1)) ; (\let local_1142 = (local_1141 == 0) ; (\let local_1143 = ( local_1142 ? queue_72[ptr_72] : local_1140) ; (\let local_1144 = ( (local_1142 || (queue_72[ptr_72] == local_1140)) ? (local_1141 + 1) : (local_1141 - 1)) ; (\let local_1145 = (local_1144 == 0) ; (\let local_1146 = ( local_1145 ? queue_76[ptr_76] : local_1143) ; (\let local_1147 = ( (local_1145 || (queue_76[ptr_76] == local_1143)) ? (local_1144 + 1) : (local_1144 - 1)) ; (\let local_1148 = (local_1147 == 0) ; (\let local_1149 = ( local_1148 ? queue_80[ptr_80] : local_1146) ; (\let local_1150 = ( (local_1148 || (queue_80[ptr_80] == local_1146)) ? (local_1147 + 1) : (local_1147 - 1)) ; (\let local_1151 = (local_1150 == 0) ; (\let local_1152 = ( local_1151 ? queue_84[ptr_84] : local_1149) ; (\let local_1153 = ( (local_1151 || (queue_84[ptr_84] == local_1149)) ? (local_1150 + 1) : (local_1150 - 1)) ; (\let local_1154 = (local_1153 == 0) ; (\let local_1155 = ( local_1154 ? queue_88[ptr_88] : local_1152) ; (\let local_1156 = ( (local_1154 || (queue_88[ptr_88] == local_1152)) ? (local_1153 + 1) : (local_1153 - 1)) ; (\let local_1157 = (local_1156 == 0) ; (\let local_1158 = ( local_1157 ? queue_92[ptr_92] : local_1155) ; (\let local_1159 = ( (local_1157 || (queue_92[ptr_92] == local_1155)) ? (local_1156 + 1) : (local_1156 - 1)) ; (\let local_1160 = (local_1159 == 0) ; (\let local_1161 = ( local_1160 ? queue_96[ptr_96] : local_1158) ; (\let local_1162 = ( (local_1160 || (queue_96[ptr_96] == local_1158)) ? (local_1159 + 1) : (local_1159 - 1)) ; (\let local_1163 = (local_1162 == 0) ; (\let local_1164 = ( local_1163 ? queue_100[ptr_100] : local_1161) ; (\let local_1165 = ( (local_1163 || (queue_100[ptr_100] == local_1161)) ? (local_1162 + 1) : (local_1162 - 1)) ; local_1164 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1014 + 1) : local_1014) ; (\let local_1166 = ( (queue_60[ptr_60] == (\let local_1167 = false ; (\let local_1168 = ( local_1167 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1169 = ( (local_1167 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1170 = (local_1169 == 0) ; (\let local_1171 = ( local_1170 ? queue_8[ptr_8] : local_1168) ; (\let local_1172 = ( (local_1170 || (queue_8[ptr_8] == local_1168)) ? (local_1169 + 1) : (local_1169 - 1)) ; (\let local_1173 = (local_1172 == 0) ; (\let local_1174 = ( local_1173 ? queue_12[ptr_12] : local_1171) ; (\let local_1175 = ( (local_1173 || (queue_12[ptr_12] == local_1171)) ? (local_1172 + 1) : (local_1172 - 1)) ; (\let local_1176 = (local_1175 == 0) ; (\let local_1177 = ( local_1176 ? queue_16[ptr_16] : local_1174) ; (\let local_1178 = ( (local_1176 || (queue_16[ptr_16] == local_1174)) ? (local_1175 + 1) : (local_1175 - 1)) ; (\let local_1179 = (local_1178 == 0) ; (\let local_1180 = ( local_1179 ? queue_20[ptr_20] : local_1177) ; (\let local_1181 = ( (local_1179 || (queue_20[ptr_20] == local_1177)) ? (local_1178 + 1) : (local_1178 - 1)) ; (\let local_1182 = (local_1181 == 0) ; (\let local_1183 = ( local_1182 ? queue_24[ptr_24] : local_1180) ; (\let local_1184 = ( (local_1182 || (queue_24[ptr_24] == local_1180)) ? (local_1181 + 1) : (local_1181 - 1)) ; (\let local_1185 = (local_1184 == 0) ; (\let local_1186 = ( local_1185 ? queue_28[ptr_28] : local_1183) ; (\let local_1187 = ( (local_1185 || (queue_28[ptr_28] == local_1183)) ? (local_1184 + 1) : (local_1184 - 1)) ; (\let local_1188 = (local_1187 == 0) ; (\let local_1189 = ( local_1188 ? queue_32[ptr_32] : local_1186) ; (\let local_1190 = ( (local_1188 || (queue_32[ptr_32] == local_1186)) ? (local_1187 + 1) : (local_1187 - 1)) ; (\let local_1191 = (local_1190 == 0) ; (\let local_1192 = ( local_1191 ? queue_36[ptr_36] : local_1189) ; (\let local_1193 = ( (local_1191 || (queue_36[ptr_36] == local_1189)) ? (local_1190 + 1) : (local_1190 - 1)) ; (\let local_1194 = (local_1193 == 0) ; (\let local_1195 = ( local_1194 ? queue_40[ptr_40] : local_1192) ; (\let local_1196 = ( (local_1194 || (queue_40[ptr_40] == local_1192)) ? (local_1193 + 1) : (local_1193 - 1)) ; (\let local_1197 = (local_1196 == 0) ; (\let local_1198 = ( local_1197 ? queue_44[ptr_44] : local_1195) ; (\let local_1199 = ( (local_1197 || (queue_44[ptr_44] == local_1195)) ? (local_1196 + 1) : (local_1196 - 1)) ; (\let local_1200 = (local_1199 == 0) ; (\let local_1201 = ( local_1200 ? queue_48[ptr_48] : local_1198) ; (\let local_1202 = ( (local_1200 || (queue_48[ptr_48] == local_1198)) ? (local_1199 + 1) : (local_1199 - 1)) ; (\let local_1203 = (local_1202 == 0) ; (\let local_1204 = ( local_1203 ? queue_52[ptr_52] : local_1201) ; (\let local_1205 = ( (local_1203 || (queue_52[ptr_52] == local_1201)) ? (local_1202 + 1) : (local_1202 - 1)) ; (\let local_1206 = (local_1205 == 0) ; (\let local_1207 = ( local_1206 ? queue_56[ptr_56] : local_1204) ; (\let local_1208 = ( (local_1206 || (queue_56[ptr_56] == local_1204)) ? (local_1205 + 1) : (local_1205 - 1)) ; (\let local_1209 = (local_1208 == 0) ; (\let local_1210 = ( local_1209 ? queue_60[ptr_60] : local_1207) ; (\let local_1211 = ( (local_1209 || (queue_60[ptr_60] == local_1207)) ? (local_1208 + 1) : (local_1208 - 1)) ; (\let local_1212 = (local_1211 == 0) ; (\let local_1213 = ( local_1212 ? queue_64[ptr_64] : local_1210) ; (\let local_1214 = ( (local_1212 || (queue_64[ptr_64] == local_1210)) ? (local_1211 + 1) : (local_1211 - 1)) ; (\let local_1215 = (local_1214 == 0) ; (\let local_1216 = ( local_1215 ? queue_68[ptr_68] : local_1213) ; (\let local_1217 = ( (local_1215 || (queue_68[ptr_68] == local_1213)) ? (local_1214 + 1) : (local_1214 - 1)) ; (\let local_1218 = (local_1217 == 0) ; (\let local_1219 = ( local_1218 ? queue_72[ptr_72] : local_1216) ; (\let local_1220 = ( (local_1218 || (queue_72[ptr_72] == local_1216)) ? (local_1217 + 1) : (local_1217 - 1)) ; (\let local_1221 = (local_1220 == 0) ; (\let local_1222 = ( local_1221 ? queue_76[ptr_76] : local_1219) ; (\let local_1223 = ( (local_1221 || (queue_76[ptr_76] == local_1219)) ? (local_1220 + 1) : (local_1220 - 1)) ; (\let local_1224 = (local_1223 == 0) ; (\let local_1225 = ( local_1224 ? queue_80[ptr_80] : local_1222) ; (\let local_1226 = ( (local_1224 || (queue_80[ptr_80] == local_1222)) ? (local_1223 + 1) : (local_1223 - 1)) ; (\let local_1227 = (local_1226 == 0) ; (\let local_1228 = ( local_1227 ? queue_84[ptr_84] : local_1225) ; (\let local_1229 = ( (local_1227 || (queue_84[ptr_84] == local_1225)) ? (local_1226 + 1) : (local_1226 - 1)) ; (\let local_1230 = (local_1229 == 0) ; (\let local_1231 = ( local_1230 ? queue_88[ptr_88] : local_1228) ; (\let local_1232 = ( (local_1230 || (queue_88[ptr_88] == local_1228)) ? (local_1229 + 1) : (local_1229 - 1)) ; (\let local_1233 = (local_1232 == 0) ; (\let local_1234 = ( local_1233 ? queue_92[ptr_92] : local_1231) ; (\let local_1235 = ( (local_1233 || (queue_92[ptr_92] == local_1231)) ? (local_1232 + 1) : (local_1232 - 1)) ; (\let local_1236 = (local_1235 == 0) ; (\let local_1237 = ( local_1236 ? queue_96[ptr_96] : local_1234) ; (\let local_1238 = ( (local_1236 || (queue_96[ptr_96] == local_1234)) ? (local_1235 + 1) : (local_1235 - 1)) ; (\let local_1239 = (local_1238 == 0) ; (\let local_1240 = ( local_1239 ? queue_100[ptr_100] : local_1237) ; (\let local_1241 = ( (local_1239 || (queue_100[ptr_100] == local_1237)) ? (local_1238 + 1) : (local_1238 - 1)) ; local_1240 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1090 + 1) : local_1090) ; (\let local_1242 = ( (queue_64[ptr_64] == (\let local_1243 = false ; (\let local_1244 = ( local_1243 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1245 = ( (local_1243 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1246 = (local_1245 == 0) ; (\let local_1247 = ( local_1246 ? queue_8[ptr_8] : local_1244) ; (\let local_1248 = ( (local_1246 || (queue_8[ptr_8] == local_1244)) ? (local_1245 + 1) : (local_1245 - 1)) ; (\let local_1249 = (local_1248 == 0) ; (\let local_1250 = ( local_1249 ? queue_12[ptr_12] : local_1247) ; (\let local_1251 = ( (local_1249 || (queue_12[ptr_12] == local_1247)) ? (local_1248 + 1) : (local_1248 - 1)) ; (\let local_1252 = (local_1251 == 0) ; (\let local_1253 = ( local_1252 ? queue_16[ptr_16] : local_1250) ; (\let local_1254 = ( (local_1252 || (queue_16[ptr_16] == local_1250)) ? (local_1251 + 1) : (local_1251 - 1)) ; (\let local_1255 = (local_1254 == 0) ; (\let local_1256 = ( local_1255 ? queue_20[ptr_20] : local_1253) ; (\let local_1257 = ( (local_1255 || (queue_20[ptr_20] == local_1253)) ? (local_1254 + 1) : (local_1254 - 1)) ; (\let local_1258 = (local_1257 == 0) ; (\let local_1259 = ( local_1258 ? queue_24[ptr_24] : local_1256) ; (\let local_1260 = ( (local_1258 || (queue_24[ptr_24] == local_1256)) ? (local_1257 + 1) : (local_1257 - 1)) ; (\let local_1261 = (local_1260 == 0) ; (\let local_1262 = ( local_1261 ? queue_28[ptr_28] : local_1259) ; (\let local_1263 = ( (local_1261 || (queue_28[ptr_28] == local_1259)) ? (local_1260 + 1) : (local_1260 - 1)) ; (\let local_1264 = (local_1263 == 0) ; (\let local_1265 = ( local_1264 ? queue_32[ptr_32] : local_1262) ; (\let local_1266 = ( (local_1264 || (queue_32[ptr_32] == local_1262)) ? (local_1263 + 1) : (local_1263 - 1)) ; (\let local_1267 = (local_1266 == 0) ; (\let local_1268 = ( local_1267 ? queue_36[ptr_36] : local_1265) ; (\let local_1269 = ( (local_1267 || (queue_36[ptr_36] == local_1265)) ? (local_1266 + 1) : (local_1266 - 1)) ; (\let local_1270 = (local_1269 == 0) ; (\let local_1271 = ( local_1270 ? queue_40[ptr_40] : local_1268) ; (\let local_1272 = ( (local_1270 || (queue_40[ptr_40] == local_1268)) ? (local_1269 + 1) : (local_1269 - 1)) ; (\let local_1273 = (local_1272 == 0) ; (\let local_1274 = ( local_1273 ? queue_44[ptr_44] : local_1271) ; (\let local_1275 = ( (local_1273 || (queue_44[ptr_44] == local_1271)) ? (local_1272 + 1) : (local_1272 - 1)) ; (\let local_1276 = (local_1275 == 0) ; (\let local_1277 = ( local_1276 ? queue_48[ptr_48] : local_1274) ; (\let local_1278 = ( (local_1276 || (queue_48[ptr_48] == local_1274)) ? (local_1275 + 1) : (local_1275 - 1)) ; (\let local_1279 = (local_1278 == 0) ; (\let local_1280 = ( local_1279 ? queue_52[ptr_52] : local_1277) ; (\let local_1281 = ( (local_1279 || (queue_52[ptr_52] == local_1277)) ? (local_1278 + 1) : (local_1278 - 1)) ; (\let local_1282 = (local_1281 == 0) ; (\let local_1283 = ( local_1282 ? queue_56[ptr_56] : local_1280) ; (\let local_1284 = ( (local_1282 || (queue_56[ptr_56] == local_1280)) ? (local_1281 + 1) : (local_1281 - 1)) ; (\let local_1285 = (local_1284 == 0) ; (\let local_1286 = ( local_1285 ? queue_60[ptr_60] : local_1283) ; (\let local_1287 = ( (local_1285 || (queue_60[ptr_60] == local_1283)) ? (local_1284 + 1) : (local_1284 - 1)) ; (\let local_1288 = (local_1287 == 0) ; (\let local_1289 = ( local_1288 ? queue_64[ptr_64] : local_1286) ; (\let local_1290 = ( (local_1288 || (queue_64[ptr_64] == local_1286)) ? (local_1287 + 1) : (local_1287 - 1)) ; (\let local_1291 = (local_1290 == 0) ; (\let local_1292 = ( local_1291 ? queue_68[ptr_68] : local_1289) ; (\let local_1293 = ( (local_1291 || (queue_68[ptr_68] == local_1289)) ? (local_1290 + 1) : (local_1290 - 1)) ; (\let local_1294 = (local_1293 == 0) ; (\let local_1295 = ( local_1294 ? queue_72[ptr_72] : local_1292) ; (\let local_1296 = ( (local_1294 || (queue_72[ptr_72] == local_1292)) ? (local_1293 + 1) : (local_1293 - 1)) ; (\let local_1297 = (local_1296 == 0) ; (\let local_1298 = ( local_1297 ? queue_76[ptr_76] : local_1295) ; (\let local_1299 = ( (local_1297 || (queue_76[ptr_76] == local_1295)) ? (local_1296 + 1) : (local_1296 - 1)) ; (\let local_1300 = (local_1299 == 0) ; (\let local_1301 = ( local_1300 ? queue_80[ptr_80] : local_1298) ; (\let local_1302 = ( (local_1300 || (queue_80[ptr_80] == local_1298)) ? (local_1299 + 1) : (local_1299 - 1)) ; (\let local_1303 = (local_1302 == 0) ; (\let local_1304 = ( local_1303 ? queue_84[ptr_84] : local_1301) ; (\let local_1305 = ( (local_1303 || (queue_84[ptr_84] == local_1301)) ? (local_1302 + 1) : (local_1302 - 1)) ; (\let local_1306 = (local_1305 == 0) ; (\let local_1307 = ( local_1306 ? queue_88[ptr_88] : local_1304) ; (\let local_1308 = ( (local_1306 || (queue_88[ptr_88] == local_1304)) ? (local_1305 + 1) : (local_1305 - 1)) ; (\let local_1309 = (local_1308 == 0) ; (\let local_1310 = ( local_1309 ? queue_92[ptr_92] : local_1307) ; (\let local_1311 = ( (local_1309 || (queue_92[ptr_92] == local_1307)) ? (local_1308 + 1) : (local_1308 - 1)) ; (\let local_1312 = (local_1311 == 0) ; (\let local_1313 = ( local_1312 ? queue_96[ptr_96] : local_1310) ; (\let local_1314 = ( (local_1312 || (queue_96[ptr_96] == local_1310)) ? (local_1311 + 1) : (local_1311 - 1)) ; (\let local_1315 = (local_1314 == 0) ; (\let local_1316 = ( local_1315 ? queue_100[ptr_100] : local_1313) ; (\let local_1317 = ( (local_1315 || (queue_100[ptr_100] == local_1313)) ? (local_1314 + 1) : (local_1314 - 1)) ; local_1316 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1166 + 1) : local_1166) ; (\let local_1318 = ( (queue_68[ptr_68] == (\let local_1319 = false ; (\let local_1320 = ( local_1319 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1321 = ( (local_1319 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1322 = (local_1321 == 0) ; (\let local_1323 = ( local_1322 ? queue_8[ptr_8] : local_1320) ; (\let local_1324 = ( (local_1322 || (queue_8[ptr_8] == local_1320)) ? (local_1321 + 1) : (local_1321 - 1)) ; (\let local_1325 = (local_1324 == 0) ; (\let local_1326 = ( local_1325 ? queue_12[ptr_12] : local_1323) ; (\let local_1327 = ( (local_1325 || (queue_12[ptr_12] == local_1323)) ? (local_1324 + 1) : (local_1324 - 1)) ; (\let local_1328 = (local_1327 == 0) ; (\let local_1329 = ( local_1328 ? queue_16[ptr_16] : local_1326) ; (\let local_1330 = ( (local_1328 || (queue_16[ptr_16] == local_1326)) ? (local_1327 + 1) : (local_1327 - 1)) ; (\let local_1331 = (local_1330 == 0) ; (\let local_1332 = ( local_1331 ? queue_20[ptr_20] : local_1329) ; (\let local_1333 = ( (local_1331 || (queue_20[ptr_20] == local_1329)) ? (local_1330 + 1) : (local_1330 - 1)) ; (\let local_1334 = (local_1333 == 0) ; (\let local_1335 = ( local_1334 ? queue_24[ptr_24] : local_1332) ; (\let local_1336 = ( (local_1334 || (queue_24[ptr_24] == local_1332)) ? (local_1333 + 1) : (local_1333 - 1)) ; (\let local_1337 = (local_1336 == 0) ; (\let local_1338 = ( local_1337 ? queue_28[ptr_28] : local_1335) ; (\let local_1339 = ( (local_1337 || (queue_28[ptr_28] == local_1335)) ? (local_1336 + 1) : (local_1336 - 1)) ; (\let local_1340 = (local_1339 == 0) ; (\let local_1341 = ( local_1340 ? queue_32[ptr_32] : local_1338) ; (\let local_1342 = ( (local_1340 || (queue_32[ptr_32] == local_1338)) ? (local_1339 + 1) : (local_1339 - 1)) ; (\let local_1343 = (local_1342 == 0) ; (\let local_1344 = ( local_1343 ? queue_36[ptr_36] : local_1341) ; (\let local_1345 = ( (local_1343 || (queue_36[ptr_36] == local_1341)) ? (local_1342 + 1) : (local_1342 - 1)) ; (\let local_1346 = (local_1345 == 0) ; (\let local_1347 = ( local_1346 ? queue_40[ptr_40] : local_1344) ; (\let local_1348 = ( (local_1346 || (queue_40[ptr_40] == local_1344)) ? (local_1345 + 1) : (local_1345 - 1)) ; (\let local_1349 = (local_1348 == 0) ; (\let local_1350 = ( local_1349 ? queue_44[ptr_44] : local_1347) ; (\let local_1351 = ( (local_1349 || (queue_44[ptr_44] == local_1347)) ? (local_1348 + 1) : (local_1348 - 1)) ; (\let local_1352 = (local_1351 == 0) ; (\let local_1353 = ( local_1352 ? queue_48[ptr_48] : local_1350) ; (\let local_1354 = ( (local_1352 || (queue_48[ptr_48] == local_1350)) ? (local_1351 + 1) : (local_1351 - 1)) ; (\let local_1355 = (local_1354 == 0) ; (\let local_1356 = ( local_1355 ? queue_52[ptr_52] : local_1353) ; (\let local_1357 = ( (local_1355 || (queue_52[ptr_52] == local_1353)) ? (local_1354 + 1) : (local_1354 - 1)) ; (\let local_1358 = (local_1357 == 0) ; (\let local_1359 = ( local_1358 ? queue_56[ptr_56] : local_1356) ; (\let local_1360 = ( (local_1358 || (queue_56[ptr_56] == local_1356)) ? (local_1357 + 1) : (local_1357 - 1)) ; (\let local_1361 = (local_1360 == 0) ; (\let local_1362 = ( local_1361 ? queue_60[ptr_60] : local_1359) ; (\let local_1363 = ( (local_1361 || (queue_60[ptr_60] == local_1359)) ? (local_1360 + 1) : (local_1360 - 1)) ; (\let local_1364 = (local_1363 == 0) ; (\let local_1365 = ( local_1364 ? queue_64[ptr_64] : local_1362) ; (\let local_1366 = ( (local_1364 || (queue_64[ptr_64] == local_1362)) ? (local_1363 + 1) : (local_1363 - 1)) ; (\let local_1367 = (local_1366 == 0) ; (\let local_1368 = ( local_1367 ? queue_68[ptr_68] : local_1365) ; (\let local_1369 = ( (local_1367 || (queue_68[ptr_68] == local_1365)) ? (local_1366 + 1) : (local_1366 - 1)) ; (\let local_1370 = (local_1369 == 0) ; (\let local_1371 = ( local_1370 ? queue_72[ptr_72] : local_1368) ; (\let local_1372 = ( (local_1370 || (queue_72[ptr_72] == local_1368)) ? (local_1369 + 1) : (local_1369 - 1)) ; (\let local_1373 = (local_1372 == 0) ; (\let local_1374 = ( local_1373 ? queue_76[ptr_76] : local_1371) ; (\let local_1375 = ( (local_1373 || (queue_76[ptr_76] == local_1371)) ? (local_1372 + 1) : (local_1372 - 1)) ; (\let local_1376 = (local_1375 == 0) ; (\let local_1377 = ( local_1376 ? queue_80[ptr_80] : local_1374) ; (\let local_1378 = ( (local_1376 || (queue_80[ptr_80] == local_1374)) ? (local_1375 + 1) : (local_1375 - 1)) ; (\let local_1379 = (local_1378 == 0) ; (\let local_1380 = ( local_1379 ? queue_84[ptr_84] : local_1377) ; (\let local_1381 = ( (local_1379 || (queue_84[ptr_84] == local_1377)) ? (local_1378 + 1) : (local_1378 - 1)) ; (\let local_1382 = (local_1381 == 0) ; (\let local_1383 = ( local_1382 ? queue_88[ptr_88] : local_1380) ; (\let local_1384 = ( (local_1382 || (queue_88[ptr_88] == local_1380)) ? (local_1381 + 1) : (local_1381 - 1)) ; (\let local_1385 = (local_1384 == 0) ; (\let local_1386 = ( local_1385 ? queue_92[ptr_92] : local_1383) ; (\let local_1387 = ( (local_1385 || (queue_92[ptr_92] == local_1383)) ? (local_1384 + 1) : (local_1384 - 1)) ; (\let local_1388 = (local_1387 == 0) ; (\let local_1389 = ( local_1388 ? queue_96[ptr_96] : local_1386) ; (\let local_1390 = ( (local_1388 || (queue_96[ptr_96] == local_1386)) ? (local_1387 + 1) : (local_1387 - 1)) ; (\let local_1391 = (local_1390 == 0) ; (\let local_1392 = ( local_1391 ? queue_100[ptr_100] : local_1389) ; (\let local_1393 = ( (local_1391 || (queue_100[ptr_100] == local_1389)) ? (local_1390 + 1) : (local_1390 - 1)) ; local_1392 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1242 + 1) : local_1242) ; (\let local_1394 = ( (queue_72[ptr_72] == (\let local_1395 = false ; (\let local_1396 = ( local_1395 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1397 = ( (local_1395 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1398 = (local_1397 == 0) ; (\let local_1399 = ( local_1398 ? queue_8[ptr_8] : local_1396) ; (\let local_1400 = ( (local_1398 || (queue_8[ptr_8] == local_1396)) ? (local_1397 + 1) : (local_1397 - 1)) ; (\let local_1401 = (local_1400 == 0) ; (\let local_1402 = ( local_1401 ? queue_12[ptr_12] : local_1399) ; (\let local_1403 = ( (local_1401 || (queue_12[ptr_12] == local_1399)) ? (local_1400 + 1) : (local_1400 - 1)) ; (\let local_1404 = (local_1403 == 0) ; (\let local_1405 = ( local_1404 ? queue_16[ptr_16] : local_1402) ; (\let local_1406 = ( (local_1404 || (queue_16[ptr_16] == local_1402)) ? (local_1403 + 1) : (local_1403 - 1)) ; (\let local_1407 = (local_1406 == 0) ; (\let local_1408 = ( local_1407 ? queue_20[ptr_20] : local_1405) ; (\let local_1409 = ( (local_1407 || (queue_20[ptr_20] == local_1405)) ? (local_1406 + 1) : (local_1406 - 1)) ; (\let local_1410 = (local_1409 == 0) ; (\let local_1411 = ( local_1410 ? queue_24[ptr_24] : local_1408) ; (\let local_1412 = ( (local_1410 || (queue_24[ptr_24] == local_1408)) ? (local_1409 + 1) : (local_1409 - 1)) ; (\let local_1413 = (local_1412 == 0) ; (\let local_1414 = ( local_1413 ? queue_28[ptr_28] : local_1411) ; (\let local_1415 = ( (local_1413 || (queue_28[ptr_28] == local_1411)) ? (local_1412 + 1) : (local_1412 - 1)) ; (\let local_1416 = (local_1415 == 0) ; (\let local_1417 = ( local_1416 ? queue_32[ptr_32] : local_1414) ; (\let local_1418 = ( (local_1416 || (queue_32[ptr_32] == local_1414)) ? (local_1415 + 1) : (local_1415 - 1)) ; (\let local_1419 = (local_1418 == 0) ; (\let local_1420 = ( local_1419 ? queue_36[ptr_36] : local_1417) ; (\let local_1421 = ( (local_1419 || (queue_36[ptr_36] == local_1417)) ? (local_1418 + 1) : (local_1418 - 1)) ; (\let local_1422 = (local_1421 == 0) ; (\let local_1423 = ( local_1422 ? queue_40[ptr_40] : local_1420) ; (\let local_1424 = ( (local_1422 || (queue_40[ptr_40] == local_1420)) ? (local_1421 + 1) : (local_1421 - 1)) ; (\let local_1425 = (local_1424 == 0) ; (\let local_1426 = ( local_1425 ? queue_44[ptr_44] : local_1423) ; (\let local_1427 = ( (local_1425 || (queue_44[ptr_44] == local_1423)) ? (local_1424 + 1) : (local_1424 - 1)) ; (\let local_1428 = (local_1427 == 0) ; (\let local_1429 = ( local_1428 ? queue_48[ptr_48] : local_1426) ; (\let local_1430 = ( (local_1428 || (queue_48[ptr_48] == local_1426)) ? (local_1427 + 1) : (local_1427 - 1)) ; (\let local_1431 = (local_1430 == 0) ; (\let local_1432 = ( local_1431 ? queue_52[ptr_52] : local_1429) ; (\let local_1433 = ( (local_1431 || (queue_52[ptr_52] == local_1429)) ? (local_1430 + 1) : (local_1430 - 1)) ; (\let local_1434 = (local_1433 == 0) ; (\let local_1435 = ( local_1434 ? queue_56[ptr_56] : local_1432) ; (\let local_1436 = ( (local_1434 || (queue_56[ptr_56] == local_1432)) ? (local_1433 + 1) : (local_1433 - 1)) ; (\let local_1437 = (local_1436 == 0) ; (\let local_1438 = ( local_1437 ? queue_60[ptr_60] : local_1435) ; (\let local_1439 = ( (local_1437 || (queue_60[ptr_60] == local_1435)) ? (local_1436 + 1) : (local_1436 - 1)) ; (\let local_1440 = (local_1439 == 0) ; (\let local_1441 = ( local_1440 ? queue_64[ptr_64] : local_1438) ; (\let local_1442 = ( (local_1440 || (queue_64[ptr_64] == local_1438)) ? (local_1439 + 1) : (local_1439 - 1)) ; (\let local_1443 = (local_1442 == 0) ; (\let local_1444 = ( local_1443 ? queue_68[ptr_68] : local_1441) ; (\let local_1445 = ( (local_1443 || (queue_68[ptr_68] == local_1441)) ? (local_1442 + 1) : (local_1442 - 1)) ; (\let local_1446 = (local_1445 == 0) ; (\let local_1447 = ( local_1446 ? queue_72[ptr_72] : local_1444) ; (\let local_1448 = ( (local_1446 || (queue_72[ptr_72] == local_1444)) ? (local_1445 + 1) : (local_1445 - 1)) ; (\let local_1449 = (local_1448 == 0) ; (\let local_1450 = ( local_1449 ? queue_76[ptr_76] : local_1447) ; (\let local_1451 = ( (local_1449 || (queue_76[ptr_76] == local_1447)) ? (local_1448 + 1) : (local_1448 - 1)) ; (\let local_1452 = (local_1451 == 0) ; (\let local_1453 = ( local_1452 ? queue_80[ptr_80] : local_1450) ; (\let local_1454 = ( (local_1452 || (queue_80[ptr_80] == local_1450)) ? (local_1451 + 1) : (local_1451 - 1)) ; (\let local_1455 = (local_1454 == 0) ; (\let local_1456 = ( local_1455 ? queue_84[ptr_84] : local_1453) ; (\let local_1457 = ( (local_1455 || (queue_84[ptr_84] == local_1453)) ? (local_1454 + 1) : (local_1454 - 1)) ; (\let local_1458 = (local_1457 == 0) ; (\let local_1459 = ( local_1458 ? queue_88[ptr_88] : local_1456) ; (\let local_1460 = ( (local_1458 || (queue_88[ptr_88] == local_1456)) ? (local_1457 + 1) : (local_1457 - 1)) ; (\let local_1461 = (local_1460 == 0) ; (\let local_1462 = ( local_1461 ? queue_92[ptr_92] : local_1459) ; (\let local_1463 = ( (local_1461 || (queue_92[ptr_92] == local_1459)) ? (local_1460 + 1) : (local_1460 - 1)) ; (\let local_1464 = (local_1463 == 0) ; (\let local_1465 = ( local_1464 ? queue_96[ptr_96] : local_1462) ; (\let local_1466 = ( (local_1464 || (queue_96[ptr_96] == local_1462)) ? (local_1463 + 1) : (local_1463 - 1)) ; (\let local_1467 = (local_1466 == 0) ; (\let local_1468 = ( local_1467 ? queue_100[ptr_100] : local_1465) ; (\let local_1469 = ( (local_1467 || (queue_100[ptr_100] == local_1465)) ? (local_1466 + 1) : (local_1466 - 1)) ; local_1468 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1318 + 1) : local_1318) ; (\let local_1470 = ( (queue_76[ptr_76] == (\let local_1471 = false ; (\let local_1472 = ( local_1471 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1473 = ( (local_1471 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1474 = (local_1473 == 0) ; (\let local_1475 = ( local_1474 ? queue_8[ptr_8] : local_1472) ; (\let local_1476 = ( (local_1474 || (queue_8[ptr_8] == local_1472)) ? (local_1473 + 1) : (local_1473 - 1)) ; (\let local_1477 = (local_1476 == 0) ; (\let local_1478 = ( local_1477 ? queue_12[ptr_12] : local_1475) ; (\let local_1479 = ( (local_1477 || (queue_12[ptr_12] == local_1475)) ? (local_1476 + 1) : (local_1476 - 1)) ; (\let local_1480 = (local_1479 == 0) ; (\let local_1481 = ( local_1480 ? queue_16[ptr_16] : local_1478) ; (\let local_1482 = ( (local_1480 || (queue_16[ptr_16] == local_1478)) ? (local_1479 + 1) : (local_1479 - 1)) ; (\let local_1483 = (local_1482 == 0) ; (\let local_1484 = ( local_1483 ? queue_20[ptr_20] : local_1481) ; (\let local_1485 = ( (local_1483 || (queue_20[ptr_20] == local_1481)) ? (local_1482 + 1) : (local_1482 - 1)) ; (\let local_1486 = (local_1485 == 0) ; (\let local_1487 = ( local_1486 ? queue_24[ptr_24] : local_1484) ; (\let local_1488 = ( (local_1486 || (queue_24[ptr_24] == local_1484)) ? (local_1485 + 1) : (local_1485 - 1)) ; (\let local_1489 = (local_1488 == 0) ; (\let local_1490 = ( local_1489 ? queue_28[ptr_28] : local_1487) ; (\let local_1491 = ( (local_1489 || (queue_28[ptr_28] == local_1487)) ? (local_1488 + 1) : (local_1488 - 1)) ; (\let local_1492 = (local_1491 == 0) ; (\let local_1493 = ( local_1492 ? queue_32[ptr_32] : local_1490) ; (\let local_1494 = ( (local_1492 || (queue_32[ptr_32] == local_1490)) ? (local_1491 + 1) : (local_1491 - 1)) ; (\let local_1495 = (local_1494 == 0) ; (\let local_1496 = ( local_1495 ? queue_36[ptr_36] : local_1493) ; (\let local_1497 = ( (local_1495 || (queue_36[ptr_36] == local_1493)) ? (local_1494 + 1) : (local_1494 - 1)) ; (\let local_1498 = (local_1497 == 0) ; (\let local_1499 = ( local_1498 ? queue_40[ptr_40] : local_1496) ; (\let local_1500 = ( (local_1498 || (queue_40[ptr_40] == local_1496)) ? (local_1497 + 1) : (local_1497 - 1)) ; (\let local_1501 = (local_1500 == 0) ; (\let local_1502 = ( local_1501 ? queue_44[ptr_44] : local_1499) ; (\let local_1503 = ( (local_1501 || (queue_44[ptr_44] == local_1499)) ? (local_1500 + 1) : (local_1500 - 1)) ; (\let local_1504 = (local_1503 == 0) ; (\let local_1505 = ( local_1504 ? queue_48[ptr_48] : local_1502) ; (\let local_1506 = ( (local_1504 || (queue_48[ptr_48] == local_1502)) ? (local_1503 + 1) : (local_1503 - 1)) ; (\let local_1507 = (local_1506 == 0) ; (\let local_1508 = ( local_1507 ? queue_52[ptr_52] : local_1505) ; (\let local_1509 = ( (local_1507 || (queue_52[ptr_52] == local_1505)) ? (local_1506 + 1) : (local_1506 - 1)) ; (\let local_1510 = (local_1509 == 0) ; (\let local_1511 = ( local_1510 ? queue_56[ptr_56] : local_1508) ; (\let local_1512 = ( (local_1510 || (queue_56[ptr_56] == local_1508)) ? (local_1509 + 1) : (local_1509 - 1)) ; (\let local_1513 = (local_1512 == 0) ; (\let local_1514 = ( local_1513 ? queue_60[ptr_60] : local_1511) ; (\let local_1515 = ( (local_1513 || (queue_60[ptr_60] == local_1511)) ? (local_1512 + 1) : (local_1512 - 1)) ; (\let local_1516 = (local_1515 == 0) ; (\let local_1517 = ( local_1516 ? queue_64[ptr_64] : local_1514) ; (\let local_1518 = ( (local_1516 || (queue_64[ptr_64] == local_1514)) ? (local_1515 + 1) : (local_1515 - 1)) ; (\let local_1519 = (local_1518 == 0) ; (\let local_1520 = ( local_1519 ? queue_68[ptr_68] : local_1517) ; (\let local_1521 = ( (local_1519 || (queue_68[ptr_68] == local_1517)) ? (local_1518 + 1) : (local_1518 - 1)) ; (\let local_1522 = (local_1521 == 0) ; (\let local_1523 = ( local_1522 ? queue_72[ptr_72] : local_1520) ; (\let local_1524 = ( (local_1522 || (queue_72[ptr_72] == local_1520)) ? (local_1521 + 1) : (local_1521 - 1)) ; (\let local_1525 = (local_1524 == 0) ; (\let local_1526 = ( local_1525 ? queue_76[ptr_76] : local_1523) ; (\let local_1527 = ( (local_1525 || (queue_76[ptr_76] == local_1523)) ? (local_1524 + 1) : (local_1524 - 1)) ; (\let local_1528 = (local_1527 == 0) ; (\let local_1529 = ( local_1528 ? queue_80[ptr_80] : local_1526) ; (\let local_1530 = ( (local_1528 || (queue_80[ptr_80] == local_1526)) ? (local_1527 + 1) : (local_1527 - 1)) ; (\let local_1531 = (local_1530 == 0) ; (\let local_1532 = ( local_1531 ? queue_84[ptr_84] : local_1529) ; (\let local_1533 = ( (local_1531 || (queue_84[ptr_84] == local_1529)) ? (local_1530 + 1) : (local_1530 - 1)) ; (\let local_1534 = (local_1533 == 0) ; (\let local_1535 = ( local_1534 ? queue_88[ptr_88] : local_1532) ; (\let local_1536 = ( (local_1534 || (queue_88[ptr_88] == local_1532)) ? (local_1533 + 1) : (local_1533 - 1)) ; (\let local_1537 = (local_1536 == 0) ; (\let local_1538 = ( local_1537 ? queue_92[ptr_92] : local_1535) ; (\let local_1539 = ( (local_1537 || (queue_92[ptr_92] == local_1535)) ? (local_1536 + 1) : (local_1536 - 1)) ; (\let local_1540 = (local_1539 == 0) ; (\let local_1541 = ( local_1540 ? queue_96[ptr_96] : local_1538) ; (\let local_1542 = ( (local_1540 || (queue_96[ptr_96] == local_1538)) ? (local_1539 + 1) : (local_1539 - 1)) ; (\let local_1543 = (local_1542 == 0) ; (\let local_1544 = ( local_1543 ? queue_100[ptr_100] : local_1541) ; (\let local_1545 = ( (local_1543 || (queue_100[ptr_100] == local_1541)) ? (local_1542 + 1) : (local_1542 - 1)) ; local_1544 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1394 + 1) : local_1394) ; (\let local_1546 = ( (queue_80[ptr_80] == (\let local_1547 = false ; (\let local_1548 = ( local_1547 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1549 = ( (local_1547 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1550 = (local_1549 == 0) ; (\let local_1551 = ( local_1550 ? queue_8[ptr_8] : local_1548) ; (\let local_1552 = ( (local_1550 || (queue_8[ptr_8] == local_1548)) ? (local_1549 + 1) : (local_1549 - 1)) ; (\let local_1553 = (local_1552 == 0) ; (\let local_1554 = ( local_1553 ? queue_12[ptr_12] : local_1551) ; (\let local_1555 = ( (local_1553 || (queue_12[ptr_12] == local_1551)) ? (local_1552 + 1) : (local_1552 - 1)) ; (\let local_1556 = (local_1555 == 0) ; (\let local_1557 = ( local_1556 ? queue_16[ptr_16] : local_1554) ; (\let local_1558 = ( (local_1556 || (queue_16[ptr_16] == local_1554)) ? (local_1555 + 1) : (local_1555 - 1)) ; (\let local_1559 = (local_1558 == 0) ; (\let local_1560 = ( local_1559 ? queue_20[ptr_20] : local_1557) ; (\let local_1561 = ( (local_1559 || (queue_20[ptr_20] == local_1557)) ? (local_1558 + 1) : (local_1558 - 1)) ; (\let local_1562 = (local_1561 == 0) ; (\let local_1563 = ( local_1562 ? queue_24[ptr_24] : local_1560) ; (\let local_1564 = ( (local_1562 || (queue_24[ptr_24] == local_1560)) ? (local_1561 + 1) : (local_1561 - 1)) ; (\let local_1565 = (local_1564 == 0) ; (\let local_1566 = ( local_1565 ? queue_28[ptr_28] : local_1563) ; (\let local_1567 = ( (local_1565 || (queue_28[ptr_28] == local_1563)) ? (local_1564 + 1) : (local_1564 - 1)) ; (\let local_1568 = (local_1567 == 0) ; (\let local_1569 = ( local_1568 ? queue_32[ptr_32] : local_1566) ; (\let local_1570 = ( (local_1568 || (queue_32[ptr_32] == local_1566)) ? (local_1567 + 1) : (local_1567 - 1)) ; (\let local_1571 = (local_1570 == 0) ; (\let local_1572 = ( local_1571 ? queue_36[ptr_36] : local_1569) ; (\let local_1573 = ( (local_1571 || (queue_36[ptr_36] == local_1569)) ? (local_1570 + 1) : (local_1570 - 1)) ; (\let local_1574 = (local_1573 == 0) ; (\let local_1575 = ( local_1574 ? queue_40[ptr_40] : local_1572) ; (\let local_1576 = ( (local_1574 || (queue_40[ptr_40] == local_1572)) ? (local_1573 + 1) : (local_1573 - 1)) ; (\let local_1577 = (local_1576 == 0) ; (\let local_1578 = ( local_1577 ? queue_44[ptr_44] : local_1575) ; (\let local_1579 = ( (local_1577 || (queue_44[ptr_44] == local_1575)) ? (local_1576 + 1) : (local_1576 - 1)) ; (\let local_1580 = (local_1579 == 0) ; (\let local_1581 = ( local_1580 ? queue_48[ptr_48] : local_1578) ; (\let local_1582 = ( (local_1580 || (queue_48[ptr_48] == local_1578)) ? (local_1579 + 1) : (local_1579 - 1)) ; (\let local_1583 = (local_1582 == 0) ; (\let local_1584 = ( local_1583 ? queue_52[ptr_52] : local_1581) ; (\let local_1585 = ( (local_1583 || (queue_52[ptr_52] == local_1581)) ? (local_1582 + 1) : (local_1582 - 1)) ; (\let local_1586 = (local_1585 == 0) ; (\let local_1587 = ( local_1586 ? queue_56[ptr_56] : local_1584) ; (\let local_1588 = ( (local_1586 || (queue_56[ptr_56] == local_1584)) ? (local_1585 + 1) : (local_1585 - 1)) ; (\let local_1589 = (local_1588 == 0) ; (\let local_1590 = ( local_1589 ? queue_60[ptr_60] : local_1587) ; (\let local_1591 = ( (local_1589 || (queue_60[ptr_60] == local_1587)) ? (local_1588 + 1) : (local_1588 - 1)) ; (\let local_1592 = (local_1591 == 0) ; (\let local_1593 = ( local_1592 ? queue_64[ptr_64] : local_1590) ; (\let local_1594 = ( (local_1592 || (queue_64[ptr_64] == local_1590)) ? (local_1591 + 1) : (local_1591 - 1)) ; (\let local_1595 = (local_1594 == 0) ; (\let local_1596 = ( local_1595 ? queue_68[ptr_68] : local_1593) ; (\let local_1597 = ( (local_1595 || (queue_68[ptr_68] == local_1593)) ? (local_1594 + 1) : (local_1594 - 1)) ; (\let local_1598 = (local_1597 == 0) ; (\let local_1599 = ( local_1598 ? queue_72[ptr_72] : local_1596) ; (\let local_1600 = ( (local_1598 || (queue_72[ptr_72] == local_1596)) ? (local_1597 + 1) : (local_1597 - 1)) ; (\let local_1601 = (local_1600 == 0) ; (\let local_1602 = ( local_1601 ? queue_76[ptr_76] : local_1599) ; (\let local_1603 = ( (local_1601 || (queue_76[ptr_76] == local_1599)) ? (local_1600 + 1) : (local_1600 - 1)) ; (\let local_1604 = (local_1603 == 0) ; (\let local_1605 = ( local_1604 ? queue_80[ptr_80] : local_1602) ; (\let local_1606 = ( (local_1604 || (queue_80[ptr_80] == local_1602)) ? (local_1603 + 1) : (local_1603 - 1)) ; (\let local_1607 = (local_1606 == 0) ; (\let local_1608 = ( local_1607 ? queue_84[ptr_84] : local_1605) ; (\let local_1609 = ( (local_1607 || (queue_84[ptr_84] == local_1605)) ? (local_1606 + 1) : (local_1606 - 1)) ; (\let local_1610 = (local_1609 == 0) ; (\let local_1611 = ( local_1610 ? queue_88[ptr_88] : local_1608) ; (\let local_1612 = ( (local_1610 || (queue_88[ptr_88] == local_1608)) ? (local_1609 + 1) : (local_1609 - 1)) ; (\let local_1613 = (local_1612 == 0) ; (\let local_1614 = ( local_1613 ? queue_92[ptr_92] : local_1611) ; (\let local_1615 = ( (local_1613 || (queue_92[ptr_92] == local_1611)) ? (local_1612 + 1) : (local_1612 - 1)) ; (\let local_1616 = (local_1615 == 0) ; (\let local_1617 = ( local_1616 ? queue_96[ptr_96] : local_1614) ; (\let local_1618 = ( (local_1616 || (queue_96[ptr_96] == local_1614)) ? (local_1615 + 1) : (local_1615 - 1)) ; (\let local_1619 = (local_1618 == 0) ; (\let local_1620 = ( local_1619 ? queue_100[ptr_100] : local_1617) ; (\let local_1621 = ( (local_1619 || (queue_100[ptr_100] == local_1617)) ? (local_1618 + 1) : (local_1618 - 1)) ; local_1620 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1470 + 1) : local_1470) ; (\let local_1622 = ( (queue_84[ptr_84] == (\let local_1623 = false ; (\let local_1624 = ( local_1623 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1625 = ( (local_1623 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1626 = (local_1625 == 0) ; (\let local_1627 = ( local_1626 ? queue_8[ptr_8] : local_1624) ; (\let local_1628 = ( (local_1626 || (queue_8[ptr_8] == local_1624)) ? (local_1625 + 1) : (local_1625 - 1)) ; (\let local_1629 = (local_1628 == 0) ; (\let local_1630 = ( local_1629 ? queue_12[ptr_12] : local_1627) ; (\let local_1631 = ( (local_1629 || (queue_12[ptr_12] == local_1627)) ? (local_1628 + 1) : (local_1628 - 1)) ; (\let local_1632 = (local_1631 == 0) ; (\let local_1633 = ( local_1632 ? queue_16[ptr_16] : local_1630) ; (\let local_1634 = ( (local_1632 || (queue_16[ptr_16] == local_1630)) ? (local_1631 + 1) : (local_1631 - 1)) ; (\let local_1635 = (local_1634 == 0) ; (\let local_1636 = ( local_1635 ? queue_20[ptr_20] : local_1633) ; (\let local_1637 = ( (local_1635 || (queue_20[ptr_20] == local_1633)) ? (local_1634 + 1) : (local_1634 - 1)) ; (\let local_1638 = (local_1637 == 0) ; (\let local_1639 = ( local_1638 ? queue_24[ptr_24] : local_1636) ; (\let local_1640 = ( (local_1638 || (queue_24[ptr_24] == local_1636)) ? (local_1637 + 1) : (local_1637 - 1)) ; (\let local_1641 = (local_1640 == 0) ; (\let local_1642 = ( local_1641 ? queue_28[ptr_28] : local_1639) ; (\let local_1643 = ( (local_1641 || (queue_28[ptr_28] == local_1639)) ? (local_1640 + 1) : (local_1640 - 1)) ; (\let local_1644 = (local_1643 == 0) ; (\let local_1645 = ( local_1644 ? queue_32[ptr_32] : local_1642) ; (\let local_1646 = ( (local_1644 || (queue_32[ptr_32] == local_1642)) ? (local_1643 + 1) : (local_1643 - 1)) ; (\let local_1647 = (local_1646 == 0) ; (\let local_1648 = ( local_1647 ? queue_36[ptr_36] : local_1645) ; (\let local_1649 = ( (local_1647 || (queue_36[ptr_36] == local_1645)) ? (local_1646 + 1) : (local_1646 - 1)) ; (\let local_1650 = (local_1649 == 0) ; (\let local_1651 = ( local_1650 ? queue_40[ptr_40] : local_1648) ; (\let local_1652 = ( (local_1650 || (queue_40[ptr_40] == local_1648)) ? (local_1649 + 1) : (local_1649 - 1)) ; (\let local_1653 = (local_1652 == 0) ; (\let local_1654 = ( local_1653 ? queue_44[ptr_44] : local_1651) ; (\let local_1655 = ( (local_1653 || (queue_44[ptr_44] == local_1651)) ? (local_1652 + 1) : (local_1652 - 1)) ; (\let local_1656 = (local_1655 == 0) ; (\let local_1657 = ( local_1656 ? queue_48[ptr_48] : local_1654) ; (\let local_1658 = ( (local_1656 || (queue_48[ptr_48] == local_1654)) ? (local_1655 + 1) : (local_1655 - 1)) ; (\let local_1659 = (local_1658 == 0) ; (\let local_1660 = ( local_1659 ? queue_52[ptr_52] : local_1657) ; (\let local_1661 = ( (local_1659 || (queue_52[ptr_52] == local_1657)) ? (local_1658 + 1) : (local_1658 - 1)) ; (\let local_1662 = (local_1661 == 0) ; (\let local_1663 = ( local_1662 ? queue_56[ptr_56] : local_1660) ; (\let local_1664 = ( (local_1662 || (queue_56[ptr_56] == local_1660)) ? (local_1661 + 1) : (local_1661 - 1)) ; (\let local_1665 = (local_1664 == 0) ; (\let local_1666 = ( local_1665 ? queue_60[ptr_60] : local_1663) ; (\let local_1667 = ( (local_1665 || (queue_60[ptr_60] == local_1663)) ? (local_1664 + 1) : (local_1664 - 1)) ; (\let local_1668 = (local_1667 == 0) ; (\let local_1669 = ( local_1668 ? queue_64[ptr_64] : local_1666) ; (\let local_1670 = ( (local_1668 || (queue_64[ptr_64] == local_1666)) ? (local_1667 + 1) : (local_1667 - 1)) ; (\let local_1671 = (local_1670 == 0) ; (\let local_1672 = ( local_1671 ? queue_68[ptr_68] : local_1669) ; (\let local_1673 = ( (local_1671 || (queue_68[ptr_68] == local_1669)) ? (local_1670 + 1) : (local_1670 - 1)) ; (\let local_1674 = (local_1673 == 0) ; (\let local_1675 = ( local_1674 ? queue_72[ptr_72] : local_1672) ; (\let local_1676 = ( (local_1674 || (queue_72[ptr_72] == local_1672)) ? (local_1673 + 1) : (local_1673 - 1)) ; (\let local_1677 = (local_1676 == 0) ; (\let local_1678 = ( local_1677 ? queue_76[ptr_76] : local_1675) ; (\let local_1679 = ( (local_1677 || (queue_76[ptr_76] == local_1675)) ? (local_1676 + 1) : (local_1676 - 1)) ; (\let local_1680 = (local_1679 == 0) ; (\let local_1681 = ( local_1680 ? queue_80[ptr_80] : local_1678) ; (\let local_1682 = ( (local_1680 || (queue_80[ptr_80] == local_1678)) ? (local_1679 + 1) : (local_1679 - 1)) ; (\let local_1683 = (local_1682 == 0) ; (\let local_1684 = ( local_1683 ? queue_84[ptr_84] : local_1681) ; (\let local_1685 = ( (local_1683 || (queue_84[ptr_84] == local_1681)) ? (local_1682 + 1) : (local_1682 - 1)) ; (\let local_1686 = (local_1685 == 0) ; (\let local_1687 = ( local_1686 ? queue_88[ptr_88] : local_1684) ; (\let local_1688 = ( (local_1686 || (queue_88[ptr_88] == local_1684)) ? (local_1685 + 1) : (local_1685 - 1)) ; (\let local_1689 = (local_1688 == 0) ; (\let local_1690 = ( local_1689 ? queue_92[ptr_92] : local_1687) ; (\let local_1691 = ( (local_1689 || (queue_92[ptr_92] == local_1687)) ? (local_1688 + 1) : (local_1688 - 1)) ; (\let local_1692 = (local_1691 == 0) ; (\let local_1693 = ( local_1692 ? queue_96[ptr_96] : local_1690) ; (\let local_1694 = ( (local_1692 || (queue_96[ptr_96] == local_1690)) ? (local_1691 + 1) : (local_1691 - 1)) ; (\let local_1695 = (local_1694 == 0) ; (\let local_1696 = ( local_1695 ? queue_100[ptr_100] : local_1693) ; (\let local_1697 = ( (local_1695 || (queue_100[ptr_100] == local_1693)) ? (local_1694 + 1) : (local_1694 - 1)) ; local_1696 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1546 + 1) : local_1546) ; (\let local_1698 = ( (queue_88[ptr_88] == (\let local_1699 = false ; (\let local_1700 = ( local_1699 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1701 = ( (local_1699 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1702 = (local_1701 == 0) ; (\let local_1703 = ( local_1702 ? queue_8[ptr_8] : local_1700) ; (\let local_1704 = ( (local_1702 || (queue_8[ptr_8] == local_1700)) ? (local_1701 + 1) : (local_1701 - 1)) ; (\let local_1705 = (local_1704 == 0) ; (\let local_1706 = ( local_1705 ? queue_12[ptr_12] : local_1703) ; (\let local_1707 = ( (local_1705 || (queue_12[ptr_12] == local_1703)) ? (local_1704 + 1) : (local_1704 - 1)) ; (\let local_1708 = (local_1707 == 0) ; (\let local_1709 = ( local_1708 ? queue_16[ptr_16] : local_1706) ; (\let local_1710 = ( (local_1708 || (queue_16[ptr_16] == local_1706)) ? (local_1707 + 1) : (local_1707 - 1)) ; (\let local_1711 = (local_1710 == 0) ; (\let local_1712 = ( local_1711 ? queue_20[ptr_20] : local_1709) ; (\let local_1713 = ( (local_1711 || (queue_20[ptr_20] == local_1709)) ? (local_1710 + 1) : (local_1710 - 1)) ; (\let local_1714 = (local_1713 == 0) ; (\let local_1715 = ( local_1714 ? queue_24[ptr_24] : local_1712) ; (\let local_1716 = ( (local_1714 || (queue_24[ptr_24] == local_1712)) ? (local_1713 + 1) : (local_1713 - 1)) ; (\let local_1717 = (local_1716 == 0) ; (\let local_1718 = ( local_1717 ? queue_28[ptr_28] : local_1715) ; (\let local_1719 = ( (local_1717 || (queue_28[ptr_28] == local_1715)) ? (local_1716 + 1) : (local_1716 - 1)) ; (\let local_1720 = (local_1719 == 0) ; (\let local_1721 = ( local_1720 ? queue_32[ptr_32] : local_1718) ; (\let local_1722 = ( (local_1720 || (queue_32[ptr_32] == local_1718)) ? (local_1719 + 1) : (local_1719 - 1)) ; (\let local_1723 = (local_1722 == 0) ; (\let local_1724 = ( local_1723 ? queue_36[ptr_36] : local_1721) ; (\let local_1725 = ( (local_1723 || (queue_36[ptr_36] == local_1721)) ? (local_1722 + 1) : (local_1722 - 1)) ; (\let local_1726 = (local_1725 == 0) ; (\let local_1727 = ( local_1726 ? queue_40[ptr_40] : local_1724) ; (\let local_1728 = ( (local_1726 || (queue_40[ptr_40] == local_1724)) ? (local_1725 + 1) : (local_1725 - 1)) ; (\let local_1729 = (local_1728 == 0) ; (\let local_1730 = ( local_1729 ? queue_44[ptr_44] : local_1727) ; (\let local_1731 = ( (local_1729 || (queue_44[ptr_44] == local_1727)) ? (local_1728 + 1) : (local_1728 - 1)) ; (\let local_1732 = (local_1731 == 0) ; (\let local_1733 = ( local_1732 ? queue_48[ptr_48] : local_1730) ; (\let local_1734 = ( (local_1732 || (queue_48[ptr_48] == local_1730)) ? (local_1731 + 1) : (local_1731 - 1)) ; (\let local_1735 = (local_1734 == 0) ; (\let local_1736 = ( local_1735 ? queue_52[ptr_52] : local_1733) ; (\let local_1737 = ( (local_1735 || (queue_52[ptr_52] == local_1733)) ? (local_1734 + 1) : (local_1734 - 1)) ; (\let local_1738 = (local_1737 == 0) ; (\let local_1739 = ( local_1738 ? queue_56[ptr_56] : local_1736) ; (\let local_1740 = ( (local_1738 || (queue_56[ptr_56] == local_1736)) ? (local_1737 + 1) : (local_1737 - 1)) ; (\let local_1741 = (local_1740 == 0) ; (\let local_1742 = ( local_1741 ? queue_60[ptr_60] : local_1739) ; (\let local_1743 = ( (local_1741 || (queue_60[ptr_60] == local_1739)) ? (local_1740 + 1) : (local_1740 - 1)) ; (\let local_1744 = (local_1743 == 0) ; (\let local_1745 = ( local_1744 ? queue_64[ptr_64] : local_1742) ; (\let local_1746 = ( (local_1744 || (queue_64[ptr_64] == local_1742)) ? (local_1743 + 1) : (local_1743 - 1)) ; (\let local_1747 = (local_1746 == 0) ; (\let local_1748 = ( local_1747 ? queue_68[ptr_68] : local_1745) ; (\let local_1749 = ( (local_1747 || (queue_68[ptr_68] == local_1745)) ? (local_1746 + 1) : (local_1746 - 1)) ; (\let local_1750 = (local_1749 == 0) ; (\let local_1751 = ( local_1750 ? queue_72[ptr_72] : local_1748) ; (\let local_1752 = ( (local_1750 || (queue_72[ptr_72] == local_1748)) ? (local_1749 + 1) : (local_1749 - 1)) ; (\let local_1753 = (local_1752 == 0) ; (\let local_1754 = ( local_1753 ? queue_76[ptr_76] : local_1751) ; (\let local_1755 = ( (local_1753 || (queue_76[ptr_76] == local_1751)) ? (local_1752 + 1) : (local_1752 - 1)) ; (\let local_1756 = (local_1755 == 0) ; (\let local_1757 = ( local_1756 ? queue_80[ptr_80] : local_1754) ; (\let local_1758 = ( (local_1756 || (queue_80[ptr_80] == local_1754)) ? (local_1755 + 1) : (local_1755 - 1)) ; (\let local_1759 = (local_1758 == 0) ; (\let local_1760 = ( local_1759 ? queue_84[ptr_84] : local_1757) ; (\let local_1761 = ( (local_1759 || (queue_84[ptr_84] == local_1757)) ? (local_1758 + 1) : (local_1758 - 1)) ; (\let local_1762 = (local_1761 == 0) ; (\let local_1763 = ( local_1762 ? queue_88[ptr_88] : local_1760) ; (\let local_1764 = ( (local_1762 || (queue_88[ptr_88] == local_1760)) ? (local_1761 + 1) : (local_1761 - 1)) ; (\let local_1765 = (local_1764 == 0) ; (\let local_1766 = ( local_1765 ? queue_92[ptr_92] : local_1763) ; (\let local_1767 = ( (local_1765 || (queue_92[ptr_92] == local_1763)) ? (local_1764 + 1) : (local_1764 - 1)) ; (\let local_1768 = (local_1767 == 0) ; (\let local_1769 = ( local_1768 ? queue_96[ptr_96] : local_1766) ; (\let local_1770 = ( (local_1768 || (queue_96[ptr_96] == local_1766)) ? (local_1767 + 1) : (local_1767 - 1)) ; (\let local_1771 = (local_1770 == 0) ; (\let local_1772 = ( local_1771 ? queue_100[ptr_100] : local_1769) ; (\let local_1773 = ( (local_1771 || (queue_100[ptr_100] == local_1769)) ? (local_1770 + 1) : (local_1770 - 1)) ; local_1772 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1622 + 1) : local_1622) ; (\let local_1774 = ( (queue_92[ptr_92] == (\let local_1775 = false ; (\let local_1776 = ( local_1775 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1777 = ( (local_1775 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1778 = (local_1777 == 0) ; (\let local_1779 = ( local_1778 ? queue_8[ptr_8] : local_1776) ; (\let local_1780 = ( (local_1778 || (queue_8[ptr_8] == local_1776)) ? (local_1777 + 1) : (local_1777 - 1)) ; (\let local_1781 = (local_1780 == 0) ; (\let local_1782 = ( local_1781 ? queue_12[ptr_12] : local_1779) ; (\let local_1783 = ( (local_1781 || (queue_12[ptr_12] == local_1779)) ? (local_1780 + 1) : (local_1780 - 1)) ; (\let local_1784 = (local_1783 == 0) ; (\let local_1785 = ( local_1784 ? queue_16[ptr_16] : local_1782) ; (\let local_1786 = ( (local_1784 || (queue_16[ptr_16] == local_1782)) ? (local_1783 + 1) : (local_1783 - 1)) ; (\let local_1787 = (local_1786 == 0) ; (\let local_1788 = ( local_1787 ? queue_20[ptr_20] : local_1785) ; (\let local_1789 = ( (local_1787 || (queue_20[ptr_20] == local_1785)) ? (local_1786 + 1) : (local_1786 - 1)) ; (\let local_1790 = (local_1789 == 0) ; (\let local_1791 = ( local_1790 ? queue_24[ptr_24] : local_1788) ; (\let local_1792 = ( (local_1790 || (queue_24[ptr_24] == local_1788)) ? (local_1789 + 1) : (local_1789 - 1)) ; (\let local_1793 = (local_1792 == 0) ; (\let local_1794 = ( local_1793 ? queue_28[ptr_28] : local_1791) ; (\let local_1795 = ( (local_1793 || (queue_28[ptr_28] == local_1791)) ? (local_1792 + 1) : (local_1792 - 1)) ; (\let local_1796 = (local_1795 == 0) ; (\let local_1797 = ( local_1796 ? queue_32[ptr_32] : local_1794) ; (\let local_1798 = ( (local_1796 || (queue_32[ptr_32] == local_1794)) ? (local_1795 + 1) : (local_1795 - 1)) ; (\let local_1799 = (local_1798 == 0) ; (\let local_1800 = ( local_1799 ? queue_36[ptr_36] : local_1797) ; (\let local_1801 = ( (local_1799 || (queue_36[ptr_36] == local_1797)) ? (local_1798 + 1) : (local_1798 - 1)) ; (\let local_1802 = (local_1801 == 0) ; (\let local_1803 = ( local_1802 ? queue_40[ptr_40] : local_1800) ; (\let local_1804 = ( (local_1802 || (queue_40[ptr_40] == local_1800)) ? (local_1801 + 1) : (local_1801 - 1)) ; (\let local_1805 = (local_1804 == 0) ; (\let local_1806 = ( local_1805 ? queue_44[ptr_44] : local_1803) ; (\let local_1807 = ( (local_1805 || (queue_44[ptr_44] == local_1803)) ? (local_1804 + 1) : (local_1804 - 1)) ; (\let local_1808 = (local_1807 == 0) ; (\let local_1809 = ( local_1808 ? queue_48[ptr_48] : local_1806) ; (\let local_1810 = ( (local_1808 || (queue_48[ptr_48] == local_1806)) ? (local_1807 + 1) : (local_1807 - 1)) ; (\let local_1811 = (local_1810 == 0) ; (\let local_1812 = ( local_1811 ? queue_52[ptr_52] : local_1809) ; (\let local_1813 = ( (local_1811 || (queue_52[ptr_52] == local_1809)) ? (local_1810 + 1) : (local_1810 - 1)) ; (\let local_1814 = (local_1813 == 0) ; (\let local_1815 = ( local_1814 ? queue_56[ptr_56] : local_1812) ; (\let local_1816 = ( (local_1814 || (queue_56[ptr_56] == local_1812)) ? (local_1813 + 1) : (local_1813 - 1)) ; (\let local_1817 = (local_1816 == 0) ; (\let local_1818 = ( local_1817 ? queue_60[ptr_60] : local_1815) ; (\let local_1819 = ( (local_1817 || (queue_60[ptr_60] == local_1815)) ? (local_1816 + 1) : (local_1816 - 1)) ; (\let local_1820 = (local_1819 == 0) ; (\let local_1821 = ( local_1820 ? queue_64[ptr_64] : local_1818) ; (\let local_1822 = ( (local_1820 || (queue_64[ptr_64] == local_1818)) ? (local_1819 + 1) : (local_1819 - 1)) ; (\let local_1823 = (local_1822 == 0) ; (\let local_1824 = ( local_1823 ? queue_68[ptr_68] : local_1821) ; (\let local_1825 = ( (local_1823 || (queue_68[ptr_68] == local_1821)) ? (local_1822 + 1) : (local_1822 - 1)) ; (\let local_1826 = (local_1825 == 0) ; (\let local_1827 = ( local_1826 ? queue_72[ptr_72] : local_1824) ; (\let local_1828 = ( (local_1826 || (queue_72[ptr_72] == local_1824)) ? (local_1825 + 1) : (local_1825 - 1)) ; (\let local_1829 = (local_1828 == 0) ; (\let local_1830 = ( local_1829 ? queue_76[ptr_76] : local_1827) ; (\let local_1831 = ( (local_1829 || (queue_76[ptr_76] == local_1827)) ? (local_1828 + 1) : (local_1828 - 1)) ; (\let local_1832 = (local_1831 == 0) ; (\let local_1833 = ( local_1832 ? queue_80[ptr_80] : local_1830) ; (\let local_1834 = ( (local_1832 || (queue_80[ptr_80] == local_1830)) ? (local_1831 + 1) : (local_1831 - 1)) ; (\let local_1835 = (local_1834 == 0) ; (\let local_1836 = ( local_1835 ? queue_84[ptr_84] : local_1833) ; (\let local_1837 = ( (local_1835 || (queue_84[ptr_84] == local_1833)) ? (local_1834 + 1) : (local_1834 - 1)) ; (\let local_1838 = (local_1837 == 0) ; (\let local_1839 = ( local_1838 ? queue_88[ptr_88] : local_1836) ; (\let local_1840 = ( (local_1838 || (queue_88[ptr_88] == local_1836)) ? (local_1837 + 1) : (local_1837 - 1)) ; (\let local_1841 = (local_1840 == 0) ; (\let local_1842 = ( local_1841 ? queue_92[ptr_92] : local_1839) ; (\let local_1843 = ( (local_1841 || (queue_92[ptr_92] == local_1839)) ? (local_1840 + 1) : (local_1840 - 1)) ; (\let local_1844 = (local_1843 == 0) ; (\let local_1845 = ( local_1844 ? queue_96[ptr_96] : local_1842) ; (\let local_1846 = ( (local_1844 || (queue_96[ptr_96] == local_1842)) ? (local_1843 + 1) : (local_1843 - 1)) ; (\let local_1847 = (local_1846 == 0) ; (\let local_1848 = ( local_1847 ? queue_100[ptr_100] : local_1845) ; (\let local_1849 = ( (local_1847 || (queue_100[ptr_100] == local_1845)) ? (local_1846 + 1) : (local_1846 - 1)) ; local_1848 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1698 + 1) : local_1698) ; (\let local_1850 = ( (queue_96[ptr_96] == (\let local_1851 = false ; (\let local_1852 = ( local_1851 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1853 = ( (local_1851 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1854 = (local_1853 == 0) ; (\let local_1855 = ( local_1854 ? queue_8[ptr_8] : local_1852) ; (\let local_1856 = ( (local_1854 || (queue_8[ptr_8] == local_1852)) ? (local_1853 + 1) : (local_1853 - 1)) ; (\let local_1857 = (local_1856 == 0) ; (\let local_1858 = ( local_1857 ? queue_12[ptr_12] : local_1855) ; (\let local_1859 = ( (local_1857 || (queue_12[ptr_12] == local_1855)) ? (local_1856 + 1) : (local_1856 - 1)) ; (\let local_1860 = (local_1859 == 0) ; (\let local_1861 = ( local_1860 ? queue_16[ptr_16] : local_1858) ; (\let local_1862 = ( (local_1860 || (queue_16[ptr_16] == local_1858)) ? (local_1859 + 1) : (local_1859 - 1)) ; (\let local_1863 = (local_1862 == 0) ; (\let local_1864 = ( local_1863 ? queue_20[ptr_20] : local_1861) ; (\let local_1865 = ( (local_1863 || (queue_20[ptr_20] == local_1861)) ? (local_1862 + 1) : (local_1862 - 1)) ; (\let local_1866 = (local_1865 == 0) ; (\let local_1867 = ( local_1866 ? queue_24[ptr_24] : local_1864) ; (\let local_1868 = ( (local_1866 || (queue_24[ptr_24] == local_1864)) ? (local_1865 + 1) : (local_1865 - 1)) ; (\let local_1869 = (local_1868 == 0) ; (\let local_1870 = ( local_1869 ? queue_28[ptr_28] : local_1867) ; (\let local_1871 = ( (local_1869 || (queue_28[ptr_28] == local_1867)) ? (local_1868 + 1) : (local_1868 - 1)) ; (\let local_1872 = (local_1871 == 0) ; (\let local_1873 = ( local_1872 ? queue_32[ptr_32] : local_1870) ; (\let local_1874 = ( (local_1872 || (queue_32[ptr_32] == local_1870)) ? (local_1871 + 1) : (local_1871 - 1)) ; (\let local_1875 = (local_1874 == 0) ; (\let local_1876 = ( local_1875 ? queue_36[ptr_36] : local_1873) ; (\let local_1877 = ( (local_1875 || (queue_36[ptr_36] == local_1873)) ? (local_1874 + 1) : (local_1874 - 1)) ; (\let local_1878 = (local_1877 == 0) ; (\let local_1879 = ( local_1878 ? queue_40[ptr_40] : local_1876) ; (\let local_1880 = ( (local_1878 || (queue_40[ptr_40] == local_1876)) ? (local_1877 + 1) : (local_1877 - 1)) ; (\let local_1881 = (local_1880 == 0) ; (\let local_1882 = ( local_1881 ? queue_44[ptr_44] : local_1879) ; (\let local_1883 = ( (local_1881 || (queue_44[ptr_44] == local_1879)) ? (local_1880 + 1) : (local_1880 - 1)) ; (\let local_1884 = (local_1883 == 0) ; (\let local_1885 = ( local_1884 ? queue_48[ptr_48] : local_1882) ; (\let local_1886 = ( (local_1884 || (queue_48[ptr_48] == local_1882)) ? (local_1883 + 1) : (local_1883 - 1)) ; (\let local_1887 = (local_1886 == 0) ; (\let local_1888 = ( local_1887 ? queue_52[ptr_52] : local_1885) ; (\let local_1889 = ( (local_1887 || (queue_52[ptr_52] == local_1885)) ? (local_1886 + 1) : (local_1886 - 1)) ; (\let local_1890 = (local_1889 == 0) ; (\let local_1891 = ( local_1890 ? queue_56[ptr_56] : local_1888) ; (\let local_1892 = ( (local_1890 || (queue_56[ptr_56] == local_1888)) ? (local_1889 + 1) : (local_1889 - 1)) ; (\let local_1893 = (local_1892 == 0) ; (\let local_1894 = ( local_1893 ? queue_60[ptr_60] : local_1891) ; (\let local_1895 = ( (local_1893 || (queue_60[ptr_60] == local_1891)) ? (local_1892 + 1) : (local_1892 - 1)) ; (\let local_1896 = (local_1895 == 0) ; (\let local_1897 = ( local_1896 ? queue_64[ptr_64] : local_1894) ; (\let local_1898 = ( (local_1896 || (queue_64[ptr_64] == local_1894)) ? (local_1895 + 1) : (local_1895 - 1)) ; (\let local_1899 = (local_1898 == 0) ; (\let local_1900 = ( local_1899 ? queue_68[ptr_68] : local_1897) ; (\let local_1901 = ( (local_1899 || (queue_68[ptr_68] == local_1897)) ? (local_1898 + 1) : (local_1898 - 1)) ; (\let local_1902 = (local_1901 == 0) ; (\let local_1903 = ( local_1902 ? queue_72[ptr_72] : local_1900) ; (\let local_1904 = ( (local_1902 || (queue_72[ptr_72] == local_1900)) ? (local_1901 + 1) : (local_1901 - 1)) ; (\let local_1905 = (local_1904 == 0) ; (\let local_1906 = ( local_1905 ? queue_76[ptr_76] : local_1903) ; (\let local_1907 = ( (local_1905 || (queue_76[ptr_76] == local_1903)) ? (local_1904 + 1) : (local_1904 - 1)) ; (\let local_1908 = (local_1907 == 0) ; (\let local_1909 = ( local_1908 ? queue_80[ptr_80] : local_1906) ; (\let local_1910 = ( (local_1908 || (queue_80[ptr_80] == local_1906)) ? (local_1907 + 1) : (local_1907 - 1)) ; (\let local_1911 = (local_1910 == 0) ; (\let local_1912 = ( local_1911 ? queue_84[ptr_84] : local_1909) ; (\let local_1913 = ( (local_1911 || (queue_84[ptr_84] == local_1909)) ? (local_1910 + 1) : (local_1910 - 1)) ; (\let local_1914 = (local_1913 == 0) ; (\let local_1915 = ( local_1914 ? queue_88[ptr_88] : local_1912) ; (\let local_1916 = ( (local_1914 || (queue_88[ptr_88] == local_1912)) ? (local_1913 + 1) : (local_1913 - 1)) ; (\let local_1917 = (local_1916 == 0) ; (\let local_1918 = ( local_1917 ? queue_92[ptr_92] : local_1915) ; (\let local_1919 = ( (local_1917 || (queue_92[ptr_92] == local_1915)) ? (local_1916 + 1) : (local_1916 - 1)) ; (\let local_1920 = (local_1919 == 0) ; (\let local_1921 = ( local_1920 ? queue_96[ptr_96] : local_1918) ; (\let local_1922 = ( (local_1920 || (queue_96[ptr_96] == local_1918)) ? (local_1919 + 1) : (local_1919 - 1)) ; (\let local_1923 = (local_1922 == 0) ; (\let local_1924 = ( local_1923 ? queue_100[ptr_100] : local_1921) ; (\let local_1925 = ( (local_1923 || (queue_100[ptr_100] == local_1921)) ? (local_1922 + 1) : (local_1922 - 1)) ; local_1924 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1774 + 1) : local_1774) ; (\let local_1926 = ( (queue_100[ptr_100] == (\let local_1927 = false ; (\let local_1928 = ( local_1927 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_1929 = ( (local_1927 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_1930 = (local_1929 == 0) ; (\let local_1931 = ( local_1930 ? queue_8[ptr_8] : local_1928) ; (\let local_1932 = ( (local_1930 || (queue_8[ptr_8] == local_1928)) ? (local_1929 + 1) : (local_1929 - 1)) ; (\let local_1933 = (local_1932 == 0) ; (\let local_1934 = ( local_1933 ? queue_12[ptr_12] : local_1931) ; (\let local_1935 = ( (local_1933 || (queue_12[ptr_12] == local_1931)) ? (local_1932 + 1) : (local_1932 - 1)) ; (\let local_1936 = (local_1935 == 0) ; (\let local_1937 = ( local_1936 ? queue_16[ptr_16] : local_1934) ; (\let local_1938 = ( (local_1936 || (queue_16[ptr_16] == local_1934)) ? (local_1935 + 1) : (local_1935 - 1)) ; (\let local_1939 = (local_1938 == 0) ; (\let local_1940 = ( local_1939 ? queue_20[ptr_20] : local_1937) ; (\let local_1941 = ( (local_1939 || (queue_20[ptr_20] == local_1937)) ? (local_1938 + 1) : (local_1938 - 1)) ; (\let local_1942 = (local_1941 == 0) ; (\let local_1943 = ( local_1942 ? queue_24[ptr_24] : local_1940) ; (\let local_1944 = ( (local_1942 || (queue_24[ptr_24] == local_1940)) ? (local_1941 + 1) : (local_1941 - 1)) ; (\let local_1945 = (local_1944 == 0) ; (\let local_1946 = ( local_1945 ? queue_28[ptr_28] : local_1943) ; (\let local_1947 = ( (local_1945 || (queue_28[ptr_28] == local_1943)) ? (local_1944 + 1) : (local_1944 - 1)) ; (\let local_1948 = (local_1947 == 0) ; (\let local_1949 = ( local_1948 ? queue_32[ptr_32] : local_1946) ; (\let local_1950 = ( (local_1948 || (queue_32[ptr_32] == local_1946)) ? (local_1947 + 1) : (local_1947 - 1)) ; (\let local_1951 = (local_1950 == 0) ; (\let local_1952 = ( local_1951 ? queue_36[ptr_36] : local_1949) ; (\let local_1953 = ( (local_1951 || (queue_36[ptr_36] == local_1949)) ? (local_1950 + 1) : (local_1950 - 1)) ; (\let local_1954 = (local_1953 == 0) ; (\let local_1955 = ( local_1954 ? queue_40[ptr_40] : local_1952) ; (\let local_1956 = ( (local_1954 || (queue_40[ptr_40] == local_1952)) ? (local_1953 + 1) : (local_1953 - 1)) ; (\let local_1957 = (local_1956 == 0) ; (\let local_1958 = ( local_1957 ? queue_44[ptr_44] : local_1955) ; (\let local_1959 = ( (local_1957 || (queue_44[ptr_44] == local_1955)) ? (local_1956 + 1) : (local_1956 - 1)) ; (\let local_1960 = (local_1959 == 0) ; (\let local_1961 = ( local_1960 ? queue_48[ptr_48] : local_1958) ; (\let local_1962 = ( (local_1960 || (queue_48[ptr_48] == local_1958)) ? (local_1959 + 1) : (local_1959 - 1)) ; (\let local_1963 = (local_1962 == 0) ; (\let local_1964 = ( local_1963 ? queue_52[ptr_52] : local_1961) ; (\let local_1965 = ( (local_1963 || (queue_52[ptr_52] == local_1961)) ? (local_1962 + 1) : (local_1962 - 1)) ; (\let local_1966 = (local_1965 == 0) ; (\let local_1967 = ( local_1966 ? queue_56[ptr_56] : local_1964) ; (\let local_1968 = ( (local_1966 || (queue_56[ptr_56] == local_1964)) ? (local_1965 + 1) : (local_1965 - 1)) ; (\let local_1969 = (local_1968 == 0) ; (\let local_1970 = ( local_1969 ? queue_60[ptr_60] : local_1967) ; (\let local_1971 = ( (local_1969 || (queue_60[ptr_60] == local_1967)) ? (local_1968 + 1) : (local_1968 - 1)) ; (\let local_1972 = (local_1971 == 0) ; (\let local_1973 = ( local_1972 ? queue_64[ptr_64] : local_1970) ; (\let local_1974 = ( (local_1972 || (queue_64[ptr_64] == local_1970)) ? (local_1971 + 1) : (local_1971 - 1)) ; (\let local_1975 = (local_1974 == 0) ; (\let local_1976 = ( local_1975 ? queue_68[ptr_68] : local_1973) ; (\let local_1977 = ( (local_1975 || (queue_68[ptr_68] == local_1973)) ? (local_1974 + 1) : (local_1974 - 1)) ; (\let local_1978 = (local_1977 == 0) ; (\let local_1979 = ( local_1978 ? queue_72[ptr_72] : local_1976) ; (\let local_1980 = ( (local_1978 || (queue_72[ptr_72] == local_1976)) ? (local_1977 + 1) : (local_1977 - 1)) ; (\let local_1981 = (local_1980 == 0) ; (\let local_1982 = ( local_1981 ? queue_76[ptr_76] : local_1979) ; (\let local_1983 = ( (local_1981 || (queue_76[ptr_76] == local_1979)) ? (local_1980 + 1) : (local_1980 - 1)) ; (\let local_1984 = (local_1983 == 0) ; (\let local_1985 = ( local_1984 ? queue_80[ptr_80] : local_1982) ; (\let local_1986 = ( (local_1984 || (queue_80[ptr_80] == local_1982)) ? (local_1983 + 1) : (local_1983 - 1)) ; (\let local_1987 = (local_1986 == 0) ; (\let local_1988 = ( local_1987 ? queue_84[ptr_84] : local_1985) ; (\let local_1989 = ( (local_1987 || (queue_84[ptr_84] == local_1985)) ? (local_1986 + 1) : (local_1986 - 1)) ; (\let local_1990 = (local_1989 == 0) ; (\let local_1991 = ( local_1990 ? queue_88[ptr_88] : local_1988) ; (\let local_1992 = ( (local_1990 || (queue_88[ptr_88] == local_1988)) ? (local_1989 + 1) : (local_1989 - 1)) ; (\let local_1993 = (local_1992 == 0) ; (\let local_1994 = ( local_1993 ? queue_92[ptr_92] : local_1991) ; (\let local_1995 = ( (local_1993 || (queue_92[ptr_92] == local_1991)) ? (local_1992 + 1) : (local_1992 - 1)) ; (\let local_1996 = (local_1995 == 0) ; (\let local_1997 = ( local_1996 ? queue_96[ptr_96] : local_1994) ; (\let local_1998 = ( (local_1996 || (queue_96[ptr_96] == local_1994)) ? (local_1995 + 1) : (local_1995 - 1)) ; (\let local_1999 = (local_1998 == 0) ; (\let local_2000 = ( local_1999 ? queue_100[ptr_100] : local_1997) ; (\let local_2001 = ( (local_1999 || (queue_100[ptr_100] == local_1997)) ? (local_1998 + 1) : (local_1998 - 1)) ; local_2000 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )) ? (local_1850 + 1) : local_1850) ; local_1926 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) * 2) > 26); +*/ +SBool trigger_aMaj_arg_0(const SWord32 *queue_1, + const SWord32 ptr_1, const SWord32 *queue_4, const SWord32 ptr_4, + const SWord32 *queue_8, const SWord32 ptr_8, + const SWord32 *queue_12, const SWord32 ptr_12, + const SWord32 *queue_16, const SWord32 ptr_16, + const SWord32 *queue_20, const SWord32 ptr_20, + const SWord32 *queue_24, const SWord32 ptr_24, + const SWord32 *queue_28, const SWord32 ptr_28, + const SWord32 *queue_32, const SWord32 ptr_32, + const SWord32 *queue_36, const SWord32 ptr_36, + const SWord32 *queue_40, const SWord32 ptr_40, + const SWord32 *queue_44, const SWord32 ptr_44, + const SWord32 *queue_48, const SWord32 ptr_48, + const SWord32 *queue_52, const SWord32 ptr_52, + const SWord32 *queue_56, const SWord32 ptr_56, + const SWord32 *queue_60, const SWord32 ptr_60, + const SWord32 *queue_64, const SWord32 ptr_64, + const SWord32 *queue_68, const SWord32 ptr_68, + const SWord32 *queue_72, const SWord32 ptr_72, + const SWord32 *queue_76, const SWord32 ptr_76, + const SWord32 *queue_80, const SWord32 ptr_80, + const SWord32 *queue_84, const SWord32 ptr_84, + const SWord32 *queue_88, const SWord32 ptr_88, + const SWord32 *queue_92, const SWord32 ptr_92, + const SWord32 *queue_96, const SWord32 ptr_96, + const SWord32 *queue_100, const SWord32 ptr_100) +{ + const SWord32 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SWord32 s2 = queue_4[0]; + const SWord32 s3 = ptr_4; + const SWord32 s4 = queue_8[0]; + const SWord32 s5 = ptr_8; + const SWord32 s6 = queue_12[0]; + const SWord32 s7 = ptr_12; + const SWord32 s8 = queue_16[0]; + const SWord32 s9 = ptr_16; + const SWord32 s10 = queue_20[0]; + const SWord32 s11 = ptr_20; + const SWord32 s12 = queue_24[0]; + const SWord32 s13 = ptr_24; + const SWord32 s14 = queue_28[0]; + const SWord32 s15 = ptr_28; + const SWord32 s16 = queue_32[0]; + const SWord32 s17 = ptr_32; + const SWord32 s18 = queue_36[0]; + const SWord32 s19 = ptr_36; + const SWord32 s20 = queue_40[0]; + const SWord32 s21 = ptr_40; + const SWord32 s22 = queue_44[0]; + const SWord32 s23 = ptr_44; + const SWord32 s24 = queue_48[0]; + const SWord32 s25 = ptr_48; + const SWord32 s26 = queue_52[0]; + const SWord32 s27 = ptr_52; + const SWord32 s28 = queue_56[0]; + const SWord32 s29 = ptr_56; + const SWord32 s30 = queue_60[0]; + const SWord32 s31 = ptr_60; + const SWord32 s32 = queue_64[0]; + const SWord32 s33 = ptr_64; + const SWord32 s34 = queue_68[0]; + const SWord32 s35 = ptr_68; + const SWord32 s36 = queue_72[0]; + const SWord32 s37 = ptr_72; + const SWord32 s38 = queue_76[0]; + const SWord32 s39 = ptr_76; + const SWord32 s40 = queue_80[0]; + const SWord32 s41 = ptr_80; + const SWord32 s42 = queue_84[0]; + const SWord32 s43 = ptr_84; + const SWord32 s44 = queue_88[0]; + const SWord32 s45 = ptr_88; + const SWord32 s46 = queue_92[0]; + const SWord32 s47 = ptr_92; + const SWord32 s48 = queue_96[0]; + const SWord32 s49 = ptr_96; + const SWord32 s50 = queue_100[0]; + const SWord32 s51 = ptr_100; + const SBool s52 = s0 == s2; + const SWord32 s55 = s52 ? 0x00000002UL : 0x00000000UL; + const SBool s56 = 0x00000000UL == s55; + const SBool s57 = s0 == s4; + const SBool s58 = s56 || s57; + const SWord32 s60 = s55 + 0x00000001UL; + const SWord32 s61 = s55 - 0x00000001UL; + const SWord32 s62 = s58 ? s60 : s61; + const SBool s63 = 0x00000000UL == s62; + const SWord32 s64 = s56 ? s4 : s0; + const SBool s65 = s6 == s64; + const SBool s66 = s63 || s65; + const SWord32 s67 = 0x00000001UL + s62; + const SWord32 s68 = s62 - 0x00000001UL; + const SWord32 s69 = s66 ? s67 : s68; + const SBool s70 = 0x00000000UL == s69; + const SWord32 s71 = s63 ? s6 : s64; + const SBool s72 = s8 == s71; + const SBool s73 = s70 || s72; + const SWord32 s74 = 0x00000001UL + s69; + const SWord32 s75 = s69 - 0x00000001UL; + const SWord32 s76 = s73 ? s74 : s75; + const SBool s77 = 0x00000000UL == s76; + const SWord32 s78 = s70 ? s8 : s71; + const SBool s79 = s10 == s78; + const SBool s80 = s77 || s79; + const SWord32 s81 = 0x00000001UL + s76; + const SWord32 s82 = s76 - 0x00000001UL; + const SWord32 s83 = s80 ? s81 : s82; + const SBool s84 = 0x00000000UL == s83; + const SWord32 s85 = s77 ? s10 : s78; + const SBool s86 = s12 == s85; + const SBool s87 = s84 || s86; + const SWord32 s88 = 0x00000001UL + s83; + const SWord32 s89 = s83 - 0x00000001UL; + const SWord32 s90 = s87 ? s88 : s89; + const SBool s91 = 0x00000000UL == s90; + const SWord32 s92 = s84 ? s12 : s85; + const SBool s93 = s14 == s92; + const SBool s94 = s91 || s93; + const SWord32 s95 = 0x00000001UL + s90; + const SWord32 s96 = s90 - 0x00000001UL; + const SWord32 s97 = s94 ? s95 : s96; + const SBool s98 = 0x00000000UL == s97; + const SWord32 s99 = s91 ? s14 : s92; + const SBool s100 = s16 == s99; + const SBool s101 = s98 || s100; + const SWord32 s102 = 0x00000001UL + s97; + const SWord32 s103 = s97 - 0x00000001UL; + const SWord32 s104 = s101 ? s102 : s103; + const SBool s105 = 0x00000000UL == s104; + const SWord32 s106 = s98 ? s16 : s99; + const SBool s107 = s18 == s106; + const SBool s108 = s105 || s107; + const SWord32 s109 = 0x00000001UL + s104; + const SWord32 s110 = s104 - 0x00000001UL; + const SWord32 s111 = s108 ? s109 : s110; + const SBool s112 = 0x00000000UL == s111; + const SWord32 s113 = s105 ? s18 : s106; + const SBool s114 = s20 == s113; + const SBool s115 = s112 || s114; + const SWord32 s116 = 0x00000001UL + s111; + const SWord32 s117 = s111 - 0x00000001UL; + const SWord32 s118 = s115 ? s116 : s117; + const SBool s119 = 0x00000000UL == s118; + const SWord32 s120 = s112 ? s20 : s113; + const SBool s121 = s22 == s120; + const SBool s122 = s119 || s121; + const SWord32 s123 = 0x00000001UL + s118; + const SWord32 s124 = s118 - 0x00000001UL; + const SWord32 s125 = s122 ? s123 : s124; + const SBool s126 = 0x00000000UL == s125; + const SWord32 s127 = s119 ? s22 : s120; + const SBool s128 = s24 == s127; + const SBool s129 = s126 || s128; + const SWord32 s130 = 0x00000001UL + s125; + const SWord32 s131 = s125 - 0x00000001UL; + const SWord32 s132 = s129 ? s130 : s131; + const SBool s133 = 0x00000000UL == s132; + const SWord32 s134 = s126 ? s24 : s127; + const SBool s135 = s26 == s134; + const SBool s136 = s133 || s135; + const SWord32 s137 = 0x00000001UL + s132; + const SWord32 s138 = s132 - 0x00000001UL; + const SWord32 s139 = s136 ? s137 : s138; + const SBool s140 = 0x00000000UL == s139; + const SWord32 s141 = s133 ? s26 : s134; + const SBool s142 = s28 == s141; + const SBool s143 = s140 || s142; + const SWord32 s144 = 0x00000001UL + s139; + const SWord32 s145 = s139 - 0x00000001UL; + const SWord32 s146 = s143 ? s144 : s145; + const SBool s147 = 0x00000000UL == s146; + const SWord32 s148 = s140 ? s28 : s141; + const SBool s149 = s30 == s148; + const SBool s150 = s147 || s149; + const SWord32 s151 = 0x00000001UL + s146; + const SWord32 s152 = s146 - 0x00000001UL; + const SWord32 s153 = s150 ? s151 : s152; + const SBool s154 = 0x00000000UL == s153; + const SWord32 s155 = s147 ? s30 : s148; + const SBool s156 = s32 == s155; + const SBool s157 = s154 || s156; + const SWord32 s158 = 0x00000001UL + s153; + const SWord32 s159 = s153 - 0x00000001UL; + const SWord32 s160 = s157 ? s158 : s159; + const SBool s161 = 0x00000000UL == s160; + const SWord32 s162 = s154 ? s32 : s155; + const SBool s163 = s34 == s162; + const SBool s164 = s161 || s163; + const SWord32 s165 = 0x00000001UL + s160; + const SWord32 s166 = s160 - 0x00000001UL; + const SWord32 s167 = s164 ? s165 : s166; + const SBool s168 = 0x00000000UL == s167; + const SWord32 s169 = s161 ? s34 : s162; + const SBool s170 = s36 == s169; + const SBool s171 = s168 || s170; + const SWord32 s172 = 0x00000001UL + s167; + const SWord32 s173 = s167 - 0x00000001UL; + const SWord32 s174 = s171 ? s172 : s173; + const SBool s175 = 0x00000000UL == s174; + const SWord32 s176 = s168 ? s36 : s169; + const SBool s177 = s38 == s176; + const SBool s178 = s175 || s177; + const SWord32 s179 = 0x00000001UL + s174; + const SWord32 s180 = s174 - 0x00000001UL; + const SWord32 s181 = s178 ? s179 : s180; + const SBool s182 = 0x00000000UL == s181; + const SWord32 s183 = s175 ? s38 : s176; + const SBool s184 = s40 == s183; + const SBool s185 = s182 || s184; + const SWord32 s186 = 0x00000001UL + s181; + const SWord32 s187 = s181 - 0x00000001UL; + const SWord32 s188 = s185 ? s186 : s187; + const SBool s189 = 0x00000000UL == s188; + const SWord32 s190 = s182 ? s40 : s183; + const SBool s191 = s42 == s190; + const SBool s192 = s189 || s191; + const SWord32 s193 = 0x00000001UL + s188; + const SWord32 s194 = s188 - 0x00000001UL; + const SWord32 s195 = s192 ? s193 : s194; + const SBool s196 = 0x00000000UL == s195; + const SWord32 s197 = s189 ? s42 : s190; + const SBool s198 = s44 == s197; + const SBool s199 = s196 || s198; + const SWord32 s200 = 0x00000001UL + s195; + const SWord32 s201 = s195 - 0x00000001UL; + const SWord32 s202 = s199 ? s200 : s201; + const SBool s203 = 0x00000000UL == s202; + const SWord32 s204 = s196 ? s44 : s197; + const SBool s205 = s46 == s204; + const SBool s206 = s203 || s205; + const SWord32 s207 = 0x00000001UL + s202; + const SWord32 s208 = s202 - 0x00000001UL; + const SWord32 s209 = s206 ? s207 : s208; + const SBool s210 = 0x00000000UL == s209; + const SWord32 s211 = s203 ? s46 : s204; + const SBool s212 = s48 == s211; + const SBool s213 = s210 || s212; + const SWord32 s214 = 0x00000001UL + s209; + const SWord32 s215 = s209 - 0x00000001UL; + const SWord32 s216 = s213 ? s214 : s215; + const SBool s217 = 0x00000000UL == s216; + const SWord32 s218 = s210 ? s48 : s211; + const SWord32 s219 = s217 ? s50 : s218; + const SBool s220 = s50 == s219; + const SBool s221 = s48 == s219; + const SBool s222 = s46 == s219; + const SBool s223 = s44 == s219; + const SBool s224 = s42 == s219; + const SBool s225 = s40 == s219; + const SBool s226 = s38 == s219; + const SBool s227 = s36 == s219; + const SBool s228 = s34 == s219; + const SBool s229 = s32 == s219; + const SBool s230 = s30 == s219; + const SBool s231 = s28 == s219; + const SBool s232 = s26 == s219; + const SBool s233 = s24 == s219; + const SBool s234 = s22 == s219; + const SBool s235 = s20 == s219; + const SBool s236 = s18 == s219; + const SBool s237 = s16 == s219; + const SBool s238 = s14 == s219; + const SBool s239 = s12 == s219; + const SBool s240 = s10 == s219; + const SBool s241 = s8 == s219; + const SBool s242 = s6 == s219; + const SBool s243 = s4 == s219; + const SBool s244 = s2 == s219; + const SBool s245 = s0 == s219; + const SWord32 s246 = s245 ? 0x00000001UL : 0x00000000UL; + const SWord32 s247 = 0x00000001UL + s246; + const SWord32 s248 = s244 ? s247 : s246; + const SWord32 s249 = 0x00000001UL + s248; + const SWord32 s250 = s243 ? s249 : s248; + const SWord32 s251 = 0x00000001UL + s250; + const SWord32 s252 = s242 ? s251 : s250; + const SWord32 s253 = 0x00000001UL + s252; + const SWord32 s254 = s241 ? s253 : s252; + const SWord32 s255 = 0x00000001UL + s254; + const SWord32 s256 = s240 ? s255 : s254; + const SWord32 s257 = 0x00000001UL + s256; + const SWord32 s258 = s239 ? s257 : s256; + const SWord32 s259 = 0x00000001UL + s258; + const SWord32 s260 = s238 ? s259 : s258; + const SWord32 s261 = 0x00000001UL + s260; + const SWord32 s262 = s237 ? s261 : s260; + const SWord32 s263 = 0x00000001UL + s262; + const SWord32 s264 = s236 ? s263 : s262; + const SWord32 s265 = 0x00000001UL + s264; + const SWord32 s266 = s235 ? s265 : s264; + const SWord32 s267 = 0x00000001UL + s266; + const SWord32 s268 = s234 ? s267 : s266; + const SWord32 s269 = 0x00000001UL + s268; + const SWord32 s270 = s233 ? s269 : s268; + const SWord32 s271 = 0x00000001UL + s270; + const SWord32 s272 = s232 ? s271 : s270; + const SWord32 s273 = 0x00000001UL + s272; + const SWord32 s274 = s231 ? s273 : s272; + const SWord32 s275 = 0x00000001UL + s274; + const SWord32 s276 = s230 ? s275 : s274; + const SWord32 s277 = 0x00000001UL + s276; + const SWord32 s278 = s229 ? s277 : s276; + const SWord32 s279 = 0x00000001UL + s278; + const SWord32 s280 = s228 ? s279 : s278; + const SWord32 s281 = 0x00000001UL + s280; + const SWord32 s282 = s227 ? s281 : s280; + const SWord32 s283 = 0x00000001UL + s282; + const SWord32 s284 = s226 ? s283 : s282; + const SWord32 s285 = 0x00000001UL + s284; + const SWord32 s286 = s225 ? s285 : s284; + const SWord32 s287 = 0x00000001UL + s286; + const SWord32 s288 = s224 ? s287 : s286; + const SWord32 s289 = 0x00000001UL + s288; + const SWord32 s290 = s223 ? s289 : s288; + const SWord32 s291 = 0x00000001UL + s290; + const SWord32 s292 = s222 ? s291 : s290; + const SWord32 s293 = 0x00000001UL + s292; + const SWord32 s294 = s221 ? s293 : s292; + const SWord32 s295 = 0x00000001UL + s294; + const SWord32 s296 = s220 ? s295 : s294; + const SWord32 s297 = 0x00000002UL * s296; + const SBool s299 = s297 > 0x0000001aUL; + + return s299; +} diff --git a/example24/copilot-sbv-codegen/trigger_guard_aMaj.c b/example24/copilot-sbv-codegen/trigger_guard_aMaj.c new file mode 100644 index 00000000..6028a53e --- /dev/null +++ b/example24/copilot-sbv-codegen/trigger_guard_aMaj.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_aMaj.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_aMaj() +{ + return true; +} diff --git a/example24/copilot-sbv-codegen/trigger_guard_maj.c b/example24/copilot-sbv-codegen/trigger_guard_maj.c new file mode 100644 index 00000000..d10954d0 --- /dev/null +++ b/example24/copilot-sbv-codegen/trigger_guard_maj.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_maj.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_maj() +{ + return true; +} diff --git a/example24/copilot-sbv-codegen/trigger_maj_arg_0.c b/example24/copilot-sbv-codegen/trigger_maj_arg_0.c new file mode 100644 index 00000000..70198031 --- /dev/null +++ b/example24/copilot-sbv-codegen/trigger_maj_arg_0.c @@ -0,0 +1,339 @@ +/* File: "trigger_maj_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + local "local_2002" = false +in local "local_2003" = (if var "local_2002" then s4 else s1) + in local "local_2004" = (if (var "local_2002" || (s4 == s1)) then 2 else 0) + in local "local_2005" = (var "local_2004" == 0) + in local "local_2006" = (if var "local_2005" then s8 else var "local_2003") + in local "local_2007" = (if (var "local_2005" || (s8 == var "local_2003")) then (var "local_2004" + 1) else (var "local_2004" - 1)) + in local "local_2008" = (var "local_2007" == 0) + in local "local_2009" = (if var "local_2008" then s12 else var "local_2006") + in local "local_2010" = (if (var "local_2008" || (s12 == var "local_2006")) then (var "local_2007" + 1) else (var "local_2007" - 1)) + in local "local_2011" = (var "local_2010" == 0) + in local "local_2012" = (if var "local_2011" then s16 else var "local_2009") + in local "local_2013" = (if (var "local_2011" || (s16 == var "local_2009")) then (var "local_2010" + 1) else (var "local_2010" - 1)) + in local "local_2014" = (var "local_2013" == 0) + in local "local_2015" = (if var "local_2014" then s20 else var "local_2012") + in local "local_2016" = (if (var "local_2014" || (s20 == var "local_2012")) then (var "local_2013" + 1) else (var "local_2013" - 1)) + in local "local_2017" = (var "local_2016" == 0) + in local "local_2018" = (if var "local_2017" then s24 else var "local_2015") + in local "local_2019" = (if (var "local_2017" || (s24 == var "local_2015")) then (var "local_2016" + 1) else (var "local_2016" - 1)) + in local "local_2020" = (var "local_2019" == 0) + in local "local_2021" = (if var "local_2020" then s28 else var "local_2018") + in local "local_2022" = (if (var "local_2020" || (s28 == var "local_2018")) then (var "local_2019" + 1) else (var "local_2019" - 1)) + in local "local_2023" = (var "local_2022" == 0) + in local "local_2024" = (if var "local_2023" then s32 else var "local_2021") + in local "local_2025" = (if (var "local_2023" || (s32 == var "local_2021")) then (var "local_2022" + 1) else (var "local_2022" - 1)) + in local "local_2026" = (var "local_2025" == 0) + in local "local_2027" = (if var "local_2026" then s36 else var "local_2024") + in local "local_2028" = (if (var "local_2026" || (s36 == var "local_2024")) then (var "local_2025" + 1) else (var "local_2025" - 1)) + in local "local_2029" = (var "local_2028" == 0) + in local "local_2030" = (if var "local_2029" then s40 else var "local_2027") + in local "local_2031" = (if (var "local_2029" || (s40 == var "local_2027")) then (var "local_2028" + 1) else (var "local_2028" - 1)) + in local "local_2032" = (var "local_2031" == 0) + in local "local_2033" = (if var "local_2032" then s44 else var "local_2030") + in local "local_2034" = (if (var "local_2032" || (s44 == var "local_2030")) then (var "local_2031" + 1) else (var "local_2031" - 1)) + in local "local_2035" = (var "local_2034" == 0) + in local "local_2036" = (if var "local_2035" then s48 else var "local_2033") + in local "local_2037" = (if (var "local_2035" || (s48 == var "local_2033")) then (var "local_2034" + 1) else (var "local_2034" - 1)) + in local "local_2038" = (var "local_2037" == 0) + in local "local_2039" = (if var "local_2038" then s52 else var "local_2036") + in local "local_2040" = (if (var "local_2038" || (s52 == var "local_2036")) then (var "local_2037" + 1) else (var "local_2037" - 1)) + in local "local_2041" = (var "local_2040" == 0) + in local "local_2042" = (if var "local_2041" then s56 else var "local_2039") + in local "local_2043" = (if (var "local_2041" || (s56 == var "local_2039")) then (var "local_2040" + 1) else (var "local_2040" - 1)) + in local "local_2044" = (var "local_2043" == 0) + in local "local_2045" = (if var "local_2044" then s60 else var "local_2042") + in local "local_2046" = (if (var "local_2044" || (s60 == var "local_2042")) then (var "local_2043" + 1) else (var "local_2043" - 1)) + in local "local_2047" = (var "local_2046" == 0) + in local "local_2048" = (if var "local_2047" then s64 else var "local_2045") + in local "local_2049" = (if (var "local_2047" || (s64 == var "local_2045")) then (var "local_2046" + 1) else (var "local_2046" - 1)) + in local "local_2050" = (var "local_2049" == 0) + in local "local_2051" = (if var "local_2050" then s68 else var "local_2048") + in local "local_2052" = (if (var "local_2050" || (s68 == var "local_2048")) then (var "local_2049" + 1) else (var "local_2049" - 1)) + in local "local_2053" = (var "local_2052" == 0) + in local "local_2054" = (if var "local_2053" then s72 else var "local_2051") + in local "local_2055" = (if (var "local_2053" || (s72 == var "local_2051")) then (var "local_2052" + 1) else (var "local_2052" - 1)) + in local "local_2056" = (var "local_2055" == 0) + in local "local_2057" = (if var "local_2056" then s76 else var "local_2054") + in local "local_2058" = (if (var "local_2056" || (s76 == var "local_2054")) then (var "local_2055" + 1) else (var "local_2055" - 1)) + in local "local_2059" = (var "local_2058" == 0) + in local "local_2060" = (if var "local_2059" then s80 else var "local_2057") + in local "local_2061" = (if (var "local_2059" || (s80 == var "local_2057")) then (var "local_2058" + 1) else (var "local_2058" - 1)) + in local "local_2062" = (var "local_2061" == 0) + in local "local_2063" = (if var "local_2062" then s84 else var "local_2060") + in local "local_2064" = (if (var "local_2062" || (s84 == var "local_2060")) then (var "local_2061" + 1) else (var "local_2061" - 1)) + in local "local_2065" = (var "local_2064" == 0) + in local "local_2066" = (if var "local_2065" then s88 else var "local_2063") + in local "local_2067" = (if (var "local_2065" || (s88 == var "local_2063")) then (var "local_2064" + 1) else (var "local_2064" - 1)) + in local "local_2068" = (var "local_2067" == 0) + in local "local_2069" = (if var "local_2068" then s92 else var "local_2066") + in local "local_2070" = (if (var "local_2068" || (s92 == var "local_2066")) then (var "local_2067" + 1) else (var "local_2067" - 1)) + in local "local_2071" = (var "local_2070" == 0) + in local "local_2072" = (if var "local_2071" then s96 else var "local_2069") + in local "local_2073" = (if (var "local_2071" || (s96 == var "local_2069")) then (var "local_2070" + 1) else (var "local_2070" - 1)) + in local "local_2074" = (var "local_2073" == 0) + in local "local_2075" = (if var "local_2074" then s100 else var "local_2072") + in local "local_2076" = (if (var "local_2074" || (s100 == var "local_2072")) then (var "local_2073" + 1) else (var "local_2073" - 1)) + in var "local_2075" +*/ +/*@ + assigns \nothing; + ensures \result == (\let local_2002 = false ; (\let local_2003 = ( local_2002 ? queue_4[ptr_4] : queue_1[ptr_1]) ; (\let local_2004 = ( (local_2002 || (queue_4[ptr_4] == queue_1[ptr_1])) ? 2 : 0) ; (\let local_2005 = (local_2004 == 0) ; (\let local_2006 = ( local_2005 ? queue_8[ptr_8] : local_2003) ; (\let local_2007 = ( (local_2005 || (queue_8[ptr_8] == local_2003)) ? (local_2004 + 1) : (local_2004 - 1)) ; (\let local_2008 = (local_2007 == 0) ; (\let local_2009 = ( local_2008 ? queue_12[ptr_12] : local_2006) ; (\let local_2010 = ( (local_2008 || (queue_12[ptr_12] == local_2006)) ? (local_2007 + 1) : (local_2007 - 1)) ; (\let local_2011 = (local_2010 == 0) ; (\let local_2012 = ( local_2011 ? queue_16[ptr_16] : local_2009) ; (\let local_2013 = ( (local_2011 || (queue_16[ptr_16] == local_2009)) ? (local_2010 + 1) : (local_2010 - 1)) ; (\let local_2014 = (local_2013 == 0) ; (\let local_2015 = ( local_2014 ? queue_20[ptr_20] : local_2012) ; (\let local_2016 = ( (local_2014 || (queue_20[ptr_20] == local_2012)) ? (local_2013 + 1) : (local_2013 - 1)) ; (\let local_2017 = (local_2016 == 0) ; (\let local_2018 = ( local_2017 ? queue_24[ptr_24] : local_2015) ; (\let local_2019 = ( (local_2017 || (queue_24[ptr_24] == local_2015)) ? (local_2016 + 1) : (local_2016 - 1)) ; (\let local_2020 = (local_2019 == 0) ; (\let local_2021 = ( local_2020 ? queue_28[ptr_28] : local_2018) ; (\let local_2022 = ( (local_2020 || (queue_28[ptr_28] == local_2018)) ? (local_2019 + 1) : (local_2019 - 1)) ; (\let local_2023 = (local_2022 == 0) ; (\let local_2024 = ( local_2023 ? queue_32[ptr_32] : local_2021) ; (\let local_2025 = ( (local_2023 || (queue_32[ptr_32] == local_2021)) ? (local_2022 + 1) : (local_2022 - 1)) ; (\let local_2026 = (local_2025 == 0) ; (\let local_2027 = ( local_2026 ? queue_36[ptr_36] : local_2024) ; (\let local_2028 = ( (local_2026 || (queue_36[ptr_36] == local_2024)) ? (local_2025 + 1) : (local_2025 - 1)) ; (\let local_2029 = (local_2028 == 0) ; (\let local_2030 = ( local_2029 ? queue_40[ptr_40] : local_2027) ; (\let local_2031 = ( (local_2029 || (queue_40[ptr_40] == local_2027)) ? (local_2028 + 1) : (local_2028 - 1)) ; (\let local_2032 = (local_2031 == 0) ; (\let local_2033 = ( local_2032 ? queue_44[ptr_44] : local_2030) ; (\let local_2034 = ( (local_2032 || (queue_44[ptr_44] == local_2030)) ? (local_2031 + 1) : (local_2031 - 1)) ; (\let local_2035 = (local_2034 == 0) ; (\let local_2036 = ( local_2035 ? queue_48[ptr_48] : local_2033) ; (\let local_2037 = ( (local_2035 || (queue_48[ptr_48] == local_2033)) ? (local_2034 + 1) : (local_2034 - 1)) ; (\let local_2038 = (local_2037 == 0) ; (\let local_2039 = ( local_2038 ? queue_52[ptr_52] : local_2036) ; (\let local_2040 = ( (local_2038 || (queue_52[ptr_52] == local_2036)) ? (local_2037 + 1) : (local_2037 - 1)) ; (\let local_2041 = (local_2040 == 0) ; (\let local_2042 = ( local_2041 ? queue_56[ptr_56] : local_2039) ; (\let local_2043 = ( (local_2041 || (queue_56[ptr_56] == local_2039)) ? (local_2040 + 1) : (local_2040 - 1)) ; (\let local_2044 = (local_2043 == 0) ; (\let local_2045 = ( local_2044 ? queue_60[ptr_60] : local_2042) ; (\let local_2046 = ( (local_2044 || (queue_60[ptr_60] == local_2042)) ? (local_2043 + 1) : (local_2043 - 1)) ; (\let local_2047 = (local_2046 == 0) ; (\let local_2048 = ( local_2047 ? queue_64[ptr_64] : local_2045) ; (\let local_2049 = ( (local_2047 || (queue_64[ptr_64] == local_2045)) ? (local_2046 + 1) : (local_2046 - 1)) ; (\let local_2050 = (local_2049 == 0) ; (\let local_2051 = ( local_2050 ? queue_68[ptr_68] : local_2048) ; (\let local_2052 = ( (local_2050 || (queue_68[ptr_68] == local_2048)) ? (local_2049 + 1) : (local_2049 - 1)) ; (\let local_2053 = (local_2052 == 0) ; (\let local_2054 = ( local_2053 ? queue_72[ptr_72] : local_2051) ; (\let local_2055 = ( (local_2053 || (queue_72[ptr_72] == local_2051)) ? (local_2052 + 1) : (local_2052 - 1)) ; (\let local_2056 = (local_2055 == 0) ; (\let local_2057 = ( local_2056 ? queue_76[ptr_76] : local_2054) ; (\let local_2058 = ( (local_2056 || (queue_76[ptr_76] == local_2054)) ? (local_2055 + 1) : (local_2055 - 1)) ; (\let local_2059 = (local_2058 == 0) ; (\let local_2060 = ( local_2059 ? queue_80[ptr_80] : local_2057) ; (\let local_2061 = ( (local_2059 || (queue_80[ptr_80] == local_2057)) ? (local_2058 + 1) : (local_2058 - 1)) ; (\let local_2062 = (local_2061 == 0) ; (\let local_2063 = ( local_2062 ? queue_84[ptr_84] : local_2060) ; (\let local_2064 = ( (local_2062 || (queue_84[ptr_84] == local_2060)) ? (local_2061 + 1) : (local_2061 - 1)) ; (\let local_2065 = (local_2064 == 0) ; (\let local_2066 = ( local_2065 ? queue_88[ptr_88] : local_2063) ; (\let local_2067 = ( (local_2065 || (queue_88[ptr_88] == local_2063)) ? (local_2064 + 1) : (local_2064 - 1)) ; (\let local_2068 = (local_2067 == 0) ; (\let local_2069 = ( local_2068 ? queue_92[ptr_92] : local_2066) ; (\let local_2070 = ( (local_2068 || (queue_92[ptr_92] == local_2066)) ? (local_2067 + 1) : (local_2067 - 1)) ; (\let local_2071 = (local_2070 == 0) ; (\let local_2072 = ( local_2071 ? queue_96[ptr_96] : local_2069) ; (\let local_2073 = ( (local_2071 || (queue_96[ptr_96] == local_2069)) ? (local_2070 + 1) : (local_2070 - 1)) ; (\let local_2074 = (local_2073 == 0) ; (\let local_2075 = ( local_2074 ? queue_100[ptr_100] : local_2072) ; (\let local_2076 = ( (local_2074 || (queue_100[ptr_100] == local_2072)) ? (local_2073 + 1) : (local_2073 - 1)) ; local_2075 ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ); +*/ +SWord32 trigger_maj_arg_0(const SWord32 *queue_4, + const SWord32 ptr_4, const SWord32 *queue_1, const SWord32 ptr_1, + const SWord32 *queue_8, const SWord32 ptr_8, + const SWord32 *queue_12, const SWord32 ptr_12, + const SWord32 *queue_16, const SWord32 ptr_16, + const SWord32 *queue_20, const SWord32 ptr_20, + const SWord32 *queue_24, const SWord32 ptr_24, + const SWord32 *queue_28, const SWord32 ptr_28, + const SWord32 *queue_32, const SWord32 ptr_32, + const SWord32 *queue_36, const SWord32 ptr_36, + const SWord32 *queue_40, const SWord32 ptr_40, + const SWord32 *queue_44, const SWord32 ptr_44, + const SWord32 *queue_48, const SWord32 ptr_48, + const SWord32 *queue_52, const SWord32 ptr_52, + const SWord32 *queue_56, const SWord32 ptr_56, + const SWord32 *queue_60, const SWord32 ptr_60, + const SWord32 *queue_64, const SWord32 ptr_64, + const SWord32 *queue_68, const SWord32 ptr_68, + const SWord32 *queue_72, const SWord32 ptr_72, + const SWord32 *queue_76, const SWord32 ptr_76, + const SWord32 *queue_80, const SWord32 ptr_80, + const SWord32 *queue_84, const SWord32 ptr_84, + const SWord32 *queue_88, const SWord32 ptr_88, + const SWord32 *queue_92, const SWord32 ptr_92, + const SWord32 *queue_96, const SWord32 ptr_96, + const SWord32 *queue_100, const SWord32 ptr_100) +{ + const SWord32 s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + const SWord32 s2 = queue_1[0]; + const SWord32 s3 = ptr_1; + const SWord32 s4 = queue_8[0]; + const SWord32 s5 = ptr_8; + const SWord32 s6 = queue_12[0]; + const SWord32 s7 = ptr_12; + const SWord32 s8 = queue_16[0]; + const SWord32 s9 = ptr_16; + const SWord32 s10 = queue_20[0]; + const SWord32 s11 = ptr_20; + const SWord32 s12 = queue_24[0]; + const SWord32 s13 = ptr_24; + const SWord32 s14 = queue_28[0]; + const SWord32 s15 = ptr_28; + const SWord32 s16 = queue_32[0]; + const SWord32 s17 = ptr_32; + const SWord32 s18 = queue_36[0]; + const SWord32 s19 = ptr_36; + const SWord32 s20 = queue_40[0]; + const SWord32 s21 = ptr_40; + const SWord32 s22 = queue_44[0]; + const SWord32 s23 = ptr_44; + const SWord32 s24 = queue_48[0]; + const SWord32 s25 = ptr_48; + const SWord32 s26 = queue_52[0]; + const SWord32 s27 = ptr_52; + const SWord32 s28 = queue_56[0]; + const SWord32 s29 = ptr_56; + const SWord32 s30 = queue_60[0]; + const SWord32 s31 = ptr_60; + const SWord32 s32 = queue_64[0]; + const SWord32 s33 = ptr_64; + const SWord32 s34 = queue_68[0]; + const SWord32 s35 = ptr_68; + const SWord32 s36 = queue_72[0]; + const SWord32 s37 = ptr_72; + const SWord32 s38 = queue_76[0]; + const SWord32 s39 = ptr_76; + const SWord32 s40 = queue_80[0]; + const SWord32 s41 = ptr_80; + const SWord32 s42 = queue_84[0]; + const SWord32 s43 = ptr_84; + const SWord32 s44 = queue_88[0]; + const SWord32 s45 = ptr_88; + const SWord32 s46 = queue_92[0]; + const SWord32 s47 = ptr_92; + const SWord32 s48 = queue_96[0]; + const SWord32 s49 = ptr_96; + const SWord32 s50 = queue_100[0]; + const SWord32 s51 = ptr_100; + const SBool s52 = s0 == s2; + const SWord32 s55 = s52 ? 0x00000002UL : 0x00000000UL; + const SBool s56 = 0x00000000UL == s55; + const SBool s57 = s2 == s4; + const SBool s58 = s56 || s57; + const SWord32 s60 = s55 + 0x00000001UL; + const SWord32 s61 = s55 - 0x00000001UL; + const SWord32 s62 = s58 ? s60 : s61; + const SBool s63 = 0x00000000UL == s62; + const SWord32 s64 = s56 ? s4 : s2; + const SBool s65 = s6 == s64; + const SBool s66 = s63 || s65; + const SWord32 s67 = 0x00000001UL + s62; + const SWord32 s68 = s62 - 0x00000001UL; + const SWord32 s69 = s66 ? s67 : s68; + const SBool s70 = 0x00000000UL == s69; + const SWord32 s71 = s63 ? s6 : s64; + const SBool s72 = s8 == s71; + const SBool s73 = s70 || s72; + const SWord32 s74 = 0x00000001UL + s69; + const SWord32 s75 = s69 - 0x00000001UL; + const SWord32 s76 = s73 ? s74 : s75; + const SBool s77 = 0x00000000UL == s76; + const SWord32 s78 = s70 ? s8 : s71; + const SBool s79 = s10 == s78; + const SBool s80 = s77 || s79; + const SWord32 s81 = 0x00000001UL + s76; + const SWord32 s82 = s76 - 0x00000001UL; + const SWord32 s83 = s80 ? s81 : s82; + const SBool s84 = 0x00000000UL == s83; + const SWord32 s85 = s77 ? s10 : s78; + const SBool s86 = s12 == s85; + const SBool s87 = s84 || s86; + const SWord32 s88 = 0x00000001UL + s83; + const SWord32 s89 = s83 - 0x00000001UL; + const SWord32 s90 = s87 ? s88 : s89; + const SBool s91 = 0x00000000UL == s90; + const SWord32 s92 = s84 ? s12 : s85; + const SBool s93 = s14 == s92; + const SBool s94 = s91 || s93; + const SWord32 s95 = 0x00000001UL + s90; + const SWord32 s96 = s90 - 0x00000001UL; + const SWord32 s97 = s94 ? s95 : s96; + const SBool s98 = 0x00000000UL == s97; + const SWord32 s99 = s91 ? s14 : s92; + const SBool s100 = s16 == s99; + const SBool s101 = s98 || s100; + const SWord32 s102 = 0x00000001UL + s97; + const SWord32 s103 = s97 - 0x00000001UL; + const SWord32 s104 = s101 ? s102 : s103; + const SBool s105 = 0x00000000UL == s104; + const SWord32 s106 = s98 ? s16 : s99; + const SBool s107 = s18 == s106; + const SBool s108 = s105 || s107; + const SWord32 s109 = 0x00000001UL + s104; + const SWord32 s110 = s104 - 0x00000001UL; + const SWord32 s111 = s108 ? s109 : s110; + const SBool s112 = 0x00000000UL == s111; + const SWord32 s113 = s105 ? s18 : s106; + const SBool s114 = s20 == s113; + const SBool s115 = s112 || s114; + const SWord32 s116 = 0x00000001UL + s111; + const SWord32 s117 = s111 - 0x00000001UL; + const SWord32 s118 = s115 ? s116 : s117; + const SBool s119 = 0x00000000UL == s118; + const SWord32 s120 = s112 ? s20 : s113; + const SBool s121 = s22 == s120; + const SBool s122 = s119 || s121; + const SWord32 s123 = 0x00000001UL + s118; + const SWord32 s124 = s118 - 0x00000001UL; + const SWord32 s125 = s122 ? s123 : s124; + const SBool s126 = 0x00000000UL == s125; + const SWord32 s127 = s119 ? s22 : s120; + const SBool s128 = s24 == s127; + const SBool s129 = s126 || s128; + const SWord32 s130 = 0x00000001UL + s125; + const SWord32 s131 = s125 - 0x00000001UL; + const SWord32 s132 = s129 ? s130 : s131; + const SBool s133 = 0x00000000UL == s132; + const SWord32 s134 = s126 ? s24 : s127; + const SBool s135 = s26 == s134; + const SBool s136 = s133 || s135; + const SWord32 s137 = 0x00000001UL + s132; + const SWord32 s138 = s132 - 0x00000001UL; + const SWord32 s139 = s136 ? s137 : s138; + const SBool s140 = 0x00000000UL == s139; + const SWord32 s141 = s133 ? s26 : s134; + const SBool s142 = s28 == s141; + const SBool s143 = s140 || s142; + const SWord32 s144 = 0x00000001UL + s139; + const SWord32 s145 = s139 - 0x00000001UL; + const SWord32 s146 = s143 ? s144 : s145; + const SBool s147 = 0x00000000UL == s146; + const SWord32 s148 = s140 ? s28 : s141; + const SBool s149 = s30 == s148; + const SBool s150 = s147 || s149; + const SWord32 s151 = 0x00000001UL + s146; + const SWord32 s152 = s146 - 0x00000001UL; + const SWord32 s153 = s150 ? s151 : s152; + const SBool s154 = 0x00000000UL == s153; + const SWord32 s155 = s147 ? s30 : s148; + const SBool s156 = s32 == s155; + const SBool s157 = s154 || s156; + const SWord32 s158 = 0x00000001UL + s153; + const SWord32 s159 = s153 - 0x00000001UL; + const SWord32 s160 = s157 ? s158 : s159; + const SBool s161 = 0x00000000UL == s160; + const SWord32 s162 = s154 ? s32 : s155; + const SBool s163 = s34 == s162; + const SBool s164 = s161 || s163; + const SWord32 s165 = 0x00000001UL + s160; + const SWord32 s166 = s160 - 0x00000001UL; + const SWord32 s167 = s164 ? s165 : s166; + const SBool s168 = 0x00000000UL == s167; + const SWord32 s169 = s161 ? s34 : s162; + const SBool s170 = s36 == s169; + const SBool s171 = s168 || s170; + const SWord32 s172 = 0x00000001UL + s167; + const SWord32 s173 = s167 - 0x00000001UL; + const SWord32 s174 = s171 ? s172 : s173; + const SBool s175 = 0x00000000UL == s174; + const SWord32 s176 = s168 ? s36 : s169; + const SBool s177 = s38 == s176; + const SBool s178 = s175 || s177; + const SWord32 s179 = 0x00000001UL + s174; + const SWord32 s180 = s174 - 0x00000001UL; + const SWord32 s181 = s178 ? s179 : s180; + const SBool s182 = 0x00000000UL == s181; + const SWord32 s183 = s175 ? s38 : s176; + const SBool s184 = s40 == s183; + const SBool s185 = s182 || s184; + const SWord32 s186 = 0x00000001UL + s181; + const SWord32 s187 = s181 - 0x00000001UL; + const SWord32 s188 = s185 ? s186 : s187; + const SBool s189 = 0x00000000UL == s188; + const SWord32 s190 = s182 ? s40 : s183; + const SBool s191 = s42 == s190; + const SBool s192 = s189 || s191; + const SWord32 s193 = 0x00000001UL + s188; + const SWord32 s194 = s188 - 0x00000001UL; + const SWord32 s195 = s192 ? s193 : s194; + const SBool s196 = 0x00000000UL == s195; + const SWord32 s197 = s189 ? s42 : s190; + const SBool s198 = s44 == s197; + const SBool s199 = s196 || s198; + const SWord32 s200 = 0x00000001UL + s195; + const SWord32 s201 = s195 - 0x00000001UL; + const SWord32 s202 = s199 ? s200 : s201; + const SBool s203 = 0x00000000UL == s202; + const SWord32 s204 = s196 ? s44 : s197; + const SBool s205 = s46 == s204; + const SBool s206 = s203 || s205; + const SWord32 s207 = 0x00000001UL + s202; + const SWord32 s208 = s202 - 0x00000001UL; + const SWord32 s209 = s206 ? s207 : s208; + const SBool s210 = 0x00000000UL == s209; + const SWord32 s211 = s203 ? s46 : s204; + const SBool s212 = s48 == s211; + const SBool s213 = s210 || s212; + const SWord32 s214 = 0x00000001UL + s209; + const SWord32 s215 = s209 - 0x00000001UL; + const SWord32 s216 = s213 ? s214 : s215; + const SBool s217 = 0x00000000UL == s216; + const SWord32 s218 = s210 ? s48 : s211; + const SWord32 s219 = s217 ? s50 : s218; + + return s219; +} diff --git a/example24/copilot-sbv-codegen/update_state_1.c b/example24/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..fa1b522b --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,25 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s1 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] + 1); +*/ +SWord32 update_state_1(const SWord32 *queue_1, const SWord32 ptr_1) +{ + const SWord32 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_100.c b/example24/copilot-sbv-codegen/update_state_100.c new file mode 100644 index 00000000..f9592ffa --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_100.c @@ -0,0 +1,26 @@ +/* File: "update_state_100.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s100 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_100[ptr_100] + 1); +*/ +SWord32 update_state_100(const SWord32 *queue_100, + const SWord32 ptr_100) +{ + const SWord32 s0 = queue_100[0]; + const SWord32 s1 = ptr_100; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_12.c b/example24/copilot-sbv-codegen/update_state_12.c new file mode 100644 index 00000000..7bbcfa62 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_12.c @@ -0,0 +1,26 @@ +/* File: "update_state_12.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s12 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_12[ptr_12] + 1); +*/ +SWord32 update_state_12(const SWord32 *queue_12, + const SWord32 ptr_12) +{ + const SWord32 s0 = queue_12[0]; + const SWord32 s1 = ptr_12; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_16.c b/example24/copilot-sbv-codegen/update_state_16.c new file mode 100644 index 00000000..4644a539 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_16.c @@ -0,0 +1,26 @@ +/* File: "update_state_16.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s16 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_16[ptr_16] + 1); +*/ +SWord32 update_state_16(const SWord32 *queue_16, + const SWord32 ptr_16) +{ + const SWord32 s0 = queue_16[0]; + const SWord32 s1 = ptr_16; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_20.c b/example24/copilot-sbv-codegen/update_state_20.c new file mode 100644 index 00000000..a3c5a5b5 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_20.c @@ -0,0 +1,26 @@ +/* File: "update_state_20.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s20 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_20[ptr_20] + 1); +*/ +SWord32 update_state_20(const SWord32 *queue_20, + const SWord32 ptr_20) +{ + const SWord32 s0 = queue_20[0]; + const SWord32 s1 = ptr_20; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_24.c b/example24/copilot-sbv-codegen/update_state_24.c new file mode 100644 index 00000000..c219bf13 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_24.c @@ -0,0 +1,26 @@ +/* File: "update_state_24.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s24 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_24[ptr_24] + 1); +*/ +SWord32 update_state_24(const SWord32 *queue_24, + const SWord32 ptr_24) +{ + const SWord32 s0 = queue_24[0]; + const SWord32 s1 = ptr_24; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_28.c b/example24/copilot-sbv-codegen/update_state_28.c new file mode 100644 index 00000000..5c5d4176 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_28.c @@ -0,0 +1,26 @@ +/* File: "update_state_28.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s28 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_28[ptr_28] + 1); +*/ +SWord32 update_state_28(const SWord32 *queue_28, + const SWord32 ptr_28) +{ + const SWord32 s0 = queue_28[0]; + const SWord32 s1 = ptr_28; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_32.c b/example24/copilot-sbv-codegen/update_state_32.c new file mode 100644 index 00000000..a56a1aa5 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_32.c @@ -0,0 +1,26 @@ +/* File: "update_state_32.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s32 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_32[ptr_32] + 1); +*/ +SWord32 update_state_32(const SWord32 *queue_32, + const SWord32 ptr_32) +{ + const SWord32 s0 = queue_32[0]; + const SWord32 s1 = ptr_32; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_36.c b/example24/copilot-sbv-codegen/update_state_36.c new file mode 100644 index 00000000..d7c984fd --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_36.c @@ -0,0 +1,26 @@ +/* File: "update_state_36.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s36 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_36[ptr_36] + 1); +*/ +SWord32 update_state_36(const SWord32 *queue_36, + const SWord32 ptr_36) +{ + const SWord32 s0 = queue_36[0]; + const SWord32 s1 = ptr_36; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_4.c b/example24/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..3074830a --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,25 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s4 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_4[ptr_4] + 1); +*/ +SWord32 update_state_4(const SWord32 *queue_4, const SWord32 ptr_4) +{ + const SWord32 s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_40.c b/example24/copilot-sbv-codegen/update_state_40.c new file mode 100644 index 00000000..4a2cda89 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_40.c @@ -0,0 +1,26 @@ +/* File: "update_state_40.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s40 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_40[ptr_40] + 1); +*/ +SWord32 update_state_40(const SWord32 *queue_40, + const SWord32 ptr_40) +{ + const SWord32 s0 = queue_40[0]; + const SWord32 s1 = ptr_40; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_44.c b/example24/copilot-sbv-codegen/update_state_44.c new file mode 100644 index 00000000..7bbe7293 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_44.c @@ -0,0 +1,26 @@ +/* File: "update_state_44.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s44 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_44[ptr_44] + 1); +*/ +SWord32 update_state_44(const SWord32 *queue_44, + const SWord32 ptr_44) +{ + const SWord32 s0 = queue_44[0]; + const SWord32 s1 = ptr_44; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_48.c b/example24/copilot-sbv-codegen/update_state_48.c new file mode 100644 index 00000000..4e832e20 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_48.c @@ -0,0 +1,26 @@ +/* File: "update_state_48.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s48 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_48[ptr_48] + 1); +*/ +SWord32 update_state_48(const SWord32 *queue_48, + const SWord32 ptr_48) +{ + const SWord32 s0 = queue_48[0]; + const SWord32 s1 = ptr_48; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_52.c b/example24/copilot-sbv-codegen/update_state_52.c new file mode 100644 index 00000000..ccb1ffb6 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_52.c @@ -0,0 +1,26 @@ +/* File: "update_state_52.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s52 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_52[ptr_52] + 1); +*/ +SWord32 update_state_52(const SWord32 *queue_52, + const SWord32 ptr_52) +{ + const SWord32 s0 = queue_52[0]; + const SWord32 s1 = ptr_52; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_56.c b/example24/copilot-sbv-codegen/update_state_56.c new file mode 100644 index 00000000..e1742550 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_56.c @@ -0,0 +1,26 @@ +/* File: "update_state_56.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s56 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_56[ptr_56] + 1); +*/ +SWord32 update_state_56(const SWord32 *queue_56, + const SWord32 ptr_56) +{ + const SWord32 s0 = queue_56[0]; + const SWord32 s1 = ptr_56; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_60.c b/example24/copilot-sbv-codegen/update_state_60.c new file mode 100644 index 00000000..597e7015 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_60.c @@ -0,0 +1,26 @@ +/* File: "update_state_60.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s60 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_60[ptr_60] + 1); +*/ +SWord32 update_state_60(const SWord32 *queue_60, + const SWord32 ptr_60) +{ + const SWord32 s0 = queue_60[0]; + const SWord32 s1 = ptr_60; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_64.c b/example24/copilot-sbv-codegen/update_state_64.c new file mode 100644 index 00000000..6049126e --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_64.c @@ -0,0 +1,26 @@ +/* File: "update_state_64.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s64 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_64[ptr_64] + 1); +*/ +SWord32 update_state_64(const SWord32 *queue_64, + const SWord32 ptr_64) +{ + const SWord32 s0 = queue_64[0]; + const SWord32 s1 = ptr_64; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_68.c b/example24/copilot-sbv-codegen/update_state_68.c new file mode 100644 index 00000000..1ae7bcfc --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_68.c @@ -0,0 +1,26 @@ +/* File: "update_state_68.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s68 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_68[ptr_68] + 1); +*/ +SWord32 update_state_68(const SWord32 *queue_68, + const SWord32 ptr_68) +{ + const SWord32 s0 = queue_68[0]; + const SWord32 s1 = ptr_68; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_72.c b/example24/copilot-sbv-codegen/update_state_72.c new file mode 100644 index 00000000..1003f77e --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_72.c @@ -0,0 +1,26 @@ +/* File: "update_state_72.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s72 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_72[ptr_72] + 1); +*/ +SWord32 update_state_72(const SWord32 *queue_72, + const SWord32 ptr_72) +{ + const SWord32 s0 = queue_72[0]; + const SWord32 s1 = ptr_72; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_76.c b/example24/copilot-sbv-codegen/update_state_76.c new file mode 100644 index 00000000..772a61b3 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_76.c @@ -0,0 +1,26 @@ +/* File: "update_state_76.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s76 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_76[ptr_76] + 1); +*/ +SWord32 update_state_76(const SWord32 *queue_76, + const SWord32 ptr_76) +{ + const SWord32 s0 = queue_76[0]; + const SWord32 s1 = ptr_76; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_8.c b/example24/copilot-sbv-codegen/update_state_8.c new file mode 100644 index 00000000..e3660834 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_8.c @@ -0,0 +1,25 @@ +/* File: "update_state_8.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s8 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_8[ptr_8] + 1); +*/ +SWord32 update_state_8(const SWord32 *queue_8, const SWord32 ptr_8) +{ + const SWord32 s0 = queue_8[0]; + const SWord32 s1 = ptr_8; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_80.c b/example24/copilot-sbv-codegen/update_state_80.c new file mode 100644 index 00000000..cfed9095 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_80.c @@ -0,0 +1,26 @@ +/* File: "update_state_80.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s80 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_80[ptr_80] + 1); +*/ +SWord32 update_state_80(const SWord32 *queue_80, + const SWord32 ptr_80) +{ + const SWord32 s0 = queue_80[0]; + const SWord32 s1 = ptr_80; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_84.c b/example24/copilot-sbv-codegen/update_state_84.c new file mode 100644 index 00000000..0b62fecb --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_84.c @@ -0,0 +1,26 @@ +/* File: "update_state_84.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s84 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_84[ptr_84] + 1); +*/ +SWord32 update_state_84(const SWord32 *queue_84, + const SWord32 ptr_84) +{ + const SWord32 s0 = queue_84[0]; + const SWord32 s1 = ptr_84; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_88.c b/example24/copilot-sbv-codegen/update_state_88.c new file mode 100644 index 00000000..f7fd36f9 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_88.c @@ -0,0 +1,26 @@ +/* File: "update_state_88.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s88 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_88[ptr_88] + 1); +*/ +SWord32 update_state_88(const SWord32 *queue_88, + const SWord32 ptr_88) +{ + const SWord32 s0 = queue_88[0]; + const SWord32 s1 = ptr_88; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_92.c b/example24/copilot-sbv-codegen/update_state_92.c new file mode 100644 index 00000000..e32cbd4b --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_92.c @@ -0,0 +1,26 @@ +/* File: "update_state_92.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s92 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_92[ptr_92] + 1); +*/ +SWord32 update_state_92(const SWord32 *queue_92, + const SWord32 ptr_92) +{ + const SWord32 s0 = queue_92[0]; + const SWord32 s1 = ptr_92; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/copilot-sbv-codegen/update_state_96.c b/example24/copilot-sbv-codegen/update_state_96.c new file mode 100644 index 00000000..54d09855 --- /dev/null +++ b/example24/copilot-sbv-codegen/update_state_96.c @@ -0,0 +1,26 @@ +/* File: "update_state_96.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s96 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_96[ptr_96] + 1); +*/ +SWord32 update_state_96(const SWord32 *queue_96, + const SWord32 ptr_96) +{ + const SWord32 s0 = queue_96[0]; + const SWord32 s1 = ptr_96; + const SWord32 s3 = s0 + 0x00000001UL; + + return s3; +} diff --git a/example24/main.hs b/example24/main.hs new file mode 100644 index 00000000..8d292337 --- /dev/null +++ b/example24/main.hs @@ -0,0 +1,63 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.Statistics +import Copilot.Library.Voting + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +spec :: Spec +spec = do + trigger "maj" true [ arg maj ] + + trigger "aMaj" true + [ arg $ aMajority xs maj ] + + where + + maj = majority xs + xs = concat (replicate 1 ls) + ls = [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z] + + a = [0] ++ a + 1 :: Stream Word32 + b = [0] ++ b + 1 + c = [0] ++ c + 1 + d = [0] ++ d + 1 + e = [1] ++ e + 1 + f = [1] ++ f + 1 + g = [1] ++ g + 1 + h = [1] ++ h + 1 + i = [1] ++ i + 1 + j = [1] ++ j + 1 + k = [1] ++ k + 1 + l = [1] ++ l + 1 + m = [1] ++ m + 1 + n = [1] ++ n + 1 + o = [1] ++ o + 1 + p = [1] ++ p + 1 + q = [1] ++ q + 1 + r = [1] ++ r + 1 + s = [1] ++ s + 1 + t = [1] ++ t + 1 + u = [1] ++ u + 1 + v = [1] ++ v + 1 + w = [1] ++ w + 1 + x = [1] ++ x + 1 + y = [1] ++ y + 1 + z = [1] ++ z + 1 + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example3/--list-options/add-source-timestamps b/example3/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example3/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example3/--list-options/packages/00-index.cache b/example3/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example3/--list-options/packages/00-index.tar b/example3/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example3/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example3/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example3/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example3/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example3/.cabal-sandbox/add-source-timestamps b/example3/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example3/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example3/.cabal-sandbox/packages/00-index.cache b/example3/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example3/.cabal-sandbox/packages/00-index.tar b/example3/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example3/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example3/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example3/Makefile b/example3/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example3/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example3/cabal.sandbox.config b/example3/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example3/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example3/copilot-sbv-codegen/Makefile b/example3/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..24ff8281 --- /dev/null +++ b/example3/copilot-sbv-codegen/Makefile @@ -0,0 +1,44 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o trigger_guard_trigger.o trigger_trigger_arg_0.o trigger_trigger_arg_1.o trigger_trigger_arg_2.o ext_arr_arr1.o ext_arr_arr2.o ext_arr_arr2.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_trigger.o: trigger_guard_trigger.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_0.o: trigger_trigger_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_1.o: trigger_trigger_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trigger_arg_2.o: trigger_trigger_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_arr_arr1.o: ext_arr_arr1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_arr_arr2.o: ext_arr_arr2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_arr_arr2.o: ext_arr_arr2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example3/copilot-sbv-codegen/README b/example3/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example3/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example3/copilot-sbv-codegen/copilot.h b/example3/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..d0fc1dc1 --- /dev/null +++ b/example3/copilot-sbv-codegen/copilot.h @@ -0,0 +1,28 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void trigger(uint32_t, uint32_t, uint32_t); + +/* External variables (must be defined by user): */ + +extern uint8_t idx2; +extern uint8_t idx3; + +/* External arrays (must be defined by user): */ + +extern uint32_t arr1[5]; +extern uint32_t arr2[4]; + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example3/copilot-sbv-codegen/copilot.mk b/example3/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example3/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example3/copilot-sbv-codegen/driver.c b/example3/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..3a303ba2 --- /dev/null +++ b/example3/copilot-sbv-codegen/driver.c @@ -0,0 +1,99 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SWord32 tmp_0 = 0; +SWord32 queue_0[1] = { 0 }; +SWord32 ptr_0 = 0; +SWord8 ext_idx2 = 0; +SWord8 ext_idx3 = 0; +SWord32 ext_arr1_0 = 0; +SWord32 ext_arr2_1 = 0; +SWord32 ext_arr2_2 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); +*/ + +/*@ + assigns ext_idx2; + assigns ext_idx3; + //ensures ext_idx2 == idx2; + //ensures ext_idx3 == idx3; + assigns ext_arr1_0 ; + assigns ext_arr2_1 ; + assigns ext_arr2_2 ; + //ensures ext_arr1_0 == tmp_arr1; + //ensures ext_arr2_1 == tmp_arr2; + //ensures ext_arr2_2 == tmp_arr2; +*/ +void sampleExts(void) { + ext_idx2 = idx2; + ext_idx3 = idx3; + SWord32 tmp_ext_arr1_0 = arr1[ext_arr_arr1(queue_0, ptr_0)]; + ext_arr1_0 = tmp_ext_arr1_0; + SWord32 tmp_ext_arr2_1 = arr2[ext_arr_arr2(ext_idx2)]; + ext_arr2_1 = tmp_ext_arr2_1; + SWord32 tmp_ext_arr2_2 = arr2[ext_arr_arr2(ext_idx3)]; + ext_arr2_2 = tmp_ext_arr2_2; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_trigger()) + trigger(trigger_trigger_arg_0(ext_arr1_0), + trigger_trigger_arg_1(ext_arr2_1), + trigger_trigger_arg_2(ext_arr2_2)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example3/copilot-sbv-codegen/ext_arr_arr1.c b/example3/copilot-sbv-codegen/ext_arr_arr1.c new file mode 100644 index 00000000..082e4611 --- /dev/null +++ b/example3/copilot-sbv-codegen/ext_arr_arr1.c @@ -0,0 +1,23 @@ +/* File: "ext_arr_arr1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 002*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord32 ext_arr_arr1(const SWord32 *queue_0, const SWord32 ptr_0) +{ + const SWord32 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example3/copilot-sbv-codegen/ext_arr_arr2.c b/example3/copilot-sbv-codegen/ext_arr_arr2.c new file mode 100644 index 00000000..f2d95ab5 --- /dev/null +++ b/example3/copilot-sbv-codegen/ext_arr_arr2.c @@ -0,0 +1,24 @@ +/* File: "ext_arr_arr2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 002*/ +/*ACSL to write + (cast) extern "idx3" +*/ +/*@ + assigns \nothing; + ensures \result == ext_idx3; +*/ +SWord16 ext_arr_arr2(const SWord8 ext_idx3) +{ + const SWord8 s0 = ext_idx3; + const SWord16 s2 = (((SWord16) 0) << 8) | ((SWord16) s0); + + return s2; +} diff --git a/example3/copilot-sbv-codegen/internal.h b/example3/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..5cd51678 --- /dev/null +++ b/example3/copilot-sbv-codegen/internal.h @@ -0,0 +1,43 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord32 update_state_0(const SWord32 *queue_0, + const SWord32 ptr_0); +SBool trigger_guard_trigger(); +SWord32 trigger_trigger_arg_0(const SWord32 ext_arr1_0); +SWord32 trigger_trigger_arg_1(const SWord32 ext_arr2_1); +SWord32 trigger_trigger_arg_2(const SWord32 ext_arr2_2); +SWord32 ext_arr_arr1(const SWord32 *queue_0, const SWord32 ptr_0); +SWord16 ext_arr_arr2(const SWord8 ext_idx2); +SWord16 ext_arr_arr2(const SWord8 ext_idx3); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example3/copilot-sbv-codegen/trigger_guard_trigger.c b/example3/copilot-sbv-codegen/trigger_guard_trigger.c new file mode 100644 index 00000000..219a0e0f --- /dev/null +++ b/example3/copilot-sbv-codegen/trigger_guard_trigger.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_trigger.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_trigger() +{ + return true; +} diff --git a/example3/copilot-sbv-codegen/trigger_trigger_arg_0.c b/example3/copilot-sbv-codegen/trigger_trigger_arg_0.c new file mode 100644 index 00000000..e5dc4298 --- /dev/null +++ b/example3/copilot-sbv-codegen/trigger_trigger_arg_0.c @@ -0,0 +1,22 @@ +/* File: "trigger_trigger_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "arr1[s0]" +*/ +/*@ + assigns \nothing; + ensures \result == ext_arr1_0; +*/ +SWord32 trigger_trigger_arg_0(const SWord32 ext_arr1_0) +{ + const SWord32 s0 = ext_arr1_0; + return s0; +} diff --git a/example3/copilot-sbv-codegen/trigger_trigger_arg_1.c b/example3/copilot-sbv-codegen/trigger_trigger_arg_1.c new file mode 100644 index 00000000..fad424c0 --- /dev/null +++ b/example3/copilot-sbv-codegen/trigger_trigger_arg_1.c @@ -0,0 +1,22 @@ +/* File: "trigger_trigger_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "arr2[(cast) extern "idx2"]" +*/ +/*@ + assigns \nothing; + ensures \result == ext_arr2_1; +*/ +SWord32 trigger_trigger_arg_1(const SWord32 ext_arr2_1) +{ + const SWord32 s0 = ext_arr2_1; + return s0; +} diff --git a/example3/copilot-sbv-codegen/trigger_trigger_arg_2.c b/example3/copilot-sbv-codegen/trigger_trigger_arg_2.c new file mode 100644 index 00000000..e1cca6af --- /dev/null +++ b/example3/copilot-sbv-codegen/trigger_trigger_arg_2.c @@ -0,0 +1,22 @@ +/* File: "trigger_trigger_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "arr2[(cast) extern "idx3"]" +*/ +/*@ + assigns \nothing; + ensures \result == ext_arr2_2; +*/ +SWord32 trigger_trigger_arg_2(const SWord32 ext_arr2_2) +{ + const SWord32 s0 = ext_arr2_2; + return s0; +} diff --git a/example3/copilot-sbv-codegen/update_state_0.c b/example3/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..9bdb1626 --- /dev/null +++ b/example3/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,26 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((s0 + 1) mod 4) +*/ +/*@ + assigns \nothing; + ensures \result == ((queue_0[ptr_0] + 1) % 4); +*/ +SWord32 update_state_0(const SWord32 *queue_0, const SWord32 ptr_0) +{ + const SWord32 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SWord32 s3 = s0 + 0x00000001UL; + const SWord32 s5 = (0x00000004UL == 0) ? s3 : (s3 % 0x00000004UL); + + return s5; +} diff --git a/example3/main.hs b/example3/main.hs new file mode 100644 index 00000000..cc4c9376 --- /dev/null +++ b/example3/main.hs @@ -0,0 +1,44 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +extArr :: Stream Word32 +extArr = externArray "arr1" arrIdx 5 (Just $ L.repeat [7,8,9,10,11]) + +arrIdx :: Stream Word32 +arrIdx = [0] ++ (arrIdx + 1) `mod` 4 + +arrIdx2 :: Stream Word8 +arrIdx2 = extern "idx2" (Just [0,0..]) + +extArr2 :: Stream Word16 -> Stream Word32 +extArr2 idx = externArray "arr2" idx 4 (Just $ L.repeat [1,2,3,4]) + +extArr3 :: Stream Word32 +extArr3 = extArr2 (cast $ externW8 "idx3" (Just $ L.cycle [0,1,2])) + +spec :: Spec +spec = trigger "trigger" true [ arg extArr + , arg (extArr2 (cast arrIdx2)) + , arg extArr3 +-- Throws an exception since the index is too big for the array! +-- , arg (extArr2 5) + ] + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example4/--list-options/add-source-timestamps b/example4/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example4/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example4/--list-options/packages/00-index.cache b/example4/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example4/--list-options/packages/00-index.tar b/example4/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example4/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example4/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example4/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example4/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example4/.cabal-sandbox/add-source-timestamps b/example4/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example4/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example4/.cabal-sandbox/packages/00-index.cache b/example4/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example4/.cabal-sandbox/packages/00-index.tar b/example4/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example4/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example4/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example4/Makefile b/example4/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example4/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example4/cabal.sandbox.config b/example4/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example4/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example4/main.hs b/example4/main.hs new file mode 100644 index 00000000..4a3cd425 --- /dev/null +++ b/example4/main.hs @@ -0,0 +1,35 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +b :: Stream Bool +b = [True] ++ not b + +i :: Stream Int8 +i = cast b + +x :: Stream Word16 +x = [0] ++ x + 1 + +y :: Stream Int32 +y = 1 + cast x + +spec :: Spec +spec = trigger "trigger" true [arg y, arg i] + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example5/--list-options/add-source-timestamps b/example5/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example5/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example5/--list-options/packages/00-index.cache b/example5/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example5/--list-options/packages/00-index.tar b/example5/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example5/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example5/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example5/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example5/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example5/.cabal-sandbox/add-source-timestamps b/example5/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example5/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example5/.cabal-sandbox/packages/00-index.cache b/example5/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example5/.cabal-sandbox/packages/00-index.tar b/example5/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example5/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example5/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example5/Makefile b/example5/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example5/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example5/cabal.sandbox.config b/example5/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example5/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example5/copilot-sbv-codegen/Makefile b/example5/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..22b37e99 --- /dev/null +++ b/example5/copilot-sbv-codegen/Makefile @@ -0,0 +1,32 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o observer_clk1.o observer_clk.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_clk1.o: observer_clk1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_clk.o: observer_clk.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example5/copilot-sbv-codegen/README b/example5/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example5/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example5/copilot-sbv-codegen/copilot.h b/example5/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..5b7d66bd --- /dev/null +++ b/example5/copilot-sbv-codegen/copilot.h @@ -0,0 +1,25 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool clk1; +extern bool clk; + +/* Triggers (must be defined by user): */ + + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example5/copilot-sbv-codegen/copilot.mk b/example5/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example5/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example5/copilot-sbv-codegen/driver.c b/example5/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..a6c0a2cf --- /dev/null +++ b/example5/copilot-sbv-codegen/driver.c @@ -0,0 +1,91 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool clk1; +SBool clk; + +/* Variables */ +SWord8 tmp_0 = 0; +SBool tmp_1 = true; +SWord8 queue_0[1] = { 0 }; +SBool queue_1[5] = { true, false, false, false, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 5 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 4 )); +*/ + +/*@ + assigns \nothing; +*/ +void sampleExts(void) { +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { +} + +/*@ + assigns clk; + assigns clk1; + */ +void updateObservers(void) { + clk = observer_clk(queue_1, ptr_1); + clk1 = observer_clk1(queue_0, ptr_0); +} + +/*@ + assigns tmp_0; + assigns tmp_1; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 5; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 5; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example5/copilot-sbv-codegen/internal.h b/example5/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..790012f3 --- /dev/null +++ b/example5/copilot-sbv-codegen/internal.h @@ -0,0 +1,38 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord8 update_state_0(const SWord8 *queue_0, const SWord32 ptr_0); +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1); +SBool observer_clk1(const SWord8 *queue_0, const SWord32 ptr_0); +SBool observer_clk(const SBool *queue_1, const SWord32 ptr_1); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example5/copilot-sbv-codegen/observer_clk.c b/example5/copilot-sbv-codegen/observer_clk.c new file mode 100644 index 00000000..af373803 --- /dev/null +++ b/example5/copilot-sbv-codegen/observer_clk.c @@ -0,0 +1,33 @@ +/* File: "observer_clk.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool observer_clk(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SWord32 s5 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4 + }; + const SWord32 s7 = (0x00000005UL == 0) ? s5 : (s5 % 0x00000005UL); + const SBool s8 = table0[s7]; + + return s8; +} diff --git a/example5/copilot-sbv-codegen/observer_clk1.c b/example5/copilot-sbv-codegen/observer_clk1.c new file mode 100644 index 00000000..b2df9e1d --- /dev/null +++ b/example5/copilot-sbv-codegen/observer_clk1.c @@ -0,0 +1,25 @@ +/* File: "observer_clk1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + (s0 == 0) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] == 0); +*/ +SBool observer_clk1(const SWord8 *queue_0, const SWord32 ptr_0) +{ + const SWord8 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s3 = s0 == 0; + + return s3; +} diff --git a/example5/copilot-sbv-codegen/update_state_0.c b/example5/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..30be3c42 --- /dev/null +++ b/example5/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,27 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if (s0 /= 4) then (s0 + 1) else 0) +*/ +/*@ + assigns \nothing; + ensures \result == ( (queue_0[ptr_0] != 4) ? (queue_0[ptr_0] + 1) : 0); +*/ +SWord8 update_state_0(const SWord8 *queue_0, const SWord32 ptr_0) +{ + const SWord8 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s3 = s0 != 4; + const SWord8 s5 = s0 + 1; + const SWord8 s7 = s3 ? s5 : 0; + + return s7; +} diff --git a/example5/copilot-sbv-codegen/update_state_1.c b/example5/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..7c22cc25 --- /dev/null +++ b/example5/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,33 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool update_state_1(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SBool s1 = queue_1[1]; + const SBool s2 = queue_1[2]; + const SBool s3 = queue_1[3]; + const SBool s4 = queue_1[4]; + const SWord32 s5 = ptr_1; + const SBool table0[] = { + s0, s1, s2, s3, s4 + }; + const SWord32 s7 = (0x00000005UL == 0) ? s5 : (s5 % 0x00000005UL); + const SBool s8 = table0[s7]; + + return s8; +} diff --git a/example5/main.hs b/example5/main.hs new file mode 100644 index 00000000..92c6da98 --- /dev/null +++ b/example5/main.hs @@ -0,0 +1,35 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +p :: Word8 +p = 5 + +clkStream, clk1Stream :: Stream Bool +clkStream = clk ( period p ) ( phase 0 ) +clk1Stream = clk1 ( period p ) ( phase 0 ) + + +spec :: Spec +spec = do + observer "clk" clkStream + observer "clk1" clk1Stream + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example6/--list-options/add-source-timestamps b/example6/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example6/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example6/--list-options/packages/00-index.cache b/example6/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example6/--list-options/packages/00-index.tar b/example6/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example6/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example6/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example6/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example6/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example6/.cabal-sandbox/add-source-timestamps b/example6/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example6/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example6/.cabal-sandbox/packages/00-index.cache b/example6/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example6/.cabal-sandbox/packages/00-index.tar b/example6/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example6/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example6/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example6/Makefile b/example6/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example6/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example6/cabal.sandbox.config b/example6/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example6/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example6/copilot-sbv-codegen/Makefile b/example6/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..39a0a0ac --- /dev/null +++ b/example6/copilot-sbv-codegen/Makefile @@ -0,0 +1,44 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o trigger_guard_chksum.o trigger_chksum_arg_0.o trigger_chksum_arg_1.o trigger_chksum_arg_2.o ext_crc_sbv_0_arg0.o ext_crc_sbv_1_arg0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_chksum.o: trigger_guard_chksum.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_chksum_arg_0.o: trigger_chksum_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_chksum_arg_1.o: trigger_chksum_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_chksum_arg_2.o: trigger_chksum_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_crc_sbv_0_arg0.o: ext_crc_sbv_0_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +ext_crc_sbv_1_arg0.o: ext_crc_sbv_1_arg0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example6/copilot-sbv-codegen/README b/example6/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example6/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example6/copilot-sbv-codegen/copilot.h b/example6/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..18cd9206 --- /dev/null +++ b/example6/copilot-sbv-codegen/copilot.h @@ -0,0 +1,25 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void chksum(uint16_t, uint16_t, uint16_t); + +/* External variables (must be defined by user): */ + + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + +uint16_t crc_sbv(uint16_t); + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example6/copilot-sbv-codegen/copilot.mk b/example6/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example6/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example6/copilot-sbv-codegen/driver.c b/example6/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..93a4b1a2 --- /dev/null +++ b/example6/copilot-sbv-codegen/driver.c @@ -0,0 +1,100 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SWord16 tmp_0 = 1; +SWord16 tmp_1 = 0; +SWord16 queue_0[1] = { 1 }; +SWord16 queue_1[1] = { 0 }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord16 ext_crc_sbv_0 = 0; +SWord16 ext_crc_sbv_1 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); +*/ + +/*@ + assigns ext_crc_sbv_0; + assigns ext_crc_sbv_1; + //ensures ext_crc_sbv_0 == tmp_crc_sbv; + //ensures ext_crc_sbv_1 == tmp_crc_sbv; +*/ +void sampleExts(void) { + SWord16 tmp_crc_sbv = crc_sbv(ext_crc_sbv_0_arg0(queue_0, ptr_0)); + ext_crc_sbv_0 = tmp_crc_sbv; + SWord16 tmp_crc_sbv = crc_sbv(ext_crc_sbv_1_arg0(queue_0, ptr_0)); + ext_crc_sbv_1 = tmp_crc_sbv; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_chksum()) + chksum(trigger_chksum_arg_0(queue_0, ptr_0), + trigger_chksum_arg_1(ext_crc_sbv_1, queue_0, ptr_0), + trigger_chksum_arg_2(queue_1, ptr_1)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + assigns tmp_1; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(ext_crc_sbv_0, queue_0, ptr_0, queue_1, ptr_1); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example6/copilot-sbv-codegen/ext_crc_sbv_0_arg0.c b/example6/copilot-sbv-codegen/ext_crc_sbv_0_arg0.c new file mode 100644 index 00000000..1b42c3a4 --- /dev/null +++ b/example6/copilot-sbv-codegen/ext_crc_sbv_0_arg0.c @@ -0,0 +1,24 @@ +/* File: "ext_crc_sbv_0_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 ext_crc_sbv_0_arg0(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example6/copilot-sbv-codegen/ext_crc_sbv_1_arg0.c b/example6/copilot-sbv-codegen/ext_crc_sbv_1_arg0.c new file mode 100644 index 00000000..bb49bf75 --- /dev/null +++ b/example6/copilot-sbv-codegen/ext_crc_sbv_1_arg0.c @@ -0,0 +1,24 @@ +/* File: "ext_crc_sbv_1_arg0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 ext_crc_sbv_1_arg0(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example6/copilot-sbv-codegen/internal.h b/example6/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..e0f74f8c --- /dev/null +++ b/example6/copilot-sbv-codegen/internal.h @@ -0,0 +1,50 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord16 update_state_0(const SWord16 *queue_0, + const SWord32 ptr_0); +SWord16 update_state_1(const SWord16 ext_crc_sbv_0, + const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 *queue_1, const SWord32 ptr_1); +SBool trigger_guard_chksum(); +SWord16 trigger_chksum_arg_0(const SWord16 *queue_0, + const SWord32 ptr_0); +SWord16 trigger_chksum_arg_1(const SWord16 ext_crc_sbv_1, + const SWord16 *queue_0, const SWord32 ptr_0); +SWord16 trigger_chksum_arg_2(const SWord16 *queue_1, + const SWord32 ptr_1); +SWord16 ext_crc_sbv_0_arg0(const SWord16 *queue_0, + const SWord32 ptr_0); +SWord16 ext_crc_sbv_1_arg0(const SWord16 *queue_0, + const SWord32 ptr_0); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example6/copilot-sbv-codegen/trigger_chksum_arg_0.c b/example6/copilot-sbv-codegen/trigger_chksum_arg_0.c new file mode 100644 index 00000000..9d3045d2 --- /dev/null +++ b/example6/copilot-sbv-codegen/trigger_chksum_arg_0.c @@ -0,0 +1,24 @@ +/* File: "trigger_chksum_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord16 trigger_chksum_arg_0(const SWord16 *queue_0, + const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example6/copilot-sbv-codegen/trigger_chksum_arg_1.c b/example6/copilot-sbv-codegen/trigger_chksum_arg_1.c new file mode 100644 index 00000000..fca82a5b --- /dev/null +++ b/example6/copilot-sbv-codegen/trigger_chksum_arg_1.c @@ -0,0 +1,25 @@ +/* File: "trigger_chksum_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + extern "crc_sbv(s0)" +*/ +/*@ + assigns \nothing; + ensures \result == ext_crc_sbv_1; +*/ +SWord16 trigger_chksum_arg_1(const SWord16 ext_crc_sbv_1, + const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SWord16 s0 = ext_crc_sbv_1; + const SWord16 s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + return s0; +} diff --git a/example6/copilot-sbv-codegen/trigger_chksum_arg_2.c b/example6/copilot-sbv-codegen/trigger_chksum_arg_2.c new file mode 100644 index 00000000..360ee3cf --- /dev/null +++ b/example6/copilot-sbv-codegen/trigger_chksum_arg_2.c @@ -0,0 +1,24 @@ +/* File: "trigger_chksum_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SWord16 trigger_chksum_arg_2(const SWord16 *queue_1, + const SWord32 ptr_1) +{ + const SWord16 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + return s0; +} diff --git a/example6/copilot-sbv-codegen/trigger_guard_chksum.c b/example6/copilot-sbv-codegen/trigger_guard_chksum.c new file mode 100644 index 00000000..ee2ba28c --- /dev/null +++ b/example6/copilot-sbv-codegen/trigger_guard_chksum.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_chksum.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_chksum() +{ + return true; +} diff --git a/example6/copilot-sbv-codegen/update_state_0.c b/example6/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..e732f032 --- /dev/null +++ b/example6/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,25 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 mod 2047) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] % 2047); +*/ +SWord16 update_state_0(const SWord16 *queue_0, const SWord32 ptr_0) +{ + const SWord16 s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SWord16 s3 = (0x07ffU == 0) ? s0 : (s0 % 0x07ffU); + + return s3; +} diff --git a/example6/copilot-sbv-codegen/update_state_1.c b/example6/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..c7736b46 --- /dev/null +++ b/example6/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,30 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (extern "crc_sbv(s0)" ^ s1) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_crc_sbv_0 ^ queue_1[ptr_1]); +*/ +SWord16 update_state_1(const SWord16 ext_crc_sbv_0, + const SWord16 *queue_0, const SWord32 ptr_0, + const SWord16 *queue_1, const SWord32 ptr_1) +{ + const SWord16 s0 = ext_crc_sbv_0; + const SWord16 s1 = queue_0[0]; + const SWord32 s2 = ptr_0; + const SWord16 s3 = queue_1[0]; + const SWord32 s4 = ptr_1; + const SWord16 s5 = s0 ^ s3; + + return s5; +} diff --git a/example6/main.hs b/example6/main.hs new file mode 100644 index 00000000..0f5a2460 --- /dev/null +++ b/example6/main.hs @@ -0,0 +1,52 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +import qualified Data.SBV as V +import Data.SBV.Examples.CodeGeneration.CRC_USB5 (crcUSB) + +-- | Incoming stream of words_1: 1,2,3, ..., 2047,0,1,2, ... +words_1 :: Stream Word16 +words_1 = [1] ++ words_1 `mod` 2047 -- USB5 is for 11-bit words_1. + +-- | Call the CRC function generated by the SBV package. (The Nothing argument +-- says "no interpreter values given.) +current :: Stream Word16 +current = externFun "crc_sbv" [arg words_1] Nothing + +-- | xor the CRC of the current word and the CRC of the stream so far. +output :: Stream Word16 +output = [0] ++ current .^. output + +-- | The trigger specifies a C function with the prototype +-- void chksum(Word16, Word16, Word16); +spec :: Spec +spec = + trigger "chksum" true [ arg words_1 + , arg current + , arg output + ] + +main = do + reify spec >>= + S.compileWithSBV + S.defaultParams [] + + where + sbv = do word <- V.cgInput "word" + V.cgReturn (crcUSB word) + + + +-------------------------------------------------------------------------------- diff --git a/example7/--list-options/add-source-timestamps b/example7/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example7/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example7/--list-options/packages/00-index.cache b/example7/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example7/--list-options/packages/00-index.tar b/example7/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example7/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example7/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example7/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example7/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example7/.cabal-sandbox/add-source-timestamps b/example7/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example7/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example7/.cabal-sandbox/packages/00-index.cache b/example7/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example7/.cabal-sandbox/packages/00-index.tar b/example7/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example7/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example7/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example7/Makefile b/example7/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example7/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example7/cabal.sandbox.config b/example7/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example7/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example7/copilot-sbv-codegen/Makefile b/example7/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..bfdf40eb --- /dev/null +++ b/example7/copilot-sbv-codegen/Makefile @@ -0,0 +1,29 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_27.o trigger_guard_shutoff.o trigger_shutoff_arg_0.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_27.o: update_state_27.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_shutoff.o: trigger_guard_shutoff.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_shutoff_arg_0.o: trigger_shutoff_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example7/copilot-sbv-codegen/README b/example7/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example7/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example7/copilot-sbv-codegen/copilot.h b/example7/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..f0bce139 --- /dev/null +++ b/example7/copilot-sbv-codegen/copilot.h @@ -0,0 +1,28 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void shutoff(bool); + +/* External variables (must be defined by user): */ + +extern uint8_t tmp_probe_1; +extern uint8_t tmp_probe_0; +extern uint8_t tmp_probe_2; +extern bool cooler; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example7/copilot-sbv-codegen/copilot.mk b/example7/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example7/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example7/copilot-sbv-codegen/driver.c b/example7/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..6aba04b1 --- /dev/null +++ b/example7/copilot-sbv-codegen/driver.c @@ -0,0 +1,90 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SBool tmp_27 = true; +SBool queue_27[1] = { true }; +SWord32 ptr_27 = 0; +SBool ext_cooler = 0; +SWord8 ext_tmp_probe_0 = 0; +SWord8 ext_tmp_probe_1 = 0; +SWord8 ext_tmp_probe_2 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_27: ptr_27 < 1 ; + global invariant a_pos_ptr_27: ptr_27 >= 0 ; + global invariant a_valid_ptr_27: \valid (queue_27 + (0.. 0 )); +*/ + +/*@ + assigns ext_cooler; + assigns ext_tmp_probe_0; + assigns ext_tmp_probe_1; + assigns ext_tmp_probe_2; + //ensures ext_cooler == cooler; + //ensures ext_tmp_probe_0 == tmp_probe_0; + //ensures ext_tmp_probe_1 == tmp_probe_1; + //ensures ext_tmp_probe_2 == tmp_probe_2; +*/ +void sampleExts(void) { + ext_cooler = cooler; + ext_tmp_probe_0 = tmp_probe_0; + ext_tmp_probe_1 = tmp_probe_1; + ext_tmp_probe_2 = tmp_probe_2; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_shutoff(ext_tmp_probe_1, ext_tmp_probe_0, ext_tmp_probe_2, ext_cooler, queue_27, ptr_27)) + shutoff(trigger_shutoff_arg_0(ext_tmp_probe_1, ext_tmp_probe_0, ext_tmp_probe_2)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_27; + */ +void updateStates(void) { + tmp_27 = update_state_27(ext_tmp_probe_1, ext_tmp_probe_0, ext_tmp_probe_2, ext_cooler, queue_27, ptr_27); +} + +/*@ + assigns queue_27[ptr_27]; + ensures queue_27[ptr_27] == tmp_27; + */ +void updateBuffers(void) { + queue_27[ptr_27] = tmp_27; +} + +/*@ + assigns ptr_27; + ensures ptr_27 == (\old (ptr_27 ) + 1) % 1; + */ +void updatePtrs(void) { + ptr_27 = (ptr_27 + 1) % 1; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example7/copilot-sbv-codegen/internal.h b/example7/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..d14ab6da --- /dev/null +++ b/example7/copilot-sbv-codegen/internal.h @@ -0,0 +1,44 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_27(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2, + const SBool ext_cooler, const SBool *queue_27, + const SWord32 ptr_27); +SBool trigger_guard_shutoff(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2, + const SBool ext_cooler, const SBool *queue_27, + const SWord32 ptr_27); +SBool trigger_shutoff_arg_0(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example7/copilot-sbv-codegen/trigger_guard_shutoff.c b/example7/copilot-sbv-codegen/trigger_guard_shutoff.c new file mode 100644 index 00000000..88c63c63 --- /dev/null +++ b/example7/copilot-sbv-codegen/trigger_guard_shutoff.c @@ -0,0 +1,80 @@ +/* File: "trigger_guard_shutoff.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + not ((not (local "local_0" = false + in local "local_1" = (if var "local_0" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_2" = (if (var "local_0" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_3" = (var "local_2" == 0) + in local "local_4" = (if var "local_3" then (extern "tmp_probe_2" > 250) else var "local_1") + in local "local_5" = (if (var "local_3" || ((extern "tmp_probe_2" > 250) == var "local_1")) then (var "local_2" + 1) else (var "local_2" - 1)) + in var "local_4" && ((local "local_6" = (if ((extern "tmp_probe_0" > 250) == local "local_7" = false + in local "local_8" = (if var "local_7" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_9" = (if (var "local_7" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_10" = (var "local_9" == 0) + in local "local_11" = (if var "local_10" then (extern "tmp_probe_2" > 250) else var "local_8") + in local "local_12" = (if (var "local_10" || ((extern "tmp_probe_2" > 250) == var "local_8")) then (var "local_9" + 1) else (var "local_9" - 1)) + in var "local_11") then 1 else 0) + in local "local_13" = (if ((extern "tmp_probe_1" > 250) == local "local_14" = false + in local "local_15" = (if var "local_14" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_16" = (if (var "local_14" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_17" = (var "local_16" == 0) + in local "local_18" = (if var "local_17" then (extern "tmp_probe_2" > 250) else var "local_15") + in local "local_19" = (if (var "local_17" || ((extern "tmp_probe_2" > 250) == var "local_15")) then (var "local_16" + 1) else (var "local_16" - 1)) + in var "local_18") then (var "local_6" + 1) else var "local_6") + in local "local_20" = (if ((extern "tmp_probe_2" > 250) == local "local_21" = false + in local "local_22" = (if var "local_21" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_23" = (if (var "local_21" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_24" = (var "local_23" == 0) + in local "local_25" = (if var "local_24" then (extern "tmp_probe_2" > 250) else var "local_22") + in local "local_26" = (if (var "local_24" || ((extern "tmp_probe_2" > 250) == var "local_22")) then (var "local_23" + 1) else (var "local_23" - 1)) + in var "local_25") then (var "local_13" + 1) else var "local_13") + in var "local_20" * 2) > 3)) || extern "cooler") && s27) +*/ +/*@ + assigns \nothing; + ensures \result == ! ((! ((\let local_0 = false ; (\let local_1 = ( local_0 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_2 = ( (local_0 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_3 = (local_2 == 0) ; (\let local_4 = ( local_3 ? (ext_tmp_probe_2 > 250) : local_1) ; (\let local_5 = ( (local_3 || ((ext_tmp_probe_2 > 250) == local_1)) ? (local_2 + 1) : (local_2 - 1)) ; local_4 ) ) ) ) ) ) && (((\let local_6 = ( ((ext_tmp_probe_0 > 250) == (\let local_7 = false ; (\let local_8 = ( local_7 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_9 = ( (local_7 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_10 = (local_9 == 0) ; (\let local_11 = ( local_10 ? (ext_tmp_probe_2 > 250) : local_8) ; (\let local_12 = ( (local_10 || ((ext_tmp_probe_2 > 250) == local_8)) ? (local_9 + 1) : (local_9 - 1)) ; local_11 ) ) ) ) ) )) ? 1 : 0) ; (\let local_13 = ( ((ext_tmp_probe_1 > 250) == (\let local_14 = false ; (\let local_15 = ( local_14 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_16 = ( (local_14 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_17 = (local_16 == 0) ; (\let local_18 = ( local_17 ? (ext_tmp_probe_2 > 250) : local_15) ; (\let local_19 = ( (local_17 || ((ext_tmp_probe_2 > 250) == local_15)) ? (local_16 + 1) : (local_16 - 1)) ; local_18 ) ) ) ) ) )) ? (local_6 + 1) : local_6) ; (\let local_20 = ( ((ext_tmp_probe_2 > 250) == (\let local_21 = false ; (\let local_22 = ( local_21 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_23 = ( (local_21 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_24 = (local_23 == 0) ; (\let local_25 = ( local_24 ? (ext_tmp_probe_2 > 250) : local_22) ; (\let local_26 = ( (local_24 || ((ext_tmp_probe_2 > 250) == local_22)) ? (local_23 + 1) : (local_23 - 1)) ; local_25 ) ) ) ) ) )) ? (local_13 + 1) : local_13) ; local_20 ) ) ) * 2) > 3)) || ext_cooler) && queue_27[ptr_27]); +*/ +SBool trigger_guard_shutoff(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2, + const SBool ext_cooler, const SBool *queue_27, + const SWord32 ptr_27) +{ + const SWord8 s0 = ext_tmp_probe_1; + const SWord8 s1 = ext_tmp_probe_0; + const SWord8 s2 = ext_tmp_probe_2; + const SBool s3 = ext_cooler; + const SBool s4 = queue_27[0]; + const SWord32 s5 = ptr_27; + const SBool s7 = s0 > 250; + const SBool s8 = s1 > 250; + const SBool s9 = s7 == s8; + const SWord32 s12 = s9 ? 0x00000002UL : 0x00000000UL; + const SBool s13 = 0x00000000UL == s12; + const SBool s14 = s2 > 250; + const SBool s15 = s13 ? s14 : s8; + const SBool s16 = s14 == s15; + const SBool s17 = s7 == s15; + const SBool s18 = s8 == s15; + const SWord32 s20 = s18 ? 0x00000001UL : 0x00000000UL; + const SWord32 s21 = 0x00000001UL + s20; + const SWord32 s22 = s17 ? s21 : s20; + const SWord32 s23 = 0x00000001UL + s22; + const SWord32 s24 = s16 ? s23 : s22; + const SWord32 s25 = 0x00000002UL * s24; + const SBool s27 = s25 > 0x00000003UL; + const SBool s28 = s15 && s27; + const SBool s29 = !s28; + const SBool s30 = s29 || s3; + const SBool s31 = s30 && s4; + const SBool s32 = !s31; + + return s32; +} diff --git a/example7/copilot-sbv-codegen/trigger_shutoff_arg_0.c b/example7/copilot-sbv-codegen/trigger_shutoff_arg_0.c new file mode 100644 index 00000000..211e06a6 --- /dev/null +++ b/example7/copilot-sbv-codegen/trigger_shutoff_arg_0.c @@ -0,0 +1,39 @@ +/* File: "trigger_shutoff_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + local "local_55" = false +in local "local_56" = (if var "local_55" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_57" = (if (var "local_55" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_58" = (var "local_57" == 0) + in local "local_59" = (if var "local_58" then (extern "tmp_probe_2" > 250) else var "local_56") + in local "local_60" = (if (var "local_58" || ((extern "tmp_probe_2" > 250) == var "local_56")) then (var "local_57" + 1) else (var "local_57" - 1)) + in var "local_59" +*/ +/*@ + assigns \nothing; + ensures \result == (\let local_55 = false ; (\let local_56 = ( local_55 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_57 = ( (local_55 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_58 = (local_57 == 0) ; (\let local_59 = ( local_58 ? (ext_tmp_probe_2 > 250) : local_56) ; (\let local_60 = ( (local_58 || ((ext_tmp_probe_2 > 250) == local_56)) ? (local_57 + 1) : (local_57 - 1)) ; local_59 ) ) ) ) ) ); +*/ +SBool trigger_shutoff_arg_0(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2) +{ + const SWord8 s0 = ext_tmp_probe_1; + const SWord8 s1 = ext_tmp_probe_0; + const SWord8 s2 = ext_tmp_probe_2; + const SBool s4 = s0 > 250; + const SBool s5 = s1 > 250; + const SBool s6 = s4 == s5; + const SWord32 s9 = s6 ? 0x00000002UL : 0x00000000UL; + const SBool s10 = 0x00000000UL == s9; + const SBool s11 = s2 > 250; + const SBool s12 = s10 ? s11 : s5; + + return s12; +} diff --git a/example7/copilot-sbv-codegen/update_state_27.c b/example7/copilot-sbv-codegen/update_state_27.c new file mode 100644 index 00000000..a0c2b847 --- /dev/null +++ b/example7/copilot-sbv-codegen/update_state_27.c @@ -0,0 +1,79 @@ +/* File: "update_state_27.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + ((not (local "local_28" = false + in local "local_29" = (if var "local_28" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_30" = (if (var "local_28" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_31" = (var "local_30" == 0) + in local "local_32" = (if var "local_31" then (extern "tmp_probe_2" > 250) else var "local_29") + in local "local_33" = (if (var "local_31" || ((extern "tmp_probe_2" > 250) == var "local_29")) then (var "local_30" + 1) else (var "local_30" - 1)) + in var "local_32" && ((local "local_34" = (if ((extern "tmp_probe_0" > 250) == local "local_35" = false + in local "local_36" = (if var "local_35" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_37" = (if (var "local_35" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_38" = (var "local_37" == 0) + in local "local_39" = (if var "local_38" then (extern "tmp_probe_2" > 250) else var "local_36") + in local "local_40" = (if (var "local_38" || ((extern "tmp_probe_2" > 250) == var "local_36")) then (var "local_37" + 1) else (var "local_37" - 1)) + in var "local_39") then 1 else 0) + in local "local_41" = (if ((extern "tmp_probe_1" > 250) == local "local_42" = false + in local "local_43" = (if var "local_42" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_44" = (if (var "local_42" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_45" = (var "local_44" == 0) + in local "local_46" = (if var "local_45" then (extern "tmp_probe_2" > 250) else var "local_43") + in local "local_47" = (if (var "local_45" || ((extern "tmp_probe_2" > 250) == var "local_43")) then (var "local_44" + 1) else (var "local_44" - 1)) + in var "local_46") then (var "local_34" + 1) else var "local_34") + in local "local_48" = (if ((extern "tmp_probe_2" > 250) == local "local_49" = false + in local "local_50" = (if var "local_49" then (extern "tmp_probe_1" > 250) else (extern "tmp_probe_0" > 250)) + in local "local_51" = (if (var "local_49" || ((extern "tmp_probe_1" > 250) == (extern "tmp_probe_0" > 250))) then 2 else 0) + in local "local_52" = (var "local_51" == 0) + in local "local_53" = (if var "local_52" then (extern "tmp_probe_2" > 250) else var "local_50") + in local "local_54" = (if (var "local_52" || ((extern "tmp_probe_2" > 250) == var "local_50")) then (var "local_51" + 1) else (var "local_51" - 1)) + in var "local_53") then (var "local_41" + 1) else var "local_41") + in var "local_48" * 2) > 3)) || extern "cooler") && s27) +*/ +/*@ + assigns \nothing; + ensures \result == ((! ((\let local_28 = false ; (\let local_29 = ( local_28 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_30 = ( (local_28 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_31 = (local_30 == 0) ; (\let local_32 = ( local_31 ? (ext_tmp_probe_2 > 250) : local_29) ; (\let local_33 = ( (local_31 || ((ext_tmp_probe_2 > 250) == local_29)) ? (local_30 + 1) : (local_30 - 1)) ; local_32 ) ) ) ) ) ) && (((\let local_34 = ( ((ext_tmp_probe_0 > 250) == (\let local_35 = false ; (\let local_36 = ( local_35 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_37 = ( (local_35 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_38 = (local_37 == 0) ; (\let local_39 = ( local_38 ? (ext_tmp_probe_2 > 250) : local_36) ; (\let local_40 = ( (local_38 || ((ext_tmp_probe_2 > 250) == local_36)) ? (local_37 + 1) : (local_37 - 1)) ; local_39 ) ) ) ) ) )) ? 1 : 0) ; (\let local_41 = ( ((ext_tmp_probe_1 > 250) == (\let local_42 = false ; (\let local_43 = ( local_42 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_44 = ( (local_42 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_45 = (local_44 == 0) ; (\let local_46 = ( local_45 ? (ext_tmp_probe_2 > 250) : local_43) ; (\let local_47 = ( (local_45 || ((ext_tmp_probe_2 > 250) == local_43)) ? (local_44 + 1) : (local_44 - 1)) ; local_46 ) ) ) ) ) )) ? (local_34 + 1) : local_34) ; (\let local_48 = ( ((ext_tmp_probe_2 > 250) == (\let local_49 = false ; (\let local_50 = ( local_49 ? (ext_tmp_probe_1 > 250) : (ext_tmp_probe_0 > 250)) ; (\let local_51 = ( (local_49 || ((ext_tmp_probe_1 > 250) == (ext_tmp_probe_0 > 250))) ? 2 : 0) ; (\let local_52 = (local_51 == 0) ; (\let local_53 = ( local_52 ? (ext_tmp_probe_2 > 250) : local_50) ; (\let local_54 = ( (local_52 || ((ext_tmp_probe_2 > 250) == local_50)) ? (local_51 + 1) : (local_51 - 1)) ; local_53 ) ) ) ) ) )) ? (local_41 + 1) : local_41) ; local_48 ) ) ) * 2) > 3)) || ext_cooler) && queue_27[ptr_27]); +*/ +SBool update_state_27(const SWord8 ext_tmp_probe_1, + const SWord8 ext_tmp_probe_0, const SWord8 ext_tmp_probe_2, + const SBool ext_cooler, const SBool *queue_27, + const SWord32 ptr_27) +{ + const SWord8 s0 = ext_tmp_probe_1; + const SWord8 s1 = ext_tmp_probe_0; + const SWord8 s2 = ext_tmp_probe_2; + const SBool s3 = ext_cooler; + const SBool s4 = queue_27[0]; + const SWord32 s5 = ptr_27; + const SBool s7 = s0 > 250; + const SBool s8 = s1 > 250; + const SBool s9 = s7 == s8; + const SWord32 s12 = s9 ? 0x00000002UL : 0x00000000UL; + const SBool s13 = 0x00000000UL == s12; + const SBool s14 = s2 > 250; + const SBool s15 = s13 ? s14 : s8; + const SBool s16 = s14 == s15; + const SBool s17 = s7 == s15; + const SBool s18 = s8 == s15; + const SWord32 s20 = s18 ? 0x00000001UL : 0x00000000UL; + const SWord32 s21 = 0x00000001UL + s20; + const SWord32 s22 = s17 ? s21 : s20; + const SWord32 s23 = 0x00000001UL + s22; + const SWord32 s24 = s16 ? s23 : s22; + const SWord32 s25 = 0x00000002UL * s24; + const SBool s27 = s25 > 0x00000003UL; + const SBool s28 = s15 && s27; + const SBool s29 = !s28; + const SBool s30 = s29 || s3; + const SBool s31 = s30 && s4; + + return s31; +} diff --git a/example7/main.hs b/example7/main.hs new file mode 100644 index 00000000..bc6c8010 --- /dev/null +++ b/example7/main.hs @@ -0,0 +1,41 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks +import Copilot.Library.Voting +import Copilot.Library.PTLTL + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +spec :: Spec +spec = do + trigger "shutoff" (not ok) [arg maj] + + where + vals = [ externW8 "tmp_probe_0" two51 + , externW8 "tmp_probe_1" two51 + , externW8 "tmp_probe_2" zero] + exceed = map (> 250) vals + maj = majority exceed + checkMaj = aMajority exceed maj + ok = alwaysBeen ((maj && checkMaj) ==> extern "cooler" cooler) + + two51 = Just $ [251, 251] P.++ repeat (250 :: Word8) + zero = Just $ repeat (0 :: Word8) + cooler = Just $ [True, True] P.++ repeat False + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example8/--list-options/add-source-timestamps b/example8/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example8/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example8/--list-options/packages/00-index.cache b/example8/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example8/--list-options/packages/00-index.tar b/example8/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example8/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example8/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example8/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example8/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example8/.cabal-sandbox/add-source-timestamps b/example8/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example8/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example8/.cabal-sandbox/packages/00-index.cache b/example8/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example8/.cabal-sandbox/packages/00-index.tar b/example8/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example8/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example8/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example8/Makefile b/example8/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example8/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example8/cabal.sandbox.config b/example8/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example8/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example8/copilot-sbv-codegen/Makefile b/example8/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..ba4e60b6 --- /dev/null +++ b/example8/copilot-sbv-codegen/Makefile @@ -0,0 +1,80 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_2.o update_state_1.o update_state_3.o update_state_4.o update_state_5.o update_state_6.o observer_i.o trigger_guard_h.o trigger_h_arg_0.o trigger_guard_g.o trigger_g_arg_0.o trigger_guard_f.o trigger_f_arg_0.o trigger_f_arg_1.o trigger_guard_e.o trigger_e_arg_0.o trigger_e_arg_1.o trigger_e_arg_2.o trigger_e_arg_3.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_3.o: update_state_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_4.o: update_state_4.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_5.o: update_state_5.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_6.o: update_state_6.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +observer_i.o: observer_i.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_h.o: trigger_guard_h.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_h_arg_0.o: trigger_h_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_g.o: trigger_guard_g.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_g_arg_0.o: trigger_g_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_f.o: trigger_guard_f.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_f_arg_0.o: trigger_f_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_f_arg_1.o: trigger_f_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_e.o: trigger_guard_e.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_e_arg_0.o: trigger_e_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_e_arg_1.o: trigger_e_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_e_arg_2.o: trigger_e_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_e_arg_3.o: trigger_e_arg_3.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example8/copilot-sbv-codegen/README b/example8/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example8/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example8/copilot-sbv-codegen/copilot.h b/example8/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..cc9d0ed0 --- /dev/null +++ b/example8/copilot-sbv-codegen/copilot.h @@ -0,0 +1,31 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + +extern bool i; + +/* Triggers (must be defined by user): */ + +void h(int8_t); +void g(uint64_t); +void f(uint64_t, uint64_t); +void e(uint64_t, uint64_t, uint64_t, uint8_t); + +/* External variables (must be defined by user): */ + +extern uint64_t e3; +extern uint64_t e1; +extern uint64_t e2; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example8/copilot-sbv-codegen/copilot.mk b/example8/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example8/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example8/copilot-sbv-codegen/driver.c b/example8/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..4e2a1d7a --- /dev/null +++ b/example8/copilot-sbv-codegen/driver.c @@ -0,0 +1,181 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ +SBool i; + +/* Variables */ +SWord64 tmp_0 = 1; +SBool tmp_1 = false; +SBool tmp_2 = true; +SWord64 tmp_3 = 0; +SWord64 tmp_4 = 0; +SWord8 tmp_5 = 1; +SWord8 tmp_6 = 0; +SWord64 queue_0[2] = { 1, 1 }; +SBool queue_1[1] = { false }; +SBool queue_2[3] = { true, true, false }; +SWord64 queue_3[1] = { 0 }; +SWord64 queue_4[1] = { 0 }; +SWord8 queue_5[3] = { 1, 1, 0 }; +SWord8 queue_6[3] = { 0, 1, 1 }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord32 ptr_3 = 0; +SWord32 ptr_4 = 0; +SWord32 ptr_5 = 0; +SWord32 ptr_6 = 0; +SWord64 ext_e1 = 0; +SWord64 ext_e2 = 0; +SWord64 ext_e3 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 2 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 1 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); + global invariant a_bound_ptr_2: ptr_2 < 3 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 2 )); + global invariant a_bound_ptr_3: ptr_3 < 1 ; + global invariant a_pos_ptr_3: ptr_3 >= 0 ; + global invariant a_valid_ptr_3: \valid (queue_3 + (0.. 0 )); + global invariant a_bound_ptr_4: ptr_4 < 1 ; + global invariant a_pos_ptr_4: ptr_4 >= 0 ; + global invariant a_valid_ptr_4: \valid (queue_4 + (0.. 0 )); + global invariant a_bound_ptr_5: ptr_5 < 3 ; + global invariant a_pos_ptr_5: ptr_5 >= 0 ; + global invariant a_valid_ptr_5: \valid (queue_5 + (0.. 2 )); + global invariant a_bound_ptr_6: ptr_6 < 3 ; + global invariant a_pos_ptr_6: ptr_6 >= 0 ; + global invariant a_valid_ptr_6: \valid (queue_6 + (0.. 2 )); +*/ + +/*@ + assigns ext_e1; + assigns ext_e2; + assigns ext_e3; + //ensures ext_e1 == e1; + //ensures ext_e2 == e2; + //ensures ext_e3 == e3; +*/ +void sampleExts(void) { + ext_e1 = e1; + ext_e2 = e2; + ext_e3 = e3; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_e()) + e(trigger_e_arg_0(queue_0, ptr_0), + trigger_e_arg_1(queue_4, ptr_4), + trigger_e_arg_2(ext_e1, ext_e2), + trigger_e_arg_3(queue_5, ptr_5, queue_6, ptr_6)); + if (trigger_guard_f(queue_2, ptr_2)) + f(trigger_f_arg_0(queue_0, ptr_0), + trigger_f_arg_1(ext_e1, ext_e2)); + if (trigger_guard_g(queue_1, ptr_1)) + g(trigger_g_arg_0(ext_e1, ext_e2, queue_3, ptr_3)); + if (trigger_guard_h(ext_e3, queue_0, ptr_0)) + h(trigger_h_arg_0()); +} + +/*@ + assigns i; + */ +void updateObservers(void) { + i = observer_i(queue_4, ptr_4); +} + +/*@ + assigns tmp_0; + assigns tmp_2; + assigns tmp_1; + assigns tmp_3; + assigns tmp_4; + assigns tmp_5; + assigns tmp_6; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_2 = update_state_2(queue_2, ptr_2); + tmp_1 = update_state_1(queue_2, ptr_2, queue_1, ptr_1); + tmp_3 = update_state_3(queue_3, ptr_3); + tmp_4 = update_state_4(queue_4, ptr_4); + tmp_5 = update_state_5(queue_5, ptr_5); + tmp_6 = update_state_6(queue_6, ptr_6); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + assigns queue_3[ptr_3]; + ensures queue_3[ptr_3] == tmp_3; + assigns queue_4[ptr_4]; + ensures queue_4[ptr_4] == tmp_4; + assigns queue_5[ptr_5]; + ensures queue_5[ptr_5] == tmp_5; + assigns queue_6[ptr_6]; + ensures queue_6[ptr_6] == tmp_6; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; + queue_3[ptr_3] = tmp_3; + queue_4[ptr_4] = tmp_4; + queue_5[ptr_5] = tmp_5; + queue_6[ptr_6] = tmp_6; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 2; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 3; + assigns ptr_3; + ensures ptr_3 == (\old (ptr_3 ) + 1) % 1; + assigns ptr_4; + ensures ptr_4 == (\old (ptr_4 ) + 1) % 1; + assigns ptr_5; + ensures ptr_5 == (\old (ptr_5 ) + 1) % 3; + assigns ptr_6; + ensures ptr_6 == (\old (ptr_6 ) + 1) % 3; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 2; + ptr_1 = (ptr_1 + 1) % 1; + ptr_2 = (ptr_2 + 1) % 3; + ptr_3 = (ptr_3 + 1) % 1; + ptr_4 = (ptr_4 + 1) % 1; + ptr_5 = (ptr_5 + 1) % 3; + ptr_6 = (ptr_6 + 1) % 3; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example8/copilot-sbv-codegen/internal.h b/example8/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..f29c2c7d --- /dev/null +++ b/example8/copilot-sbv-codegen/internal.h @@ -0,0 +1,66 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SWord64 update_state_0(const SWord64 *queue_0, + const SWord32 ptr_0); +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2); +SBool update_state_1(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_1, const SWord32 ptr_1); +SWord64 update_state_3(const SWord64 *queue_3, + const SWord32 ptr_3); +SWord64 update_state_4(const SWord64 *queue_4, + const SWord32 ptr_4); +SWord8 update_state_5(const SWord8 *queue_5, const SWord32 ptr_5); +SWord8 update_state_6(const SWord8 *queue_6, const SWord32 ptr_6); +SBool observer_i(const SWord64 *queue_4, const SWord32 ptr_4); +SBool trigger_guard_h(const SWord64 ext_e3, const SWord64 *queue_0, + const SWord32 ptr_0); +SInt8 trigger_h_arg_0(); +SBool trigger_guard_g(const SBool *queue_1, const SWord32 ptr_1); +SWord64 trigger_g_arg_0(const SWord64 ext_e1, const SWord64 ext_e2, + const SWord64 *queue_3, const SWord32 ptr_3); +SBool trigger_guard_f(const SBool *queue_2, const SWord32 ptr_2); +SWord64 trigger_f_arg_0(const SWord64 *queue_0, + const SWord32 ptr_0); +SWord64 trigger_f_arg_1(const SWord64 ext_e1, + const SWord64 ext_e2); +SBool trigger_guard_e(); +SWord64 trigger_e_arg_0(const SWord64 *queue_0, + const SWord32 ptr_0); +SWord64 trigger_e_arg_1(const SWord64 *queue_4, + const SWord32 ptr_4); +SWord64 trigger_e_arg_2(const SWord64 ext_e1, + const SWord64 ext_e2); +SWord8 trigger_e_arg_3(const SWord8 *queue_5, const SWord32 ptr_5, + const SWord8 *queue_6, const SWord32 ptr_6); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example8/copilot-sbv-codegen/observer_i.c b/example8/copilot-sbv-codegen/observer_i.c new file mode 100644 index 00000000..b852c54c --- /dev/null +++ b/example8/copilot-sbv-codegen/observer_i.c @@ -0,0 +1,27 @@ +/* File: "observer_i.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 005*/ +/*ACSL to write + not ((s4 mod 2) == 0) +*/ +/*@ + assigns \nothing; + ensures \result == ! ((queue_4[ptr_4] % 2) == 0); +*/ +SBool observer_i(const SWord64 *queue_4, const SWord32 ptr_4) +{ + const SWord64 s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + const SWord64 s3 = (0x0000000000000002ULL == 0) ? s0 : (s0 % 0x0000000000000002ULL); + const SBool s5 = s3 == 0x0000000000000000ULL; + const SBool s6 = !s5; + + return s6; +} diff --git a/example8/copilot-sbv-codegen/trigger_e_arg_0.c b/example8/copilot-sbv-codegen/trigger_e_arg_0.c new file mode 100644 index 00000000..066f1b78 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_e_arg_0.c @@ -0,0 +1,31 @@ +/* File: "trigger_e_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord64 trigger_e_arg_0(const SWord64 *queue_0, + const SWord32 ptr_0) +{ + const SWord64 s0 = queue_0[0]; + const SWord64 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord64 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord64 s5 = table0[s4]; + + return s5; +} diff --git a/example8/copilot-sbv-codegen/trigger_e_arg_1.c b/example8/copilot-sbv-codegen/trigger_e_arg_1.c new file mode 100644 index 00000000..83c7a0d1 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_e_arg_1.c @@ -0,0 +1,24 @@ +/* File: "trigger_e_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s4 +*/ +/*@ + assigns \nothing; + ensures \result == queue_4[ptr_4]; +*/ +SWord64 trigger_e_arg_1(const SWord64 *queue_4, + const SWord32 ptr_4) +{ + const SWord64 s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + return s0; +} diff --git a/example8/copilot-sbv-codegen/trigger_e_arg_2.c b/example8/copilot-sbv-codegen/trigger_e_arg_2.c new file mode 100644 index 00000000..5f3fbd73 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_e_arg_2.c @@ -0,0 +1,25 @@ +/* File: "trigger_e_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (extern "e1" + extern "e2") +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e1 + ext_e2); +*/ +SWord64 trigger_e_arg_2(const SWord64 ext_e1, const SWord64 ext_e2) +{ + const SWord64 s0 = ext_e1; + const SWord64 s1 = ext_e2; + const SWord64 s2 = s0 + s1; + + return s2; +} diff --git a/example8/copilot-sbv-codegen/trigger_e_arg_3.c b/example8/copilot-sbv-codegen/trigger_e_arg_3.c new file mode 100644 index 00000000..f02c71e4 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_e_arg_3.c @@ -0,0 +1,42 @@ +/* File: "trigger_e_arg_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (s5 ^ s6) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_5[ptr_5] ^ queue_6[ptr_6]); +*/ +SWord8 trigger_e_arg_3(const SWord8 *queue_5, const SWord32 ptr_5, + const SWord8 *queue_6, const SWord32 ptr_6) +{ + const SWord8 s0 = queue_5[0]; + const SWord8 s1 = queue_5[1]; + const SWord8 s2 = queue_5[2]; + const SWord32 s3 = ptr_5; + const SWord8 s4 = queue_6[0]; + const SWord8 s5 = queue_6[1]; + const SWord8 s6 = queue_6[2]; + const SWord32 s7 = ptr_6; + const SWord8 table0[] = { + s0, s1, s2 + }; + const SWord8 table1[] = { + s4, s5, s6 + }; + const SWord32 s9 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SWord8 s10 = table0[s9]; + const SWord32 s11 = (0x00000003UL == 0) ? s7 : (s7 % 0x00000003UL); + const SWord8 s12 = table1[s11]; + const SWord8 s13 = s10 ^ s12; + + return s13; +} diff --git a/example8/copilot-sbv-codegen/trigger_f_arg_0.c b/example8/copilot-sbv-codegen/trigger_f_arg_0.c new file mode 100644 index 00000000..204ce764 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_f_arg_0.c @@ -0,0 +1,31 @@ +/* File: "trigger_f_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SWord64 trigger_f_arg_0(const SWord64 *queue_0, + const SWord32 ptr_0) +{ + const SWord64 s0 = queue_0[0]; + const SWord64 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord64 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord64 s5 = table0[s4]; + + return s5; +} diff --git a/example8/copilot-sbv-codegen/trigger_f_arg_1.c b/example8/copilot-sbv-codegen/trigger_f_arg_1.c new file mode 100644 index 00000000..b82f7ff5 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_f_arg_1.c @@ -0,0 +1,25 @@ +/* File: "trigger_f_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (extern "e1" + extern "e2") +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e1 + ext_e2); +*/ +SWord64 trigger_f_arg_1(const SWord64 ext_e1, const SWord64 ext_e2) +{ + const SWord64 s0 = ext_e1; + const SWord64 s1 = ext_e2; + const SWord64 s2 = s0 + s1; + + return s2; +} diff --git a/example8/copilot-sbv-codegen/trigger_g_arg_0.c b/example8/copilot-sbv-codegen/trigger_g_arg_0.c new file mode 100644 index 00000000..d541a0f8 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_g_arg_0.c @@ -0,0 +1,31 @@ +/* File: "trigger_g_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (((extern "e1" + extern "e2") + (s3 + 1)) + 25) +*/ +/*@ + assigns \nothing; + ensures \result == (((ext_e1 + ext_e2) + (queue_3[ptr_3] + 1)) + 25); +*/ +SWord64 trigger_g_arg_0(const SWord64 ext_e1, const SWord64 ext_e2, + const SWord64 *queue_3, const SWord32 ptr_3) +{ + const SWord64 s0 = ext_e1; + const SWord64 s1 = ext_e2; + const SWord64 s2 = queue_3[0]; + const SWord32 s3 = ptr_3; + const SWord64 s4 = s0 + s1; + const SWord64 s6 = s2 + 0x0000000000000001ULL; + const SWord64 s7 = s4 + s6; + const SWord64 s9 = s7 + 0x0000000000000019ULL; + + return s9; +} diff --git a/example8/copilot-sbv-codegen/trigger_guard_e.c b/example8/copilot-sbv-codegen/trigger_guard_e.c new file mode 100644 index 00000000..cef9cba1 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_guard_e.c @@ -0,0 +1,21 @@ +/* File: "trigger_guard_e.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + true +*/ +/*@ + assigns \nothing; + ensures \result == true; +*/ +SBool trigger_guard_e() +{ + return true; +} diff --git a/example8/copilot-sbv-codegen/trigger_guard_f.c b/example8/copilot-sbv-codegen/trigger_guard_f.c new file mode 100644 index 00000000..4da0ccab --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_guard_f.c @@ -0,0 +1,31 @@ +/* File: "trigger_guard_f.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool trigger_guard_f(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SWord32 s3 = ptr_2; + const SBool table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SBool s6 = table0[s5]; + + return s6; +} diff --git a/example8/copilot-sbv-codegen/trigger_guard_g.c b/example8/copilot-sbv-codegen/trigger_guard_g.c new file mode 100644 index 00000000..87aa9f2e --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_guard_g.c @@ -0,0 +1,23 @@ +/* File: "trigger_guard_g.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + s1 +*/ +/*@ + assigns \nothing; + ensures \result == queue_1[ptr_1]; +*/ +SBool trigger_guard_g(const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + return s0; +} diff --git a/example8/copilot-sbv-codegen/trigger_guard_h.c b/example8/copilot-sbv-codegen/trigger_guard_h.c new file mode 100644 index 00000000..4d6bec71 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_guard_h.c @@ -0,0 +1,33 @@ +/* File: "trigger_guard_h.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + (extern "e3" /= s0) +*/ +/*@ + assigns \nothing; + ensures \result == (ext_e3 != queue_0[ptr_0]); +*/ +SBool trigger_guard_h(const SWord64 ext_e3, const SWord64 *queue_0, + const SWord32 ptr_0) +{ + const SWord64 s0 = ext_e3; + const SWord64 s1 = queue_0[0]; + const SWord64 s2 = queue_0[1]; + const SWord32 s3 = ptr_0; + const SWord64 table0[] = { + s1, s2 + }; + const SWord32 s5 = (0x00000002UL == 0) ? s3 : (s3 % 0x00000002UL); + const SWord64 s6 = table0[s5]; + const SBool s7 = s0 != s6; + + return s7; +} diff --git a/example8/copilot-sbv-codegen/trigger_h_arg_0.c b/example8/copilot-sbv-codegen/trigger_h_arg_0.c new file mode 100644 index 00000000..51718875 --- /dev/null +++ b/example8/copilot-sbv-codegen/trigger_h_arg_0.c @@ -0,0 +1,21 @@ +/* File: "trigger_h_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + 0 +*/ +/*@ + assigns \nothing; + ensures \result == 0; +*/ +SInt8 trigger_h_arg_0() +{ + return 0; +} diff --git a/example8/copilot-sbv-codegen/update_state_0.c b/example8/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..653389a0 --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,34 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s0 + drop 1 s0) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_0[ptr_0] + queue_0[(ptr_0 + 1) % 2]); +*/ +SWord64 update_state_0(const SWord64 *queue_0, const SWord32 ptr_0) +{ + const SWord64 s0 = queue_0[0]; + const SWord64 s1 = queue_0[1]; + const SWord32 s2 = ptr_0; + const SWord64 table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SWord64 s5 = table0[s4]; + const SWord32 s7 = s2 + 0x00000001UL; + const SWord32 s8 = (0x00000002UL == 0) ? s7 : (s7 % 0x00000002UL); + const SWord64 s9 = table0[s8]; + const SWord64 s10 = s5 + s9; + + return s10; +} diff --git a/example8/copilot-sbv-codegen/update_state_1.c b/example8/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..c0e4dadc --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,36 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (if s2 then not s1 else s1) +*/ +/*@ + assigns \nothing; + ensures \result == ( queue_2[ptr_2] ? ! queue_1[ptr_1] : queue_1[ptr_1]); +*/ +SBool update_state_1(const SBool *queue_2, const SWord32 ptr_2, + const SBool *queue_1, const SWord32 ptr_1) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SWord32 s3 = ptr_2; + const SBool s4 = queue_1[0]; + const SWord32 s5 = ptr_1; + const SBool table0[] = { + s0, s1, s2 + }; + const SWord32 s7 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SBool s8 = table0[s7]; + const SBool s9 = !s4; + const SBool s10 = s8 ? s9 : s4; + + return s10; +} diff --git a/example8/copilot-sbv-codegen/update_state_2.c b/example8/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..107247ef --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,31 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SBool s2 = queue_2[2]; + const SWord32 s3 = ptr_2; + const SBool table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SBool s6 = table0[s5]; + + return s6; +} diff --git a/example8/copilot-sbv-codegen/update_state_3.c b/example8/copilot-sbv-codegen/update_state_3.c new file mode 100644 index 00000000..2d43159c --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_3.c @@ -0,0 +1,25 @@ +/* File: "update_state_3.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s3 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_3[ptr_3] + 1); +*/ +SWord64 update_state_3(const SWord64 *queue_3, const SWord32 ptr_3) +{ + const SWord64 s0 = queue_3[0]; + const SWord32 s1 = ptr_3; + const SWord64 s3 = s0 + 0x0000000000000001ULL; + + return s3; +} diff --git a/example8/copilot-sbv-codegen/update_state_4.c b/example8/copilot-sbv-codegen/update_state_4.c new file mode 100644 index 00000000..b48a409c --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_4.c @@ -0,0 +1,25 @@ +/* File: "update_state_4.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s4 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_4[ptr_4] + 1); +*/ +SWord64 update_state_4(const SWord64 *queue_4, const SWord32 ptr_4) +{ + const SWord64 s0 = queue_4[0]; + const SWord32 s1 = ptr_4; + const SWord64 s3 = s0 + 0x0000000000000001ULL; + + return s3; +} diff --git a/example8/copilot-sbv-codegen/update_state_5.c b/example8/copilot-sbv-codegen/update_state_5.c new file mode 100644 index 00000000..8881f16c --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_5.c @@ -0,0 +1,31 @@ +/* File: "update_state_5.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s5 +*/ +/*@ + assigns \nothing; + ensures \result == queue_5[ptr_5]; +*/ +SWord8 update_state_5(const SWord8 *queue_5, const SWord32 ptr_5) +{ + const SWord8 s0 = queue_5[0]; + const SWord8 s1 = queue_5[1]; + const SWord8 s2 = queue_5[2]; + const SWord32 s3 = ptr_5; + const SWord8 table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SWord8 s6 = table0[s5]; + + return s6; +} diff --git a/example8/copilot-sbv-codegen/update_state_6.c b/example8/copilot-sbv-codegen/update_state_6.c new file mode 100644 index 00000000..8df75f56 --- /dev/null +++ b/example8/copilot-sbv-codegen/update_state_6.c @@ -0,0 +1,31 @@ +/* File: "update_state_6.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + s6 +*/ +/*@ + assigns \nothing; + ensures \result == queue_6[ptr_6]; +*/ +SWord8 update_state_6(const SWord8 *queue_6, const SWord32 ptr_6) +{ + const SWord8 s0 = queue_6[0]; + const SWord8 s1 = queue_6[1]; + const SWord8 s2 = queue_6[2]; + const SWord32 s3 = ptr_6; + const SWord8 table0[] = { + s0, s1, s2 + }; + const SWord32 s5 = (0x00000003UL == 0) ? s3 : (s3 % 0x00000003UL); + const SWord8 s6 = table0[s5]; + + return s6; +} diff --git a/example8/main.hs b/example8/main.hs new file mode 100644 index 00000000..8d7ef5bc --- /dev/null +++ b/example8/main.hs @@ -0,0 +1,94 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace +import Control.Monad (foldM_) + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +flipflop :: Stream Bool -> Stream Bool +flipflop x = y + where + y = [False] ++ mux x (not y) y + +nats :: Stream Word64 +nats = [0] ++ nats + 1 + +even1 :: (P.Integral a, Typed a) => Stream a -> Stream Bool +even1 x = x `mod` 2 == 0 + +odd1 :: (P.Integral a, Typed a) => Stream a -> Stream Bool +odd1 = not . even1 + +counter :: (Eq a, Num a, Typed a) => Stream Bool -> Stream a +counter reset = y + where + zy = [0] ++ y + y = mux reset 0 (zy + 1) + +booleans :: Stream Bool +booleans = [True, True, False] ++ booleans + +fib :: Stream Word64 +fib = [1, 1] ++ fib + drop 1 fib + +bitWise :: Stream Word8 +bitWise = ( let a = [ 1, 1, 0 ] ++ a in a ) + .^. + ( let b = [ 0, 1, 1 ] ++ b in b ) + +sumExterns :: Stream Word64 +sumExterns = + let ex1 = extern "e1" (Just e1) + ex2 = extern "e2" (Just e2) + in ex1 + ex2 + +--- Some infinite lists for simulating external variables: +e1, e2 :: [Word64] +e1 = [0..] +e2 = 5 : 4 : e2 + +-------------------------------------------------------------------------------- + +-- +-- An example of a complete copilot specification. +-- + +-- A specification: +spec :: Spec +spec = do + + -- A trigger with four arguments: + trigger "e" true -- booleans + [ arg fib, arg nats, arg sumExterns, arg bitWise ] + + -- A trigger with two arguments: + trigger "f" booleans + [ arg fib, arg sumExterns ] +-- [ arg fib, arg nats ] + + -- A trigger with a single argument: + trigger "g" (flipflop booleans) + [ arg (sumExterns + counter false + 25) ] +-- [ arg (counter false + 25 :: Stream Int32) ] + + -- A trigger with a single argument (should never fire): + let e3 = [1, 1] P.++ zipWith (+) e3 (P.drop 1 e3) + trigger "h" (extern "e3" (Just e3) /= fib) + [ arg (0 :: Stream Int8) ] + + observer "i" (odd1 nats) + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +-------------------------------------------------------------------------------- diff --git a/example9/--list-options/add-source-timestamps b/example9/--list-options/add-source-timestamps new file mode 100644 index 00000000..ff523034 --- /dev/null +++ b/example9/--list-options/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.10.1",[]),("x86_64-linux-ghc-7.8.4",[]),("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example9/--list-options/packages/00-index.cache b/example9/--list-options/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example9/--list-options/packages/00-index.tar b/example9/--list-options/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example9/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache b/example9/--list-options/x86_64-linux-ghc-7.10.1-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..b3cae5cf028ad4728b344193a7c6fe4e76e36af3 GIT binary patch literal 40 ZcmZQb&qyxFPG9 literal 0 HcmV?d00001 diff --git a/example9/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache b/example9/--list-options/x86_64-linux-ghc-7.8.4-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example9/.cabal-sandbox/add-source-timestamps b/example9/.cabal-sandbox/add-source-timestamps new file mode 100644 index 00000000..b604c5a4 --- /dev/null +++ b/example9/.cabal-sandbox/add-source-timestamps @@ -0,0 +1 @@ +[("x86_64-linux-ghc-7.6.3",[])] \ No newline at end of file diff --git a/example9/.cabal-sandbox/packages/00-index.cache b/example9/.cabal-sandbox/packages/00-index.cache new file mode 100644 index 00000000..e69de29b diff --git a/example9/.cabal-sandbox/packages/00-index.tar b/example9/.cabal-sandbox/packages/00-index.tar new file mode 100644 index 0000000000000000000000000000000000000000..9df64990f7be3c1f7194a0c22852a1ab3a09f3c5 GIT binary patch literal 10240 zcmeIu0Sy2E0K%a6Pi+o2h(KY$fB^#r3>YwAz<>b*1`HT5V8DO@0|pEjFkrxd0RsjM P7%*VKfB^#r47?2tC;$Kf literal 0 HcmV?d00001 diff --git a/example9/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache b/example9/.cabal-sandbox/x86_64-linux-ghc-7.6.3-packages.conf.d/package.cache new file mode 100644 index 0000000000000000000000000000000000000000..1b1cb4d44c57c2d7a5122870fa6ac3e62ff7e94e GIT binary patch literal 8 KcmZQzfB*mh2mk>9 literal 0 HcmV?d00001 diff --git a/example9/Makefile b/example9/Makefile new file mode 100644 index 00000000..39bd1718 --- /dev/null +++ b/example9/Makefile @@ -0,0 +1,17 @@ +default: + ghc main.hs + ./main + +sandbox: + cabal exec -- ghc main.hs + ./main + +val: + frama-c -val -main step copilot-sbv-codegen/internal.h copilot-sbv-codegen/copilot.h copilot-sbv-codegen/*.c -unspecified-access + +clean: + rm *~ + rm main.hi + rm main.o + rm -rf copilot-c99-codegen + rm main diff --git a/example9/cabal.sandbox.config b/example9/cabal.sandbox.config new file mode 100644 index 00000000..1f807168 --- /dev/null +++ b/example9/cabal.sandbox.config @@ -0,0 +1,25 @@ +-- This is a Cabal package environment file. +-- THIS FILE IS AUTO-GENERATED. DO NOT EDIT DIRECTLY. +-- Please create a 'cabal.config' file in the same directory +-- if you want to change the default settings for this sandbox. + + +local-repo: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/packages +logs-dir: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs +world-file: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/world +user-install: False +package-db: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/x86_64-linux-ghc-7.10.1-packages.conf.d +build-summary: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox/logs/build.log + +install-dirs + prefix: /home/jaloyan/Desktop/Copilot/Copilot/.cabal-sandbox + bindir: $prefix/bin + libdir: $prefix/lib + libsubdir: $arch-$os-$compiler/$pkgid + libexecdir: $prefix/libexec + datadir: $prefix/share + datasubdir: $arch-$os-$compiler/$pkgid + docdir: $datadir/doc/$arch-$os-$compiler/$pkgid + htmldir: $docdir/html + haddockdir: $htmldir + sysconfdir: $prefix/etc diff --git a/example9/copilot-sbv-codegen/Makefile b/example9/copilot-sbv-codegen/Makefile new file mode 100644 index 00000000..4d5a02c1 --- /dev/null +++ b/example9/copilot-sbv-codegen/Makefile @@ -0,0 +1,41 @@ +# Makefile for internal. Automatically generated by SBV. Do not edit! + +# include any user-defined .mk file in the current directory. +-include *.mk + +CC=gcc +CCFLAGS?=-Wall -O3 -DNDEBUG -fomit-frame-pointer +AR=ar +ARFLAGS=cr + +all: internal.a + +internal.a: update_state_0.o update_state_1.o update_state_2.o trigger_guard_trig1.o trigger_trig1_arg_0.o trigger_trig1_arg_1.o trigger_trig1_arg_2.o + ${AR} ${ARFLAGS} $@ $^ + +update_state_0.o: update_state_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_1.o: update_state_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +update_state_2.o: update_state_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_guard_trig1.o: trigger_guard_trig1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_0.o: trigger_trig1_arg_0.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_1.o: trigger_trig1_arg_1.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +trigger_trig1_arg_2.o: trigger_trig1_arg_2.c internal.h + ${CC} ${CCFLAGS} -c $< -o $@ + +clean: + rm -f *.o + +veryclean: clean + rm -f internal.a diff --git a/example9/copilot-sbv-codegen/README b/example9/copilot-sbv-codegen/README new file mode 100644 index 00000000..3a94d2c8 --- /dev/null +++ b/example9/copilot-sbv-codegen/README @@ -0,0 +1,11 @@ +These files are automatically generated by Copilot using the SBV code generator backend. + +To build, you will need to ensure that all external variables and triggers are visible. +Also, modify driver.c to include a main() function. +Once you have a valid C program, execute + + > make driver + +Modify the Makefile rules (Makefile and copilot.mk) as you see fit. + +Please report bugs to lee pike at gmail . com (remove all spaces). diff --git a/example9/copilot-sbv-codegen/copilot.h b/example9/copilot-sbv-codegen/copilot.h new file mode 100644 index 00000000..dd77023e --- /dev/null +++ b/example9/copilot-sbv-codegen/copilot.h @@ -0,0 +1,26 @@ +/* Generated by Copilot Core. */ + +#include +#include + +/* Observers (defined by Copilot): */ + + +/* Triggers (must be defined by user): */ + +void trig1(bool, uint64_t, bool); + +/* External variables (must be defined by user): */ + +extern uint64_t e1; +extern uint64_t e2; + +/* External arrays (must be defined by user): */ + + +/* External functions (must be defined by user): */ + + +/* Step function: */ + +void step(); \ No newline at end of file diff --git a/example9/copilot-sbv-codegen/copilot.mk b/example9/copilot-sbv-codegen/copilot.mk new file mode 100644 index 00000000..213053b8 --- /dev/null +++ b/example9/copilot-sbv-codegen/copilot.mk @@ -0,0 +1,6 @@ +# Makefile rules for the Copilot driver. + +#CCFLAGS= -std=c99 -Werror -Wall -Wextra -Wbad-function-cast -Wcast-align -Wcast-qual -Wconversion -Wdisabled-optimization -Wformat=2 -Winit-self -Winline -Wnested-externs -Wold-style-definition -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-default -Wswitch-enum -Wundef -Wwrite-strings -Wshadow -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-parameter -Wno-unused-label -O2 -march=native -c + +driver: driver.c copilot.h internal.a + ${CC} ${CCFLAGS} $< -o $@ internal.a diff --git a/example9/copilot-sbv-codegen/driver.c b/example9/copilot-sbv-codegen/driver.c new file mode 100644 index 00000000..0ec0aab3 --- /dev/null +++ b/example9/copilot-sbv-codegen/driver.c @@ -0,0 +1,112 @@ +/* Driver for SBV program generated from Copilot. */ +/* Edit as you see fit */ + +#include +#include +#include +#include +#include "internal.h" +#include "copilot.h" + +/* Observers */ + + +/* Variables */ +SBool tmp_0 = true; +SWord64 tmp_1 = 0; +SBool tmp_2 = true; +SBool queue_0[1] = { true }; +SWord64 queue_1[1] = { 0 }; +SBool queue_2[2] = { true, false }; +SWord32 ptr_0 = 0; +SWord32 ptr_1 = 0; +SWord32 ptr_2 = 0; +SWord64 ext_e1 = 0; +SWord64 ext_e2 = 0; +/*ACSL following*/ +/*@ + global invariant a_bound_ptr_0: ptr_0 < 1 ; + global invariant a_pos_ptr_0: ptr_0 >= 0 ; + global invariant a_valid_ptr_0: \valid (queue_0 + (0.. 0 )); + global invariant a_bound_ptr_1: ptr_1 < 1 ; + global invariant a_pos_ptr_1: ptr_1 >= 0 ; + global invariant a_valid_ptr_1: \valid (queue_1 + (0.. 0 )); + global invariant a_bound_ptr_2: ptr_2 < 2 ; + global invariant a_pos_ptr_2: ptr_2 >= 0 ; + global invariant a_valid_ptr_2: \valid (queue_2 + (0.. 1 )); +*/ + +/*@ + assigns ext_e1; + assigns ext_e2; + //ensures ext_e1 == e1; + //ensures ext_e2 == e2; +*/ +void sampleExts(void) { + ext_e1 = e1; + ext_e2 = e2; +} + +/*@ + assigns \nothing; +*/ +void fireTriggers(void) { + if (trigger_guard_trig1(queue_0, ptr_0)) + trig1(trigger_trig1_arg_0(queue_1, ptr_1), + trigger_trig1_arg_1(ext_e1, ext_e2), + trigger_trig1_arg_2(queue_2, ptr_2)); +} + +/*@ + assigns \nothing; + */ +void updateObservers(void) { +} + +/*@ + assigns tmp_0; + assigns tmp_1; + assigns tmp_2; + */ +void updateStates(void) { + tmp_0 = update_state_0(queue_0, ptr_0); + tmp_1 = update_state_1(queue_1, ptr_1); + tmp_2 = update_state_2(queue_2, ptr_2); +} + +/*@ + assigns queue_0[ptr_0]; + ensures queue_0[ptr_0] == tmp_0; + assigns queue_1[ptr_1]; + ensures queue_1[ptr_1] == tmp_1; + assigns queue_2[ptr_2]; + ensures queue_2[ptr_2] == tmp_2; + */ +void updateBuffers(void) { + queue_0[ptr_0] = tmp_0; + queue_1[ptr_1] = tmp_1; + queue_2[ptr_2] = tmp_2; +} + +/*@ + assigns ptr_0; + ensures ptr_0 == (\old (ptr_0 ) + 1) % 1; + assigns ptr_1; + ensures ptr_1 == (\old (ptr_1 ) + 1) % 1; + assigns ptr_2; + ensures ptr_2 == (\old (ptr_2 ) + 1) % 2; + */ +void updatePtrs(void) { + ptr_0 = (ptr_0 + 1) % 1; + ptr_1 = (ptr_1 + 1) % 1; + ptr_2 = (ptr_2 + 1) % 2; +} + +void step(void) { + sampleExts(); + fireTriggers(); + updateObservers(); + updateStates(); + updateBuffers(); + updatePtrs(); +} diff --git a/example9/copilot-sbv-codegen/internal.h b/example9/copilot-sbv-codegen/internal.h new file mode 100644 index 00000000..a6fdc89c --- /dev/null +++ b/example9/copilot-sbv-codegen/internal.h @@ -0,0 +1,46 @@ +/* Header file for internal. Automatically generated by SBV. Do not edit! */ + +#ifndef __internal__HEADER_INCLUDED__ +#define __internal__HEADER_INCLUDED__ + +#include +#include +#include +#include + +/* The boolean type */ +typedef bool SBool; + +/* The float type */ +typedef float SFloat; + +/* The double type */ +typedef double SDouble; + +/* Unsigned bit-vectors */ +typedef uint8_t SWord8 ; +typedef uint16_t SWord16; +typedef uint32_t SWord32; +typedef uint64_t SWord64; + +/* Signed bit-vectors */ +typedef int8_t SInt8 ; +typedef int16_t SInt16; +typedef int32_t SInt32; +typedef int64_t SInt64; + +/* Entry point prototypes: */ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0); +SWord64 update_state_1(const SWord64 *queue_1, + const SWord32 ptr_1); +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2); +SBool trigger_guard_trig1(const SBool *queue_0, + const SWord32 ptr_0); +SBool trigger_trig1_arg_0(const SWord64 *queue_1, + const SWord32 ptr_1); +SWord64 trigger_trig1_arg_1(const SWord64 ext_e1, + const SWord64 ext_e2); +SBool trigger_trig1_arg_2(const SBool *queue_2, + const SWord32 ptr_2); + +#endif /* __internal__HEADER_INCLUDED__ */ diff --git a/example9/copilot-sbv-codegen/trigger_guard_trig1.c b/example9/copilot-sbv-codegen/trigger_guard_trig1.c new file mode 100644 index 00000000..e09a34cb --- /dev/null +++ b/example9/copilot-sbv-codegen/trigger_guard_trig1.c @@ -0,0 +1,24 @@ +/* File: "trigger_guard_trig1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 006*/ +/*ACSL to write + s0 +*/ +/*@ + assigns \nothing; + ensures \result == queue_0[ptr_0]; +*/ +SBool trigger_guard_trig1(const SBool *queue_0, + const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + return s0; +} diff --git a/example9/copilot-sbv-codegen/trigger_trig1_arg_0.c b/example9/copilot-sbv-codegen/trigger_trig1_arg_0.c new file mode 100644 index 00000000..5e83d55c --- /dev/null +++ b/example9/copilot-sbv-codegen/trigger_trig1_arg_0.c @@ -0,0 +1,26 @@ +/* File: "trigger_trig1_arg_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + (s1 < 3) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] < 3); +*/ +SBool trigger_trig1_arg_0(const SWord64 *queue_1, + const SWord32 ptr_1) +{ + const SWord64 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SBool s3 = s0 < 0x0000000000000003ULL; + + return s3; +} diff --git a/example9/copilot-sbv-codegen/trigger_trig1_arg_1.c b/example9/copilot-sbv-codegen/trigger_trig1_arg_1.c new file mode 100644 index 00000000..e8ccba04 --- /dev/null +++ b/example9/copilot-sbv-codegen/trigger_trig1_arg_1.c @@ -0,0 +1,27 @@ +/* File: "trigger_trig1_arg_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + ((extern "e1" + extern "e2") + extern "e1") +*/ +/*@ + assigns \nothing; + ensures \result == ((ext_e1 + ext_e2) + ext_e1); +*/ +SWord64 trigger_trig1_arg_1(const SWord64 ext_e1, + const SWord64 ext_e2) +{ + const SWord64 s0 = ext_e1; + const SWord64 s1 = ext_e2; + const SWord64 s2 = s0 + s1; + const SWord64 s3 = s0 + s2; + + return s3; +} diff --git a/example9/copilot-sbv-codegen/trigger_trig1_arg_2.c b/example9/copilot-sbv-codegen/trigger_trig1_arg_2.c new file mode 100644 index 00000000..6cc8899f --- /dev/null +++ b/example9/copilot-sbv-codegen/trigger_trig1_arg_2.c @@ -0,0 +1,31 @@ +/* File: "trigger_trig1_arg_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 003*/ +/*ACSL to write + s2 +*/ +/*@ + assigns \nothing; + ensures \result == queue_2[ptr_2]; +*/ +SBool trigger_trig1_arg_2(const SBool *queue_2, + const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SWord32 s2 = ptr_2; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + + return s5; +} diff --git a/example9/copilot-sbv-codegen/update_state_0.c b/example9/copilot-sbv-codegen/update_state_0.c new file mode 100644 index 00000000..3fd5a600 --- /dev/null +++ b/example9/copilot-sbv-codegen/update_state_0.c @@ -0,0 +1,25 @@ +/* File: "update_state_0.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + not s0 +*/ +/*@ + assigns \nothing; + ensures \result == ! queue_0[ptr_0]; +*/ +SBool update_state_0(const SBool *queue_0, const SWord32 ptr_0) +{ + const SBool s0 = queue_0[0]; + const SWord32 s1 = ptr_0; + const SBool s2 = !s0; + + return s2; +} diff --git a/example9/copilot-sbv-codegen/update_state_1.c b/example9/copilot-sbv-codegen/update_state_1.c new file mode 100644 index 00000000..6bb2c684 --- /dev/null +++ b/example9/copilot-sbv-codegen/update_state_1.c @@ -0,0 +1,25 @@ +/* File: "update_state_1.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s1 + 1) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_1[ptr_1] + 1); +*/ +SWord64 update_state_1(const SWord64 *queue_1, const SWord32 ptr_1) +{ + const SWord64 s0 = queue_1[0]; + const SWord32 s1 = ptr_1; + const SWord64 s3 = s0 + 0x0000000000000001ULL; + + return s3; +} diff --git a/example9/copilot-sbv-codegen/update_state_2.c b/example9/copilot-sbv-codegen/update_state_2.c new file mode 100644 index 00000000..e1f76cef --- /dev/null +++ b/example9/copilot-sbv-codegen/update_state_2.c @@ -0,0 +1,34 @@ +/* File: "update_state_2.c". Automatically generated by SBV. Do not edit! */ + +#include +#include +#include +#include +#include "internal.h" + +/*ACSL following*/ +/*test 001*/ +/*ACSL to write + (s2 || drop 1 s2) +*/ +/*@ + assigns \nothing; + ensures \result == (queue_2[ptr_2] || queue_2[(ptr_2 + 1) % 2]); +*/ +SBool update_state_2(const SBool *queue_2, const SWord32 ptr_2) +{ + const SBool s0 = queue_2[0]; + const SBool s1 = queue_2[1]; + const SWord32 s2 = ptr_2; + const SBool table0[] = { + s0, s1 + }; + const SWord32 s4 = (0x00000002UL == 0) ? s2 : (s2 % 0x00000002UL); + const SBool s5 = table0[s4]; + const SWord32 s7 = s2 + 0x00000001UL; + const SWord32 s8 = (0x00000002UL == 0) ? s7 : (s7 % 0x00000002UL); + const SBool s9 = table0[s8]; + const SBool s10 = s5 || s9; + + return s10; +} diff --git a/example9/main.hs b/example9/main.hs new file mode 100644 index 00000000..31750854 --- /dev/null +++ b/example9/main.hs @@ -0,0 +1,45 @@ +import Copilot.Language.Reify +import Copilot.Language +import Copilot.Library.Clocks + +import qualified Copilot.Compile.SBV as S +import qualified Copilot.Compile.C99 as C +import qualified Prelude as P +import Debug.Trace + +-------------------------------------------------------------------------------- + + +import qualified Data.List as L + +nats :: Stream Word64 +nats = [0] ++ nats + 1 + +alt :: Stream Bool +alt = [True] ++ not alt + +logic :: Stream Bool +logic = [True, False] ++ logic || drop 1 logic + +sumExterns :: Stream Word64 +sumExterns = + let + e1 = extern "e1" (Just [0..]) + e2 = extern "e2" (Just $ L.cycle [2,3,4]) + in + e1 + e2 + e1 + +spec :: Spec +spec = do + trigger "trig1" alt [ arg $ nats < 3 + , arg sumExterns + , arg logic + ] + + +main = do + reify spec >>= C.compile C.defaultParams + reify spec >>= S.compile S.defaultParams + + +--------------------------------------------------------------------------------