diff --git a/.gitignore b/.gitignore index ae02f99b6..c38769aec 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *~ +.clangd/* sv-benchmarks/* */CMakeFiles/ */Makefile diff --git a/.gitmodules b/.gitmodules index af8cbec7f..81095e6b1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "utils/base_image_map2check"] path = utils/base_image_map2check url = https://github.com/hbgit/base_image_map2check.git -[submodule "utils/dev-llvm_6.0"] - path = utils/dev-llvm_6.0 - url = https://github.com/hbgit/dev-llvm_6.0.git [submodule "utils/benchexecrun"] path = utils/benchexecrun url = https://github.com/hbgit/benchexecrun.git +[submodule "utils/llvm-docker-dev"] + path = utils/llvm-docker-dev + url = https://github.com/hbgit/llvm-docker-dev.git diff --git a/.travis.yml b/.travis.yml index b9c6703de..26578aa1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,7 @@ dist: xenial language: cpp env: - global: - # - secure: "JlVpGztPCTzPA/F3IpRRxwXTD1kj9hN/Kprd1+TA/tSpDjP/l7U/dHepolEBkXa8DjPXUz93d7UNeasJR+vVbB0qX3VuAeWdYcRqdlqVMLL01qg0N9lKhoC9gdlLJ5dvQ30bA6tV7znbF0SQa8p5612RfJ9CO+CyeUY48+8tUTzt7rLtjmeIzu7+nVScEUVJjrx2OblPeLdomejxv7tVYvWLa2/X515wE7HE8jkbuwFuTrdobcdcB+0JaGv+c9TG/fcZlZc/i6Eq70ImWtGza7OMaFrZn5QFcKfA3TywSpVk7x9a1pdghAfNm6ZA9xQwZrTc+ih4RoMTvrN/3UeWz9GZRZsT+e1n7QYrpeG8VQhwEMpFgOFptGClOJ8CtIN90/Kfuuob7/T7sigs6mmpzhhPrJpid3BwKtnwoctJieZlBUddQ6JX83nQOLDYDsU/1c/JZXvIME46fevp0CMBXyYff2hPBmJESn3k5TOHy5e7RasdqMo1t4mZ5AR1dXys2+JPgGxFm0mboRwKyQByQUOl+ZXXhfw57C9Kpxzwg6gpKSy46nfM2whnv+1tcErvuzUWvvwaQ4qV9uC9xQhRXYMARct313WIQ2ZTkxIaYPIqS3YQgbtpEEO0oNmgLr2fLxhgkaZTN++JmkzPa2uamKjCmc+oaDC8MYqwPFb7An0=" + global: - GIT_NAME: hbgit - GIT_EMAIL: herberthb12@gmail.com - TRAVIS_REPO_SLUG: hbgit/Map2Check @@ -12,17 +11,16 @@ services: - docker before_script: -- docker build -t hrocha/mapdevel --no-cache -f Dockerfile . -- docker build -t hrocha/benchexecrun --no-cache -f utils/benchexecrun/Dockerfile +- docker build -t herberthb/mapdevel:v7.4 --no-cache -f Dockerfile . +- docker build -t herberthb/benchexecrun --no-cache -f utils/benchexecrun/Dockerfile utils/benchexecrun/ script: - docker run --rm -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id - -g) hrocha/mapdevel /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./make-release.sh; - ./make-unit-test.sh" + -g) herberthb/mapdevel:v7.4 /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./make-release.sh;" - "./make-regression-test.sh t" - docker run --rm -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id - -g) hrocha/mapdevel /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./check_code_style.py + -g) herberthb/mapdevel:v7.4 /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./check_code_style.py -t -c -p" notifications: diff --git a/CMakeLists.txt b/CMakeLists.txt index 56406e153..650e8f3cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,20 +4,12 @@ project(Map2Check) set(Map2Check_VERSION_MAJOR 7) set(Map2Check_VERSION_MINOR 0) -option(USE_PREBUILT_CLANG "Download and Install pre-built clang" ON) option(BUILD_DOC "Build documentation" OFF) -option(SKIP_LIB_FUZZER "Don't build libFuzzer" OFF) -option(SKIP_KLEE "Don't build KLEE" OFF) -option(REGRESSION "Prepare Regression Tests" OFF) +#option(REGRESSION "Prepare Regression Tests" OFF) option(ENABLE_TEST "Build all tests" OFF) set (CMAKE_CXX_STANDARD 11) -# set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") -# set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++") -# include(cmake/ExternalDeps.cmake) - - set(Map2Check_MODE "STATIC") set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++") @@ -25,30 +17,18 @@ set(CMAKE_EXE_LINKER_FLAGS "-Bstatic -static-libgcc -static-libstdc++") include(cmake/FindClang.cmake) include(cmake/FindBoost.cmake) -if(NOT SKIP_LIB_FUZZER) - include(cmake/FindLibFuzzer.cmake) -endif() - -if(NOT SKIP_KLEE) - include(cmake/FindZ3.cmake) - include(cmake/FindMiniSat.cmake) - include(cmake/FindSTP.cmake) - include(cmake/FindKleeUCLibC.cmake) - include(cmake/FindKlee.cmake) -endif() - -if(REGRESSION) - include(cmake/DownloadRegression.cmake) -endif() +#if(REGRESSION) +# include(cmake/DownloadRegression.cmake) +#endif() include_directories(${PROJECT_SOURCE_DIR}) -if(ENABLE_TEST) - enable_testing() - include(cmake/FindGTest.cmake) - message("Adding tests") - add_subdirectory(tests) -endif() +#if(ENABLE_TEST) +# enable_testing() +# include(cmake/FindGTest.cmake) +# message("Adding tests") +# add_subdirectory(tests) +#endif() add_subdirectory(modules) diff --git a/Dockerfile b/Dockerfile index 45dd81b7d..3907462bf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,15 +4,15 @@ # Usage: # # By gitclone https://github.com/hbgit/Map2Check: -# $ docker build -t hrocha/mapdevel --no-cache -f Dockerfile . -# $ docker run -it --name=mapdevel -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id -g) hrocha/mapdevel /bin/bash +# $ docker build -t herberthb/mapdevel --no-cache -f Dockerfile . +# $ docker run -it --name=mapdevel -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id -g) herberthb/mapdevel /bin/bash # # The docker user is "map2check" and the password is "map2check" # Docker tips: # You can check that the container still exists by running: $ docker ps -a # You can restart the container by running: docker start -ai mapdevel ############################################################ -FROM herberthb/base-image-map2check:v2 +FROM herberthb/base-image-map2check:v8 # Metadata indicating an image maintainer. MAINTAINER @@ -51,22 +51,15 @@ WORKDIR /home/map2check/devel_tool/ RUN cd /home/map2check/devel_tool/ -RUN wget http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -RUN tar xf clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz -RUN mv clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04 clang600 -RUN rm clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - RUN sudo chown -R map2check:map2check . VOLUME /home/map2check/devel_tool/ + # Revoke password-less sudo and Set up sudo access for the ``map2check`` user so it # requires a password USER root RUN mv /etc/sudoers.bak /etc/sudoers && \ echo 'map2check ALL=(root) ALL' >> /etc/sudoers USER map2check -# Configure git -RUN git config --global user.email "map2check.tool@gmail.com" -RUN git config --global user.name "Map2Check" ##################### INSTALLATION END ##################### diff --git a/README.md b/README.md index a5c03f655..ed1dfd7d8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ___ Map2Check is a bug hunting tool that automatically generating and checking safety properties in C programs. It tracks memory pointers and variable assignments to check user-specified assertions, overflow, and pointer safety. The generation of the tests cases are based on assertions (safety properties) from the code instructions, adopting the -[LLVM framework](http://llvm.org/) version 6.0, [LibFuzzer](https://llvm.org/docs/LibFuzzer.html), [KLEE](https://klee.github.io/) to generate input values to the test cases generated by Map2Check. Additionally, we have adopted [Crab-LLVM](https://github.com/seahorn/crab-llvm) tool to computes inductive invariants for LLVM-based languages. +[LLVM framework](http://llvm.org/) version 8.0, [LibFuzzer](https://llvm.org/docs/LibFuzzer.html), [KLEE](https://klee.github.io/) to generate input values to the test cases generated by Map2Check. Additionally, we have adopted [Crab-LLVM](https://github.com/seahorn/crab-llvm) tool to computes inductive invariants for LLVM-based languages. Extra documentation is available at https://map2check.github.io @@ -23,7 +23,7 @@ ___ To use the Map2Check tool is necessary a Linux 64-bit OS system. In the linux OS, you should install the requirements, typing the commands: ``` bash -$ sudo apt install python-minimal +$ sudo apt install python2-minimal $ sudo apt install libc6-dev ``` @@ -37,8 +37,8 @@ After that, you should type the following command:

``` bash -$ unzip map2check-rc-v7.3-svcomp20.zip -$ cd map2check-rc-v7.3-svcomp20 +$ unzip map2check-rc-v8.zip +$ cd map2check-rc-v8-svcomp20 ``` #### Running the tool @@ -49,7 +49,7 @@ in the installation directory as follows:

``` bash -$ ./map2check --memtrack svcomp_960521-1_false-valid-free.c +$ ./map2check --memtrack code.c ``` In this case, --memtrack is the option to check for memory errors. For help and others tool options: @@ -71,8 +71,8 @@ $ git clone https://github.com/hbgit/Map2Check.git $ cd Map2Check $ git submodule update --init --recursive # Build docker image to compile Map2Check -$ docker build -t hrocha/mapdevel --no-cache -f Dockerfile . -$ docker run --rm -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id -g) hrocha/mapdevel /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./make-release.sh; ./make-unit-test.sh" +$ docker build -t herberthb/mapdevel --no-cache -f Dockerfile . +$ docker run --rm -v $(pwd):/home/map2check/devel_tool/mygitclone:Z --user $(id -u):$(id -g) herberthb/mapdevel /bin/bash -c "cd /home/map2check/devel_tool/mygitclone; ./make-release.sh;" ``` More details at https://map2check.github.io/docker.html diff --git a/cmake/CMakeLists.txt.googletest b/cmake/CMakeLists.txt.googletest index c6247af53..649e0a52e 100644 --- a/cmake/CMakeLists.txt.googletest +++ b/cmake/CMakeLists.txt.googletest @@ -1,11 +1,11 @@ -cmake_minimum_required(VERSION 2.8.2) +cmake_minimum_required(VERSION 3.1.1) project(googletest-download NONE) include(ExternalProject) ExternalProject_Add(googletest GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG master + GIT_TAG release-1.10.0 SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" CONFIGURE_COMMAND "" diff --git a/compile_commands.json b/compile_commands.json new file mode 100644 index 000000000..866da1984 --- /dev/null +++ b/compile_commands.json @@ -0,0 +1,127 @@ +[ +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DTrackBasicBlockPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/TrackBasicBlockPass.dir/TrackBasicBlockPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/TrackBasicBlockPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/TrackBasicBlockPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DMap2CheckLibrary_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/Map2CheckLibrary.dir/Map2CheckLibrary.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/Map2CheckLibrary.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/Map2CheckLibrary.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DOverflowPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/OverflowPass.dir/OverflowPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/OverflowPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/OverflowPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DMemoryTrackPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/MemoryTrackPass.dir/MemoryTrackPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/MemoryTrackPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/MemoryTrackPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DTargetPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/TargetPass.dir/TargetPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/TargetPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/TargetPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/DebugInfo.dir/DebugInfo.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/DebugInfo.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/DebugInfo.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DNonDetPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/NonDetPass.dir/NonDetPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/NonDetPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/NonDetPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DGenerateAutomataTruePass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/GenerateAutomataTruePass.dir/GenerateAutomataTruePass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/GenerateAutomataTruePass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/GenerateAutomataTruePass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DAssertPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/AssertPass.dir/AssertPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/AssertPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/AssertPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DLoopPredAssumePass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/LoopPredAssumePass.dir/LoopPredAssumePass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/LoopPredAssumePass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/LoopPredAssumePass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -DCheckNonDetFunctPass_EXPORTS -I../ -fPIC -I/usr/lib/llvm-8/include -std=c++11 -fno-exceptions -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fno-rtti -std=gnu++11 -o modules/backend/pass/CMakeFiles/CheckNonDetFunctPass.dir/CheckNonDetFunctPass.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/CheckNonDetFunctPass.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/backend/pass/CheckNonDetFunctPass.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -std=gnu++11 -o modules/frontend/CMakeFiles/map2check.dir/map2check.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/map2check.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/map2check.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -std=gnu++11 -o modules/frontend/CMakeFiles/Caller.dir/caller.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/caller.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/caller.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/utils/CMakeFiles/Tools.dir/tools.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/tools.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/tools.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/utils/CMakeFiles/Log.dir/log.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/log.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/log.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/utils/CMakeFiles/GenCryptoHash.dir/gen_crypto_hash.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/gen_crypto_hash.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/utils/gen_crypto_hash.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/counter_example/CMakeFiles/CounterExample.dir/counter_example.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/counter_example/counter_example.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/counter_example/counter_example.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/witness/CMakeFiles/Edge.dir/edge.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/edge.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/edge.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/witness/CMakeFiles/Witness.dir/witness.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/witness.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/witness.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/witness/CMakeFiles/Graph.dir/graph.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/graph.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/graph.cpp" +}, + +{ + "directory": "/home/hrocha/Documents/Projects/Map2Check/build", + "command": "/usr/lib/llvm-8/bin/clang++ -I../ -I/usr/lib/llvm-8/include -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -std=gnu++11 -o modules/frontend/witness/CMakeFiles/Node.dir/node.cpp.o -c /home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/node.cpp", + "file": "/home/hrocha/Documents/Projects/Map2Check/modules/frontend/witness/node.cpp" +} +] \ No newline at end of file diff --git a/make-regression-test.sh b/make-regression-test.sh index fd4b9aca6..acf6284f4 100755 --- a/make-regression-test.sh +++ b/make-regression-test.sh @@ -54,7 +54,7 @@ echo "Adopting: $xml_doc_benchexec_name" # Check if docker image is already build # 1 - Build docker image available at https://github.com/hbgit/benchexecrun -has_docker_img=`docker images | grep -c "hrocha/benchexecrun"` +has_docker_img=`docker images | grep -c "herberthb/benchexecrun"` if [ $has_docker_img -gt 0 ]; then echo "Found benchexec image to run tests ..." is_main_dir=`ls | grep -c "make-regression-test.sh"` @@ -62,11 +62,11 @@ if [ $has_docker_img -gt 0 ]; then if [ $is_main_dir -gt 0 ]; then if [ $travis_flag -eq 0 ]; then time docker run --rm -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ - -v $(pwd):/home/bench/benchexec_files:Z hrocha/benchexecrun \ + -v $(pwd):/home/bench/benchexec_files:Z herberthb/benchexecrun \ /bin/bash -c "cd release; python3 -m benchexec.benchexec --no-container ../$xml_doc_benchexec_name" else time docker run --rm -v /sys/fs/cgroup:/sys/fs/cgroup:rw \ - -v $(pwd):/home/bench/benchexec_files:Z hrocha/benchexecrun \ + -v $(pwd):/home/bench/benchexec_files:Z herberthb/benchexecrun \ /bin/bash -c "cd release; python3 -m benchexec.benchexec --no-container ../tests/regression_test/xml_doc_benchexec/$xml_doc_benchexec_name" fi @@ -74,8 +74,10 @@ if [ $has_docker_img -gt 0 ]; then # Analyzing the results get_last_file_result=`ls -t release/results/*.txt | head -1` get_total_test_cases=`tail -n 10 $get_last_file_result | grep -oEi "Statistics:(.[^Files]*)" | grep -oe "[0-9]*"` - get_total_success=`tail -n 10 $get_last_file_result | grep -oEi "Score:(.[^(]*)" | grep -oe "[0-9]*"` - percent_tests=$(( ($get_total_success*100)/$get_total_test_cases )) + get_total_success=`tail -n 8 $get_last_file_result | grep -oEi "correct: (.[^a-z]*)" | grep -oe "[0-9]*"` + + percent_tests=$((($get_total_success*100)/$get_total_test_cases)) + #percent_tests=10 if [ $travis_flag -eq 0 ]; then if [ $percent_tests -lt 20 ]; then diff --git a/make-release.sh b/make-release.sh index 32f9ba138..90e04d988 100755 --- a/make-release.sh +++ b/make-release.sh @@ -1,6 +1,5 @@ #!/bin/sh -export LLVM_DIR_BASE=/llvm/release/llvm600 -export LLVM_VERSION=6.0.0 +export LLVM_VERSION=8.0.0 export_svcomp=true @@ -18,29 +17,21 @@ echo "" cd build -export LLVM_DIR=$LLVM_DIR_BASE/lib/cmake/llvm -export CXX=$LLVM_DIR_BASE/bin/clang++ -export CC=$LLVM_DIR_BASE/bin/clang -cmake .. -G Ninja -DLLVM_DIR=$LLVM_DIR -DSKIP_LIB_FUZZER=ON -DSKIP_KLEE=ON -DCMAKE_INSTALL_PREFIX=../release/ +export LLVM_DIR=/usr/lib/llvm-8/lib/cmake/llvm/ +export CXX=/usr/bin/clang++-8 +export CC=/usr/bin/clang-8 +cmake .. -G Ninja -DLLVM_DIR=$LLVM_DIR -DCMAKE_INSTALL_PREFIX=../release/ ninja ninja install -if [ ! -d "/home/map2check/devel_tool/clang600" ]; then - CURRENT_DIR=`pwd` - cd /home/map2check/devel_tool/ - wget http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - tar xf clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - mv clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04 clang600 - rm clang+llvm-6.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz - cd $CURRENT_DIR -fi - cd ../release mkdir -p ./include -cp -r /home/map2check/devel_tool/clang600/lib/clang/$LLVM_VERSION/include/* ./include -cp -r /home/map2check/devel_tool/clang600/lib/clang ./lib + +cp -r /usr/include/clang/8/include/* ./include +mkdir -p ./lib/clang +cp -r /usr/lib/llvm-8/lib/clang/8.0.1 ./lib/clang/ # Copying external libraries and binaries cp /usr/bin/ld ./bin @@ -57,11 +48,17 @@ cp /usr/lib/gcc/x86_64-linux-gnu/5/crt* ./lib/ cp /usr/lib/x86_64-linux-gnu/crt* ./lib cp /lib/x86_64-linux-gnu/librt.so.1 ./lib/librt.so cp /usr/lib/x86_64-linux-gnu/libgomp.so.1 ./lib/ +cp /lib/x86_64-linux-gnu/ld-2.27.so ./lib/ + +# Supporting LLVM 8 +cp /usr/lib/x86_64-linux-gnu/libLLVM-8.so.1 ./lib/ +cp /usr/lib/x86_64-linux-gnu/libffi.so.6.0.4 ./lib/libffi.so.6 +cp /lib/x86_64-linux-gnu/libtinfo.so.5.9 ./lib/libtinfo.so.5 echo "" echo "Copying external tools" # LibFuzzer -cp /deps/install/fuzzer/libFuzzer.a ./lib +cp /usr/lib/llvm-8/lib/libFuzzer.a ./lib # Z3 if [ ! -d "./z3" ]; then @@ -70,7 +67,10 @@ if [ ! -d "./z3" ]; then fi # Klee and klee_uclib -cp -r /deps/install/klee/* . +cp -r /deps/install/klee/bin/* ./bin/ +cp -r /deps/install/klee/include/* ./include/ +cp -r /deps/install/klee/lib/* ./lib/ + # metasmt echo "> Copying metaSMT deps ..." @@ -82,63 +82,49 @@ cp -r /deps/src/metaSMT/deps/lingeling-ayv-86bf266-140429/lib/liblingeling.so li cp -r /deps/src/metaSMT/deps/yices-2.5.1/lib/libyices.so.2.5.1 lib/ cp -r /deps/src/metaSMT/deps/yices-2.5.1/lib/libyices.so.2.5 lib/ cp -r /deps/src/metaSMT/deps/yices-2.5.1/lib/libyices.so lib/ +# minisat cp -r /deps/src/metaSMT/deps/minisat-git/lib/libminisat.a lib/ cp -r /deps/src/metaSMT/deps/minisat-git/lib/libminisat.so lib/ cp -r /deps/src/metaSMT/deps/minisat-git/lib/libminisat.so.2 lib/ cp -r /deps/src/metaSMT/deps/minisat-git/lib/libminisat.so.2.1.0 lib/ -# minisat -# stp - # Crab if [ ! -d "./bin/crabllvm" ]; then - cp -r /deps/install/crab ./bin + cp -r /deps/install/crab ./bin/ mv ./bin/crab ./bin/crabllvm fi echo "> Crab-LLVM replacing PATH" -sed -i '54s/\"PATH\"/\"CLANG_PATH\"/' ./bin/crabllvm/bin/crabllvm.py +sed -i '54s/\"PATH\"/\"CLANG_PATH\"/' ./bin/crabllvm/bin/clam.py cp /usr/lib/x86_64-linux-gnu/libbfd-* ./bin/crabllvm/lib/ cp /usr/lib/x86_64-linux-gnu/libgomp.so.1 ./bin/crabllvm/lib/ cp /usr/lib/x86_64-linux-gnu/libstdc++* ./bin/crabllvm/lib/ -cp ./lib/libz3.so ./bin/crabllvm/lib/ +# cp ./lib/libz3.so ./bin/crabllvm/lib/ + ../utils/cp_utils_file.sh -# #echo "" + if [ "$export_svcomp" = true ] ; then echo "" echo "Cleaning for SVCOMP" rm -rf ./z3/include - rm -rf ./z3/lib/python2.7 + #rm -rf ./z3/lib/python2.7 rm -rf ./z3/lib - rm -rf ./lib/python2.7 - rm -rf ./lib/clang/6.0.0/include + #rm -rf ./lib/python2.7 + #rm -rf ./lib/clang/6.0.0/include rm -rf ./moduleBenchExec rm ./bin/kleaver rm -rf ./bin/crabllvm/ldd - rm ./bin/crabllvm/lib/libz3.so - #ln -s ./z3/lib/libz3.so ./bin/crabllvm/lib/libz3.so + rm ./bin/crabllvm/lib/libz3.so cd bin/crabllvm/lib/ ln -s ../../../lib/libz3.so . - cd ../../../ # go back to release - #rm ./lib/libz3.so + cd ../../../ # go back to release fi -#echo "" -#echo "Generating archive ..." -#if [ ! -d "map2check" ]; then -# mkdir map2check -#else - #rm -rf map2check - #mkdir map2check -#fi -#cp -r release/* map2check/ -#7z a map2check.zip map2check -#rm -rf map2check -#echo "" + echo "" diff --git a/make-unit-test.sh b/make-unit-test.sh index ca7064484..c851c5f14 100755 --- a/make-unit-test.sh +++ b/make-unit-test.sh @@ -1,6 +1,5 @@ #!/bin/sh -export LLVM_DIR_BASE=/llvm/release/llvm600 -export LLVM_VERSION=6.0.0 +export LLVM_VERSION=8.0.0 if [ ! -d "build" ]; then mkdir build fi @@ -13,9 +12,9 @@ echo "" cd build -export LLVM_DIR=$LLVM_DIR_BASE/lib/cmake/llvm -export CXX=$LLVM_DIR_BASE/bin/clang++ -export CC=$LLVM_DIR_BASE/bin/clang -cmake .. -G Ninja -DLLVM_DIR=$LLVM_DIR -DSKIP_LIB_FUZZER=ON -DSKIP_KLEE=ON -DENABLE_TEST=ON +export LLVM_DIR=/usr/lib/llvm-8/lib/cmake/llvm/ +export CXX=/usr/bin/clang++-8 +export CC=/usr/bin/clang-8 +cmake .. -G Ninja -DLLVM_DIR=$LLVM_DIR -DENABLE_TEST=ON ninja && ninja install && ctest diff --git a/modules/backend/library/lib/NonDetGeneratorLibFuzzy.c b/modules/backend/library/lib/NonDetGeneratorLibFuzzy.c index f4d9fdd97..7368417f0 100644 --- a/modules/backend/library/lib/NonDetGeneratorLibFuzzy.c +++ b/modules/backend/library/lib/NonDetGeneratorLibFuzzy.c @@ -34,7 +34,7 @@ void nondet_init() { nondet_log_init(); } void nondet_destroy() { nondet_log_destroy(); } -void nondet_cancel() { pthread_exit(NULL); } +void nondet_cancel() { pthread_exit(NULL); } // TODO: checkout that void nondet_assume(int expr) { if (!expr) { @@ -63,6 +63,7 @@ uint8_t get_next_input_from_fuzzer() { int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) { map2check_fuzzer_data = Data; map2check_fuzzer_size = Size; + int prevType; // int currentProccess = getpid(); // printf("Creating %d\n", currentProccess); diff --git a/modules/backend/pass/CMakeLists.txt b/modules/backend/pass/CMakeLists.txt index d96789e65..eadc63d2b 100755 --- a/modules/backend/pass/CMakeLists.txt +++ b/modules/backend/pass/CMakeLists.txt @@ -15,6 +15,8 @@ list(APPEND MAP2CHECK_PASS_LIB "GenerateAutomataTruePass") list(APPEND MAP2CHECK_PASS_LIB "AssertPass") list(APPEND MAP2CHECK_PASS_LIB "OverflowPass") list(APPEND MAP2CHECK_PASS_LIB "LoopPredAssumePass") +list(APPEND MAP2CHECK_PASS_LIB "CheckNonDetFunctPass") +list(APPEND MAP2CHECK_PASS_LIB "InitVar2NonDetFunctPass") diff --git a/modules/backend/pass/CheckNonDetFunctPass.cpp b/modules/backend/pass/CheckNonDetFunctPass.cpp new file mode 100644 index 000000000..499dd66e6 --- /dev/null +++ b/modules/backend/pass/CheckNonDetFunctPass.cpp @@ -0,0 +1,41 @@ +/** + * Copyright (C) 2014 - 2020 Map2Check tool + * This file is part of the Map2Check tool, and is made available under + * the terms of the GNU General Public License version 2. + * + * LLVM -> NCSA + * + * SPDX-License-Identifier: (GPL-2.0 AND NCSA) + **/ + +#include "CheckNonDetFunctPass.hpp" + +#include + +using llvm::dyn_cast; +using llvm::RegisterPass; +using llvm::errs; + + +bool CheckNonDetFunctPass::runOnFunction(Function& F) { + // run on each basic block + for (auto &BB : F) { + // run on each instruction from the basic block + for (auto &I : BB) { + if (CallInst *callInst = dyn_cast(&I)) { + if (Function *calledFunct = callInst->getCalledFunction()) { + if (calledFunct->getName().startswith("__VERIFIER_nondet")) { + errs() << calledFunct->getName() << "\n"; + } + } + } + } + } + // The IR was not modified + return false; +} + + +char CheckNonDetFunctPass::ID = 14; +static RegisterPass X("check_nondet_functs", + "Identify nondet function using __VERIFIER_nondet_type() call"); diff --git a/modules/backend/pass/CheckNonDetFunctPass.hpp b/modules/backend/pass/CheckNonDetFunctPass.hpp new file mode 100644 index 000000000..814ae7b64 --- /dev/null +++ b/modules/backend/pass/CheckNonDetFunctPass.hpp @@ -0,0 +1,43 @@ +/** + * Copyright (C) 2014 - 2020 Map2Check tool + * This file is part of the Map2Check tool, and is made available under + * the terms of the GNU General Public License version 2. + * + * LLVM -> NCSA + * + * SPDX-License-Identifier: (GPL-2.0 AND NCSA) + **/ + +#ifndef MODULES_BACKEND_PASS_CHECKNONDETFUNCTPASS_HPP_ + + +#define MODULES_BACKEND_PASS_CHECKNONDETFUNCTPASS_HPP_ + + +#include +#include +#include +#include +#include + +#include +#include +#include "DebugInfo.hpp" + +using llvm::BasicBlock; +using llvm::CallInst; +using llvm::Function; +using llvm::FunctionPass; +using llvm::raw_ostream; + +struct CheckNonDetFunctPass : public FunctionPass { + static char ID; + CheckNonDetFunctPass() : FunctionPass(ID) {} + virtual bool runOnFunction(Function& F); + + protected: + void runOnCallInstruction(CallInst* callInst, LLVMContext* Ctx); +}; + + +#endif // MODULES_BACKEND_PASS_CHECKNONDETFUNCTPASS_HPP_ diff --git a/modules/backend/pass/GenerateAutomataTruePass.cpp b/modules/backend/pass/GenerateAutomataTruePass.cpp index 937a39654..0a36dfb5e 100644 --- a/modules/backend/pass/GenerateAutomataTruePass.cpp +++ b/modules/backend/pass/GenerateAutomataTruePass.cpp @@ -24,7 +24,8 @@ using llvm::dyn_cast; using llvm::isa; using llvm::LoadInst; using llvm::RegisterPass; -using llvm::TerminatorInst; +// using llvm::TerminatorInst; +using llvm::Instruction; using std::ofstream; @@ -165,8 +166,10 @@ void GenerateAutomataTruePass::runOnBasicBlock(BasicBlock& B, this->st_isControl = isCond; if (B.size() > 1) { - if (auto* tI = dyn_cast(&*this->st_lastBlockInst)) { - if (std::string(tI->getOpcodeName()) == "br") { + // if (auto* tI = dyn_cast(&*this->st_lastBlockInst)) { + if ( this->st_lastBlockInst->isTerminator() ) { + // if (std::string(tI->getOpcodeName()) == "br") { + if (std::string(this->st_lastBlockInst->getOpcodeName()) == "br") { --this->st_lastBlockInst; this->checkAndSkipAssume(); // DebugInfo debugInfoLa(this->Ctx, @@ -197,8 +200,8 @@ void GenerateAutomataTruePass::runOnBasicBlock(BasicBlock& B, } else { // In case this unique instruction be a "br" then we remove this basic block - if (auto* tI = dyn_cast(&*this->st_lastBlockInst)) { - if (std::string(tI->getOpcodeName()) != "br") { + if ( this->st_lastBlockInst->isTerminator() ) { + if (std::string(this->st_lastBlockInst->getOpcodeName()) != "br") { this->st_lastBlockInst = this->firstBlockInst; // DebugInfo debugInfoLa(this->Ctx, @@ -406,16 +409,18 @@ bool GenerateAutomataTruePass::isBranchCond(BasicBlock& B) { } } - if (auto* tI = dyn_cast(&I)) { - if (std::string(tI->getOpcodeName()) == "br") { + // Instruction tmpI = (Instruction) I; + + if ( I.isTerminator() ) { + if (std::string(I.getOpcodeName()) == "br") { // tI->dump(); - if (tI->getNumSuccessors() > 1) { + if (I.getNumSuccessors() > 1) { // TRUE cond - this->skipEmptyLineItSize = tI->getSuccessor(0)->size(); - BasicBlock::iterator trueCond = --tI->getSuccessor(0)->end(); + this->skipEmptyLineItSize = I.getSuccessor(0)->size(); + BasicBlock::iterator trueCond = --I.getSuccessor(0)->end(); if (std::string(trueCond->getOpcodeName()) == "br" && - tI->getSuccessor(0)->size() == 1) { - trueCond = --tI->getSuccessor(0)->getSingleSuccessor()->end(); + I.getSuccessor(0)->size() == 1) { + trueCond = --I.getSuccessor(0)->getSingleSuccessor()->end(); } if (std::string(trueCond->getOpcodeName()) == "br" || @@ -433,18 +438,18 @@ bool GenerateAutomataTruePass::isBranchCond(BasicBlock& B) { // tI->getSuccessor(1)->dump(); // tI->getSuccessor(1)->begin()->dump(); BasicBlock::iterator falseCond; - this->skipEmptyLineItSize = tI->getSuccessor(1)->size(); + this->skipEmptyLineItSize = I.getSuccessor(1)->size(); if (this->actualSizeBB > 1) { - falseCond = --tI->getSuccessor(1)->end(); + falseCond = --I.getSuccessor(1)->end(); } else { - falseCond = tI->getSuccessor(1)->begin(); + falseCond = I.getSuccessor(1)->begin(); } // falseCond->dump(); if (std::string(falseCond->getOpcodeName()) == "br" && - tI->getSuccessor(1)->size() == 1) { - falseCond = --tI->getSuccessor(1)->getSingleSuccessor()->end(); + I.getSuccessor(1)->size() == 1) { + falseCond = --I.getSuccessor(1)->getSingleSuccessor()->end(); } if (std::string(falseCond->getOpcodeName()) == "br" || diff --git a/modules/backend/pass/GenerateAutomataTruePass.hpp b/modules/backend/pass/GenerateAutomataTruePass.hpp index 5880b61b8..362d7f2bc 100644 --- a/modules/backend/pass/GenerateAutomataTruePass.hpp +++ b/modules/backend/pass/GenerateAutomataTruePass.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/backend/pass/InitVar2NonDetFunctPass.cpp b/modules/backend/pass/InitVar2NonDetFunctPass.cpp new file mode 100644 index 000000000..983d67a44 --- /dev/null +++ b/modules/backend/pass/InitVar2NonDetFunctPass.cpp @@ -0,0 +1,94 @@ +/** + * Copyright (C) 2014 - 2020 Map2Check tool + * This file is part of the Map2Check tool, and is made available under + * the terms of the GNU General Public License version 2. + * + * LLVM -> NCSA + * + * SPDX-License-Identifier: (GPL-2.0 AND NCSA) + **/ + +#include "InitVar2NonDetFunctPass.hpp" + +using llvm::dyn_cast; +using llvm::errs; +using llvm::IRBuilder; +using llvm::RegisterPass; + +bool InitVar2NonDetFunctionPass::runOnFunction(Function &F) { + bool flag_modified = false; + int id_tmp = 0; + + // Look for main function + if (F.getName() == "main") { + LLVMContext &Ctx = F.getContext(); + llvm::Constant *funct; + + // Running each basic block + for (auto &bb : F) { + // Looking for the instructions + for (auto &instruction : bb) { + // For each Alloca instructions one Store should be + // found, if not that Alloca was not initialized + if (auto *al = dyn_cast(&instruction)) { + // This because of backtracking def-use chain searching + // https://stackoverflow.com/questions/35370195/llvm-difference-between-uses-and-user-in-instruction-or-value-classes + if (al->getNumUses() > 0) { + //al->reverseUseList(); + + // We need the first use from instruction + // to check if is an store instruction + if (auto *inst = + dyn_cast(al->uses().begin()->getUser())) { + + // Now we create a callinst instruction + // to be inserted before this instruction + // Get the basic block from LoadInst + BasicBlock * actual_bb = inst->getParent(); + IRBuilder<> builder(reinterpret_cast(inst)); + builder.SetInsertPoint(actual_bb, builder.GetInsertPoint()); + + // Identify the variable type + if (al->getAllocatedType()->isIntegerTy()) { + // errs() << *al << "\n"; + funct = F.getParent()->getOrInsertFunction( + "map2check_non_det_int", Type::getInt32Ty(Ctx)); + Function *hook = dyn_cast(funct); + //std::string name_tmp_var = "tmp_call_" + std::to_string(id_tmp); + + // Create Call Inst to __VERIFIER_nondet_* + auto *cInst = builder.CreateCall(hook, llvm::None, + "", NULL); //name_tmp_var.c_str() + + // Create a Load instruction + // Value *cast = builder.CreatePtrToInt(cInst, Type::getInt32Ty(Ctx)); \ + // builder.CreateLoad(Type::getInt32PtrTy(Ctx), cast); + + // Create a store instruction + builder.SetInsertPoint(actual_bb, builder.GetInsertPoint()); + builder.CreateStore(cInst, al); + + flag_modified = true; + } + } + } + } + } + } + } + + // errs() << flag_modified << "\n"; + + if (flag_modified) { + return true; + } else { + // The IR was not modified + return false; + } +} + +char InitVar2NonDetFunctionPass::ID = 15; +static RegisterPass X( + "init_var2_nondet", + "Identify variable not initialized (only in the main funct) and then apply " + "a nondet function using __VERIFIER_nondet_type() call"); diff --git a/modules/backend/pass/InitVar2NonDetFunctPass.hpp b/modules/backend/pass/InitVar2NonDetFunctPass.hpp new file mode 100644 index 000000000..34dac8b38 --- /dev/null +++ b/modules/backend/pass/InitVar2NonDetFunctPass.hpp @@ -0,0 +1,45 @@ +/** + * Copyright (C) 2014 - 2020 Map2Check tool + * This file is part of the Map2Check tool, and is made available under + * the terms of the GNU General Public License version 2. + * + * LLVM -> NCSA + * + * SPDX-License-Identifier: (GPL-2.0 AND NCSA) + **/ + +#ifndef MODULES_BACKEND_PASS_INITVAR2NONDETFUNCTPASS_HPP_ + + +#define MODULES_BACKEND_PASS_INITVAR2NONDETFUNCTPASS_HPP_ + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include "DebugInfo.hpp" + +using llvm::BasicBlock; +using llvm::CallInst; +using llvm::Function; +using llvm::FunctionPass; +using llvm::raw_ostream; + +struct InitVar2NonDetFunctionPass : public FunctionPass { + static char ID; + InitVar2NonDetFunctionPass() : FunctionPass(ID) {} + virtual bool runOnFunction(Function& F); +}; + + +#endif // MODULES_BACKEND_PASS_INITVAR2NONDETFUNCTPASS_HPP_ diff --git a/modules/backend/pass/NOTES.txt b/modules/backend/pass/NOTES.txt index 0cdcf91bb..ce9cb75ee 100644 --- a/modules/backend/pass/NOTES.txt +++ b/modules/backend/pass/NOTES.txt @@ -6,7 +6,8 @@ 3) Update the Map2Check/modules/backend/pass/CMakeLists.txt file -4) Update the Map2Check/modules/frontend/CMakeLists.txt, e.g.: + +OPTIONAL:: 4) Update the Map2Check/modules/frontend/CMakeLists.txt, e.g.: add_executable(map2check map2check.cpp $ $ ... diff --git a/modules/backend/pass/TargetPass.cpp b/modules/backend/pass/TargetPass.cpp index 14d1dd5c2..2fc6ec1a3 100644 --- a/modules/backend/pass/TargetPass.cpp +++ b/modules/backend/pass/TargetPass.cpp @@ -45,7 +45,10 @@ void TargetPass::runOnCallInstruction(CallInst* callInst, LLVMContext* Ctx) { } } - if (calleeFunction->getName() == targetFunctionName) { + // llvm::errs() << calleeFunction->getName() << "\n"; + if (calleeFunction->getName() == targetFunctionName_v1 || + calleeFunction->getName() == targetFunctionName_v2 || + calleeFunction->getName() == targetFunctionName_v3) { this->instrumentErrorInstruction(callInst, Ctx); } } diff --git a/modules/backend/pass/TargetPass.hpp b/modules/backend/pass/TargetPass.hpp index 13fca9b9d..10de99320 100644 --- a/modules/backend/pass/TargetPass.hpp +++ b/modules/backend/pass/TargetPass.hpp @@ -43,7 +43,8 @@ struct TargetPass : public FunctionPass { static char ID; TargetPass() : FunctionPass(ID) {} explicit TargetPass(std::string FunctionName) : FunctionPass(ID) { - targetFunctionName = FunctionName; + targetFunctionName_v1 = FunctionName; + targetFunctionName_v2 = FunctionName; } virtual bool runOnFunction(Function &F); @@ -56,7 +57,10 @@ struct TargetPass : public FunctionPass { BasicBlock::iterator currentInstruction; Constant *targetFunctionMap2Check = NULL; Value *functionName = NULL; - std::string targetFunctionName = "__VERIFIER_error"; + std::string targetFunctionName_v1 = "__VERIFIER_error"; + std::string targetFunctionName_v2 = "reach_error"; + std::string targetFunctionName_v3 = "__VERIFIER_assert"; + // }; #endif // MODULES_BACKEND_PASS_TARGETPASS_HPP_ diff --git a/modules/backend/pass/TrackBasicBlockPass.cpp b/modules/backend/pass/TrackBasicBlockPass.cpp index d47891179..ef98d5809 100644 --- a/modules/backend/pass/TrackBasicBlockPass.cpp +++ b/modules/backend/pass/TrackBasicBlockPass.cpp @@ -19,7 +19,9 @@ using llvm::IRBuilder; using llvm::isa; using llvm::PHINode; using llvm::RegisterPass; -using llvm::TerminatorInst; +// using llvm::TerminatorInst; +using llvm::Instruction; +// using llvm::Instruction::isTerminator; using llvm::UnreachableInst; namespace { @@ -156,8 +158,9 @@ void TrackBasicBlockPass::runOnBasicBlock(BasicBlock& B, LLVMContext* Ctx) { // DebugInfo debugInfoLa(this->Ctx, (Instruction*)this->st_lastBlockInst); // errs() << debugInfoLa.getLineNumberInt() << "\n"; - if (auto* tI = dyn_cast(&*this->st_lastBlockInst)) { - if (std::string(tI->getOpcodeName()) == "br") { + // if (auto* tI = dyn_cast(&*this->st_lastBlockInst)) { + if ( this->st_lastBlockInst->isTerminator() ) { + if (std::string(this->st_lastBlockInst->getOpcodeName()) == "br") { if (B.size() > 1) { --this->st_lastBlockInst; DebugInfo debugInfoLa(this->Ctx, diff --git a/modules/backend/pass/TrackBasicBlockPass.hpp b/modules/backend/pass/TrackBasicBlockPass.hpp index c5883281e..b1ca50d5f 100644 --- a/modules/backend/pass/TrackBasicBlockPass.hpp +++ b/modules/backend/pass/TrackBasicBlockPass.hpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/frontend/caller.cpp b/modules/frontend/caller.cpp index bc553f0d6..a0a7b25a8 100644 --- a/modules/frontend/caller.cpp +++ b/modules/frontend/caller.cpp @@ -37,10 +37,10 @@ namespace { inline std::string getLibSuffix() { return ".so"; } bool isWitnessFileCreated() { - Map2Check::Log::Debug("Checking file"); + Map2Check::Log::Debug("Checking file: map2check_checked_error"); std::ifstream infile("map2check_checked_error"); if (infile.is_open()) { - Map2Check::Log::Debug("Found file!"); + Map2Check::Log::Debug("Found < map2check_checked_error > file!"); return true; } return false; @@ -68,10 +68,9 @@ Caller::Caller(std::string bc_program_path, Map2CheckMode mode, moveProgram << "cp " << bc_program_path << " " << programHash; system(moveProgram.str().c_str()); - Map2Check::Log::Debug("Changing current dir"); currentPath = boost::filesystem::current_path().string(); boost::filesystem::current_path(currentPath + "/" + programHash); - Map2Check::Log::Debug("Current path: " + + Map2Check::Log::Debug("Changing to Map2Check tmp files dir: " + boost::filesystem::current_path().string()); } @@ -100,15 +99,18 @@ void Caller::cleanGarbage() { void Caller::applyNonDetGenerator() { switch (nonDetGenerator) { + case (NonDetGenerator::None): { // TODO(hbgit): Should generate binary Map2Check::Log::Info( "Map2Check will not generate non deterministic numbers"); break; } + case (NonDetGenerator::Klee): { Map2Check::Log::Info("Applying optimizations for klee"); break; } + case (NonDetGenerator::LibFuzzer): { Map2Check::Log::Info("Instrumenting with LLVM LibFuzzer"); std::ostringstream command; @@ -121,91 +123,177 @@ void Caller::applyNonDetGenerator() { << " -o " + programHash + "-fuzzed.out" << " " + programHash + "-result.bc"; + Map2Check::Log::Debug(command.str().c_str()); system(command.str().c_str()); - std::ostringstream commandWitness; + /*std::ostringstream commandWitness; commandWitness.str(""); commandWitness << Map2Check::clangBinary << " -g -fsanitize=fuzzer " << " -o " + programHash + "-witness-fuzzed.out" << " " + programHash + "-witness-result.bc"; - system(commandWitness.str().c_str()); + system(commandWitness.str().c_str());*/ break; } } } +int Caller::checkNondetFunctPass() { + std::ostringstream cmd; + cmd.str(""); + cmd << Map2Check::optBinary; + + Map2Check::Log::Info("Look for nondet function call using LLVM pass"); + cmd << " -tailcallopt"; + std::string checkNondetFunctPass = + "${MAP2CHECK_PATH}/lib/libCheckNonDetFunctPass"; + cmd << " -load " << checkNondetFunctPass << getLibSuffix() + << " -check_nondet_functs -disable-output"; + + std::string input_file = "< " + this->pathprogram; + std::string output_file = " 2> checkNondetFunct-output.txt"; + + cmd << input_file << output_file; + Map2Check::Log::Debug(cmd.str()); + + system(cmd.str().c_str()); + + std::ifstream file("checkNondetFunct-output.txt"); + + // pFile.peek() == std::ifstream::traits_type::eof() + if (file.peek() == std::ifstream::traits_type::eof()) { + return 0; + } else { + return 1; + } +} + +std::ostringstream Caller::resetCmdPass() { + std::ostringstream transformCommand; + transformCommand.str(""); + transformCommand << Map2Check::optBinary; + + return transformCommand; +} + int Caller::callPass(std::string target_function, bool sv_comp) { std::ostringstream transformCommand; transformCommand.str(""); transformCommand << Map2Check::optBinary; + std::string input_file = this->pathprogram; + std::string output_file = programHash + "-output.bc"; /* TODO(rafa.sa.xp@gmail.com): Should apply generate_automata_true * and TrackBasicBlockPass now */ - std::string nonDetPass = "${MAP2CHECK_PATH}/lib/libNonDetPass"; + if (this->pthreadCheck) { + // this->applyInitVar2NondetFunctPass(input_file, output_file); + Map2Check::Log::Info( + "In the main function the variables not initialized will be assigned " + "with nondet values"); + // cmd << " -tailcallopt"; + std::string initVar2NondetFunctPass = + "${MAP2CHECK_PATH}/lib/libInitVar2NonDetFunctPass"; + transformCommand << " -load " << initVar2NondetFunctPass << getLibSuffix() + << " -init_var2_nondet "; + // exit(0); + } - /*Map2Check::Log::Info("Adding loop pass"); - std::string loopPredAssumePass = - "${MAP2CHECK_PATH}/lib/libLoopPredAssumePass"; transformCommand << " -load " - << loopPredAssumePass << getLibSuffix() - << " -loop_predicate_assume";*/ + std::string nonDetPass = "${MAP2CHECK_PATH}/lib/libNonDetPass"; Map2Check::Log::Info("Adding nondet pass"); - transformCommand << " -tailcallopt"; - transformCommand << " -load " << nonDetPass << getLibSuffix() << " -non_det"; + //transformCommand << " -tailcallopt"; + transformCommand << " -load " << nonDetPass << getLibSuffix() << " -non_det "; + /* output_file = programHash + "-output_nondet.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ + // exit(0); + // End nondet pass switch (map2checkMode) { case Map2CheckMode::MEMTRACK_MODE: { Map2Check::Log::Info("Adding memtrack pass"); std::string memoryTrackPass = "${MAP2CHECK_PATH}/lib/libMemoryTrackPass"; transformCommand << " -load " << memoryTrackPass << getLibSuffix() - << " -memory_track"; + << " -memory_track "; + /* output_file = programHash + "-output_memtrack.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ break; } case Map2CheckMode::MEMCLEANUP_MODE: { Map2Check::Log::Info("Adding memcleanup pass"); std::string memoryTrackPass = "${MAP2CHECK_PATH}/lib/libMemoryTrackPass"; transformCommand << " -load " << memoryTrackPass << getLibSuffix() - << " -memory_track"; + << " -memory_track "; + /*output_file = programHash + "-output_memcleanup.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ break; } case Map2CheckMode::OVERFLOW_MODE: { std::string overflowPass = "${MAP2CHECK_PATH}/lib/libOverflowPass"; transformCommand << " -load " << overflowPass << getLibSuffix() - << " -check_overflow"; + << " -check_overflow "; + /* output_file = programHash + "-output_overflow.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ break; } case Map2CheckMode::REACHABILITY_MODE: { - Map2Check::Log::Info("Running reachability mode"); + Map2Check::Log::Info("Adding reachability pass"); std::string targetPass = "${MAP2CHECK_PATH}/lib/libTargetPass"; transformCommand << " -load " << targetPass << getLibSuffix() - << " -target_function"; - + << " -target_function "; + /*output_file = programHash + "-output_reach.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ + // exit(0); break; } case Map2CheckMode::ASSERT_MODE: { - Map2Check::Log::Info("Running assert mode"); + Map2Check::Log::Info("Adding assert pass"); std::string assertPass = "${MAP2CHECK_PATH}/lib/libAssertPass"; transformCommand << " -load " << assertPass << getLibSuffix() - << " -validate_asserts"; + << " -validate_asserts "; + /*output_file = programHash + "-output_assert.bc"; + transformCommand << " < " << input_file << " > " << output_file; + input_file = output_file; + Map2Check::Log::Debug(transformCommand.str()); + system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass();*/ break; } - default: { break; } + default: { + break; + } } Map2Check::Log::Info("Adding map2check pass"); std::string map2checkPass = "${MAP2CHECK_PATH}/lib/libMap2CheckLibrary"; transformCommand << " -load " << map2checkPass << getLibSuffix() << " -map2check "; - - std::string input_file = "< " + this->pathprogram; - std::string output_file = "> " + programHash + "-output.bc"; - - transformCommand << input_file << output_file; + + transformCommand << " < " << input_file << " > " << output_file; + Map2Check::Log::Debug(transformCommand.str()); - system(transformCommand.str().c_str()); + transformCommand = this->resetCmdPass(); return 1; } @@ -214,7 +302,7 @@ void Caller::linkLLVM() { /* Link functions called after executing the passes */ // TODO(rafa.sa.xp@gmail.com) Only link against used libraries - Map2Check::Log::Info("Linking with map2check library"); + Map2Check::Log::Info("Linking with map2check library using llvm-link"); std::ostringstream witnessCommand; std::ostringstream linkCommand; @@ -284,17 +372,23 @@ void Caller::linkLLVM() { } } + /* TODO: Checkout this + Map2Check::Log::Debug("Compiling to generate the witness"); witnessCommand.str(""); witnessCommand << linkCommand.str(); witnessCommand << " ${MAP2CHECK_PATH}/lib/WitnessGeneration.bc"; witnessCommand << " > " + programHash + "-witness-result.bc"; Map2Check::Log::Debug(witnessCommand.str()); - system(witnessCommand.str().c_str()); + system(witnessCommand.str().c_str());*/ - linkCommand << " ${MAP2CHECK_PATH}/lib/WitnessGenerationNone.bc"; + Map2Check::Log::Debug("Compiling to verify the properties"); + //linkCommand << " ${MAP2CHECK_PATH}/lib/WitnessGenerationNone.bc"; + linkCommand << " ${MAP2CHECK_PATH}/lib/WitnessGeneration.bc"; linkCommand << " > " + programHash + "-result.bc"; Map2Check::Log::Debug(linkCommand.str()); system(linkCommand.str().c_str()); + + // exit(0); } void Caller::executeAnalysis(std::string solvername) { @@ -304,6 +398,7 @@ void Caller::executeAnalysis(std::string solvername) { Map2Check::Log::Info("This mode is not supported"); break; } + // KLEE analysis case (NonDetGenerator::Klee): { Map2Check::Log::Info("Executing Klee with map2check"); std::ostringstream kleeCommand; @@ -311,12 +406,11 @@ void Caller::executeAnalysis(std::string solvername) { kleeCommand << "timeout " << (0.8 * this->timeout) << " "; kleeCommand << Map2Check::kleeBinary; - std::vector kleebackendsolver = {"z3", "stp"}; std::vector kleemetasolver = {"btor", "yices2"}; - - if ( std::count(kleebackendsolver.begin(), kleebackendsolver.end(), solvername) ) { + if (std::count(kleebackendsolver.begin(), kleebackendsolver.end(), + solvername)) { // Checkout solver adopted, if is z3 or stp // in KLEE add -solver-backend option @@ -333,7 +427,8 @@ void Caller::executeAnalysis(std::string solvername) { << " -libc=uclibc" << " ./" + programHash + "-witness-result.bc" << " > ExecutionOutput.log"; - } else if ( std::count(kleemetasolver.begin(), kleemetasolver.end(), solvername) ) { + } else if (std::count(kleemetasolver.begin(), kleemetasolver.end(), + solvername)) { // Checkout solver adopted, if is btor (Boolector) or yices (Yices) // in KLEE add - option Map2Check::Log::Info("Solver metaSMT caller: " + solvername); @@ -359,15 +454,19 @@ void Caller::executeAnalysis(std::string solvername) { break; } + + // LIbFUZZER analysis case (NonDetGenerator::LibFuzzer): { Map2Check::Log::Info("Executing LibFuzzer with map2check"); std::ostringstream command; command.str(""); - command << "timeout " << (0.2 * this->timeout) << " "; - command << "./" + programHash + - "-fuzzed.out -jobs=8 -use_value_profile=1 " + command << "timeout " << (0.5 * this->timeout) << " "; + command << "./" + programHash + "-fuzzed.out -rss_limit_mb=0 -jobs=8" << " > fuzzer.output"; + // "-fuzzed.out -rss_limit_mb=4000 -jobs=8 -use_value_profile=1 " + + Map2Check::Log::Debug(command.str().c_str()); int result = system(command.str().c_str()); Map2Check::Log::Warning("Exited fuzzer with " + std::to_string(result)); if (result == 31744) // Timeout @@ -375,20 +474,23 @@ void Caller::executeAnalysis(std::string solvername) { std::ostringstream commandWitness; commandWitness.str(""); - commandWitness << "./" + programHash + "-witness-fuzzed.out crash-*"; + //commandWitness << "./" + programHash + "-witness-fuzzed.out crash-*"; + commandWitness << "./" + programHash + "-fuzzed.out -rss_limit_mb=0 crash-*"; system(commandWitness.str().c_str()); Map2Check::Log::Debug("Finished fuzzer"); - if (isWitnessFileCreated()) { + /*if (isWitnessFileCreated()) { witnessVerified = true; - } + }*/ break; } } - if (isWitnessFileCreated()) { + + /*if (isWitnessFileCreated()) { witnessVerified = true; - } + }*/ + } std::vector Caller::processClangOutput() { @@ -419,6 +521,81 @@ std::vector Caller::processClangOutput() { return result; } +/** + * Apply source code transformation for concurrent + * programs adopting Lazy CSeq + * https://www.southampton.ac.uk/~gp1y10/cseq/ + **/ +std::string Caller::applyCSeqTransformation(std::string preprocessed_code) { + Map2Check::Log::Info("Applying CSeq on " + preprocessed_code); + + std::string cseq_code_output = preprocessed_code + ".cseq.c"; + + /** + * Flow: + * 1) Change to Cseq directory, because cseq modules limitation of the + * absolute path + * 2) Run CSeq and print the code transformation + * */ + + std::string currentPathTrack = boost::filesystem::current_path().string(); + + std::string path_cseq = currentPath + Map2Check::cseqPath; + + boost::filesystem::current_path(path_cseq); + + Map2Check::Log::Debug("Changing to CSeq dir: " + + boost::filesystem::current_path().string()); + + std::ostringstream command; + command.str(""); + command << "./" << Map2Check::cseqBinary << " --input " << currentPathTrack + << "/" << preprocessed_code << " --load lazy " + << " --backend cpachecker > " << currentPathTrack << "/" + << cseq_code_output; + //<< cseq_code_output; + + Map2Check::Log::Info(command.str()); + system(command.str().c_str()); + + /** + * Since CSeq dont include pthread.h header file + * We need to replace the name of the pthread functions, e.g., + * pthread_create, once LibFuzzer fail in it's execution + * */ + + // Returning the current Map2Check directory + Map2Check::Log::Debug("Changing to Map2Check tmp files dir"); + boost::filesystem::current_path(currentPathTrack); + + return cseq_code_output; +} + +void Caller::applyInitVar2NondetFunctPass(std::string in_path_bc_program, + std::string out_path_bc_program) { + std::ostringstream cmd; + cmd.str(""); + cmd << Map2Check::optBinary; + + Map2Check::Log::Info( + "In the main function the variables not initialized will be assigned " + "with nondet values"); + // cmd << " -tailcallopt"; + std::string initVar2NondetFunctPass = + "${MAP2CHECK_PATH}/lib/libInitVar2NonDetFunctPass"; + cmd << " -load " << initVar2NondetFunctPass << getLibSuffix() + << " -init_var2_nondet "; + + // std::string input_and_output_file = + // in_path_bc_program + out_path_bc_program; + // exit(0); + + cmd << " < " << in_path_bc_program << " > " << out_path_bc_program; + Map2Check::Log::Debug(cmd.str()); + + system(cmd.str().c_str()); +} + /** This function should: * (1) Remove unsupported functions and clean the C code * (2) Generate .bc file from code @@ -426,7 +603,8 @@ std::vector Caller::processClangOutput() { */ void Caller::compileCFile(bool is_llvm_bc) { if (!is_llvm_bc) { - Map2Check::Log::Info("Compiling " + this->pathprogram); + Map2Check::Log::Debug("The input is a C source code"); + Map2Check::Log::Info("Preprocessing the code: " + this->pathprogram); // (1) Remove unsupported functions and clean the C code std::ostringstream commandRemoveExternMalloc; @@ -446,36 +624,49 @@ void Caller::compileCFile(bool is_llvm_bc) { std::ostringstream commandRemoveVoidMemset; commandRemoveVoidMemset.str(""); - commandRemoveVoidMemset << "sed -i 's/void [*]memset(void[*], int, size_t);/ / g' " - << " " << programHash << "-preprocessed.c "; + commandRemoveVoidMemset + << "sed -i 's/void [*]memset(void[*], int, size_t);/ / g' " + << " " << programHash << "-preprocessed.c "; // Map2Check::Log::Info(commandRemoveExternMemset.str().c_str()); system(commandRemoveVoidMemset.str().c_str()); std::ostringstream commandRemoveVoidMemcpy; commandRemoveVoidMemcpy.str(""); - commandRemoveVoidMemcpy << "sed -i 's/void [*]memcpy(void[*], const void [*], size_t);/ / g' " - << " " << programHash << "-preprocessed.c "; + commandRemoveVoidMemcpy + << "sed -i 's/void [*]memcpy(void[*], const void [*], size_t);/ / g' " + << " " << programHash << "-preprocessed.c "; // Map2Check::Log::Info(commandRemoveExternMemset.str().c_str()); system(commandRemoveVoidMemcpy.str().c_str()); + // TODO: if is a concurrent program then apply the code transformation + std::string preprocessedFile = programHash + "-preprocessed.c"; + if (this->pthreadCheck) { + preprocessedFile = this->applyCSeqTransformation(preprocessedFile); + } + // (2) Generate .bc file from code // TODO(hbgit): -Winteger-overflow should be called only if is on overflow // mode std::string compiledFile = programHash + "-compiled.bc"; std::ostringstream command; command.str(""); + // for KLEE dont forget https://github.com/klee/klee/issues/902 command << Map2Check::clangBinary << " -I" << Map2Check::clangIncludeFolder << " -Wno-everything " << " -Winteger-overflow " << " -c -emit-llvm -g" - << " " << Caller::preOptimizationFlags() << " -o " << compiledFile - << " " << programHash << "-preprocessed.c " - << " > " << programHash << "-clang.out 2>&1"; + << " " << Caller::preOptimizationFlags() + << " -Xclang -disable-O0-optnone -o " << compiledFile << " " + << preprocessedFile << " > " << programHash << "-clang.out 2>&1"; - system(command.str().c_str()); + Map2Check::Log::Info("Compiling: " + preprocessedFile); + Map2Check::Log::Info(command.str()); + system(command.str().c_str()); this->pathprogram = compiledFile; + } else { + Map2Check::Log::Debug("The input is a LLVM bitcode"); std::string compiledFile = programHash + "-compiled.bc"; std::ostringstream command; command.str(""); @@ -508,19 +699,20 @@ void Caller::compileToCrabLlvm() { std::ostringstream commandRemoveVoidMemset; commandRemoveVoidMemset.str(""); - commandRemoveVoidMemset << "sed -i 's/void [*]memset(void[*], int, size_t);/ / g' " - << " " << programHash << "-preprocessed.c "; + commandRemoveVoidMemset + << "sed -i 's/void [*]memset(void[*], int, size_t);/ / g' " + << " " << programHash << "-preprocessed.c "; // Map2Check::Log::Info(commandRemoveExternMemset.str().c_str()); system(commandRemoveVoidMemset.str().c_str()); std::ostringstream commandRemoveVoidMemcpy; commandRemoveVoidMemcpy.str(""); - commandRemoveVoidMemcpy << "sed -i 's/void [*]memcpy(void[*], const void [*], size_t);/ / g' " - << " " << programHash << "-preprocessed.c "; + commandRemoveVoidMemcpy + << "sed -i 's/void [*]memcpy(void[*], const void [*], size_t);/ / g' " + << " " << programHash << "-preprocessed.c "; // Map2Check::Log::Info(commandRemoveExternMemset.str().c_str()); system(commandRemoveVoidMemcpy.str().c_str()); - // (2) Generate .bc file from code // TODO(hbgit): -Winteger-overflow should be called only if is on overflow // mode CLANG PATH @@ -543,12 +735,8 @@ void Caller::compileToCrabLlvm() { std::ostringstream tmp_ld_p; tmp_ld_p << getenv("LD_LIBRARY_PATH"); - - getPathLibCrabCommand << "LD_LIBRARY_PATH=" - << tmp_ld_p.str().c_str() - << ":" - << getMapPath.str().c_str() - << "/bin/crabllvm/lib"; + getPathLibCrabCommand << "LD_LIBRARY_PATH=" << tmp_ld_p.str().c_str() << ":" + << getMapPath.str().c_str() << "/bin/crabllvm/lib"; // std::ostringstream tmp_ld; // tmp_ld << getenv("LD_LIBRARY_PATH"); @@ -564,7 +752,7 @@ void Caller::compileToCrabLlvm() { std::ostringstream command; command.str(""); command << Map2Check::crabBinary << " -o " << compiledFile - << " -m 64 -g --crab-disable-warnings --disable-lower-gv " + << " -m 64 -g --crab-disable-warnings " "--llvm-pp-loops --crab-promote-assume --crab-inter " "--crab-track=num --crab-add-invariants=block-entry " << " " << programHash << "-preprocessed.c "; diff --git a/modules/frontend/caller.hpp b/modules/frontend/caller.hpp index 923ac32b9..9a0ca5228 100755 --- a/modules/frontend/caller.hpp +++ b/modules/frontend/caller.hpp @@ -58,7 +58,7 @@ class Caller { std::string currentPath; unsigned timeout; bool gotTimeout = false; - bool witnessVerified = false; + bool witnessVerified = false; public: /** @brief Constructor if .bc file already exists @@ -67,10 +67,14 @@ class Caller { NonDetGenerator generator); std::string c_program_fullpath; //!< Path for the original c program */ + bool pthreadCheck = false; void setTimeout(unsigned timeout) { this->timeout = timeout; } /** @brief Function to compile original C file removing external memory * operations calls */ void compileCFile(bool is_llvm_bc); + + // Apply Cseq and return the file new from cseq output + std::string applyCSeqTransformation(std::string preprocessed_code); void compileToCrabLlvm(); @@ -81,6 +85,17 @@ class Caller { * @param sv_comp boolean representing if should use sv-comp rules */ int callPass(std::string target_function = "", bool sv_comp = false); + /** + * Identify if the analyzed code has nondet call funct, + * thus avoiding call nondet generators. + * */ + int checkNondetFunctPass(); + + std::ostringstream resetCmdPass(); + + /**To support CSeq-Lazy execution for concurrency**/ + void applyInitVar2NondetFunctPass(std::string in_path_bc_program, std::string out_path_bc_program); + /** Link functions called after executing the passes */ void linkLLVM(); diff --git a/modules/frontend/map2check.cpp b/modules/frontend/map2check.cpp index c53d0ee6d..520479717 100644 --- a/modules/frontend/map2check.cpp +++ b/modules/frontend/map2check.cpp @@ -10,7 +10,8 @@ * STP,Z3 -> MIT * BOOST -> BSL-1.0 * - * SPDX-License-Identifier: (GPL-2.0 AND Apache-2.0 AND NCSA AND MIT AND BSL-1.0) + * SPDX-License-Identifier: (GPL-2.0 AND Apache-2.0 AND NCSA AND MIT AND + *BSL-1.0) * **/ @@ -33,7 +34,7 @@ namespace po = boost::program_options; namespace fs = boost::filesystem; -#define Map2CheckVersion "v7.3.1-Flock : Wed Nov 27 20:38:14 UTC 2019" +#define Map2CheckVersion "v8.0.0-Fractal : Fri Jul 3 18:13:20 UTC 2020" // TODO(hbgit): should get preprocessor flags from CMake @@ -156,6 +157,7 @@ struct map2check_args { bool generateTestCase = false; bool printCounterExample = false; bool btree = false; + bool concurrent = false; bool invCrabLlvm = false; Map2Check::NonDetGenerator generator; std::string spectTrue = "safetyMemory"; @@ -195,11 +197,17 @@ int map2check_execution(map2check_args args) { generator); caller->c_program_fullpath = args.inputFile; caller->setTimeout(args.timeout); + caller->pthreadCheck = args.concurrent; if (!is_llvmir_in) { if (args.invCrabLlvm) { // cout << "crab \n"; - caller->compileToCrabLlvm(); + if (args.generator != Map2Check::NonDetGenerator::LibFuzzer) { + caller->compileToCrabLlvm(); + } else { + caller->compileCFile(is_llvmir_in); + } + } else { caller->compileCFile(is_llvmir_in); } @@ -207,11 +215,40 @@ int map2check_execution(map2check_args args) { caller->compileCFile(is_llvmir_in); } + /** + * For Cseq is necessary some code transformation, e.g., all variable + * not initialize on main function need to be initialized with nondet values + * Checkout example: ./map2check --debug --target-function --smt-solver z3 + * ../samples/map2check-preprocessed.c.cseq.c + * + * */ + // (1) In the main function the variables not initialized will be assigned + // with nondet values + + // Add function to indentify if the + // code has a nondet call + int hasNonDetFunct = caller->checkNondetFunctPass(); + + if (hasNonDetFunct == 0 && + generator == Map2Check::NonDetGenerator::LibFuzzer) { + Map2Check::Log::Info("NOTE: No call nondet functions for LibFuzzer"); + // set the result UNKNOW for libfuzzer + foundViolation = false; + // clean tmp files + Map2Check::Log::Debug("Removing temp files"); + caller->cleanGarbage(); + // return SUCCESS + Map2Check::Log::Debug("Jumping to verify with KLEE"); + return SUCCESS; + } + if (args.btree) { caller->useBTree(); } // (2) Instrument functions for current mode + // TODO: BUG on Adding reachability pass, cuz cseq output had not label + // __VERIFIER_ERROR() caller->callPass(args.function); caller->linkLLVM(); @@ -231,11 +268,14 @@ int map2check_execution(map2check_args args) { if (caller->isTimeout()) { Map2Check::Log::Warning("Note: Forcing timeout"); propertyViolated = Map2Check::PropertyViolated::UNKNOWN; - } else if (!caller->isVerified() && - (generator == Map2Check::NonDetGenerator::LibFuzzer)) { + } + // WHY this? + /*else if (!caller->isVerified() && + (generator == Map2Check::NonDetGenerator::LibFuzzer)) { Map2Check::Log::Warning("Note: Could not replicate error"); propertyViolated = Map2Check::PropertyViolated::UNKNOWN; - } else { + } */ + else { propertyViolated = counterExample->getProperty(); } @@ -274,8 +314,8 @@ int map2check_execution(map2check_args args) { } // (6) Clean map2check execution (folders and temp files) - Map2Check::Log::Debug("Removing temp files"); - caller->cleanGarbage(); + // Map2Check::Log::Debug("Removing temp files"); + // caller->cleanGarbage(); if (args.expectedResult != "") { if (args.expectedResult != counterExample->getViolatedProperty()) { @@ -292,28 +332,30 @@ int main(int argc, char **argv) { try { // Define and parse the program options po::options_description desc("Options"); - desc.add_options()("help", "\tshow help") - ("version", "\tprints map2check version") - ("debug", "\tdebug mode") - ("input-file", po::value>(), - "\tspecifies the files") - ("smt-solver", po::value()->default_value("z3"), - R"(specifies the smt-solver, valid values are stp (STP), -z3 (Z3 is default), btor (Boolector), and yices2 (Yices))") - ("timeout", po::value(), - "\ttimeout for map2check execution") - ("target-function", "\tsearches for __VERIFIER_error is reachable") - ("generate-testcase", "\tcreates c program with fail testcase (experimental)") - ("memtrack", "\tcheck for memory errors") - ("print-counter", "\tprint counterexample") - ("memcleanup-property", "\tanalyze program for memcleanup errors") - ("check-overflow", "\tanalyze program for overflow failures") - ("check-asserts", "\tanalyze program and verify assert failures") - ("add-invariants", "\tadding program invariants adopting Crab-LLVM") - ("generate-witness", "\tgenerates witness file") - ("expected-result", po::value(), "\tspecifies type of violation expected") - ("btree", "\tuses btree structure to hold information (experimental, use this " - "if you are having memory problems)"); + desc.add_options()("help", "\tshow help")( + "version", "\tprints map2check version")("debug", "\tdebug mode")( + "input-file", po::value>(), + "\tspecifies the files")( + "smt-solver", po::value()->default_value("z3"), + R"(specifies the smt-solver, valid values are stp (STP), +z3 (Z3 is default), btor (Boolector), and yices2 (Yices))")( + "timeout", po::value(), "\ttimeout for map2check execution")( + "target-function", "\tsearches for __VERIFIER_error is reachable")( + "generate-testcase", + "\tcreates c program with fail testcase (experimental)")( + "memtrack", "\tcheck for memory errors")( + "memcleanup-property", "\tanalyze program for memcleanup errors")( + "check-overflow", "\tanalyze program for overflow failures")( + "check-asserts", "\tanalyze program and verify assert failures")( + "check-threads", "\tanalyze concurrent programs with POSIX threads")( + "print-counter", "\tprint counterexample")( + "add-invariants", "\tadding program invariants adopting Crab-LLVM")( + "generate-witness", "\tgenerates witness file") + //("expected-result", po::value(), "\tspecifies type of + //violation expected") + ("btree", + "\tuses btree structure to hold information (experimental, use this " + "if you are having memory problems)"); po::positional_options_description p; p.add("input-file", -1); @@ -346,13 +388,12 @@ z3 (Z3 is default), btor (Boolector), and yices2 (Yices))") } if (vm.count("smt-solver")) { string solvername = vm["smt-solver"].as(); - std::transform(solvername.begin(), solvername.end(), - solvername.begin(), [](unsigned char c){ - return std::tolower(c); }); + std::transform(solvername.begin(), solvername.end(), solvername.begin(), + [](unsigned char c) { return std::tolower(c); }); std::vector vSolver = {"z3", "stp", "btor", "yices2"}; - if ( !std::count(vSolver.begin(), vSolver.end(), solvername) ) { + if (!std::count(vSolver.begin(), vSolver.end(), solvername)) { std::cout << "Solver not supported.\n\n"; std::cout << desc; return ERROR_IN_COMMAND_LINE; @@ -383,6 +424,9 @@ z3 (Z3 is default), btor (Boolector), and yices2 (Yices))") if (vm.count("check-asserts")) { args.mode = Map2Check::Map2CheckMode::ASSERT_MODE; } + if (vm.count("check-threads")) { + args.concurrent = true; + } if (vm.count("memcleanup-property")) { args.mode = Map2Check::Map2CheckMode::MEMCLEANUP_MODE; } @@ -418,11 +462,19 @@ z3 (Z3 is default), btor (Boolector), and yices2 (Yices))") // std::cout << pathfile << std::endl; fs::path absolute_path = fs::absolute(pathfile); args.inputFile = absolute_path.string(); - args.generator = Map2Check::NonDetGenerator::LibFuzzer; - map2check_execution(args); + + if (!args.concurrent) { + args.generator = Map2Check::NonDetGenerator::LibFuzzer; + map2check_execution(args); + Map2Check::Log::Debug("Finished LibFuzzer execution"); + } + + exit(0); + if (!foundViolation) { args.generator = Map2Check::NonDetGenerator::Klee; map2check_execution(args); + exit(1); } } } catch (std::exception &e) { diff --git a/modules/frontend/utils/afl.cpp b/modules/frontend/utils/afl.cpp deleted file mode 100644 index 7370af3c4..000000000 --- a/modules/frontend/utils/afl.cpp +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Copyright (C) 2014 - 2019 Map2Check tool - * This file is part of the Map2Check tool, and is made available under - * the terms of the GNU General Public License version 2. - * - * SPDX-License-Identifier: (GPL-2.0 AND Apache-2.0) - **/ - -#include "afl.hpp" - -#include -#include - -void Map2Check::AFL_COMPILE::setPath(std::string path) { - std::ostringstream cnvt; - cnvt.str(""); - cnvt << path; - cnvt << "afl-clang"; - this->afl_clang = cnvt.str(); -} - -std::string Map2Check::AFL_COMPILE::getCommand() { - std::ostringstream cnvt; - cnvt.str(""); - cnvt << this->afl_clang; - if (compileTo32Bits) { - cnvt << " -m32"; - } - - return cnvt.str(); -} - -void Map2Check::AFL_EXEC::setPath(std::string path) { - std::ostringstream cnvt; - cnvt.str(""); - cnvt << path; - cnvt << "afl-fuzz"; - this->afl_fuzz = cnvt.str(); -} - -void Map2Check::AFL_EXEC::setTimeout(u_int32_t timeout) { - this->timeout = timeout; -} - -void Map2Check::AFL_EXEC::setBenchUntilCrash(bool isOn) { - this->benchUntilCrash = isOn; -} - -void Map2Check::AFL_EXEC::setSkipCpuFreq(bool isOn) { - this->skipCpuFreq = isOn; -} - -std::string Map2Check::AFL_EXEC::getCommand() { - std::ostringstream cnvt; - cnvt.str(""); - - if (benchUntilCrash) { - cnvt << "AFL_BENCH_UNTIL_CRASH=1 "; - } - - if (skipCpuFreq) { - cnvt << "AFL_SKIP_CPUFREQ=1 "; - } - - if (timeout != 0) { - cnvt << "timeout " << timeout << " "; - } - - cnvt << afl_fuzz; - return cnvt.str(); -} diff --git a/modules/frontend/utils/afl.hpp b/modules/frontend/utils/afl.hpp deleted file mode 100644 index e1b21b9b1..000000000 --- a/modules/frontend/utils/afl.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/** - * Copyright (C) 2014 - 2019 Map2Check tool - * This file is part of the Map2Check tool, and is made available under - * the terms of the GNU General Public License version 2. - * - * SPDX-License-Identifier: (GPL-2.0 AND Apache-2.0) - **/ - -#ifndef MODULES_FRONTEND_UTILS_AFL_HPP_ -#define MODULES_FRONTEND_UTILS_AFL_HPP_ - -#include -#include -#include - -#include - -namespace Map2Check { - -class AFL_COMPILE { - private: - /** Current afl_clang command (with path) */ - std::string afl_clang; - bool compileTo32Bits; - - public: - /** Default constructor */ - AFL_COMPILE() {} - /** - * Return afl-clang command - * @return Returns a string with afl-clang command - */ - std::string getCommand(); - void setCompileTo32Bits(bool isOn) { this->compileTo32Bits = isOn; } - /** - * Set path for current afl-clang binary folder - * @param String with path - */ - void setPath(std::string path); -}; - -class AFL_EXEC { - private: - /** Current afl_fuzz command (with path) */ - std::string afl_fuzz; - /** Timeout for AFL execution */ - u_int32_t timeout = 0; - /** Stop on crash */ - bool benchUntilCrash = false; - /** Skip AFL verification */ - bool skipCpuFreq = false; - - public: - AFL_EXEC() {} - void setPath(std::string path); - void setTimeout(u_int32_t timeout); - void setBenchUntilCrash(bool isOn); - void setSkipCpuFreq(bool isOn); - std::string getCommand(); -}; - -class AFL { - protected: - std::unique_ptr executor; - std::unique_ptr compiler; - - public: - explicit AFL(std::string path) { - this->compiler = boost::make_unique(); - this->compiler->setPath(path); - - this->executor = boost::make_unique(); - this->executor->setPath(path); - } - std::string getCompilerCommand() { return compiler->getCommand(); } - std::string getExecutionCommand() { return executor->getCommand(); } -}; - -class AFL_MAP2CHECK : public AFL { - public: - AFL_MAP2CHECK() : AFL("custom_path/") { - this->compiler->setCompileTo32Bits(true); - this->executor->setBenchUntilCrash(true); - this->executor->setSkipCpuFreq(true); - this->executor->setTimeout(180); - } -}; -} // namespace Map2Check - -#endif // MODULES_FRONTEND_UTILS_AFL_HPP_ diff --git a/modules/frontend/utils/clang.hpp b/modules/frontend/utils/clang.hpp deleted file mode 100644 index a0577d2b8..000000000 --- a/modules/frontend/utils/clang.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Copyright (C) 2014 - 2019 Map2Check tool - * This file is part of the Map2Check tool, and is made available under - * the terms of the GNU General Public License version 2. - * - * SPDX-License-Identifier: (GPL-2.0 AND Apache-2.0) - **/ - -#ifndef MODULES_FRONTEND_UTILS_CLANG_HPP_ -#define MODULES_FRONTEND_UTILS_CLANG_HPP_ - -#include -#include - -namespace Map2Check { - -inline std::string GenerateIRCode(std::string clang_path, - std::string include_dir, - std::string program) { - std::ostringstream command; - command.str(""); - - command << clang_path << "clang -c -emit-llvm " - << "-I " << include_dir << " " << program; - - return command.str(); -} - -inline std::string LinkIR(std::string opt_path, std::string ir_program); - -} // namespace Map2Check - -#endif // MODULES_FRONTEND_UTILS_CLANG_HPP_ diff --git a/modules/frontend/utils/log.cpp b/modules/frontend/utils/log.cpp index 2ca252503..f5cd4a4b6 100644 --- a/modules/frontend/utils/log.cpp +++ b/modules/frontend/utils/log.cpp @@ -21,11 +21,11 @@ void Log::Warning(std::string msg) { } void Log::Debug(std::string msg) { - if (isDebugMode) std::cout << "\033[0;33m" << msg << "\033[0m\n"; + if (isDebugMode) std::cout << "\033[0;33m" << ">> " << msg << "\033[0m\n"; } void Log::Info(std::string msg) { - std::cout << "\033[0;32m" << msg << "\033[0m\n"; + std::cout << "\033[0;32m" << "- " << msg << "\033[0m\n"; } void Log::Fatal(std::string msg) { diff --git a/modules/frontend/utils/tools.cpp b/modules/frontend/utils/tools.cpp index 4e19b451b..e194bdd81 100755 --- a/modules/frontend/utils/tools.cpp +++ b/modules/frontend/utils/tools.cpp @@ -42,7 +42,7 @@ Tools::SourceCodeHelper::SourceCodeHelper(std::string pathToCSource) { // throw Map2Check::Exceptions::ErrorOpeningFileException(pathToCSource); } - Map2Check::Log::Debug(*this); + // Map2Check::Log::Debug(*this); } std::string Tools::SourceCodeHelper::getFilePath() { return this->path; } @@ -272,7 +272,7 @@ std::vector Tools::KleeLogHelper::getListLogFromCSV( boost::split(tokens, line, boost::is_any_of(";")); if (tokens.size() == 7) { - Log::Debug("started klee log"); + Log::Debug("Started klee log"); Tools::KleeLogRow row; string id = tokens[0]; string lineNumber = tokens[1]; diff --git a/modules/frontend/utils/tools.hpp b/modules/frontend/utils/tools.hpp index 1068a299b..77f2140e0 100755 --- a/modules/frontend/utils/tools.hpp +++ b/modules/frontend/utils/tools.hpp @@ -35,12 +35,18 @@ constexpr char const* ktestBinary = "${MAP2CHECK_PATH}/bin/ktest-tool"; constexpr char const* clangBinary = "${MAP2CHECK_PATH}/bin/clang"; /** Path to crab-llvm path binary (from crab-llvm) */ constexpr char const* crabBinary = - "${MAP2CHECK_PATH}/bin/crabllvm/bin/crabllvm.py"; + "${MAP2CHECK_PATH}/bin/crabllvm/bin/clam.py"; +/** Path to CSeq path */ +constexpr char const* cseqPath = + "/bin/cseq-1.9/"; +/** Path to CSeq path binary */ +constexpr char const* cseqBinary = + "cseq.py"; /** Path to clang include folder (usually * $(PATH_TO_CLANG)/lib/clang/$(LLVM_VERSION)/include) */ constexpr char const* clangIncludeFolder = "${MAP2CHECK_PATH}/include/"; /** Path to generated list log file (check MemoryUtils implementation) */ -constexpr char const* listLogCSV = "list_log.csv"; +constexpr char const* listLogCSV = "list_mem_log.csv"; /** Path to klee binary */ constexpr char const* kleeBinary = "${MAP2CHECK_PATH}/bin/klee"; /** Path to generated klee log file (check MemoryUtils implementation) */ @@ -85,27 +91,7 @@ struct CheckViolatedProperty { * Reads file and initializes the object * @param path File describing the property */ - explicit CheckViolatedProperty(std::string path); - - // operator std::string() const { - // std::ostringstream cnvt; - // cnvt.str(""); - // // cnvt <<"Function: " << this->function_name; - // switch(this->propertyViolated) { - // case(PropertyViolated::FALSE_FREE): - // cnvt << "FALSE-FREE: Operand of free must have zero pointer - // offset"; break; - // case(PropertyViolated::TARGET_REACHED): - // //TODO(hbgit): Add message for target reached - // cnvt << "FALSE: Target Reached"; - // break; - // case(PropertyViolated::NONE) { - // cnvt << "TRUE"; - // break; - // } - // } - // return cnvt.str(); - // } + explicit CheckViolatedProperty(std::string path); /** * Reads default file and initializes the object diff --git a/samples/cdaudio_simpl1.cil-1.c b/samples/cdaudio_simpl1.cil-1.c new file mode 100644 index 000000000..a4733ccee --- /dev/null +++ b/samples/cdaudio_simpl1.cil-1.c @@ -0,0 +1,2152 @@ +extern void abort(void); +void reach_error(){} + +extern char __VERIFIER_nondet_char(void); +extern int __VERIFIER_nondet_int(void); +extern long __VERIFIER_nondet_long(void); + +int SendSrbSynchronous(int Extension , int Srb , int Buffer , int BufferLength ); +int CdAudioSignalCompletion(int DeviceObject , int Irp , int Event ); +int CdAudioStartDevice(int DeviceObject , int Irp ); +int CdAudioPnp(int DeviceObject , int Irp ); +int CdAudioDeviceControl(int DeviceObject , int Irp ); +int CdAudioSendToNextDriver(int DeviceObject , int Irp ); +int CdAudioIsPlayActive(int DeviceObject ); +int CdAudio535DeviceControl(int DeviceObject , int Irp ); +int AG_SetStatusAndReturn(int status , int Irp , int deviceExtension__TargetDeviceObject ); +int CdAudio435DeviceControl(int DeviceObject , int Irp ); +int CdAudioAtapiDeviceControl(int DeviceObject , int Irp ); +int HPCdrCompletion(int DeviceObject , int Irp , int Context ); +int CdAudioHPCdrDeviceControl(int DeviceObject , int Irp ); +int CdAudioForwardIrpSynchronous(int DeviceObject , int Irp ); +int CdAudioPower(int DeviceObject , int Irp ); +int IofCallDriver(int DeviceObject , int Irp ); +int KeSetEvent(int Event , int Increment , int Wait ); +int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , + int Timeout ); +int PoCallDriver(int DeviceObject , int Irp ); +int ZwClose(int Handle ); +void IofCompleteRequest(int Irp , int PriorityBoost ) ; +int __VERIFIER_nondet_int() ; +int s ; +int UNLOADED ; +int NP ; +int DC ; +int SKIP1 ; +int SKIP2 ; +int MPR1 ; +int MPR3 ; +int IPC ; +int pended ; +int compFptr ; +int compRegistered ; +int lowerDriverReturn ; +int setEventCalled ; +int customIrp ; +int routine ; +int myStatus ; +int pirp ; +int Executive ; +int Suspended ; +int KernelMode ; +int DeviceUsageTypePaging ; + +void errorFn(void) +{ + + { + ERROR: {reach_error();abort();} + return; +} +} +void _BLAST_init(void) +{ + + { + UNLOADED = 0; + NP = 1; + DC = 2; + SKIP1 = 3; + SKIP2 = 4; + MPR1 = 5; + MPR3 = 6; + IPC = 7; + s = UNLOADED; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + return; +} +} +int SendSrbSynchronous(int Extension , int Srb , int Buffer , int BufferLength ) +{ int ioStatus__Status = __VERIFIER_nondet_int() ; + int ioctl ; + int event = __VERIFIER_nondet_int() ; + int irp ; + int status = __VERIFIER_nondet_int() ; + int __cil_tmp10 ; + int __cil_tmp11 ; + int __cil_tmp12 ; + int __cil_tmp13 ; + int __cil_tmp14 ; + int __cil_tmp15 ; + int __cil_tmp16 ; + int __cil_tmp17 ; + long __cil_tmp18 ; + + { + irp = 0; + if (Buffer) { + __cil_tmp10 = 4116; + __cil_tmp11 = 49152; + __cil_tmp12 = 262144; + __cil_tmp13 = 311296; + ioctl = 315412; + } else { + __cil_tmp14 = 4100; + __cil_tmp15 = 49152; + __cil_tmp16 = 262144; + __cil_tmp17 = 311296; + ioctl = 315396; + } + if (! irp) { + return (-1073741670); + } + { + __cil_tmp18 = (long )status; + if (__cil_tmp18 == 259L) { + { + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + status = ioStatus__Status; + } + } + } + return (status); +} +} +int CdAudioSignalCompletion(int DeviceObject , int Irp , int Event ) +{ + + { + { + KeSetEvent(Event, 0, 0); + } + return (-1073741802); +} +} +int CdAudioStartDevice(int DeviceObject , int Irp ) +{ int deviceExtension__Active = __VERIFIER_nondet_int() ; + int deviceExtension = __VERIFIER_nondet_int() ; + int status ; + int srb = __VERIFIER_nondet_int() ; + int srb__Cdb = __VERIFIER_nondet_int() ; + int cdb ; + int inquiryDataPtr ; + int attempt ; + int tmp ; + int deviceParameterHandle = __VERIFIER_nondet_int() ; + int keyValue ; + { + { + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } + { + if (status < 0) { + return (status); + } + } + if (deviceExtension__Active == 255) { + cdb = srb__Cdb; + inquiryDataPtr = 0; + attempt = 0; + if (! inquiryDataPtr) { + deviceExtension__Active = 0; + return (0); + } + status = -1073741823; + { + while (1) { + while_0_continue: /* CIL Label */ ; + + { + if (status < 0) { + tmp = attempt; + attempt ++; + if (tmp >= 4) { + goto while_0_break_1; + } + } else { + goto while_0_break_1; + } + } + { + status = SendSrbSynchronous(deviceExtension, srb, inquiryDataPtr, 36); + } + } + while_0_break: /* CIL Label */ ; + } + while_0_break_1: ; + { + if (status < 0) { + deviceExtension__Active = 0; + return (0); + } + } + deviceExtension__Active = 0; + } + keyValue = deviceExtension__Active; + { + if (status < 0) { + return (0); + } + } + { + if (status < 0) { + + } + } + { + ZwClose(deviceParameterHandle); + } + return (0); +} +} +int CdAudioPnp(int DeviceObject , int Irp ) +{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; + int irpSp__MinorFunction = __VERIFIER_nondet_int() ; + int Irp__IoStatus__Status ; + int irpSp__Parameters__UsageNotification__Type = __VERIFIER_nondet_int() ; + int deviceExtension__PagingPathCountEvent = __VERIFIER_nondet_int() ; + int irpSp__Parameters__UsageNotification__InPath = __VERIFIER_nondet_int() ; + int deviceExtension__PagingPathCount = __VERIFIER_nondet_int() ; + int DeviceObject__Flags ; + int irpSp ; + int status ; + int setPagable ; + int tmp ; + int tmp___0 ; + + { + irpSp = Irp__Tail__Overlay__CurrentStackLocation; + status = -1073741637; + if (irpSp__MinorFunction == 0) { + goto switch_1_0; + } else { + if (irpSp__MinorFunction == 22) { + goto switch_1_22; + } else { + goto switch_1_default; + if (0) { + switch_1_0: + { + status = CdAudioStartDevice(DeviceObject, Irp); + Irp__IoStatus__Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + switch_1_22: ; + if (irpSp__Parameters__UsageNotification__Type != DeviceUsageTypePaging) { + { + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp); + } + { + status = KeWaitForSingleObject(deviceExtension__PagingPathCountEvent, Executive, + KernelMode, 0, 0); + setPagable = 0; + } + if (irpSp__Parameters__UsageNotification__InPath) { + if (deviceExtension__PagingPathCount != 1) { + goto _L; + } + } else { + _L: + if (status == status) { + //DeviceObject__Flags |= 8192; + setPagable = 1; + } + } + { + status = CdAudioForwardIrpSynchronous(DeviceObject, Irp); + } + if (status >= 0) { + if (irpSp__Parameters__UsageNotification__InPath) { + + } + if (irpSp__Parameters__UsageNotification__InPath) { + if (deviceExtension__PagingPathCount == 1) { + //DeviceObject__Flags &= -8193; + } + } + } else { + if (setPagable == 1) { + //DeviceObject__Flags &= -8193; + setPagable = 0; + } + } + { + KeSetEvent(deviceExtension__PagingPathCountEvent, 0, 0); + IofCompleteRequest(Irp, 0); + } + return (status); + goto switch_1_break; + switch_1_default: + { + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___0); + } else { + switch_1_break: ; + } + } + } + return (0); +} +} +int CdAudioDeviceControl(int DeviceObject , int Irp ) +{ int deviceExtension__Active = __VERIFIER_nondet_int() ; + int status ; + + { + if (deviceExtension__Active == 2) { + goto switch_2_2; + } else { + if (deviceExtension__Active == 3) { + goto switch_2_3; + } else { + if (deviceExtension__Active == 1) { + goto switch_2_1; + } else { + if (deviceExtension__Active == 7) { + goto switch_2_7; + } else { + goto switch_2_default; + if (0) { + switch_2_2: + { + status = CdAudio535DeviceControl(DeviceObject, Irp); + } + goto switch_2_break; + switch_2_3: + { + status = CdAudio435DeviceControl(DeviceObject, Irp); + } + goto switch_2_break; + switch_2_1: + { + status = CdAudioAtapiDeviceControl(DeviceObject, Irp); + } + goto switch_2_break; + switch_2_7: + { + status = CdAudioHPCdrDeviceControl(DeviceObject, Irp); + } + goto switch_2_break; + switch_2_default: + { + deviceExtension__Active = 0; + status = CdAudioSendToNextDriver(DeviceObject, Irp); + } + } else { + switch_2_break: ; + } + } + } + } + } + return (status); +} +} +int CdAudioSendToNextDriver(int DeviceObject , int Irp ) +{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; + int tmp ; + + { + if (s == NP) { + s = SKIP1; + } else { + { + errorFn(); + } + } + { + Irp__CurrentLocation ++; + Irp__Tail__Overlay__CurrentStackLocation ++; + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } + return (tmp); +} +} +int CdAudioIsPlayActive(int DeviceObject ) +{ int deviceExtension__PlayActive = __VERIFIER_nondet_int() ; + int ioStatus__Status = __VERIFIER_nondet_int() ; + int currentBuffer__Header__AudioStatus = __VERIFIER_nondet_int() ; + int irp_CdAudioIsPlayActive = __VERIFIER_nondet_int() ; + int event = __VERIFIER_nondet_int() ; + int status = __VERIFIER_nondet_int() ; + int currentBuffer = __VERIFIER_nondet_int() ; + int returnValue ; + long __cil_tmp10 ; + int __cil_tmp11 ; + + { + if (! deviceExtension__PlayActive) { + return (0); + } + if (currentBuffer == 0) { + return (0); + } + if (irp_CdAudioIsPlayActive == 0) { + return (0); + } + { + __cil_tmp10 = (long )status; + if (__cil_tmp10 == 259L) { + { + KeWaitForSingleObject(event, Suspended, KernelMode, 0, 0); + status = ioStatus__Status; + } + } + } + { + if (status < 0) { + return (0); + } + } + if (currentBuffer__Header__AudioStatus == 17) { + returnValue = 1; + } else { + returnValue = 0; + deviceExtension__PlayActive = 0; + } + return (returnValue); +} +} +int CdAudio535DeviceControl(int DeviceObject , int Irp ) +{ int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; + int DeviceObject__DeviceExtension = __VERIFIER_nondet_int() ; + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; + int srb__Cdb = __VERIFIER_nondet_int() ; + int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; + int Irp__IoStatus__Information ; + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; + int srb__CdbLength ; + int cdb__CDB10__OperationCode ; + int srb__TimeOutValue ; + int sizeof__READ_CAPACITY_DATA = __VERIFIER_nondet_int() ; + int lastSession__LogicalBlockAddress = __VERIFIER_nondet_int() ; + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; + int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; + int userPtr__Format = __VERIFIER_nondet_int() ; + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; + int inputBuffer__StartingM = __VERIFIER_nondet_int() ; + int inputBuffer__EndingM = __VERIFIER_nondet_int() ; + int inputBuffer__StartingS = __VERIFIER_nondet_int() ; + int inputBuffer__EndingS = __VERIFIER_nondet_int() ; + int inputBuffer__StartingF = __VERIFIER_nondet_int() ; + int inputBuffer__EndingF = __VERIFIER_nondet_int() ; + int cdb__PLAY_AUDIO_MSF__OperationCode = __VERIFIER_nondet_int() ; + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; + int currentIrpStack ; + int deviceExtension ; + int cdaudioDataOut ; + int srb = __VERIFIER_nondet_int() ; + int lastSession = __VERIFIER_nondet_int() ; + int cdb ; + int status ; + int i = __VERIFIER_nondet_int() ; + int bytesTransfered = __VERIFIER_nondet_int() ; + int Toc = __VERIFIER_nondet_int() ; + int tmp ; + int tmp___0 ; + int tmp___1 ; + int tmp___2 ; + int tmp___3 ; + int tmp___4 ; + int tracksToReturn ; + int tracksOnCd ; + int tracksInBuffer ; + int userPtr ; + int SubQPtr = __VERIFIER_nondet_int() ; + int tmp___5 ; + int tmp___6 ; + int inputBuffer ; + int inputBuffer___0 ; + int tmp___7 ; + int tmp___8 ; + int __cil_tmp58 ; + int __cil_tmp59 ; + int __cil_tmp60 ; + int __cil_tmp61 ; + int __cil_tmp62 ; + int __cil_tmp63 ; + int __cil_tmp64 ; + int __cil_tmp65 ; + int __cil_tmp66 ; + int __cil_tmp67 ; + int __cil_tmp68 ; + int __cil_tmp69 ; + int __cil_tmp70 ; + int __cil_tmp71 ; + int __cil_tmp72 ; + int __cil_tmp73 ; + int __cil_tmp74 ; + int __cil_tmp75 ; + int __cil_tmp76 ; + int __cil_tmp77 ; + int __cil_tmp78 ; + int __cil_tmp79 ; + int __cil_tmp80 ; + int __cil_tmp81 ; + int __cil_tmp82 ; + int __cil_tmp83 ; + int __cil_tmp84 ; + int __cil_tmp85 ; + int __cil_tmp86 ; + int __cil_tmp87 ; + int __cil_tmp88 ; + int __cil_tmp89 ; + int __cil_tmp90 ; + int __cil_tmp91 ; + int __cil_tmp92 ; + int __cil_tmp93 ; + int __cil_tmp94 ; + int __cil_tmp95 ; + int __cil_tmp96 ; + int __cil_tmp97 ; + int __cil_tmp98 ; + int __cil_tmp99 ; + int __cil_tmp100 ; + int __cil_tmp101 ; + int __cil_tmp102 ; + int __cil_tmp103 ; + int __cil_tmp104 ; + int __cil_tmp105 ; + int __cil_tmp106 ; + unsigned long __cil_tmp107 ; + unsigned long __cil_tmp108 ; + int __cil_tmp109 ; + int __cil_tmp110 ; + + { + currentIrpStack = Irp__Tail__Overlay__CurrentStackLocation; + deviceExtension = DeviceObject__DeviceExtension; + cdaudioDataOut = Irp__AssociatedIrp__SystemBuffer; + cdb = srb__Cdb; + { + __cil_tmp58 = 56; + __cil_tmp59 = 16384; + __cil_tmp60 = 131072; + __cil_tmp61 = 147456; + __cil_tmp62 = 147512; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { + goto switch_3_exp_0; + } else { + { + __cil_tmp63 = 16384; + __cil_tmp64 = 131072; + __cil_tmp65 = 147456; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp65) { + goto switch_3_exp_1; + } else { + { + __cil_tmp66 = 44; + __cil_tmp67 = 16384; + __cil_tmp68 = 131072; + __cil_tmp69 = 147456; + __cil_tmp70 = 147500; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp70) { + goto switch_3_exp_2; + } else { + { + __cil_tmp71 = 24; + __cil_tmp72 = 16384; + __cil_tmp73 = 131072; + __cil_tmp74 = 147456; + __cil_tmp75 = 147480; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp75) { + goto switch_3_exp_3; + } else { + { + __cil_tmp76 = 4; + __cil_tmp77 = 16384; + __cil_tmp78 = 131072; + __cil_tmp79 = 147456; + __cil_tmp80 = 147460; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp80) { + goto switch_3_exp_4; + } else { + { + __cil_tmp81 = 2056; + __cil_tmp82 = 16384; + __cil_tmp83 = 131072; + __cil_tmp84 = 147456; + __cil_tmp85 = 149512; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp85) { + goto switch_3_exp_5; + } else { + { + __cil_tmp86 = 52; + __cil_tmp87 = 16384; + __cil_tmp88 = 131072; + __cil_tmp89 = 147456; + __cil_tmp90 = 147508; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp90) { + goto switch_3_exp_6; + } else { + { + __cil_tmp91 = 20; + __cil_tmp92 = 16384; + __cil_tmp93 = 131072; + __cil_tmp94 = 147456; + __cil_tmp95 = 147476; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp95) { + goto switch_3_exp_7; + } else { + { + __cil_tmp96 = 40; + __cil_tmp97 = 16384; + __cil_tmp98 = 131072; + __cil_tmp99 = 147456; + __cil_tmp100 = 147496; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp100) { + goto switch_3_exp_8; + } else { + { + __cil_tmp101 = 2048; + __cil_tmp102 = 16384; + __cil_tmp103 = 131072; + __cil_tmp104 = 147456; + __cil_tmp105 = 149504; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp105) { + goto switch_3_exp_9; + } else { + goto switch_3_default; + if (0) { + switch_3_exp_0: + { + tmp = CdAudioIsPlayActive(DeviceObject); + } + if (tmp) { + status = -2147483631; + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + status = -1073741789; + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + if (lastSession == 0) { + { + status = -1073741670; + Irp__IoStatus__Information = 0; + tmp___0 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___0); + } + { + srb__CdbLength = 10; + cdb__CDB10__OperationCode = 38; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, lastSession, + sizeof__READ_CAPACITY_DATA); + } + { + if (status < 0) { + { + Irp__IoStatus__Information = 0; + tmp___1 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___1); + } else { + status = 0; + } + } + Irp__IoStatus__Information = bytesTransfered; + if (lastSession__LogicalBlockAddress == 0) { + goto switch_3_break; + } + cdaudioDataOut__FirstTrack = 1; + cdaudioDataOut__LastTrack = 2; + goto switch_3_break; + switch_3_exp_1: ; + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength) { + status = -1073741789; + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + { + tmp___2 = CdAudioIsPlayActive(DeviceObject); + } + if (tmp___2) { + status = -2147483631; + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + if (Toc == 0) { + { + status = -1073741670; + Irp__IoStatus__Information = 0; + tmp___3 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___3); + } + { + srb__TimeOutValue = 10; + srb__CdbLength = 10; + status = SendSrbSynchronous(deviceExtension, srb, Toc, sizeof__CDROM_TOC); + } + if (status >= 0) { + { + __cil_tmp107 = (unsigned long )status; + if (__cil_tmp107 != -1073741764) { + status = 0; + } else { + goto _L; + } + } + } else { + _L: + { + __cil_tmp108 = (unsigned long )status; + if (__cil_tmp108 != -1073741764) { + { + Irp__IoStatus__Information = 0; + tmp___4 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___4); + } + } + } + __cil_tmp109 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + tracksOnCd = __cil_tmp109 + 1; + tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + if (tracksInBuffer > tracksOnCd) { + i ++; + } + goto switch_3_break; + switch_3_exp_2: + userPtr = Irp__AssociatedIrp__SystemBuffer; + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + status = -1073741789; + Irp__IoStatus__Information = 0; + goto switch_3_break; + } + if (SubQPtr == 0) { + { + status = -1073741670; + Irp__IoStatus__Information = 0; + tmp___5 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___5); + } + if (userPtr__Format != 1) { + { + status = -1073741823; + Irp__IoStatus__Information = 0; + tmp___6 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___6); + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, + sizeof__SUB_Q_CURRENT_POSITION); + } + if (status >= 0) { + Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; + } else { + Irp__IoStatus__Information = 0; + } + goto switch_3_break; + switch_3_exp_3: + inputBuffer = Irp__AssociatedIrp__SystemBuffer; + Irp__IoStatus__Information = 0; + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + status = -1073741820; + goto switch_3_break; + } + if (inputBuffer__StartingM == inputBuffer__EndingM) { + if (inputBuffer__StartingS == inputBuffer__EndingS) { + if (inputBuffer__StartingF == inputBuffer__EndingF) { + + } + } + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + if (status >= 0) { + if (cdb__PLAY_AUDIO_MSF__OperationCode == 71) { + + } + } + goto switch_3_break; + switch_3_exp_4: + inputBuffer___0 = Irp__AssociatedIrp__SystemBuffer; + Irp__IoStatus__Information = 0; + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + status = -1073741820; + goto switch_3_break; + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + { + if (status < 0) { + + } + } + goto switch_3_break; + switch_3_exp_5: + { + Irp__IoStatus__Information = 0; + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + goto switch_3_break; + switch_3_exp_6: ; + switch_3_exp_7: ; + switch_3_exp_8: + Irp__IoStatus__Information = 0; + status = -1073741808; + goto switch_3_break; + switch_3_exp_9: + { + CdAudioIsPlayActive(DeviceObject); + } + switch_3_default: + { + tmp___7 = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___7); + goto switch_3_break; + } else { + switch_3_break: ; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + { + tmp___8 = AG_SetStatusAndReturn(status, Irp, deviceExtension__TargetDeviceObject); + } + return (tmp___8); +} +} +int AG_SetStatusAndReturn(int status , int Irp , int deviceExtension__TargetDeviceObject ) +{ unsigned long __cil_tmp4 ; + + { + { + __cil_tmp4 = (unsigned long )status; + if (__cil_tmp4 == -2147483626) { + + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); +} +} +int CdAudio435DeviceControl(int DeviceObject , int Irp ) +{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; + int currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength = __VERIFIER_nondet_int() ; + int currentIrpStack__Parameters__DeviceIoControl__InputBufferLength = __VERIFIER_nondet_int() ; + int TrackData__0 = __VERIFIER_nondet_int() ; + int Irp__IoStatus__Information ; + int srb__TimeOutValue ; + int srb__CdbLength ; + int sizeof__CDROM_TOC = __VERIFIER_nondet_int() ; + int cdaudioDataOut__LastTrack = __VERIFIER_nondet_int() ; + int cdaudioDataOut__FirstTrack = __VERIFIER_nondet_int() ; + int sizeof__CDROM_PLAY_AUDIO_MSF = __VERIFIER_nondet_int() ; + int sizeof__CDROM_SEEK_AUDIO_MSF = __VERIFIER_nondet_int() ; + int deviceExtension__Paused = __VERIFIER_nondet_int() ; + int deviceExtension__PlayActive ; + int sizeof__SUB_Q_CHANNEL_DATA = __VERIFIER_nondet_int() ; + int sizeof__SUB_Q_CURRENT_POSITION = __VERIFIER_nondet_int() ; + int deviceExtension = __VERIFIER_nondet_int() ; + int srb = __VERIFIER_nondet_int() ; + int status ; + int i = __VERIFIER_nondet_int() ; + int bytesTransfered ; + int Toc = __VERIFIER_nondet_int() ; + int tmp ; + int tracksToReturn ; + int tracksOnCd ; + int tracksInBuffer ; + int SubQPtr = __VERIFIER_nondet_int() ; + int userPtr__Format = __VERIFIER_nondet_int() ; + int SubQPtr___0 = __VERIFIER_nondet_int() ; + int tmp___0 ; + int tmp___1 ; + int tmp___2 ; + int __cil_tmp35 ; + int __cil_tmp36 ; + int __cil_tmp37 ; + int __cil_tmp38 ; + int __cil_tmp39 ; + int __cil_tmp40 ; + int __cil_tmp41 ; + int __cil_tmp42 ; + int __cil_tmp43 ; + int __cil_tmp44 ; + int __cil_tmp45 ; + int __cil_tmp46 ; + int __cil_tmp47 ; + int __cil_tmp48 ; + int __cil_tmp49 ; + int __cil_tmp50 ; + int __cil_tmp51 ; + int __cil_tmp52 ; + int __cil_tmp53 ; + int __cil_tmp54 ; + int __cil_tmp55 ; + int __cil_tmp56 ; + int __cil_tmp57 ; + int __cil_tmp58 ; + int __cil_tmp59 ; + int __cil_tmp60 ; + int __cil_tmp61 ; + int __cil_tmp62 ; + int __cil_tmp63 ; + int __cil_tmp64 ; + int __cil_tmp65 ; + int __cil_tmp66 ; + int __cil_tmp67 ; + int __cil_tmp68 ; + int __cil_tmp69 ; + int __cil_tmp70 ; + int __cil_tmp71 ; + int __cil_tmp72 ; + int __cil_tmp73 ; + int __cil_tmp74 ; + int __cil_tmp75 ; + int __cil_tmp76 ; + int __cil_tmp77 ; + int __cil_tmp78 ; + int __cil_tmp79 ; + int __cil_tmp80 ; + int __cil_tmp81 ; + int __cil_tmp82 ; + int __cil_tmp83 ; + int __cil_tmp84 ; + int __cil_tmp85 ; + int __cil_tmp86 ; + int __cil_tmp87 ; + int __cil_tmp88 ; + int __cil_tmp89 ; + int __cil_tmp90 ; + int __cil_tmp91 ; + int __cil_tmp92 ; + unsigned long __cil_tmp93 ; + int __cil_tmp94 ; + unsigned long __cil_tmp95 ; + unsigned long __cil_tmp96 ; + unsigned long __cil_tmp97 ; + int __cil_tmp98 ; + int __cil_tmp99 ; + int __cil_tmp100 ; + int __cil_tmp101 ; + int __cil_tmp102 ; + int __cil_tmp103 ; + unsigned long __cil_tmp104 ; + unsigned long __cil_tmp105 ; + unsigned long __cil_tmp106 ; + unsigned long __cil_tmp107 ; + int __cil_tmp108 ; + unsigned long __cil_tmp109 ; + int __cil_tmp110 ; + unsigned long __cil_tmp111 ; + unsigned long __cil_tmp112 ; + unsigned long __cil_tmp113 ; + unsigned long __cil_tmp114 ; + unsigned long __cil_tmp115 ; + unsigned long __cil_tmp116 ; + + { + { + __cil_tmp35 = 16384; + __cil_tmp36 = 131072; + __cil_tmp37 = 147456; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp37) { + goto switch_4_exp_10; + } else { + { + __cil_tmp38 = 24; + __cil_tmp39 = 16384; + __cil_tmp40 = 131072; + __cil_tmp41 = 147456; + __cil_tmp42 = 147480; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp42) { + goto switch_4_exp_11; + } else { + { + __cil_tmp43 = 8; + __cil_tmp44 = 16384; + __cil_tmp45 = 131072; + __cil_tmp46 = 147456; + __cil_tmp47 = 147464; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp47) { + goto switch_4_exp_12; + } else { + { + __cil_tmp48 = 4; + __cil_tmp49 = 16384; + __cil_tmp50 = 131072; + __cil_tmp51 = 147456; + __cil_tmp52 = 147460; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp52) { + goto switch_4_exp_13; + } else { + { + __cil_tmp53 = 12; + __cil_tmp54 = 16384; + __cil_tmp55 = 131072; + __cil_tmp56 = 147456; + __cil_tmp57 = 147468; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp57) { + goto switch_4_exp_14; + } else { + { + __cil_tmp58 = 16; + __cil_tmp59 = 16384; + __cil_tmp60 = 131072; + __cil_tmp61 = 147456; + __cil_tmp62 = 147472; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp62) { + goto switch_4_exp_15; + } else { + { + __cil_tmp63 = 44; + __cil_tmp64 = 16384; + __cil_tmp65 = 131072; + __cil_tmp66 = 147456; + __cil_tmp67 = 147500; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp67) { + goto switch_4_exp_16; + } else { + { + __cil_tmp68 = 2056; + __cil_tmp69 = 16384; + __cil_tmp70 = 131072; + __cil_tmp71 = 147456; + __cil_tmp72 = 149512; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp72) { + goto switch_4_exp_17; + } else { + { + __cil_tmp73 = 52; + __cil_tmp74 = 16384; + __cil_tmp75 = 131072; + __cil_tmp76 = 147456; + __cil_tmp77 = 147508; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp77) { + goto switch_4_exp_18; + } else { + { + __cil_tmp78 = 20; + __cil_tmp79 = 16384; + __cil_tmp80 = 131072; + __cil_tmp81 = 147456; + __cil_tmp82 = 147476; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp82) { + goto switch_4_exp_19; + } else { + { + __cil_tmp83 = 40; + __cil_tmp84 = 16384; + __cil_tmp85 = 131072; + __cil_tmp86 = 147456; + __cil_tmp87 = 147496; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp87) { + goto switch_4_exp_20; + } else { + { + __cil_tmp88 = 2048; + __cil_tmp89 = 16384; + __cil_tmp90 = 131072; + __cil_tmp91 = 147456; + __cil_tmp92 = 149504; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp92) { + goto switch_4_exp_21; + } else { + goto switch_4_default; + if (0) { + switch_4_exp_10: ; + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < TrackData__0) { + status = -1073741789; + Irp__IoStatus__Information = 0; + goto switch_4_break; + } + { + tmp = CdAudioIsPlayActive(DeviceObject); + } + if (tmp) { + status = -2147483631; + Irp__IoStatus__Information = 0; + goto switch_4_break; + } + if (Toc == 0) { + status = -1073741670; + Irp__IoStatus__Information = 0; + { + __cil_tmp93 = (unsigned long )status; + if (__cil_tmp93 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + { + srb__TimeOutValue = 10; + srb__CdbLength = 10; + status = SendSrbSynchronous(deviceExtension, srb, Toc, + sizeof__CDROM_TOC); + } + { + if (status < 0) { + { + __cil_tmp95 = (unsigned long )status; + if (__cil_tmp95 != -1073741764) { + { + __cil_tmp96 = (unsigned long )status; + if (__cil_tmp96 != -1073741764) { + { + __cil_tmp97 = (unsigned long )status; + if (__cil_tmp97 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + } + } else { + status = 0; + } + } + } else { + status = 0; + } + } + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength > sizeof__CDROM_TOC) { + bytesTransfered = sizeof__CDROM_TOC; + } else { + bytesTransfered = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength; + } + __cil_tmp98 = cdaudioDataOut__LastTrack - cdaudioDataOut__FirstTrack; + tracksOnCd = __cil_tmp98 + 1; + tracksInBuffer = currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength - TrackData__0; + if (tracksInBuffer < tracksOnCd) { + tracksToReturn = tracksInBuffer; + } else { + tracksToReturn = tracksOnCd; + } + if (tracksInBuffer > tracksOnCd) { + i ++; + } + goto switch_4_break; + switch_4_exp_11: ; + switch_4_exp_12: + { + Irp__IoStatus__Information = 0; + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + if (status >= 0) { + + } + { + __cil_tmp99 = 8; + __cil_tmp100 = 16384; + __cil_tmp101 = 131072; + __cil_tmp102 = 147456; + __cil_tmp103 = 147464; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp103) { + { + __cil_tmp104 = (unsigned long )status; + if (__cil_tmp104 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + } + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_PLAY_AUDIO_MSF) { + status = -1073741820; + goto switch_4_break; + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + if (status >= 0) { + + } + goto switch_4_break; + switch_4_exp_13: + Irp__IoStatus__Information = 0; + if (currentIrpStack__Parameters__DeviceIoControl__InputBufferLength < sizeof__CDROM_SEEK_AUDIO_MSF) { + status = -1073741820; + goto switch_4_break; + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + if (status < 0) { + { + __cil_tmp105 = (unsigned long )status; + if (__cil_tmp105 == -1073741808) { + status = -1073741803; + } + } + } + goto switch_4_break; + switch_4_exp_14: + Irp__IoStatus__Information = 0; + if (SubQPtr == 0) { + status = -1073741670; + { + __cil_tmp106 = (unsigned long )status; + if (__cil_tmp106 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + if (deviceExtension__Paused == 1) { + status = 0; + { + __cil_tmp107 = (unsigned long )status; + if (__cil_tmp107 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, SubQPtr, + sizeof__SUB_Q_CHANNEL_DATA); + } + { + if (status < 0) { + { + __cil_tmp109 = (unsigned long )status; + if (__cil_tmp109 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + { + if (status < 0) { + { + __cil_tmp111 = (unsigned long )status; + if (__cil_tmp111 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + } + goto switch_4_break; + switch_4_exp_15: + Irp__IoStatus__Information = 0; + if (deviceExtension__Paused == 0) { + status = -1073741823; + { + __cil_tmp112 = (unsigned long )status; + if (__cil_tmp112 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + if (status >= 0) { + deviceExtension__PlayActive = 1; + deviceExtension__Paused = 0; + } + goto switch_4_break; + switch_4_exp_16: ; + if (currentIrpStack__Parameters__DeviceIoControl__OutputBufferLength < sizeof__SUB_Q_CURRENT_POSITION) { + status = -1073741789; + Irp__IoStatus__Information = 0; + goto switch_4_break; + } + if (SubQPtr___0 == 0) { + status = -1073741670; + Irp__IoStatus__Information = 0; + { + __cil_tmp113 = (unsigned long )status; + if (__cil_tmp113 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + if (userPtr__Format != 1) { + status = -1073741823; + Irp__IoStatus__Information = 0; + { + __cil_tmp114 = (unsigned long )status; + if (__cil_tmp114 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + { + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, SubQPtr___0, + sizeof__SUB_Q_CHANNEL_DATA); + } + if (status >= 0) { + if (deviceExtension__Paused == 1) { + deviceExtension__PlayActive = 0; + } + Irp__IoStatus__Information = sizeof__SUB_Q_CURRENT_POSITION; + } else { + Irp__IoStatus__Information = 0; + } + goto switch_4_break; + switch_4_exp_17: + { + Irp__IoStatus__Information = 0; + srb__CdbLength = 10; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + goto switch_4_break; + switch_4_exp_18: ; + switch_4_exp_19: ; + switch_4_exp_20: + Irp__IoStatus__Information = 0; + status = -1073741808; + goto switch_4_break; + switch_4_exp_21: + { + tmp___1 = CdAudioIsPlayActive(DeviceObject); + } + if (tmp___1 == 1) { + deviceExtension__PlayActive = 1; + status = 0; + Irp__IoStatus__Information = 0; + { + __cil_tmp115 = (unsigned long )status; + if (__cil_tmp115 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } else { + { + deviceExtension__PlayActive = 0; + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___0); + } + goto switch_4_break; + switch_4_default: + { + tmp___2 = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___2); + goto switch_4_break; + } else { + switch_4_break: ; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + { + __cil_tmp116 = (unsigned long )status; + if (__cil_tmp116 == -2147483626) { + Irp__IoStatus__Information = 0; + } + } + { + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); +} +} +int CdAudioAtapiDeviceControl(int DeviceObject , int Irp ) +{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; + int Irp__IoStatus__Information ; + int deviceExtension__PlayActive ; + int srb__CdbLength ; + int srb__TimeOutValue ; + int Irp__IoStatus__Status ; + int status ; + int deviceExtension = __VERIFIER_nondet_int() ; + int srb = __VERIFIER_nondet_int() ; + int tmp ; + int __cil_tmp13 ; + int __cil_tmp14 ; + int __cil_tmp15 ; + int __cil_tmp16 ; + int __cil_tmp17 ; + int __cil_tmp18 ; + + { + { + __cil_tmp13 = 8; + __cil_tmp14 = 16384; + __cil_tmp15 = 131072; + __cil_tmp16 = 147456; + __cil_tmp17 = 147464; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp17) { + { + Irp__IoStatus__Information = 0; + deviceExtension__PlayActive = 0; + srb__CdbLength = 12; + srb__TimeOutValue = 10; + status = SendSrbSynchronous(deviceExtension, srb, 0, 0); + } + { + if (status < 0) { + { + Irp__IoStatus__Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); + } + } + } else { + { + tmp = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp); + } + } + { + Irp__IoStatus__Status = status; + myStatus = status; + IofCompleteRequest(Irp, 0); + } + return (status); +} +} +void HpCdrProcessLastSession(int Toc ) +{ int index = __VERIFIER_nondet_int() ; + + { + if (index) { + index --; + } + return; +} +} +int HPCdrCompletion(int DeviceObject , int Irp , int Context ) +{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; + int Irp__AssociatedIrp__SystemBuffer = __VERIFIER_nondet_int() ; + + { + if (Irp__PendingReturned) { + if (pended == 0) { + pended = 1; + } else { + { + errorFn(); + } + } + } + if (myStatus >= 0) { + { + HpCdrProcessLastSession(Irp__AssociatedIrp__SystemBuffer); + } + } + return (myStatus); +} +} +int CdAudioHPCdrDeviceControl(int DeviceObject , int Irp ) +{ int currentIrpStack__Parameters__DeviceIoControl__IoControlCode = __VERIFIER_nondet_int() ; + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; + int irpSp__Control ; + int tmp ; + int tmp___0 ; + int __cil_tmp8 ; + int __cil_tmp9 ; + int __cil_tmp10 ; + int __cil_tmp11 ; + int __cil_tmp12 ; + + { + { + __cil_tmp8 = 56; + __cil_tmp9 = 16384; + __cil_tmp10 = 131072; + __cil_tmp11 = 147456; + __cil_tmp12 = 147512; + if (currentIrpStack__Parameters__DeviceIoControl__IoControlCode == __cil_tmp12) { + if (s != NP) { + { + errorFn(); + } + } else { + if (compRegistered != 0) { + { + errorFn(); + } + } else { + compRegistered = 1; + routine = 0; + } + } + { + irpSp__Control = 224; + tmp = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + } + return (tmp); + } else { + { + tmp___0 = CdAudioSendToNextDriver(DeviceObject, Irp); + } + return (tmp___0); + } + } + return (-1073741823); +} +} +int CdAudioForwardIrpSynchronous(int DeviceObject , int Irp ) +{ int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; + int event = __VERIFIER_nondet_int() ; + int status ; + int irpSp__Control ; + + { + if (s != NP) { + { + errorFn(); + } + } else { + if (compRegistered != 0) { + { + errorFn(); + } + } else { + compRegistered = 1; + routine = 1; + } + } + { + irpSp__Control = 224; + status = IofCallDriver(deviceExtension__TargetDeviceObject, Irp); + status = 259; + } + if (status) { + { + KeWaitForSingleObject(event, Executive, KernelMode, 0, 0); + status = myStatus; + } + } + return (status); +} +} +void CdAudioUnload(int DriverObject ) +{ + + { + return; +} +} +int CdAudioPower(int DeviceObject , int Irp ) +{ int Irp__CurrentLocation = __VERIFIER_nondet_int() ; + int Irp__Tail__Overlay__CurrentStackLocation = __VERIFIER_nondet_int() ; + int deviceExtension__TargetDeviceObject = __VERIFIER_nondet_int() ; + int tmp ; + + { + if (s == NP) { + s = SKIP1; + } else { + { + errorFn(); + } + } + { + Irp__CurrentLocation ++; + Irp__Tail__Overlay__CurrentStackLocation ++; + tmp = PoCallDriver(deviceExtension__TargetDeviceObject, Irp); + } + return (tmp); +} +} +void stub_driver_init(void) +{ + + { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + return; +} +} +int main(void) +{ int pirp__IoStatus__Status ; + int d = __VERIFIER_nondet_int() ; + int status = __VERIFIER_nondet_int() ; + int irp = __VERIFIER_nondet_int() ; + int we_should_unload = __VERIFIER_nondet_int() ; + int irp_choice = __VERIFIER_nondet_int() ; + int devobj = __VERIFIER_nondet_int() ; + int __cil_tmp9 ; + + { + { + + s = 0; + UNLOADED = 0; + NP = 0; + DC = 0; + SKIP1 = 0; + SKIP2 = 0; + MPR1 = 0; + MPR3 = 0; + IPC = 0; + pended = 0; + compFptr = 0; + compRegistered = 0; + lowerDriverReturn = 0; + setEventCalled = 0; + customIrp = 0; + routine = 0; + myStatus = 0; + pirp = 0; + Executive = 0; + Suspended = 5; + KernelMode = 0; + DeviceUsageTypePaging = 1; + + + pirp = irp; + _BLAST_init(); + } + if (status >= 0) { + s = NP; + customIrp = 0; + setEventCalled = customIrp; + lowerDriverReturn = setEventCalled; + compRegistered = lowerDriverReturn; + compFptr = compRegistered; + pended = compFptr; + pirp__IoStatus__Status = 0; + myStatus = 0; + if (irp_choice == 0) { + pirp__IoStatus__Status = -1073741637; + myStatus = -1073741637; + } + { + stub_driver_init(); + } + { + if (status < 0) { + return (-1); + } + } + int tmp_ndt_1; + tmp_ndt_1 = __VERIFIER_nondet_int(); + if (tmp_ndt_1 == 2) { + goto switch_5_2; + } else { + int tmp_ndt_2; + tmp_ndt_2 = __VERIFIER_nondet_int(); + if (tmp_ndt_2 == 3) { + goto switch_5_3; + } else { + int tmp_ndt_3; + tmp_ndt_3 = __VERIFIER_nondet_int(); + if (tmp_ndt_3 == 4) { + goto switch_5_4; + } else { + goto switch_5_default; + if (0) { + switch_5_2: + { + status = CdAudioDeviceControl(devobj, pirp); + } + goto switch_5_break; + switch_5_3: + { + status = CdAudioPnp(devobj, pirp); + } + goto switch_5_break; + switch_5_4: + { + status = CdAudioPower(devobj, pirp); + } + goto switch_5_break; + switch_5_default: ; + return (-1); + } else { + switch_5_break: ; + } + } + } + } + if (we_should_unload) { + { + CdAudioUnload(d); + } + } + } + if (pended == 1) { + if (s == NP) { + s = NP; + } else { + goto _L___2; + } + } else { + _L___2: + if (pended == 1) { + if (s == MPR3) { + s = MPR3; + } else { + goto _L___1; + } + } else { + _L___1: + if (s != UNLOADED) { + if (status != -1) { + if (s != SKIP2) { + if (s != IPC) { + if (s != DC) { + { + errorFn(); + } + } else { + goto _L___0; + } + } else { + goto _L___0; + } + } else { + _L___0: + if (pended != 1) { + if (s == DC) { + if (status == 259) { + errorFn(); + } + } else { + if (status != lowerDriverReturn) { + errorFn(); + } + } + } + else { + if (status != 259) { + { + errorFn(); + } + } else { + + } + } + } + } + } + } + } + return (status); +} +} +void stubMoreProcessingRequired(void) +{ + + { + if (s == NP) { + s = MPR1; + } else { + { + errorFn(); + } + } + return; +} +} +int IofCallDriver(int DeviceObject , int Irp ) +{ int Irp__PendingReturned = __VERIFIER_nondet_int() ; + int returnVal2 ; + int compRetStatus ; + int lcontext = __VERIFIER_nondet_int() ; + unsigned long __cil_tmp8 ; + + { + if (compRegistered) { + if (routine == 0) { + { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { + if (routine == 1) { + { + compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } + } + } + { + __cil_tmp8 = (unsigned long )compRetStatus; + if (__cil_tmp8 == -1073741802) { + { + stubMoreProcessingRequired(); + } + } + } + } + if (Irp__PendingReturned) { + returnVal2 = 259; + } else { + int tmp_ndt_4; + tmp_ndt_4 = __VERIFIER_nondet_int(); + if (tmp_ndt_4 == 0) { + goto switch_6_0; + } else { + int tmp_ndt_5; + tmp_ndt_5 = __VERIFIER_nondet_int(); + if (tmp_ndt_5 == 1) { + goto switch_6_1; + } else { + goto switch_6_default; + if (0) { + switch_6_0: + returnVal2 = 0; + goto switch_6_break; + switch_6_1: + returnVal2 = -1073741823; + goto switch_6_break; + switch_6_default: + returnVal2 = 259; + goto switch_6_break; + } else { + switch_6_break: ; + } + } + } + } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal2; + } else { + if (s == MPR1) { + if (returnVal2 == 259) { + s = MPR3; + lowerDriverReturn = returnVal2; + } else { + s = NP; + lowerDriverReturn = returnVal2; + } + } else { + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal2; + } else { + { + errorFn(); + } + } + } + } + return (returnVal2); +} +} +void IofCompleteRequest(int Irp , int PriorityBoost ) +{ + + { + if (s == NP) { + s = DC; + } else { + { + errorFn(); + } + } + return; +} +} +int KeSetEvent(int Event , int Increment , int Wait ) +{ int l = __VERIFIER_nondet_int() ; + + { + setEventCalled = 1; + return (l); +} +} +int KeWaitForSingleObject(int Object , int WaitReason , int WaitMode , int Alertable , + int Timeout ) +{ + + { + if (s == MPR3) { + if (setEventCalled == 1) { + s = NP; + setEventCalled = 0; + } else { + goto _L; + } + } else { + _L: + if (customIrp == 1) { + s = NP; + customIrp = 0; + } else { + if (s == MPR3) { + { + errorFn(); + } + } + } + } + int tmp_ndt_6; + tmp_ndt_6 = __VERIFIER_nondet_int(); + if (tmp_ndt_6 == 0) { + goto switch_7_0; + } else { + goto switch_7_default; + if (0) { + switch_7_0: ; + return (0); + switch_7_default: ; + return (-1073741823); + } else { + + } + } +} +} +int PoCallDriver(int DeviceObject , int Irp ) +{ + int compRetStatus ; + int returnVal ; + int lcontext = __VERIFIER_nondet_int() ; + unsigned long __cil_tmp7 ; + long __cil_tmp8 ; + + { + if (compRegistered) { + if (routine == 0) { + { + compRetStatus = HPCdrCompletion(DeviceObject, Irp, lcontext); + } + } else { + if (routine == 1) { + { + compRetStatus = CdAudioSignalCompletion(DeviceObject, Irp, lcontext); + } + } + } + { + __cil_tmp7 = (unsigned long )compRetStatus; + if (__cil_tmp7 == -1073741802) { + { + stubMoreProcessingRequired(); + } + } + } + } + int tmp_ndt_7; + tmp_ndt_7 = __VERIFIER_nondet_int(); + if (tmp_ndt_7 == 0) { + goto switch_8_0; + } else { + int tmp_ndt_8; + tmp_ndt_8 = __VERIFIER_nondet_int(); + if (tmp_ndt_8 == 1) { + goto switch_8_1; + } else { + goto switch_8_default; + if (0) { + switch_8_0: + returnVal = 0; + goto switch_8_break; + switch_8_1: + returnVal = -1073741823; + goto switch_8_break; + switch_8_default: + returnVal = 259; + goto switch_8_break; + } else { + switch_8_break: ; + } + } + } + if (s == NP) { + s = IPC; + lowerDriverReturn = returnVal; + } else { + if (s == MPR1) { + { + __cil_tmp8 = (long )returnVal; + if (__cil_tmp8 == 259L) { + s = MPR3; + lowerDriverReturn = returnVal; + } else { + s = NP; + lowerDriverReturn = returnVal; + } + } + } else { + if (s == SKIP1) { + s = SKIP2; + lowerDriverReturn = returnVal; + } else { + { + errorFn(); + } + } + } + } + return (returnVal); +} +} +int ZwClose(int Handle ) +{ + + { + int tmp_ndt_9; + tmp_ndt_9 = __VERIFIER_nondet_int(); + if (tmp_ndt_9 == 0) { + goto switch_9_0; + } else { + goto switch_9_default; + if (0) { + switch_9_0: ; + return (0); + switch_9_default: ; + return (-1073741823); + } else { + + } + } +} +} diff --git a/samples/example.c b/samples/example.c new file mode 100644 index 000000000..99767422f --- /dev/null +++ b/samples/example.c @@ -0,0 +1,25 @@ +extern void __VERIFIER_error() __attribute__((__noreturn__)); +extern int __VERIFIER_nondet_int(void); +extern int __VERIFIER_nondet_double(void); + +int bar(){ + int a;// = __VERIFIER_nondet_int(); + return a; +} + +void foo() { + int N = bar(); + int i =0; + for(i = 0; i<= N; i++){ + if(i > 1){ + __VERIFIER_error(); + } + + } +} + +int main(){ + foo(); + int b;// = __VERIFIER_nondet_int(); + return 0; +} \ No newline at end of file diff --git a/samples/example2.c b/samples/example2.c new file mode 100644 index 000000000..bcf30a848 --- /dev/null +++ b/samples/example2.c @@ -0,0 +1,9 @@ +#include + +int main(){ + int a = INT_MAX; + int b = INT_MAX; + int c; + c = a + b; + return 0; +} \ No newline at end of file diff --git a/samples/map2check-preprocessed.c.cseq.c b/samples/map2check-preprocessed.c.cseq.c new file mode 100644 index 000000000..f04c84b91 --- /dev/null +++ b/samples/map2check-preprocessed.c.cseq.c @@ -0,0 +1,656 @@ +/* + * generated by CSeq [ 0000 / 0000 ] 2020-07-14 19:03:31 + * + * [ 0000 merger-2019.11.15 + * 0000 parser-2019.11.27 + * 0000 module-0.0-2019.11.27 ] + * + * params: + * --input /mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/release/fa51e0339adc66ed1405eceb445cca7f892f3476.map2check/fa51e0339adc66ed1405eceb445cca7f892f3476.map2check-preprocessed.c, --load lazy, --backend cpachecker + * + * modules: + * 0000 workarounds () + * 0000 functiontracker () + * 0000 preinstrumenter (error-label) + * 0000 constants (deep-propagation) + * 0000 spinlock () + * 0000 switchtransformer () + * 0000 dowhileconverter () + * 0000 conditionextractor () + * 0000 varnames () + * 0000 preinliner () + * 0000 inliner (atomic-parameters simplify-args) + * 0000 unroller (unwind unwind-while unwind-for unwind-for-max softunwindbound varnamesmap varscopesmap extra-tracking) + * 0000 duplicator () + * 0000 condwaitconverter () + * 0000 lazyseq (rounds threads schedule deadlock norobin preanalysis nondet-condvar-wakeups) + * 0000 instrumenter (backend bitwidth header well-nested-locks emptystructs) + * 0000 feeder (backend time llvm depth slevel output no-simplify) + * 0000 cex (backend cex exitcode threadnamesmap threadindexes threadindextoname varnamesmap coordstofunctions sv-comp witness entry threadsizes threadendlines loopheads) + * + */ +#define __cs_MUTEX_INITIALIZER -1 +#define __cs_COND_INITIALIZER -1 +#define __cs_RWLOCK_INITIALIZER -1 +#define __cs_BARRIER_SERIAL_THREAD 0 +#define __cs_CANCEL_ASYNCHRONOUS 0 +#define __cs_CANCEL_ENABLE 0 +#define __cs_CANCEL_DEFERRED 0 +#define __cs_CANCEL_DISABLE 0 +#define __cs_CANCELED 0 +#define __cs_CREATE_DETACHED 0 +#define __cs_CREATE_JOINABLE 0 +#define __cs_EXPLICIT_SCHED 0 +#define __cs_INHERIT_SCHED 0 +#define __cs_MUTEX_DEFAULT 0 +#define __cs_MUTEX_ERRORCHECK 0 +#define __cs_MUTEX_NORMAL 0 +#define __cs_MUTEX_RECURSIVE 0 +#define __cs_MUTEX_ROBUST 0 +#define __cs_MUTEX_STALLED 0 +#define __cs_ONCE_INIT 0 +#define __cs_PRIO_INHERIT 0 +#define __cs_PRIO_NONE 0 +#define __cs_PRIO_PROTECT 0 +#define __cs_PROCESS_SHARED 0 +#define __cs_PROCESS_PRIVATE 0 +#define __cs_SCOPE_PROCESS 0 +#define __cs_SCOPE_SYSTEM 0 +//#include +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); +void __VERIFIER_assert(int x) { if(!(x)) {ERROR: goto ERROR;}} +extern void __VERIFIER_assume(int); +extern int __VERIFIER_nondet_int(void); +extern unsigned int __VERIFIER_nondet_uint(void); +extern _Bool __VERIFIER_nondet_bool(void); +extern char __VERIFIER_nondet_char(void); +extern unsigned char __VERIFIER_nondet_uchar(void);//#include +//#include +#define THREADS 3 +#define ROUNDS 1 +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; +#define IF(T,A,B) if ((__cs_pc[T] > A) | (A >= __cs_pc_cs[T])) goto B; +#ifndef NULL +#define NULL 0 +#endif + //IF(1,0,tthread1_0_1) + unsigned int __cs_active_thread[THREADS + 1] = {1}; + + unsigned int __cs_pc[THREADS + 1]; + + unsigned int __cs_pc_cs[THREADS + 1]; + + unsigned int __cs_thread_index; + + unsigned int __cs_last_thread; + + unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + + void *__cs_safe_malloc(unsigned int __cs_size) + { + + void *__cs_ptr = (malloc(__cs_size)); + + __VERIFIER_assume(__cs_ptr); + return (__cs_ptr); + } + + + void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) + { + + if (__cs_size == (sizeof(int))) + + * ((int *) __cs_var) = (__VERIFIER_nondet_int()); + //* ((int *) __cs_var) = (0); + else + + { + + __cs_var = (malloc(__cs_size)); + } + + } + + + void __CSEQ_message(char *__cs_message) + { + ; + } + + + typedef int cspthread_t; + + void *__cs_threadargs[THREADS + 1]; + + typedef int cspthread_key_t; + + cspthread_key_t __cs_keys[1][THREADS + 2]; + + void (*__cs_key_destructor[1])(void *); + + int pthread_create_tool_cseq(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void *), void *__cs_arg, int __cs_threadID) + { + + if (__cs_threadID > THREADS) + return (0); + + + * __cs_new_thread_id = (__cs_threadID); + + __cs_active_thread[__cs_threadID] = (1); + + __cs_threadargs[__cs_threadID] = (__cs_arg); + + __CSEQ_message("thread spawned"); + + return (0); + } + + + int pthread_join_cseq(cspthread_t __cs_id, void **__cs_value_ptr) + { + + __VERIFIER_assume(__cs_pc[__cs_id] = __cs_thread_lines[__cs_id]); + //__cs_pc[__cs_id] = __cs_thread_lines[__cs_id]; + + return (0); + } + + + int pthread_exit_cseq(void *__cs_value_ptr) + { + + if ((__cs_key_destructor[0] != 0) && (__cs_keys[0][__cs_thread_index + 1] != 0)) + { + + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index + 1]); + } + + } + + + int pthread_self_cseq(void) + { + return (__cs_thread_index + 1); + } + + + typedef int cspthread_mutex_t; + + int pthread_mutex_init_cseq(cspthread_mutex_t *__cs_m, int __cs_val) + { + + * __cs_m = (- 1); + + return (0); + } + + + int pthread_mutex_destroy_cseq(cspthread_mutex_t *__cs_mutex_to_destroy) + { + + * __cs_mutex_to_destroy = (- 2); + + __CSEQ_message("lock destroyed"); + + return (0); + } + + + int pthread_mutex_lock_cseq(cspthread_mutex_t *__cs_mutex_to_lock) + { + + __VERIFIER_assume((* __cs_mutex_to_lock) = (- 1)); + //(* __cs_mutex_to_lock) = (- 1); + + * __cs_mutex_to_lock = (__cs_thread_index + 1); + + __CSEQ_message("lock acquired"); + + return (0); + } + + + int pthread_mutex_unlock_cseq(cspthread_mutex_t *__cs_mutex_to_unlock) + { + + __VERIFIER_assume((* __cs_mutex_to_unlock) = (__cs_thread_index + 1)); + //(* __cs_mutex_to_unlock) = (__cs_thread_index + 1); + + * __cs_mutex_to_unlock = (- 1); + + __CSEQ_message("lock released"); + + return (0); + } + + + typedef int cspthread_cond_t; + + int pthread_cond_init_cseq(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) + { + + * __cs_cond_to_init = (- 1); + + return (0); + } + + + int pthread_cond_destroy_cseq(cspthread_cond_t *__cs_cond_to_destroy) + { + + * __cs_cond_to_destroy = (- 2); + + return (0); + } + + + int pthread_cond_wait_1_cseq(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + pthread_mutex_unlock_cseq(__cs_m); + + return (0); + } + + + int pthread_cond_wait_2_cseq(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + __VERIFIER_assume((* __cs_cond_to_wait_for) = 1); + //(* __cs_cond_to_wait_for) = 1; + + pthread_mutex_lock_cseq(__cs_m); + + return (0); + } + + + int pthread_cond_signal_cseq(cspthread_cond_t *__cs_cond_to_signal) + { + + * __cs_cond_to_signal = (1); + + __CSEQ_message("conditional variable signal"); + + return (0); + } + + + int pthread_cond_broadcast_cseq(cspthread_cond_t *__cs_cond_to_broadcast) + { + + * __cs_cond_to_broadcast = (1); + + __CSEQ_message("conditional variable broadcast"); + + return (0); + } + + + typedef struct cspthread_barrier_t + { + + unsigned int init; + + unsigned int current; + } cspthread_barrier_t; + + int pthread_barrier_init_cseq(cspthread_barrier_t *__cs_barrier_to_init, void *__cs_attr, unsigned int count) + { + + __cs_barrier_to_init->current = (count); + + __cs_barrier_to_init->init = (count); + + return (0); + } + + + int pthread_barrier_destroy_cseq(cspthread_barrier_t *__cs_barrier_to_destroy) + { + + __cs_barrier_to_destroy->init = (- 1); + + __cs_barrier_to_destroy->current = (- 1); + + return (0); + } + + + int pthread_barrier_wait_1_cseq(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __cs_barrier_to_wait->current--; + + return (0); + } + + + int pthread_barrier_wait_2_cseq(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __VERIFIER_assume(__cs_barrier_to_wait->current = 0); + //__cs_barrier_to_wait->current = 0; + + __cs_barrier_to_wait->current = (__cs_barrier_to_wait->init); + + return (0); + } + + + int pthread_key_create_cseq(cspthread_key_t *key, void (*destructor)(void *)) + { + + static int currentkey = (0); + + __cs_key_destructor[0] = (destructor); + + * key = (currentkey++); + + return (0); + } + + + int pthread_setspecific_cseq(cspthread_key_t key, const void *value) + { + + __cs_keys[key][__cs_thread_index + 1] = (value); + + return (0); + } + + + void *pthread_getspecific_cseq(cspthread_key_t key) + { + + return (__cs_keys[key][__cs_thread_index + 1]); + } + + + void __CSEQ_noop(void) + { + } + + + //void __VERIFIER_error(); + + + cspthread_mutex_t m; + + int data = (0); + + void *thread1_0(void *__cs_param_thread1_arg) + + { + +IF(1,0,tthread1_0_1) + + pthread_mutex_lock_cseq(& m); + + +tthread1_0_1: IF(1,1,tthread1_0_2) + + data++; + +tthread1_0_2: IF(1,2,tthread1_0_3) + + pthread_mutex_unlock_cseq(& m); + + __exit_thread1: + __VERIFIER_assume(__cs_pc_cs[1] >= 3); + + + ; + ; + +tthread1_0_3: + + pthread_exit_cseq(0); + + } + + + void *thread2_0(void *__cs_param_thread2_arg) + + { + +IF(2,0,tthread2_0_1) + + pthread_mutex_lock_cseq(& m); + +tthread2_0_1: IF(2,1,tthread2_0_2) + + data += (2); + +tthread2_0_2: IF(2,2,tthread2_0_3) + + pthread_mutex_unlock_cseq(& m); + + __exit_thread2: + __VERIFIER_assume(__cs_pc_cs[2] >= 3); + + + ; + ; + +tthread2_0_3: + + pthread_exit_cseq(0); + + + } + + + void *thread3_0(void *__cs_param_thread3_arg) + + { + +IF(3,0,tthread3_0_1) + + + pthread_mutex_lock_cseq(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + +tthread3_0_1: IF(3,1,tthread3_0_2) + + //__VERIFIER_error(); + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + //__VERIFIER_assert(0); + __VERIFIER_error(); + + + ; + ; + } + + + ; + +tthread3_0_2: IF(3,2,tthread3_0_3) + + pthread_mutex_unlock_cseq(& m); + + __exit_thread3: + __VERIFIER_assume(__cs_pc_cs[3] >= 3); + + + ; + ; + +tthread3_0_3: + + pthread_exit_cseq(0); + + } + + + int main_thread(void) + + { + +IF(0,0,tmain_1) + + pthread_mutex_init_cseq(& m, 0); + + static cspthread_t __cs_local_main_t1; + __cs_init_scalar(& __cs_local_main_t1, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t2; + __cs_init_scalar(& __cs_local_main_t2, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t3; + __cs_init_scalar(& __cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create_tool_cseq(& __cs_local_main_t1, 0, thread1_0, 0, 1); + +tmain_1: IF(0,1,tmain_2) + + pthread_create_tool_cseq(& __cs_local_main_t2, 0, thread2_0, 0, 2); + +tmain_2: IF(0,2,tmain_3) + + pthread_create_tool_cseq(& __cs_local_main_t3, 0, thread3_0, 0, 3); + +tmain_3: IF(0,3,tmain_4) + + pthread_join_cseq(__cs_local_main_t1, 0); + +tmain_4: IF(0,4,tmain_5) + + pthread_join_cseq(__cs_local_main_t2, 0); + +tmain_5: IF(0,5,tmain_6) + + pthread_join_cseq(__cs_local_main_t3, 0); + + goto __exit_main; + ; + + __exit_main: + __VERIFIER_assume(__cs_pc_cs[0] >= 6); + + + ; + ; + +tmain_6: + + pthread_exit_cseq(0); + } + + + int main(void) + { + +/* round 0 */ + +/* main */ + + __cs_thread_index = (0); + + //unsigned int __cs_tmp_t0_r0; + unsigned int __cs_tmp_t0_r0 = __VERIFIER_nondet_int(); + + //__cs_pc_cs[0] = (__cs_tmp_t0_r0); + + //__cs_pc_cs[0] = 3;//__VERIFIER_nondet_int(); + __cs_pc_cs[0] = __cs_tmp_t0_r0; + __VERIFIER_assume(__cs_pc_cs[0] > 0); + + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + + __cs_pc[0] = (__cs_pc_cs[0]); + +/* thread1_0 */ + + //unsigned int __cs_tmp_t1_r0; + unsigned int __cs_tmp_t1_r0 = __VERIFIER_nondet_int(); + + if (__cs_active_thread[1]) + { + + __cs_thread_index = (1); + + __cs_pc_cs[1] = __cs_tmp_t1_r0; + + __VERIFIER_assume(__cs_pc_cs[1] <= 3); + + thread1_0(__cs_threadargs[1]); + + __cs_pc[1] = (__cs_pc_cs[1]); + } + + +/* thread2_0 */ + + unsigned int __cs_tmp_t2_r0 = __VERIFIER_nondet_int(); + + if (__cs_active_thread[2]) + { + + __cs_thread_index = (2); + + __cs_pc_cs[2] = __cs_tmp_t2_r0; + + __VERIFIER_assume(__cs_pc_cs[2] <= 3); + + thread2_0(__cs_threadargs[2]); + + __cs_pc[2] = (__cs_pc_cs[2]); + } + + +/* thread3_0 */ + + unsigned int __cs_tmp_t3_r0= __VERIFIER_nondet_int(); + + if (__cs_active_thread[3]) + { + + __cs_thread_index = (3); + + __cs_pc_cs[3] = __cs_tmp_t3_r0; + + __VERIFIER_assume(__cs_pc_cs[3] <= 3); + + thread3_0(__cs_threadargs[3]); + + __cs_pc[3] = (__cs_pc_cs[3]); + } + + + unsigned int __cs_tmp_t0_r1= __VERIFIER_nondet_int(); + + if (__cs_active_thread[0]) + { + + __cs_thread_index = (0); + + __cs_pc_cs[0] = __cs_tmp_t0_r1; + + __VERIFIER_assume(__cs_pc_cs[0] >= __cs_pc[0]); + + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + } + + + return (0); + } + + + diff --git a/samples/sample.c b/samples/sample.c new file mode 100644 index 000000000..30ca44607 --- /dev/null +++ b/samples/sample.c @@ -0,0 +1,13 @@ +void reach_error(){} +int __VERIFIER_nondet_int(); + +int main(){ + + int a = __VERIFIER_nondet_int(); + + if(a > 42){ + reach_error(); + } + + return 0; +} \ No newline at end of file diff --git a/tests/regression_test/test_cases/map2check-test/MemSafety-Map.set b/tests/regression_test/test_cases/map2check-test/MemSafety-Map.set new file mode 100644 index 000000000..0a0d2f2e5 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/MemSafety-Map.set @@ -0,0 +1 @@ +memsafety-map/*.yml \ No newline at end of file diff --git a/tests/regression_test/test_cases/map2check-test/Overflow-Map.set b/tests/regression_test/test_cases/map2check-test/Overflow-Map.set new file mode 100644 index 000000000..d3f314ef3 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/Overflow-Map.set @@ -0,0 +1 @@ +nooverflow-map/*.yml \ No newline at end of file diff --git a/tests/regression_test/test_cases/map2check-test/ReachSafety-Map.set b/tests/regression_test/test_cases/map2check-test/ReachSafety-Map.set new file mode 100644 index 000000000..18d3643eb --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/ReachSafety-Map.set @@ -0,0 +1 @@ +reachsafety-map/*.yml diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.c new file mode 100644 index 000000000..d87f98759 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.c @@ -0,0 +1,10 @@ +#include + +int *a; + +int main () +{ + a = malloc (12 * sizeof(*a)); + free(a); + free(a); // it was released +} diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.yml new file mode 100644 index 000000000..138d0c8ee --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_00.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_00.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: false + subproperty: valid-free diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.c new file mode 100644 index 000000000..4ef239963 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.c @@ -0,0 +1,12 @@ +#include + +int *a, *b; + +int main () +{ + a = malloc (12 * sizeof(*a)); + b = malloc (12 * sizeof(*b)); + b = a; + free(a); + free(b); // was released +} diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.yml new file mode 100644 index 000000000..435dbc25d --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_01.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_01.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: false + subproperty: valid-free diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.c new file mode 100644 index 000000000..f8f06a3a5 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.c @@ -0,0 +1,11 @@ +#include + +int *a, *b; + +int main () +{ + a = malloc (12 * sizeof(*a)); + b = malloc (12 * sizeof(*b)); + b = a; + free(b); +} diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.yml new file mode 100644 index 000000000..4fd60c841 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_02.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_02.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: false + subproperty: valid-memtrack diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.c new file mode 100644 index 000000000..0c77306bb --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.c @@ -0,0 +1,12 @@ +#include + +int *a, *b; + +int main () +{ + a = malloc (12 * sizeof(*a)); + b = malloc (12 * sizeof(*b)); + + free(a); + free(b); +} diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.yml new file mode 100644 index 000000000..aa5362f61 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_03.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_03.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: true + subproperty: valid-memtrack diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.c new file mode 100644 index 000000000..45178425f --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.c @@ -0,0 +1,15 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +int main () +{ + const char* p = "abc"; + + __VERIFIER_assert(*p == 'a'); +} diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.yml new file mode 100644 index 000000000..93f33090c --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_04.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_04.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: true + subproperty: valid-deref diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.c new file mode 100644 index 000000000..782ef8b7e --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.c @@ -0,0 +1,19 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +int main () +{ + int x = 2; + int* p_x = &x; // Put the address of the x variable into the pointer p_x + *p_x = 4; // Change the memory at the address in p_x to be 4 + __VERIFIER_assert(x == 4); // Check x is now 4 +} + + + diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.yml new file mode 100644 index 000000000..f34103b3a --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_06.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_06.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: true + subproperty: valid-deref diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.c b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.c new file mode 100644 index 000000000..1a8680ac6 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.c @@ -0,0 +1,19 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +// Multi-byte data types + +int main () +{ + double sizes[] = { 10.3, 13.4, 11.2, 19.4 }; + double* p = sizes; + + ++p; // Advance p by sizeof(double) + __VERIFIER_assert(*p == 13.4); // The double at memory beginning at address p has value 13.4 +} \ No newline at end of file diff --git a/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.yml b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.yml new file mode 100644 index 000000000..a8d2dfe92 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/memsafety-map/mem_08.yml @@ -0,0 +1,8 @@ +format_version: '1.0' + +input_files: 'mem_08.c' + +properties: + - property_file: ../../sv-benchmarks/properties/valid-memsafety.prp + expected_verdict: true + subproperty: valid-deref diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.c b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.c new file mode 100644 index 000000000..32978400e --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.c @@ -0,0 +1,18 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +extern int __VERIFIER_nondet_int(void); + +int main () +{ + int a = __VERIFIER_nondet_int(); + int b = __VERIFIER_nondet_int(); + + int c = a + b; +} diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.yml b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.yml new file mode 100644 index 000000000..666c53d28 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_01.yml @@ -0,0 +1,7 @@ +format_version: '1.0' + +input_files: 'over_01.c' + +properties: + - property_file: ../../sv-benchmarks/properties/no-overflow.prp + expected_verdict: false diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.c b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.c new file mode 100644 index 000000000..db0cfae00 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.c @@ -0,0 +1,24 @@ +// based on https://www.cs.utexas.edu/~shmat/courses/cs380s_fall09/blexim.txt + +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +extern int __VERIFIER_nondet_int(void); + +int main () +{ + int l; + + l = 0x7fffffff; + + // When it is incremented, the most significant bit + // (indicating signedness) is set and the integer is interpreted as being + // negative. + __VERIFIER_assert(l + 1 >= 0); +} diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.yml b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.yml new file mode 100644 index 000000000..dd225fc07 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_02.yml @@ -0,0 +1,7 @@ +format_version: '1.0' + +input_files: 'over_02.c' + +properties: + - property_file: ../../sv-benchmarks/properties/no-overflow.prp + expected_verdict: false diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.c b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.c new file mode 100644 index 000000000..73ef0d96c --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.c @@ -0,0 +1,37 @@ +// based on https://www.cs.utexas.edu/~shmat/courses/cs380s_fall09/blexim.txt + +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + +extern int __VERIFIER_nondet_int(void); +/* +The addition is causing an overflow in exactly the same way as the first +example, and so is the multiplication, although it may seem different. In +both cases the result of the arithmetic is too great to fit in an integer, +so it is reduced as described above. The subtraction is slightly +different, as it is causing an underflow rather than an overflow: an +attempt is made to store a value lower than the minimum value the integer +can hold, causing a wrap around. In this way we are able to force an +addition to subtract, a multiplication to divide or a subtraction to add. +**/ + +int main () +{ + int l, x; + + l = 0x40000000; + + x = l + 0xc0000000; + + x = l * 0x4; + + x = l - 0xffffffff; + + return 0; +} diff --git a/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.yml b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.yml new file mode 100644 index 000000000..2bd5f8ad2 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/nooverflow-map/over_03.yml @@ -0,0 +1,7 @@ +format_version: '1.0' + +input_files: 'over_03.c' + +properties: + - property_file: ../../sv-benchmarks/properties/no-overflow.prp + expected_verdict: false diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/array_bug.c b/tests/regression_test/test_cases/map2check-test/reachsafety-map/array_bug.c similarity index 100% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/array_bug.c rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/array_bug.c diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/array_bug.yml b/tests/regression_test/test_cases/map2check-test/reachsafety-map/array_bug.yml similarity index 57% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/array_bug.yml rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/array_bug.yml index 3ba150e6a..e89f181d9 100644 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/array_bug.yml +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/array_bug.yml @@ -3,5 +3,5 @@ format_version: '1.0' input_files: 'array_bug.c' properties: - - property_file: ../properties/unreach-call.prp + - property_file: ../../sv-benchmarks/properties/unreach-call.prp expected_verdict: false diff --git a/tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.c b/tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.c new file mode 100644 index 000000000..0a8588a14 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.c @@ -0,0 +1,24 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); +void __VERIFIER_assert(int cond) { + if (!(cond)) { + ERROR: __VERIFIER_error(); + } + return; +} + + +int main() { + + int x=__VERIFIER_nondet_int(); + int y=__VERIFIER_nondet_int(); + + int z=0; + + while(x>0) { + x--; + if(x==y) z=1; + } + + __VERIFIER_assert(z==0); +} + diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.yml b/tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.yml similarity index 58% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.yml rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.yml index 2e67d2cd4..be7d45c2c 100644 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.yml +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/check_if_bug.yml @@ -3,5 +3,5 @@ format_version: '1.0' input_files: 'check_if_bug.c' properties: - - property_file: ../properties/unreach-call.prp + - property_file: ../../sv-benchmarks/properties/unreach-call.prp expected_verdict: false diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex01_false.c b/tests/regression_test/test_cases/map2check-test/reachsafety-map/ex01_false.c similarity index 100% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex01_false.c rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/ex01_false.c diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex01_false.yml b/tests/regression_test/test_cases/map2check-test/reachsafety-map/ex01_false.yml similarity index 57% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex01_false.yml rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/ex01_false.yml index 7eb10efab..4a74967d0 100644 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex01_false.yml +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/ex01_false.yml @@ -3,5 +3,5 @@ format_version: '1.0' input_files: 'ex01_false.c' properties: - - property_file: ../properties/unreach-call.prp + - property_file: ../../sv-benchmarks/properties/unreach-call.prp expected_verdict: false diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex02_false.c b/tests/regression_test/test_cases/map2check-test/reachsafety-map/ex02_false.c similarity index 98% rename from tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex02_false.c rename to tests/regression_test/test_cases/map2check-test/reachsafety-map/ex02_false.c index 859290a4b..c8b5c539a 100644 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/ex02_false.c +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/ex02_false.c @@ -4,6 +4,7 @@ int main(void) int i=1; int j=0; int n = __VERIFIER_nondet_int(); + while(id_ = 3.14159; // Dereference and access data member x.d_ + (*p).d_ *= -1; // Another equivalent notation for accessing x.d_ + + __VERIFIER_assert(p->d_ >= 2.0); +} + + + diff --git a/tests/regression_test/test_cases/map2check-test/reachsafety-map/mem_07.yml b/tests/regression_test/test_cases/map2check-test/reachsafety-map/mem_07.yml new file mode 100644 index 000000000..d286b09d1 --- /dev/null +++ b/tests/regression_test/test_cases/map2check-test/reachsafety-map/mem_07.yml @@ -0,0 +1,7 @@ +format_version: '1.0' + +input_files: 'mem_07.c' + +properties: + - property_file: ../../sv-benchmarks/properties/unreach-call.prp + expected_verdict: false diff --git a/tests/regression_test/test_cases/sv-benchmarks/Map2Check-Assert.set b/tests/regression_test/test_cases/sv-benchmarks/Map2Check-Assert.set deleted file mode 100644 index 956608a43..000000000 --- a/tests/regression_test/test_cases/sv-benchmarks/Map2Check-Assert.set +++ /dev/null @@ -1 +0,0 @@ -map2check-assert/*.yml diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.c b/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.c deleted file mode 100644 index 41ddcb8b5..000000000 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.c +++ /dev/null @@ -1,113 +0,0 @@ -/* emulates multi-precision addition */ -#include - -extern void __VERIFIER_error() __attribute__ ((__noreturn__)); - -void __VERIFIER_assert(int cond) { - if (!(cond)) { - ERROR: __VERIFIER_error(); - } - return; -} - -unsigned int mp_add(unsigned int a, unsigned int b) -{ - unsigned char a0, a1, a2, a3; - unsigned char b0, b1, b2, b3; - unsigned char r0, r1, r2, r3; - - unsigned short carry; - unsigned short partial_sum; - unsigned int r; - unsigned char i; - unsigned char na, nb; - - a0 = a; - a1 = a >> 8; - a2 = a >> 16U; - a3 = a >> 24U; - - b0 = b; - b1 = b >> 8U; - b2 = b >> 16U; - b3 = b >> 24U; - - na = (unsigned char)4; /* num of components of a */ - if (a3 == (unsigned char)0) { - na = na - 1; - if (a2 == (unsigned char)0) { - na = na - 1; - if (a1 == (unsigned char)0) { - na = na - 1; - } - } - } - - nb = (unsigned char)4; /* num of components of b */ - if (b3 == (unsigned char)0) { - nb = nb - 1; - if (b2 == (unsigned char)0) { - nb = nb - 1; - if (b1 == (unsigned char)0) { - nb = nb - 1; - } - } - } - - carry = (unsigned short)0; - i = (unsigned char)0; - while ((i < na) || (i < nb) || (carry != (unsigned short)0)) { - partial_sum = carry; - carry = (unsigned short)0; - - if (i < na) { - if (i == (unsigned char)0) { partial_sum = partial_sum + a0; } - if (i == (unsigned char)1) { partial_sum = partial_sum + a1; } - if (i == (unsigned char)2) { partial_sum = partial_sum + a2; } - if (i == (unsigned char)3) { partial_sum = partial_sum + a3; } - } - if (i < nb) { - if (i == (unsigned char)0) { partial_sum = partial_sum + b0; } - if (i == (unsigned char)1) { partial_sum = partial_sum + b1; } - if (i == (unsigned char)2) { partial_sum = partial_sum + b2; } - if (i == (unsigned char)3) { partial_sum = partial_sum + b3; } - } - if (partial_sum > ((unsigned char)254)) { - partial_sum = partial_sum & ((unsigned char)255); - carry = (unsigned short)1; - } - - if (i == (unsigned char)0) { r0 = (unsigned char)partial_sum; } - if (i == (unsigned char)1) { r1 = (unsigned char)partial_sum; } - if (i == (unsigned char)2) { r2 = (unsigned char)partial_sum; } - if (i == (unsigned char)3) { r3 = (unsigned char)partial_sum; } - - i = i + (unsigned char)1; - } - - while (i < (unsigned char)4) { - if (i == (unsigned char)0) { r0 = (unsigned char)0; } - if (i == (unsigned char)1) { r1 = (unsigned char)0; } - if (i == (unsigned char)2) { r2 = (unsigned char)0; } - if (i == (unsigned char)3) { r3 = (unsigned char)0; } - - i = i + (unsigned char)1; - } - - r = r0 | (r1 << 8U) | (r2 << 16U) | (r3 << 24U); - - return r; -} - - -int main() -{ - unsigned int a, b, r; - - r = mp_add(a, b); - - __VERIFIER_assert(r == a + b); - - return 0; -} - diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.yml b/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.yml deleted file mode 100644 index 73f576d42..000000000 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/byte_add_bug.yml +++ /dev/null @@ -1,7 +0,0 @@ -format_version: '1.0' - -input_files: 'byte_add_bug.c' - -properties: - - property_file: ../properties/unreach-call.prp - expected_verdict: false diff --git a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.c b/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.c deleted file mode 100644 index 5b891f97a..000000000 --- a/tests/regression_test/test_cases/sv-benchmarks/map2check-assert/check_if_bug.c +++ /dev/null @@ -1,16 +0,0 @@ -int main() { - - int x=__VERIFIER_nondet_int(); - //__ESBMC_assume(x>0); - int y=__VERIFIER_nondet_int(); - //__ESBMC_assume(y>=0); - //__ESBMC_assume(y<1); - int z=0; - - while(x>0) { - x--; - if(x==y) z=1; // assert(0); - } - __VERIFIER_assert(z==0); -} - diff --git a/tests/regression_test/xml_doc_benchexec/map2check_regression_test_travis.xml b/tests/regression_test/xml_doc_benchexec/map2check_regression_test_travis.xml index 92706ea76..1973284ca 100644 --- a/tests/regression_test/xml_doc_benchexec/map2check_regression_test_travis.xml +++ b/tests/regression_test/xml_doc_benchexec/map2check_regression_test_travis.xml @@ -2,21 +2,23 @@ - + - - /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/MemSafety-Arrays.set + + /home/bench/benchexec_files/tests/regression_test/test_cases/map2check-test/MemSafety-Map.set /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/properties/valid-memsafety.prp - - /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/MemSafety-Heap.set - /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/properties/valid-memsafety.prp + + /home/bench/benchexec_files/tests/regression_test/test_cases/map2check-test/ReachSafety-Map.set + /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/properties/unreach-call.prp - - /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/Map2Check-Assert.set - /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/properties/unreach-call.prp + + /home/bench/benchexec_files/tests/regression_test/test_cases/map2check-test/Overflow-Map.set + /home/bench/benchexec_files/tests/regression_test/test_cases/sv-benchmarks/properties/no-overflow.prp + + diff --git a/tests/regression_test/xml_doc_benchexec/map2check_svcomp_regression.xml b/tests/regression_test/xml_doc_benchexec/map2check_svcomp_regression.xml index 8b4914b34..a17e90ea8 100644 --- a/tests/regression_test/xml_doc_benchexec/map2check_svcomp_regression.xml +++ b/tests/regression_test/xml_doc_benchexec/map2check_svcomp_regression.xml @@ -4,6 +4,54 @@ + + + /home/bench/benchexec_files/sv-benchmarks/c/ReachSafety-ECA.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + /home/bench/benchexec_files/sv-benchmarks/c/ReachSafety-Floats.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/ReachSafety-ProductLines.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/ReachSafety-Sequentialized.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + - - + + + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-AWS-C-Common-ReachSafety.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-BusyBox-MemSafety.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/valid-memsafety.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-BusyBox-NoOverflows.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/no-overflow.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-DeviceDriversLinux64-ReachSafety.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/unreach-call.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-OpenBSD-MemSafety.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/valid-memsafety.prp + + + + /home/bench/benchexec_files/sv-benchmarks/c/SoftwareSystems-SQLite-MemSafety.set + /home/bench/benchexec_files/sv-benchmarks/c/properties/valid-memsafety.prp + + diff --git a/utils/base_image_map2check b/utils/base_image_map2check index cb16afe81..53fe8409e 160000 --- a/utils/base_image_map2check +++ b/utils/base_image_map2check @@ -1 +1 @@ -Subproject commit cb16afe810121ee7308f6538121a2ac6c80d0eb4 +Subproject commit 53fe8409edea4ccb68a52ed06d7ce5931cfa3862 diff --git a/utils/cp_utils_file.sh b/utils/cp_utils_file.sh index e607275e1..73644faad 100755 --- a/utils/cp_utils_file.sh +++ b/utils/cp_utils_file.sh @@ -11,12 +11,20 @@ cp_utils_file() # /deps/src/metaSMT/deps/build/lingeling-ayv-86bf266-140429/license.txt # /deps/src/metaSMT/deps/build/yices-2.5.1/LICENSE echo "> Map2Check license" - if [ ! -f $PREFIX/LICENSE ]; then - cp ../utils/LICENSE.TXT $PREFIX/ - else - rm $PREFIX/LICENSE - cp ../utils/LICENSE.TXT $PREFIX/ - fi + if [ ! -f $PREFIX/LICENSE ]; then + cp ../utils/LICENSE.TXT $PREFIX/ + else + rm $PREFIX/LICENSE + cp ../utils/LICENSE.TXT $PREFIX/ + fi + + echo "> Install CSeq v1.9" + if [ ! -f $PREFIX/bin/cseq-1.9 ]; then + cp -r ../utils/cseq-1.9 $PREFIX/bin/ + else + rm -r $PREFIX/bin/cseq-1.9 + cp -r ../utils/cseq-1.9 $PREFIX/bin/ + fi # Copying licenses tools echo "> Extra tools licenses" diff --git a/utils/cseq-1.9/AUTHORS b/utils/cseq-1.9/AUTHORS new file mode 100644 index 000000000..9c993aced --- /dev/null +++ b/utils/cseq-1.9/AUTHORS @@ -0,0 +1,12 @@ + +CSeq Framework: + Omar Inverso (lead developer and project maintainer, 2013-) + +Lazy-CSeq Sequentialization (lazy configuration): + Omar Inverso (2013-) + Gennaro Parlato (2013-2015) + Bernd Fischer (2013-) + Salvatore La Torre (2013-2015) + Ermenegildo Tomasco (2014-2015) + Truc Nguyen Lam (2015) + diff --git a/utils/cseq-1.9/CHANGES b/utils/cseq-1.9/CHANGES new file mode 100644 index 000000000..7807fec0c --- /dev/null +++ b/utils/cseq-1.9/CHANGES @@ -0,0 +1,8 @@ ++ Version 1.9 (2019.11.27) + + - support for non-standard compiler extensions (e.g., GNU C) via pycparserext and pycparser 2.18 + - more precise linemapping + - improved constant folding and propagation + - improved inliner and unroller modules + - plenty of bug fixes in the modules for the lazy configuration + diff --git a/utils/cseq-1.9/LICENSE b/utils/cseq-1.9/LICENSE new file mode 100644 index 000000000..feb19959b --- /dev/null +++ b/utils/cseq-1.9/LICENSE @@ -0,0 +1,33 @@ +CSeq Program Analysis Framework +Copyright (C) Omar Inverso. + + +All rights reserved. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and other materials provided with the distribution. + + * Neither the name of its contributors or of their affiliations + may be used to endorse or promote products derived from + this software without specific prior written permission. + + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/utils/cseq-1.9/LICENSE-pycparser b/utils/cseq-1.9/LICENSE-pycparser new file mode 100644 index 000000000..d7fb239dc --- /dev/null +++ b/utils/cseq-1.9/LICENSE-pycparser @@ -0,0 +1,28 @@ +pycparser -- A C parser in Python + +Copyright (c) 2008-2017, Eli Bendersky +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +* Neither the name of Eli Bendersky nor the names of its contributors may + be used to endorse or promote products derived from this software without + specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/utils/cseq-1.9/LICENSE-pycparserext b/utils/cseq-1.9/LICENSE-pycparserext new file mode 100644 index 000000000..4eb59e87e --- /dev/null +++ b/utils/cseq-1.9/LICENSE-pycparserext @@ -0,0 +1,24 @@ +pycparserext is licensed to you under the MIT/X Consortium license: + +Copyright (c) 2009-18 Andreas Klöckner and Contributors. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/utils/cseq-1.9/README b/utils/cseq-1.9/README new file mode 100644 index 000000000..ea8373bcf --- /dev/null +++ b/utils/cseq-1.9/README @@ -0,0 +1,62 @@ + C S e q + 1 . 9 + + November 2019 + SV-COMP 2020 + https://github.com/omainv/cseq + http://cseq.cc + + + * Package contents * + +README.txt this file + +cseq.py CSeq command-line front-end +lazy-cseq.py SV-COMP wrapper script + +core/ CSeq core framework +modules/ modules and configuration files + +pycparser/ C99 parser +pycparserext/ GNU C parser + +examples/ examples programs to analyse. + +cbmc-5.4 default backend CBMC (linux binary) for sequential analysis + + + * Installation * + +To install CSeq, please follow the steps below: + + 1. make sure that Python 2.7.14 and GNU gcc (for preprocessing) + are installed on the system + (all other required packages are already included in this package) + + 2. create a directory, suppose this is called /workspace + + 3. extract the entire package contents in /workspace + + 4. set execution (+x) permissions for cseq.py + + 5. set execution (+x) permissions for cbmc-5.4 + + 6. to choose a different backend than the default one + make sure that the backend's binary is in the search path, or + amend the command strings in feeder.py, sect. Options and Parameters, + accordingly. + + + * Usage * + +To try CSeq, please use the following command: + + ./cseq.py -i examples/lazy_unsafe.c + +which should report the file to be unsafe. +Invoking the tool without options: + + ./cseq.py + +will provide further usage directions. + diff --git a/utils/cseq-1.9/core/include/_ansi.h b/utils/cseq-1.9/core/include/_ansi.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/_ansi.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/_fake_defines.h b/utils/cseq-1.9/core/include/_fake_defines.h new file mode 100644 index 000000000..ff3421b5e --- /dev/null +++ b/utils/cseq-1.9/core/include/_fake_defines.h @@ -0,0 +1,67 @@ +#ifndef _FAKE_DEFINES_H +#define _FAKE_DEFINES_H + +#define NULL 0 +#define BUFSIZ 1024 +#define FOPEN_MAX 20 +#define FILENAME_MAX 1024 + +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + +#define __LITTLE_ENDIAN 1234 +#define LITTLE_ENDIAN __LITTLE_ENDIAN +#define __BIG_ENDIAN 4321 +#define BIG_ENDIAN __BIG_ENDIAN +#define __BYTE_ORDER __LITTLE_ENDIAN +#define BYTE_ORDER __BYTE_ORDER + +#define EXIT_FAILURE 1 +#define EXIT_SUCCESS 0 + +#define UCHAR_MAX 255 +#define USHRT_MAX 65535 +#define UINT_MAX 4294967295U +#define RAND_MAX 32767 +#define INT_MAX 32767 + +/* C99 stdbool.h defines */ +#define __bool_true_false_are_defined 1 +#define false 0 +#define true 1 + +/* va_arg macros and type*/ +// typedef int va_list; +#define va_start(_ap, _type) __builtin_va_start((_ap)) +#define va_arg(_ap, _type) __builtin_va_arg((_ap)) +#define va_end(_list) + +/* bzlib.h */ +#define BZ_RUN 0 +#define BZ_FLUSH 1 +#define BZ_FINISH 2 + +#define BZ_OK 0 +#define BZ_RUN_OK 1 +#define BZ_FLUSH_OK 2 +#define BZ_FINISH_OK 3 +#define BZ_STREAM_END 4 +#define BZ_SEQUENCE_ERROR (-1) +#define BZ_PARAM_ERROR (-2) +#define BZ_MEM_ERROR (-3) +#define BZ_DATA_ERROR (-4) +#define BZ_DATA_ERROR_MAGIC (-5) +#define BZ_IO_ERROR (-6) +#define BZ_UNEXPECTED_EOF (-7) +#define BZ_OUTBUFF_FULL (-8) +#define BZ_CONFIG_ERROR (-9) +#define BZ_EXTERN extern + +#endif diff --git a/utils/cseq-1.9/core/include/_fake_typedefs.h b/utils/cseq-1.9/core/include/_fake_typedefs.h new file mode 100644 index 000000000..58fbd21fd --- /dev/null +++ b/utils/cseq-1.9/core/include/_fake_typedefs.h @@ -0,0 +1,175 @@ +#ifndef _FAKE_TYPEDEFS_H +#define _FAKE_TYPEDEFS_H +typedef int _____STARTSTRIPPINGFROMHERE_____; +typedef int __cs_barrier_t; +typedef int __cs_barrierattr_t; +typedef int __cs_attr_t; +typedef int __cs_cond_t; +typedef int __cs_condattr_t; +typedef int __cs_key_t; +typedef int __cs_mutex_t; +typedef int __cs_mutexattr_t; +typedef int __cs_once_t; +typedef int __cs_rwlock_t; +typedef int __cs_rwlockattr_t; +typedef int __cs_t; +typedef int size_t; +typedef int __builtin_va_list; +typedef int __gnuc_va_list; +typedef int __int8_t; +typedef int __uint8_t; +typedef int __int16_t; +typedef int __uint16_t; +typedef int __int_least16_t; +typedef int __uint_least16_t; +typedef int __int32_t; +typedef int __uint32_t; +typedef int __int64_t; +typedef int __uint64_t; +typedef int __int_least32_t; +typedef int __uint_least32_t; +typedef int __s8; +typedef int __u8; +typedef int __s16; +typedef int __u16; +typedef int __s32; +typedef int __u32; +typedef int __s64; +typedef int __u64; +typedef int _LOCK_T; +typedef int _LOCK_RECURSIVE_T; +typedef int _off_t; +typedef int __dev_t; +typedef int __uid_t; +typedef int __gid_t; +typedef int _off64_t; +typedef int _fpos_t; +typedef int _ssize_t; +typedef int wint_t; +typedef int _mbstate_t; +typedef int _flock_t; +typedef int _iconv_t; +typedef int __ULong; +typedef int __FILE; +typedef int ptrdiff_t; +typedef int wchar_t; +typedef int __off_t; +typedef int __pid_t; +typedef int __loff_t; +typedef int u_char; +typedef int u_short; +typedef int u_int; +typedef int u_long; +typedef int ushort; +typedef int uint; +typedef int clock_t; +typedef int time_t; +typedef int daddr_t; +typedef int caddr_t; +typedef int ino_t; +typedef int off_t; +typedef int dev_t; +typedef int uid_t; +typedef int gid_t; +typedef int pid_t; +typedef int key_t; +typedef int ssize_t; +typedef int mode_t; +typedef int nlink_t; +typedef int fd_mask; +typedef int _types_fd_set; +typedef int fd_set; +typedef int clockid_t; +typedef int timer_t; +typedef int useconds_t; +typedef int suseconds_t; +typedef int FILE; +typedef int fpos_t; +typedef int cookie_read_function_t; +typedef int cookie_write_function_t; +typedef int cookie_seek_function_t; +typedef int cookie_close_function_t; +typedef int cookie_io_functions_t; +typedef int div_t; +typedef int ldiv_t; +typedef int lldiv_t; +typedef int sigset_t; +typedef int __sigset_t; +typedef int _sig_func_ptr; +typedef int sig_atomic_t; +typedef int __tzrule_type; +typedef int __tzinfo_type; +typedef int mbstate_t; +typedef int sem_t; +typedef int pthread_t; +typedef int pthread_attr_t; +typedef int pthread_mutex_t; +typedef int pthread_mutexattr_t; +typedef int pthread_cond_t; +typedef int pthread_condattr_t; +typedef int pthread_key_t; +typedef int pthread_once_t; +typedef int pthread_rwlock_t; +typedef int pthread_rwlockattr_t; +typedef int pthread_spinlock_t; +typedef int pthread_barrier_t; +typedef int pthread_barrierattr_t; +typedef int jmp_buf; +typedef int rlim_t; +typedef int sa_family_t; +typedef int sigjmp_buf; +typedef int stack_t; +typedef int siginfo_t; +typedef int z_stream; + +/* C99 exact-width integer types */ +typedef int int8_t; +typedef int uint8_t; +typedef int int16_t; +typedef int uint16_t; +typedef int int32_t; +typedef int uint32_t; +typedef int int64_t; +typedef int uint64_t; + +/* C99 minimum-width integer types */ +typedef int int_least8_t; +typedef int uint_least8_t; +typedef int int_least16_t; +typedef int uint_least16_t; +typedef int int_least32_t; +typedef int uint_least32_t; +typedef int int_least64_t; +typedef int uint_least64_t; + +/* C99 fastest minimum-width integer types */ +typedef int int_fast8_t; +typedef int uint_fast8_t; +typedef int int_fast16_t; +typedef int uint_fast16_t; +typedef int int_fast32_t; +typedef int uint_fast32_t; +typedef int int_fast64_t; +typedef int uint_fast64_t; + +/* C99 integer types capable of holding object pointers */ +typedef int intptr_t; +typedef int uintptr_t; + +/* C99 greatest-width integer types */ +typedef int intmax_t; +typedef int uintmax_t; + +/* C99 stdbool.h bool type. _Bool is built-in in C99 */ +typedef _Bool bool; + +/* bzlib.h */ +typedef void BZFILE; + +typedef int va_list; + +/* For weirdo smack benchmark */ +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; +#endif diff --git a/utils/cseq-1.9/core/include/_syslist.h b/utils/cseq-1.9/core/include/_syslist.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/_syslist.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/alloca.h b/utils/cseq-1.9/core/include/alloca.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/alloca.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/ar.h b/utils/cseq-1.9/core/include/ar.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/ar.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/argz.h b/utils/cseq-1.9/core/include/argz.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/argz.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/arpa/inet.h b/utils/cseq-1.9/core/include/arpa/inet.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/arpa/inet.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/asm-generic/int-ll64.h b/utils/cseq-1.9/core/include/asm-generic/int-ll64.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/asm-generic/int-ll64.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/assert.h b/utils/cseq-1.9/core/include/assert.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/assert.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/bzlib.h b/utils/cseq-1.9/core/include/bzlib.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/bzlib.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/complex.h b/utils/cseq-1.9/core/include/complex.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/complex.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/cseq-include.c b/utils/cseq-1.9/core/include/cseq-include.c new file mode 100644 index 000000000..05cc07ea8 --- /dev/null +++ b/utils/cseq-1.9/core/include/cseq-include.c @@ -0,0 +1,291 @@ +/* Generated by CSeq (-t -r -f) */ + + +#define __CS_type unsigned char +#define __CS_pthread_t unsigned char +#define __CS_pthread_mutex_t unsigned char +#define __CS_pthread_cond_t unsigned char + +//cseq: max no. of rounds and threads (parameters for the translation) +#define __CS_ROUNDS +#define __CS_THREADS + +//cseq: main extra variables used for the simulation +//// __CS_type __k; + +__CS_type __CS_round = 0; //cseq: index of the current round being simulated + +__CS_type __CS_ret = 0; //cseq: thread exit conditions +const __CS_type __CS_ret_PREEMPTED = 0x01; //cseq: context-switch happened before thread end +const __CS_type __CS_ret_ERROR = 0x02; //cseq: thread returned due to an error condition +const __CS_type __CS_ret_FINISHED = 0x04; //cseq: thread finished without errors happening + +__CS_type __CS_error = 0; //cseq: set whenever an error is found and checked after thread-wrapping + +/* +__CS_type __CS_error_detail = 0; //cseq: error condition details (tells why __CS_error was set) +const __CS_type __ERR_MAXTHREADS_REACHED = 0x01; +const __CS_type __ERR_ERROR_LABEL_REACHED = 0x02; +const __CS_type __ERR_ASSERT_FAILURE = 0x04; +const __CS_type __ERR_UNLOCK_ATTEMPT = 0x08; +const __CS_type __ERR_JOIN_FAILED_WRONG_THREAD_ID = 0x10; +const __CS_type __ERR_JOIN_FAILED_THREAD_NOT_CREATED = 0x20; +const __CS_type __ERR_COND_WAIT_MUTEX_NOT_OWNED = 0x30; +const __CS_type __ERR_MUTEX_DESTROY = 0x40; +const __CS_type __ERR_MUTEX_NOT_OWNED = 0x80; +*/ + +//cseq: handling of the status of the threads +__CS_type __CS_thread_index; //cseq: currently running thread ranging in [1..max+1], 1 being main() + +__CS_type __CS_thread_allocated[__CS_THREADS+1]; //cseq: threads used in the simulation +__CS_type __CS_thread_born_round[__CS_THREADS+1]; //cseq: round when a thread is born + +void *(*__CS_thread[__CS_THREADS+1])(void *); //cseq: pointers to thread functions + +__CS_type __CS_thread_status[__CS_ROUNDS][__CS_THREADS+1]; //cseq: thread status at a round +const __CS_type __THREAD_UNUSED = 0x00; //cseq: not used +const __CS_type __THREAD_RUNNING = 0x01; //cseq: successfully created +const __CS_type __THREAD_FINISHED = 0x02; //cseq: finished with errors or without errors +/* +const __CS_type __THREAD_FINISHED_ERROR = 0x02; //cseq: finished with errors +const __CS_type __THREAD_FINISHED_NO_ERROR = 0x04; //cseq: finished without errors +*/ + +__CS_type *__CS_thread_lockedon[__CS_ROUNDS][__CS_THREADS+1]; //cseq: threads waiting for conditional variables + +/* +//cseq: size of dynamically allocated memory blocks, indexed by var ID +int __CS_size[__CS_ROUNDS][9]; +int __CS_cp___CS_size[__CS_ROUNDS][9]; +*/ + +/* +unsigned int __CS_SwitchPoints[__CS_ROUNDS]; +unsigned int __CS_StmtCount; +unsigned int __CS_SwitchDone; +*/ + + + +//cseq: function declarations +int nondet_int(); + +int ___XXXXX__dummyBlock1; +int ___XXXXX__dummyBlock2; + +void __CS_cs(void) +{ + __CS_type k; + + ___XXXXX__assume(__CS_round+k < __CS_ROUNDS); // k==0 --> no switch + __CS_round += k; + ___XXXXX__assume(__CS_thread_lockedon[k][__CS_thread_index] == 0); // this is removed when not needed + + // __CS_ret = (nondet_int() && __CS_round == __CS_ROUNDS-1)?1:__CS_ret; // preemption + __CS_ret = (nondet_int() && __CS_round == __CS_ROUNDS-1)?__CS_ret_PREEMPTED:__CS_ret; +} +/* +void __CS_cs(void) +{ + if (__CS_SwitchDone == __CS_ROUNDS-1) return; + + if (__CS_SwitchPoints[__CS_SwitchDone] == __CS_StmtCount++) { + __CS_type k; + + ___XXXXX__assume(__CS_round+k < __CS_ROUNDS); // k==__CS_round --> no switch + __CS_round += k; + //___XXXXX__assume(__CS_thread_lockedon[__CS_round][__CS_thread_index] == 0); + + __CS_SwitchDone++; + //__CS_StmtCount = 0; + } +} +*/ + +int __CS_pthread_mutex_init(__CS_pthread_mutex_t *mutex, void *attr) +{ + return 0; +} + +int __CS_pthread_mutex_destroy(__CS_pthread_mutex_t *lock) +{ + if (*lock != __CS_thread_index && *lock != 0) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + //__CS_error_detail = __ERR_MUTEX_DESTROY; + } + else *lock = 0; + + return 0; +} + +int __CS_pthread_mutex_lock(__CS_pthread_mutex_t *lock) +{ + if (*lock == 0) *lock = (__CS_thread_index+1); + else { __CS_ret = __CS_ret_PREEMPTED; return 1; } + + return 0; +} + +int __CS_pthread_mutex_unlock(__CS_pthread_mutex_t *lock) +{ + if (*lock != (__CS_thread_index+1)) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + //__CS_error_detail = __ERR_UNLOCK_ATTEMPT; + return 1; + } else *lock = 0; + + return 0; +} + +int __CS_pthread_cond_init(__CS_pthread_cond_t *cond, void *attr) +{ + return 0; +} + +int __CS_pthread_cond_signal(__CS_pthread_cond_t *cond) +{ + int j; + + for (j=0; j<=__CS_THREADS; j++) + if (__CS_thread_lockedon[__CS_round][j] == cond) + __CS_thread_lockedon[__CS_round][j] = 0; + + return 0; +} + +int __CS_pthread_cond_broadcast(__CS_pthread_cond_t *cond) +{ + int j; + + for (j=0; j<=__CS_THREADS; j++) + if (__CS_thread_lockedon[__CS_round][j] == cond) + __CS_thread_lockedon[__CS_round][j] = 0; + + return 0; +} + +int __CS_pthread_cond_wait(__CS_pthread_cond_t *cond, __CS_pthread_mutex_t *lock) +{ + // __CS_pthread_mutex_unlock(mutex); + if (*lock != (__CS_thread_index+1)) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + //__CS_error_detail = __ERR_COND_WAIT_MUTEX_NOT_OWNED; + return 1; + } + else *lock = 0; + + __CS_thread_lockedon[__CS_round][__CS_thread_index] = cond; + __CS_ret = __CS_ret_PREEMPTED; // force context-switch + + // __CS_pthread_mutex_lock(mutex); + if (*lock == 0) *lock = __CS_thread_index+1; + else { __CS_ret = __CS_ret_PREEMPTED; return 1; } + + return 0; +} + +void __CS_assert(int expr) +{ + if (!expr) { + __CS_error = 1; + //__CS_error_detail = __ERR_ASSERT_FAILURE; + __CS_ret = __CS_ret_ERROR; + } +} + +void __CS_assume(int expr) +{ + if (!expr) __CS_ret = __CS_ret_PREEMPTED; +} + +int __CS_pthread_join(__CS_pthread_t thread, void **value_ptr) +{ + // checking index range + if (thread != 123 && thread > __CS_THREADS+1) + { + __CS_error = 1; + //__CS_error_detail = __ERR_JOIN_FAILED_WRONG_THREAD_ID; + __CS_ret = __CS_ret_ERROR; + return 0; + } + + if ( thread == 123 || __CS_thread_status[__CS_round][thread] == __THREAD_RUNNING ) + { + __CS_ret = __CS_ret_PREEMPTED; + return 0; + } + + if (__CS_thread_status[__CS_round][thread] == __THREAD_UNUSED) + { + __CS_error = 1; + //__CS_error_detail = __ERR_JOIN_FAILED_THREAD_NOT_CREATED; + __CS_ret = __CS_ret_ERROR; + return 0; + } + + /* + ___XXXXX__assume( __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED_ERROR || + __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED_NO_ERROR ); + */ + + ___XXXXX__assume( __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED ); + + return 0; +} + +int __CS_pthread_create(__CS_pthread_t *id1, void *attr, void *(*t1)(void*), void *arg) +{ + /* if (nondet_int()) { *id = -1; return -1; } */ + + /* + if (__CS_thread_index == __CS_THREADS+1) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + __CS_error_detail = __ERR_MAXTHREADS_REACHED; + return 1; + } + */ + + if (__CS_thread_index == __CS_THREADS) { + *id1 = 123; + return -1; + } + + __CS_thread_index++; + + __CS_thread_allocated[__CS_thread_index] = 1; + __CS_thread_born_round[__CS_thread_index] = __CS_round; + __CS_thread[__CS_thread_index] = t1; + __CS_thread_status[__CS_round][__CS_thread_index] = __THREAD_RUNNING; + + *id1 = __CS_thread_index; + + return __CS_thread_index; +} + +/* +void *__CS_malloc(int varID, int size) +{ + __CS_size[__CS_round][varID] = size; + return malloc((size_t)size); +} + +void __CS_free(int varID, void *ptr) +{ + __CS_size[__CS_round][varID] = 0; +} + +int __CS_memcmp(void *a, void *b, int size) +{ + int j; + + for (j=0; j (-t -r -f) */ + + +#define __CS_type unsigned char +#define __CS_pthread_t unsigned char +#define __CS_pthread_mutex_t unsigned char +#define __CS_pthread_cond_t unsigned char + +//cseq: max no. of rounds and threads (parameters for the translation) +#define __CS_ROUNDS +#define __CS_THREADS + +//cseq: main extra variables used for the simulation +//// __CS_type __k; + +__CS_type __CS_round = 0; //cseq: index of the current round being simulated + +__CS_type __CS_ret = 0; //cseq: thread exit conditions +const __CS_type __CS_ret_PREEMPTED = 0x01; //cseq: context-switch happened before thread end +const __CS_type __CS_ret_ERROR = 0x02; //cseq: thread returned due to an error condition +const __CS_type __CS_ret_FINISHED = 0x04; //cseq: thread finished without errors happening + +__CS_type __CS_error = 0; //cseq: set whenever an error is found and checked after thread-wrapping + +__CS_type __CS_error_detail = 0; //cseq: error condition details (tells why __CS_error was set) +const __CS_type __ERR_MAXTHREADS_REACHED = 0x01; +const __CS_type __ERR_ERROR_LABEL_REACHED = 0x02; +const __CS_type __ERR_ASSERT_FAILURE = 0x04; +const __CS_type __ERR_UNLOCK_ATTEMPT = 0x08; +const __CS_type __ERR_JOIN_FAILED_WRONG_THREAD_ID = 0x10; +const __CS_type __ERR_JOIN_FAILED_THREAD_NOT_CREATED = 0x20; +const __CS_type __ERR_COND_WAIT_MUTEX_NOT_OWNED = 0x30; +const __CS_type __ERR_MUTEX_DESTROY = 0x40; +const __CS_type __ERR_MUTEX_NOT_OWNED = 0x80; + +//cseq: handling of the status of the threads +__CS_type __CS_thread_index; //cseq: currently running thread ranging in [1..max+1], 1 being main() + +__CS_type __CS_thread_allocated[__CS_THREADS+1]; //cseq: threads used in the simulation +__CS_type __CS_thread_born_round[__CS_THREADS+1]; //cseq: round when a thread is born + +void *(*__CS_thread[__CS_THREADS+1])(void *); //cseq: pointers to thread functions + +__CS_type __CS_thread_status[__CS_ROUNDS][__CS_THREADS+1]; //cseq: thread status at a round +const __CS_type __THREAD_UNUSED = 0x00; //cseq: not used +const __CS_type __THREAD_RUNNING = 0x01; //cseq: successfully created +const __CS_type __THREAD_FINISHED = 0x02; //cseq: finished with errors or without errors +/* +const __CS_type __THREAD_FINISHED_ERROR = 0x02; //cseq: finished with errors +const __CS_type __THREAD_FINISHED_NO_ERROR = 0x04; //cseq: finished without errors +*/ + + +__CS_type *__CS_thread_lockedon[__CS_ROUNDS][__CS_THREADS+1]; //cseq: threads waiting for conditional variables + +/* +//cseq: size of dynamically allocated memory blocks, indexed by var ID +int __CS_size[__CS_ROUNDS][9]; +int __CS_cp___CS_size[__CS_ROUNDS][9]; +*/ + +/* +unsigned int __CS_SwitchPoints[__CS_ROUNDS]; +unsigned int __CS_StmtCount; +unsigned int __CS_SwitchDone; +*/ + + + +//cseq: function declarations +int nondet_int(); + +int ___XXXXX__dummyBlock1; +int ___XXXXX__dummyBlock2; + +void __CS_cs(void) +{ + __CS_type k; + + ___XXXXX__assume(__CS_round+k < __CS_ROUNDS); // k==0 --> no switch + __CS_round += k; + ___XXXXX__assume(__CS_thread_lockedon[k][__CS_thread_index] == 0); // this is removed when not needed + + // __CS_ret = (nondet_int() && __CS_round == __CS_ROUNDS-1)?1:__CS_ret; // preemption + __CS_ret = (nondet_int() && __CS_round == __CS_ROUNDS-1)?__CS_ret_PREEMPTED:__CS_ret; +} +/* +void __CS_cs(void) +{ + if (__CS_SwitchDone == __CS_ROUNDS-1) return; + + if (__CS_SwitchPoints[__CS_SwitchDone] == __CS_StmtCount++) { + __CS_type k; + + ___XXXXX__assume(__CS_round+k < __CS_ROUNDS); // k==__CS_round --> no switch + __CS_round += k; + //___XXXXX__assume(__CS_thread_lockedon[__CS_round][__CS_thread_index] == 0); + + __CS_SwitchDone++; + //__CS_StmtCount = 0; + } +} +*/ + +int __CS_pthread_mutex_init(__CS_pthread_mutex_t *mutex, void *attr) +{ + return 0; +} + +int __CS_pthread_mutex_destroy(__CS_pthread_mutex_t *lock) +{ + if (*lock != __CS_thread_index && *lock != 0) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + __CS_error_detail = __ERR_MUTEX_DESTROY; + } + else *lock = 0; + + return 0; +} + +int __CS_pthread_mutex_lock(__CS_pthread_mutex_t *lock) +{ + if (*lock == 0) *lock = (__CS_thread_index+1); + else { __CS_ret = __CS_ret_PREEMPTED; return 1; } + + return 0; +} + +int __CS_pthread_mutex_unlock(__CS_pthread_mutex_t *lock) +{ + if (*lock != (__CS_thread_index+1)) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + __CS_error_detail = __ERR_UNLOCK_ATTEMPT; + return 1; + } else *lock = 0; + + return 0; +} + +int __CS_pthread_cond_init(__CS_pthread_cond_t *cond, void *attr) +{ + return 0; +} + +int __CS_pthread_cond_signal(__CS_pthread_cond_t *cond) +{ + int j; + + for (j=0; j<=__CS_THREADS; j++) + if (__CS_thread_lockedon[__CS_round][j] == cond) + __CS_thread_lockedon[__CS_round][j] = 0; + + return 0; +} + +int __CS_pthread_cond_broadcast(__CS_pthread_cond_t *cond) +{ + int j; + + for (j=0; j<=__CS_THREADS; j++) + if (__CS_thread_lockedon[__CS_round][j] == cond) + __CS_thread_lockedon[__CS_round][j] = 0; + + return 0; +} + +int __CS_pthread_cond_wait(__CS_pthread_cond_t *cond, __CS_pthread_mutex_t *lock) +{ + // __CS_pthread_mutex_unlock(mutex); + if (*lock != (__CS_thread_index+1)) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + __CS_error_detail = __ERR_COND_WAIT_MUTEX_NOT_OWNED; + return 1; + } + else *lock = 0; + + __CS_thread_lockedon[__CS_round][__CS_thread_index] = cond; + __CS_ret = __CS_ret_PREEMPTED; // force context-switch + + // __CS_pthread_mutex_lock(mutex); + if (*lock == 0) *lock = __CS_thread_index+1; + else { __CS_ret = __CS_ret_PREEMPTED; return 1; } + + return 0; +} + +void __CS_assert(int expr) +{ + if (!expr) { + __CS_error = 1; + __CS_error_detail = __ERR_ASSERT_FAILURE; + __CS_ret = __CS_ret_ERROR; + } +} + +void __CS_assume(int expr) +{ + if (!expr) __CS_ret = __CS_ret_PREEMPTED; +} + +int __CS_pthread_join(__CS_pthread_t thread, void **value_ptr) +{ + // checking index range + if (thread != 123 && thread > __CS_THREADS+1) + { + __CS_error = 1; + __CS_error_detail = __ERR_JOIN_FAILED_WRONG_THREAD_ID; + __CS_ret = __CS_ret_ERROR; + return 0; + } + + if ( thread == 123 || __CS_thread_status[__CS_round][thread] == __THREAD_RUNNING ) + { + __CS_ret = __CS_ret_PREEMPTED; + return 0; + } + + if (__CS_thread_status[__CS_round][thread] == __THREAD_UNUSED) + { + __CS_error = 1; + __CS_error_detail = __ERR_JOIN_FAILED_THREAD_NOT_CREATED; + __CS_ret = __CS_ret_ERROR; + return 0; + } + + /* + ___XXXXX__assume( __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED_ERROR || + __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED_NO_ERROR ); + */ + + ___XXXXX__assume( __CS_thread_status[__CS_round][thread] == __THREAD_FINISHED ); + + return 0; +} + +int __CS_pthread_create(__CS_pthread_t *id1, void *attr, void *(*t1)(void*), void *arg) +{ + /* if (nondet_int()) { *id = -1; return -1; } */ + + /* + if (__CS_thread_index == __CS_THREADS+1) { + __CS_error = 1; + __CS_ret = __CS_ret_ERROR; + __CS_error_detail = __ERR_MAXTHREADS_REACHED; + return 1; + } + */ + + if (__CS_thread_index == __CS_THREADS) { + *id1 = 123; + return -1; + } + + __CS_thread_index++; + + __CS_thread_allocated[__CS_thread_index] = 1; + __CS_thread_born_round[__CS_thread_index] = __CS_round; + __CS_thread[__CS_thread_index] = t1; + __CS_thread_status[__CS_round][__CS_thread_index] = __THREAD_RUNNING; + + *id1 = __CS_thread_index; + + return __CS_thread_index; +} + +/* +void *__CS_malloc(int varID, int size) +{ + __CS_size[__CS_round][varID] = size; + return malloc((size_t)size); +} + +void __CS_free(int varID, void *ptr) +{ + __CS_size[__CS_round][varID] = 0; +} + +int __CS_memcmp(void *a, void *b, int size) +{ + int j; + + for (j=0; j (-t -r -u -b) */ +#include +#include + + +#define THREADS +#define ROUNDS + +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; + +#define IF(A,B) if (pc[thread_index] > A || (A >= pc_cs)) goto B; +#define GUARD(B) assume( pc_cs >= B ); + +#ifndef NULL +#define NULL 0 +#endif + +#define assume(x) (x) +#define __VERIFIER_assume(x) (x) + +#define assert(x) (x) +#define __VERIFIER_assert(x) (x) + +#define __VERIFIER_nondet_int() () + + +#define __VERIFIER_nondet_uint() () + +unsigned int nondet_uint(); + +unsigned char active_thread[THREADS+1]={1}; +unsigned int pc[THREADS+1]; +unsigned int thread_index; +unsigned int pc_cs; + + + +void * __cs_safe_malloc(size_t size) { void * ptr = malloc(size); assume(ptr); return ptr; } +void * __cs_unsafe_malloc(size_t size) { if(nondet_int()) return 0; return malloc(size); } +////#define __cs_unsafe_malloc malloc + +///char __cs_nondet_char() { char c; return c; } + +// #define __cs_init_scalar(A,B) ; +void __cs_init_scalar(void *var, size_t size) { + if (size == sizeof(int)) + *(int *)var = nondet_int(); + else { + char * ptr = (char *)var; + size_t j; + + //for (j=0; j THREADS) return 0; *id = threadID; active_thread[threadID] = 1; threadargs[threadID] = arg; return 0; } +int __cs_join(__cs_t id, void **value_ptr) { assume(pc[id] == thread_lines[id]); return 0; } +int __cs_exit(void *value_ptr) { return 0; } // only for parsing + +int __cs_cond_wait(__cs_cond_t *cond, __cs_mutex_t *mutex) { __cs_mutex_unlock(mutex); assume(*cond != -1); __cs_mutex_lock(mutex); return 0; } +int __cs_cond_signal(__cs_cond_t *cond) { *cond = 1; return 0; } +int __cs_cond_init(__cs_cond_t *cond, void *attr) { *cond = -1; return 0; } + +/////unsigned short guess_pc() { unsigned short x; return x; } +unsigned short guess_pc() { unsigned short x = nondet_int(); return x; } + + +/* here */ + diff --git a/utils/cseq-1.9/core/include/newseq-include.c b/utils/cseq-1.9/core/include/newseq-include.c new file mode 100644 index 000000000..af1a3f489 --- /dev/null +++ b/utils/cseq-1.9/core/include/newseq-include.c @@ -0,0 +1,80 @@ +/* Generated (-t -r -u -b) */ +#include +#include + + +#define THREADS +#define ROUNDS + +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; + +#define IF(T,A,B) if (pc[T] > A || (A >= pc_cs[T])) goto B; +#define GUARD(T,B) assume( pc_cs[T] >= B ); + +#ifndef NULL +#define NULL 0 +#endif + +#define assume(x) (x) +#define __VERIFIER_assume(x) (x) + +#define assert(x) (x) +#define __VERIFIER_assert(x) (x) + +#define __VERIFIER_nondet_int() () + + +#define __VERIFIER_nondet_uint() () + +unsigned int nondet_uint(); + +unsigned active_thread[THREADS+1]={1}; //unsigned char active_thread[THREADS+1]={1}; +unsigned pc[THREADS+1]; //unsigned char active_thread[THREADS+1]={1}; +unsigned pc_cs[THREADS+1]; //unsigned int pc[THREADS+1]; +unsigned thread_index; //unsigned int thread_index; +unsigned thread_lines[] = {}; //unsigned __CPROVER_bitvector[4] thread_lines[] = {3, 8, 8}; + +void * __cs_safe_malloc(size_t size) { void * ptr = malloc(size); assume(ptr); return ptr; } +void * __cs_unsafe_malloc(size_t size) { if(nondet_int()) return 0; return malloc(size); } +//#define __cs_unsafe_malloc malloc + +void __cs_init_scalar(void *var, size_t size) { + if (size == sizeof(int)) + *(int *)var = nondet_int(); + else { + char * ptr = (char *)var; + size_t j; + + //for (j=0; j THREADS) return 0; *id = threadID; active_thread[threadID] = 1; threadargs[threadID] = arg; return 0; } +int __cs_join(__cs_t id, void **value_ptr) { assume(pc[id] == thread_lines[id]); return 0; } +int __cs_exit(void *value_ptr) { return 0; } // only for parsing + +int __cs_cond_wait(__cs_cond_t *cond, __cs_mutex_t *mutex) { __cs_mutex_unlock(mutex); assume(*cond != -1); __cs_mutex_lock(mutex); return 0; } +int __cs_cond_signal(__cs_cond_t *cond) { *cond = 1; return 0; } +int __cs_cond_init(__cs_cond_t *cond, void *attr) { *cond = -1; return 0; } + + + +/* here */ + diff --git a/utils/cseq-1.9/core/include/openssl/err.h b/utils/cseq-1.9/core/include/openssl/err.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/openssl/err.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/openssl/evp.h b/utils/cseq-1.9/core/include/openssl/evp.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/openssl/evp.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/openssl/hmac.h b/utils/cseq-1.9/core/include/openssl/hmac.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/openssl/hmac.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/openssl/ssl.h b/utils/cseq-1.9/core/include/openssl/ssl.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/openssl/ssl.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/openssl/x509v3.h b/utils/cseq-1.9/core/include/openssl/x509v3.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/openssl/x509v3.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/paths.h b/utils/cseq-1.9/core/include/paths.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/paths.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/process.h b/utils/cseq-1.9/core/include/process.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/process.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/pthread.h b/utils/cseq-1.9/core/include/pthread.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/pthread.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/pwd.h b/utils/cseq-1.9/core/include/pwd.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/pwd.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/reent.h b/utils/cseq-1.9/core/include/reent.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/reent.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/regdef.h b/utils/cseq-1.9/core/include/regdef.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/regdef.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/regex.h b/utils/cseq-1.9/core/include/regex.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/regex.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sched.h b/utils/cseq-1.9/core/include/sched.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sched.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/search.h b/utils/cseq-1.9/core/include/search.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/search.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/semaphore.h b/utils/cseq-1.9/core/include/semaphore.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/semaphore.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/setjmp.h b/utils/cseq-1.9/core/include/setjmp.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/setjmp.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/signal.h b/utils/cseq-1.9/core/include/signal.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/signal.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/smack.h b/utils/cseq-1.9/core/include/smack.h new file mode 100644 index 000000000..94dd7b43a --- /dev/null +++ b/utils/cseq-1.9/core/include/smack.h @@ -0,0 +1,12 @@ +#ifndef SMACK_H_ +#define SMACK_H_ + +#define __VERIFIER_assume __SMACK_assume +#define __VERIFIER_assert __SMACK_assert + + +void __SMACK_assert(int val); +void __SMACK_assume(int val); +int __SMACK_nondet(void); + +#endif /*SMACK_H_*/ diff --git a/utils/cseq-1.9/core/include/smack_svcomp.h b/utils/cseq-1.9/core/include/smack_svcomp.h new file mode 100644 index 000000000..0a0fcb61f --- /dev/null +++ b/utils/cseq-1.9/core/include/smack_svcomp.h @@ -0,0 +1,196 @@ +typedef int s8; +typedef int u8; +typedef int s16; +typedef int u16; +typedef int s32; +typedef int u32; + +typedef struct { + int init; + int lock; +} spinlock_t; + +void spin_lock_init(spinlock_t *lock) +{ + lock->init = 1; + lock->lock = 0; +} + +void spin_lock(spinlock_t *lock) +{ + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->lock == 0); + lock->lock = tid; + __VERIFIER_atomic_end(); +} + +void spin_lock_irqsave(spinlock_t *lock, unsigned long value) +{ + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->lock == 0); + lock->lock = tid; + __VERIFIER_atomic_end(); +} + +void spin_lock_irq(spinlock_t *lock) +{ + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->lock == 0); + lock->lock = tid; + __VERIFIER_atomic_end(); +} + +void spin_lock_bh(spinlock_t *lock) +{ + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->lock == 0); + lock->lock = tid; + __VERIFIER_atomic_end(); +} + +void spin_unlock(spinlock_t *lock) +{ + // pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + lock->lock = 0; + __VERIFIER_atomic_end(); +} + +void spin_unlock_irqrestore(spinlock_t *lock, unsigned long value) +{ + // pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + lock->lock = 0; + __VERIFIER_atomic_end(); +} + +void spin_unlock_irq(spinlock_t *lock) +{ + // pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + lock->lock = 0; + __VERIFIER_atomic_end(); +} + +void spin_unlock_bh(spinlock_t *lock) +{ + // pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + lock->lock = 0; + __VERIFIER_atomic_end(); +} + + +struct mutex { + int init; + int locked; +}; + +void mutex_init(struct mutex *lock) +{ + lock->locked = 0; + lock->init = 1; +} + +void mutex_lock(struct mutex *lock) +{ + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->locked == 0); + lock->locked = tid; + __VERIFIER_atomic_end(); +} + +bool mutex_lock_interruptible(struct mutex *lock) +{ + bool ret = __VERIFIER_nondet_bool(); + if(!ret) { + pthread_t tid = pthread_self(); + + __VERIFIER_atomic_begin(); + __VERIFIER_assume(lock->locked == 0); + lock->locked = tid; + __VERIFIER_atomic_end(); + } + return ret; +} + +void mutex_unlock(struct mutex *lock) +{ + __VERIFIER_atomic_begin(); + lock->locked = 0; + __VERIFIER_atomic_end(); +} + +typedef struct poll_table_struct { + int something; +} poll_table; + +struct file_operations { + struct module *owner; + loff_t (*llseek) (struct file *, loff_t, int); + ssize_t (*read) (struct file *, char *, size_t, loff_t *); + ssize_t (*write) (struct file *, const char *, size_t, loff_t *); + long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); + int (*open) (struct inode *, struct file *); +}; + +struct miscdevice { + int minor; + const char *name; + struct file_operations *fops; +}; + +struct file { + loff_t f_pos; + void *private_data; +}; + +struct inode { + int unused; +}; + +struct pci_dev { + int unused; +}; + +struct platform_device { + int dev; +}; + +struct vm_area_struct { + int unused; +}; + +struct cx_dev { + int unused; +}; + +struct nsc_gpio_ops { + struct module* owner; + u32 (*gpio_config) (unsigned iminor, u32 mask, u32 bits); + void (*gpio_dump) (struct nsc_gpio_ops *amp, unsigned iminor); + int (*gpio_get) (unsigned iminor); + void (*gpio_set) (unsigned iminor, int state); + void (*gpio_change) (unsigned iminor); + int (*gpio_current) (unsigned iminor); + struct device* dev; +}; + +extern ssize_t nsc_gpio_write(struct file *file, const char *data, size_t len, loff_t *ppos); +extern ssize_t nsc_gpio_read(struct file *file, char *buf, size_t len, loff_t *ppos); +extern void nsc_gpio_dump(struct nsc_gpio_ops *amp, unsigned index); +extern loff_t no_llseek(struct file *file, loff_t offset, int origin); diff --git a/utils/cseq-1.9/core/include/stdarg.h b/utils/cseq-1.9/core/include/stdarg.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stdarg.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/stdbool.h b/utils/cseq-1.9/core/include/stdbool.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stdbool.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/stddef.h b/utils/cseq-1.9/core/include/stddef.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stddef.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/stdint.h b/utils/cseq-1.9/core/include/stdint.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stdint.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/stdio.h b/utils/cseq-1.9/core/include/stdio.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stdio.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/stdlib.h b/utils/cseq-1.9/core/include/stdlib.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/stdlib.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/string.h b/utils/cseq-1.9/core/include/string.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/string.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/strings.h b/utils/cseq-1.9/core/include/strings.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/strings.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/cdefs.h b/utils/cseq-1.9/core/include/sys/cdefs.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/cdefs.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/ioctl.h b/utils/cseq-1.9/core/include/sys/ioctl.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/ioctl.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/mman.h b/utils/cseq-1.9/core/include/sys/mman.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/mman.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/poll.h b/utils/cseq-1.9/core/include/sys/poll.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/poll.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/resource.h b/utils/cseq-1.9/core/include/sys/resource.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/resource.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/select.h b/utils/cseq-1.9/core/include/sys/select.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/select.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/socket.h b/utils/cseq-1.9/core/include/sys/socket.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/socket.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/stat.h b/utils/cseq-1.9/core/include/sys/stat.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/stat.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/sysctl.h b/utils/cseq-1.9/core/include/sys/sysctl.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/sysctl.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/time.h b/utils/cseq-1.9/core/include/sys/time.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/time.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/timeb.h b/utils/cseq-1.9/core/include/sys/timeb.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/timeb.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/types.h b/utils/cseq-1.9/core/include/sys/types.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/types.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/uio.h b/utils/cseq-1.9/core/include/sys/uio.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/uio.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/un.h b/utils/cseq-1.9/core/include/sys/un.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/un.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/utsname.h b/utils/cseq-1.9/core/include/sys/utsname.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/utsname.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/sys/wait.h b/utils/cseq-1.9/core/include/sys/wait.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/sys/wait.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/syslog.h b/utils/cseq-1.9/core/include/syslog.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/syslog.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/tar.h b/utils/cseq-1.9/core/include/tar.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/tar.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/termios.h b/utils/cseq-1.9/core/include/termios.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/termios.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/tgmath.h b/utils/cseq-1.9/core/include/tgmath.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/tgmath.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/time.h b/utils/cseq-1.9/core/include/time.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/time.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/unctrl.h b/utils/cseq-1.9/core/include/unctrl.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/unctrl.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/unistd.h b/utils/cseq-1.9/core/include/unistd.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/unistd.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/utime.h b/utils/cseq-1.9/core/include/utime.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/utime.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/utmp.h b/utils/cseq-1.9/core/include/utmp.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/utmp.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/wchar.h b/utils/cseq-1.9/core/include/wchar.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/wchar.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/wctype.h b/utils/cseq-1.9/core/include/wctype.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/wctype.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/core/include/zlib.h b/utils/cseq-1.9/core/include/zlib.h new file mode 100644 index 000000000..f952c1d67 --- /dev/null +++ b/utils/cseq-1.9/core/include/zlib.h @@ -0,0 +1,2 @@ +#include "_fake_defines.h" +#include "_fake_typedefs.h" diff --git a/utils/cseq-1.9/cseq.py b/utils/cseq-1.9/cseq.py new file mode 100755 index 000000000..daa80568d --- /dev/null +++ b/utils/cseq-1.9/cseq.py @@ -0,0 +1,764 @@ +#!/usr/bin/env python2.7 +""" CSeq C Program Analysis Framework + command-line user interface + + Copyright (c) Omar Inverso +""" +from __future__ import print_function + +FRAMEWORK_VERSION = 'CSeq-1.9-2019.11.20' # SV-COMP 2020 +#FRAMEWORK_VERSION = 'CSeq-1.9-2019.11.15' # pycparserext +#FRAMEWORK_VERSION = 'CSeq-1.9-2019.10.01' # ICCPS2018 ported with consistent experimental results +#FRAMEWORK_VERSION = 'CSeq-1.8-2019.03.11' +#FRAMEWORK_VERSION = 'CSeq-1.8-2019.03.11' # towards merging all forks +#FRAMEWORK_VERSION = 'CSeq-1.6-2018.11.24' # SVCOMP2019 last submitted version +#FRAMEWORK_VERSION = 'CSeq-1.6-2018.11.07' +#FRAMEWORK_VERSION = 'CSeq-1.6-2018.11.04' +#FRAMEWORK_VERSION = 'CSeq-1.6-2018.10.27' # SVCOMP2019 experiments +#FRAMEWORK_VERSION = 'CSeq-1.6-2018.07.19' # +#FRAMEWORK_VERSION = 'CSeq-1.5-2018.04.22' # CSeq 1.5 Release - experiments with parallel analysis +#FRAMEWORK_VERSION = 'CSeq-1.4-2017.02.27' # start porting to python3 +#FRAMEWORK_VERSION = 'CSeq-1.3-2016.12.15' +#FRAMEWORK_VERSION = 'CSeq-1.3-2016.11.01' +#FRAMEWORK_VERSION = 'CSeq-1.2-2016.09.24' +#FRAMEWORK_VERSION = 'CSeq-1.2-2016.05.05' # CSeq 1.2 student's coursework with transformation examples +#FRAMEWORK_VERSION = 'CSeq-1.1-2016.05.03' # CSeq 1.1 +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.07.16' # CSeq 1.0 Release - ASE2015 +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.07.09' +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.06.24' +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.05.05' +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.01.22' +#FRAMEWORK_VERSION = 'CSeq-1.0-2015.01.07' +#FRAMEWORK_VERSION = 'CSeq-1.0-2014.12.24' # CSeq 1.0beta +#FRAMEWORK_VERSION = 'CSeq-2014.09.27' # CSeq-Lazy-0.6: newseq-0.6a, newseq-0.6c, SVCOMP15 +#FRAMEWORK_VERSION = 'CSeq-2014.06.02' +#FRAMEWORK_VERSION = 'CSeq-2014.02.28' +""" +Changelog: + 2019.11.15 support for compiler extensions (e.g. GNUC) thanks to pycparserext+pycparser 2.18 + 2019.10.04 verbosity levels: 0 errors, 1 warnings+errors, 2 messages+warning+errors, default 1. + 2019.10.04 slight code tidy-up + 2019.10.01 modules can now be grouped into subdirectories + 2019.10.01 improved printable comments (### comment, and ## comment) in configuration files + 2018.11.24 printable comments (e.g., ## comment) in configuration files + 2018.11.07 showfullmapback() now also prints initial coords that referr to a .i file instead of .c and .h only + 2018.11.07 fixed merger's linemapping for preprocessed files to refer to the original input .i file + 2018.11.04 extended debug information (see debugextended) + 2018.10.27 added (optional) workarounds for successfully parsing SVCOMP2019 .i files + 2018.07.19 improved exception handling and on-screen report + 2016.12.05 new debug option to show linemap + 2016.11.01 improved usage screen + 2016.09.24 improved module error output + 2016.05.03 debug options + 2015.06.23 major work on modularization (module parameters,front-end output depending on the configuration) + 2015.05.05 output header with translation detail to replicate experiments + 2015.01.18 minor bugfixing in reading module chains + 2015.01.07 fixing default parameters assignments + 2014.12.09 new CSeq framework organisation + 2014.09.27 moved all code-sanitising to merger stage (merger.py). + 2014.09.22 use strings rather than temporary files before merging (faster) + 2014.09.22 moved thread_local workaround to merging stage (merger.py) + 2014.06.02 introduced specific module.ModuleError exception for detailed error handling + 2014.02.28 major code refactory + error details from module->module transforms incl. source snippet + uniform module importing and handling through one main for loop + +TODO: + - module handling: add hash signatures within a configuration file + to make sure one is using the required version of each module (replicability) + + - this is too long and unreadable now, need to arrange the code properly + + - at the end of the analysis, user time should be reported in addition to wall clock time + + - review all error messages and warnings + + - merger's linemapping should also track the input filename + + - handle multiple command-line parameters, + for example -I firstpath -I secondpath, + also -i firstsourcefile.c -i secondsourcefile.c + + - maybe rather than being part of the core files the merger should be a normal translation module + (useful for instance to handle parameter passing across other modules in a uniform way, + but would mess things up with linemapping) + + - issue a warning message when concurrent versions are running + (useful, for example, with -D which is obviously not thread-safe as it writes the same files to the same folder) +""" +#import exceptions, +import os, sys, time, getopt, glob, importlib, inspect, re, shutil, traceback, resource +import pycparser +import core.config, core.merger, core.module, core.parser, core.utils +from core.utils import colors as colors + +requirepycparser = '2.18' +requirepython = '2.7' + + +class cseqenv: + cmdline = None # full command-line + opts = None # command-line option-value pairs, e.g. (--input, 'file.c') + args = None # + verbosity = 1 # 0 = errors, 1 = errors and warnings, 2 = errors, warnings, and messages + + params = [] # additional front-end input parameters + paramIDs = [] # parameters ID only + paramvalues = {} # param values indexed by param ID + + debug = False # + debugextended = False + showsymbols = False # + showast = False # + shownodes = False # + showlinemap = False # + + chainfile = None # file with the sequence of modules to execute + chaincomment = '' # notes within the chainfile (comments with ### at the beginning) + + inputfile = None # input source file to process + includepath = None # #include path (for source merging) + outputfile = None # TODO not implemented yet + + modules = [] # modules (each performing a single code trasformation) + modulecomment = {} # notes (##) before each module + modulehash = {} # hash of the module, if defined in the chainfile + + transforms = 0 # no. of modules executed so far + + maps = [] + lastlinenoinlastmodule = 0 + outputtofiles = [] # map coords from merged sources to the input source file(s) + + +def moduleparamusage(p): + abc = "--%s" % (p.id) + abc += " <%s>" % p.datatype if p.datatype else '' + + opt = 'optional' if p.optional else '' + opt += ', ' if p.optional and p.default else '' + opt += 'default:%s%s%s' % (colors.FAINT,p.default,colors.NO) if p.default else '' + opt = '(%s)' % opt if len(opt) > 0 else opt + + desc = ('\n '+' '*27).join([l for l in p.description.split('\n')]) # multiline description + + return "%-27s %s %s" % (abc, desc, opt) + + +def usage(cmd, errormsg, showhelp=True, detail=False): + # Long help (-H) provides the list of all input and output parameters + # for each module. + # + # Short help (-h) provides only the input parameters + # that must be provided in the command line. + # + # The input parameters for a given module in the chain + # are those that are not generated by any of the preceeding modules + # (see class core.module). + # + if showhelp: + config = core.utils.extractparamvalue(cseqenv.cmdline, '-l','--load', core.config.defaultchain) + currentconfig = core.config.defaultchain if config == core.config.defaultchain else config + currentconfig = colors.HIGHLIGHT+currentconfig+colors.NO + defaultorcurrent = 'default' if config == core.config.defaultchain else 'currently' + + searchpath = colors.FAINT+'./'+colors.NO + debugpath = colors.FAINT+core.config.debugpath+colors.NO + + version = FRAMEWORK_VERSION[FRAMEWORK_VERSION.find('-')+1:] + version = version[:version.find('-')].split('.') + vmajor = version[0] + vminor = version[1] + + print("") + print(" C S e q ") + print(" %s . %s" % (vmajor,vminor)) + print("") + print("Usage: ") + print("") + print(" %s -h [-l ]" % cmd) + print(" %s -i [options]" % cmd) + print("") + print(" configuration options: ") + print(" -l, --load= configuration to use (%s:%s)" % (defaultorcurrent,currentconfig)) + print(" -L, --list-chains show available configurations") + print("") + print(" input options:") + print(" -i, --input= input filename") + print(" -I, --include= include search path (use : as a separator) (default:%s)" % (searchpath)) + print("") + + # Module-specific params for the given chain (or for the default one) + print(" options:") + + outputparamssofar = [] # used to check which module input params are front-end input + inputparamssofar = [] + + for m in cseqenv.modules: + if detail: + print(" [%s]" % m.getname()) + if len(m.inputparamdefs) == len(m.outputparamdefs) == 0: print('') + + try: + if detail: + if len(m.inputparamdefs) > 0: print(" input:") + + for p in m.inputparamdefs: + if (p.id not in [q.id for q in outputparamssofar] and + p.id not in [q.id for q in inputparamssofar]): + inputparamssofar.append(p) + print(' '+moduleparamusage(p)) + elif detail: + print(' ('+moduleparamusage(p)+')') + + if detail and len(m.inputparamdefs) > 0: print('') + + if detail: + if len(m.outputparamdefs) > 0: print(" output:") + + for p in m.outputparamdefs: + outputparamssofar.append(p) + if detail: + abc = "--%s" % (p.id) + print(" %-26s %s" % (abc, p.description)) + + if detail and len(m.outputparamdefs) > 0: print('') + + except Exception as e: + print("Module error '%s':\n%s.\n" % (m.getname(), str(e))) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + + print("") + print(" debugging options: ") + print(" -D, --debug dump (to:%s) temporary files for each module" % (debugpath)) + print(" -X, --debug-stdout dump (to stdout) temporary files for each module" ) + print(" -S, --show-symbols show symbol table and exit") + print(" -A, --show-ast show abstract syntax tree and exit") + print(" -M, --show-linemap show linemap at the end") + #print " -N, --shownodes show ...") + print("") + print(" other options: ") + print(" -h, --help show help") + print(" -H, --detailedhelp show detailed configuration-specific help") + print(" -q, --quiet show errors only") + print(" -b, --verbose show errors, warnings, and messages") + print(" -v, --version show version number") + print("") + + if errormsg: + print(errormsg + '\n') + sys.exit(1) + + sys.exit(0) + + +def listmodulechains(): + list = '' + for filename in glob.glob('modules/*.chain'): list += filename[len('modules/'):-len('.chain')] + '\n' + if list.endswith(', '): list = list[:-2] + return list + + +def _showfullmapback(): + # Note: since the same input line may correspond to + # multiple lines in the final output, + # the tracing has to be done backwards. + # + lastmodule = len(cseqenv.maps) + nextkey = 0 + inputfile = '' + + additionalspace = 4 + symbolspace = '.' + + for lineno in range(1,cseqenv.lastlinenoinlastmodule): + lastmodule = len(cseqenv.maps) + nextkey = 0 + inputfile = '' + + #if cseqenv.maps[len(cseqenv.maps)-1].has_key(lineno): + if lineno in cseqenv.maps[len(cseqenv.maps)-1]: + firstkey = nextkey = lastkey = lineno + + printfirstkey = symbolspace*(additionalspace+len(str(max(cseqenv.maps[len(cseqenv.maps)-1]))) - len(str(firstkey)))+str(firstkey) + + buff = '' + buff +="%s" % printfirstkey + + for modno in reversed(range(0,lastmodule)): + if nextkey in cseqenv.maps[modno] and nextkey != 0: + lastkey = nextkey + nextkey = cseqenv.maps[modno][nextkey] + + printnextkey = symbolspace*(additionalspace+len(str(max(cseqenv.maps[modno]))) - len(str(nextkey)))+str(nextkey) + + buff+="%s" % printnextkey + else: + nextkey = 0 + + if modno == 0 and lastkey in cseqenv.outputtofiles: + inputfile = cseqenv.outputtofiles[lastkey] + buff +=" %s" %inputfile + + if not buff.endswith('_fake_typedefs.h'): ## and (buff.endswith('.c') or buff.endswith('.h')): + print(buff) + + +def warn(string): + if cseqenv.verbosity > 1: + tag = core.utils.colors.FAINT +string+ core.utils.colors.NO + print(tag) + + +def check(): + ## sanity checks + ## pkg_resources.get_distribution("pycparserext").version 2015.1 + ## pkg_resources.get_distribution("pycparser").version 2.14 + needpython = requirepython.split('.') + + if (int(needpython[0]),int(needpython[1])) > sys.version_info: + print("Python version mismatch: installed version is %s.%s, version %s or later is required.\n" % (sys.version_info[0],sys.version_info[1],requirepython)) + sys.exit(1) + + havepyc = pycparser.__version__.split('.') + needpyc = requirepycparser.split('.') + + if (int(needpyc[0]),int(needpyc[1])) > (int(havepyc[0]),int(havepyc[1])): + print("pycparser version mismatch: installed version is %s, version %s or later is required.\n" % (pycparser.__version__,requirepycparser)) + sys.exit(1) + + +def init(): + ''' + # List all pycparser's AST visit_xyz methods + # (any of them can be overridden in a module) + # + k = core.parser.Parser() + methods = inspect.getmembers(k, predicate=inspect.ismethod) + + for m in methods: + if m[0].startswith('visit_'): print m[0] + + sys.exit(1) + ''' + + ''' ''' + ''' I. Initialisation ''' + ''' ''' + cseqenv.cmdline = sys.argv + cseqenv.starttime = time.time() # save wall time + + # Extract the configuration from the command-line or set it to the default. + cseqenv.chainname = core.utils.extractparamvalue(cseqenv.cmdline, '-l','--load', core.config.defaultchain) + cseqenv.chainfile = 'modules/%s.chain' % core.utils.extractparamvalue(cseqenv.cmdline, '-l','--load', core.config.defaultchain) + + if not core.utils.fileExists(cseqenv.chainfile): + usage(cseqenv.cmdline[0], 'error: unable to open configuration file (%s)' % cseqenv.chainfile, showhelp=False) + + # Import all modules in the current configuration. + + # Module comments. + # + # Notes related to the whole configuration can be positioned + # at the beginning of the file (e.g., '### This configuration implements CAV2014 paper') and + # will be shown by the user interface as the configuration is loaded. + # + # Intermediate comments (e.g., '## Program flattening') can occur anywhere and are shown + # during the execution of the modules. + # + # Regular comments (e.g., '# text') are just ignored. + # + for line in core.utils.printFile(cseqenv.chainfile).splitlines(): + if line.startswith('### ') or line == '###': # configuration notes + if cseqenv.chaincomment == '': + cseqenv.chaincomment = line[4:] + #print("%s%s%s" % (core.utils.colors.FAINT,line[4:],core.utils.colors.NO)) + else: + cseqenv.chaincomment += '\n' +line[4:] + #print("%s%s%s" % (core.utils.colors.FAINT,line[4:],core.utils.colors.NO)) + + elif line.startswith('## ') or line == '##': # comments related to next module + if len(cseqenv.modules) not in cseqenv.modulecomment: + cseqenv.modulecomment[len(cseqenv.modules)] = line[3:] + else: + cseqenv.modulecomment[len(cseqenv.modules)] += '\n' +line[3:] + elif not line.startswith('#') and len(line) >= 1: # comments taking an entire line + line = line.strip() + + if '#' in line: line = line[:line.find('#')].strip() # comments at the end of a line + + split = line.split(' ') + modulename = split[0] + modulehash = split[1] if len(split) == 2 else '' + + cseqenv.modulehash[modulename] = modulehash + + if cseqenv.modulehash[modulename] != '': + modhash = core.utils.shortfilehash('modules/%s.py' % modulename) + warn("module [%s] hash check ok" % modulename) + + if modulehash != modhash: + print("error: hash mismatch for module [%s], stored hash [%s] actual hash [%s]" % (modulename,modulehash,modhash)) + exit(1) + + try: + mod = importlib.import_module('modules.'+modulename.replace('/','.')) # use dots to import + modulename = modulename[modulename.rfind('/')+1:] # modules.something.module + cseqenv.modules.append(getattr(mod, modulename)()) + except ImportError as e: + print("Unable to import module '%s',\nplease check installation.\n" % modulename) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + except AttributeError as e: + print("Unable to load module '%s',\nplease check that the module filename,\nthe entry in the chain-file, and\nthe top-level classname in the module correctly match.\n" % modulename) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + except Exception as e: + print("%serror%s: unable to initialise (module %s):\n%s.\n" % (colors.HIGHLIGHT,colors.NO,modulename,str(e))) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + + # Init modules. + for m in cseqenv.modules: + try: + if 'init' in dir(m): + m.init() + except Exception as e: + print("Unable to initialise module '%s':\n%s.\n" % (m.getname(), str(e))) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + + # Init module parameters. + # + # Modules can have input and output parameters. + # Any module input that is not the output of a previous module + # is a front-end parameter + # (it is displayed in the usage() screen, and + # it can be provided to the front-end in the command-line) + inParams = [] # module-specific input parameters seen so far + inParamIDs = [] + inparamvalues = {} + + outParams = [] # module-specific output parameters seen so far + outParamIDs = [] + outparamvalues = {} + + for moduleid,m in enumerate(cseqenv.modules): + try: + for p in m.inputparamdefs: # global input params seen so far + if p.id not in inParamIDs: + inParamIDs.append(p.id) + inParams.append(p) + + # if the input param p is new and + # no previous module generates it + # (i.e., it is not an output param for any previous module) + # then it needs to be a global (front-end) input + if p.id not in outParamIDs: + cseqenv.paramIDs.append(p.id) + cseqenv.params.append(p) + + for p in m.outputparamdefs: # output params seen so far + if p.id not in outParamIDs: + outParamIDs.append(p.id) + outParams.append(p) + except Exception as e: + print("Unable to initialise module '%s':\n%s.\n" % (m.getname(), str(e))) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + + ''' ''' + ''' II. Parameters ''' + ''' ''' + # Parse command-line. + try: + shortargs = "hHdi:o:I:e:DXSANMvl:Cqb" + longargs = [ "help", "detailed-help", "detail", "input=", "output=", "include=", + "error-label=", + "debug", "debug-stdout", "show-symbols", "show-ast", + "show-nodes", "show-linemap", "version", "load=", + "list-configs", "quiet", "verbose" ] # <-- append module params here + + # add one command-line parameter for each module-specific parameter + for p in cseqenv.params: + longargs.append('%s%s' % (p.id, '' if p.isflag() else '=')) + + cseqenv.opts, cseqenv.args = getopt.getopt(sys.argv[1:], shortargs, longargs) + except getopt.GetoptError as err: + usage(cseqenv.cmdline[0], 'error: ' +str(err)) + + for o, a in cseqenv.opts: + if o in ("-v", "--version"): print(FRAMEWORK_VERSION); return + elif o in ("-h", "--help"): usage(cseqenv.cmdline[0],'') + elif o in ("-H", "--detailed-help"): usage(cseqenv.cmdline[0],'',detail=True) + elif o in ("-l", "--load"): pass # handled beforehand, see above + elif o in ("-C", "--list-configs"): print(listmodulechains()); sys.exit(0) + elif o in ("-D", "--debug"): cseqenv.debug = True + elif o in ("-X", "--debug-stdout"): cseqenv.debugextended = True + elif o in ("-S", "--show-symbols"): cseqenv.showsymbols = True + elif o in ("-A", "--show-ast"): cseqenv.showast = True + elif o in ("-N", "--show-nodes"): cseqenv.shownodes = True + elif o in ("-M", "--show-linemap"): cseqenv.showlinemap = True + elif o in ("-d", "--detail"): detail = True + elif o in ("-i", "--input"): cseqenv.inputfile = a + elif o in ("-o", "--output"): cseqenv.outputfile = a + elif o in ("-I", "--include"): cseqenv.includepath = a + elif o in ("-q", "--quiet"): cseqenv.verbosity = 0 + elif o in ("-b", "--verbose"): cseqenv.verbosity = 2 + else: # module-specific parameters + cseqenv.paramvalues[o[2:]] = a + + if cseqenv.debug and cseqenv.debugextended: + usage(cseqenv.cmdline[0], 'only one debug mode can be activated.') + + # Basic parameter check. + if not cseqenv.inputfile: usage(cseqenv.cmdline[0], 'error: input file name not specified.') + if not core.utils.fileExists(cseqenv.inputfile): usage(cseqenv.cmdline[0], 'error: unable to open input file (%s)' % cseqenv.inputfile, showhelp=False) + if not core.utils.fileExists(cseqenv.chainfile): usage(cseqenv.cmdline[0], 'error: unable to open module-chain file (%s)' % cseqenv.chainfile, showhelp=False) + + # All global parameters (calculated above) should be in the command-line. + for p in cseqenv.params: + if not p.optional and not p.default: + usage(cseqenv.cmdline[0], 'error: %s (option --%s) not specified.' % (p.description, p.id)) + + # Debug setup. + cseqenv.debugpath = core.config.debugpath + if not os.path.exists(core.config.debugpath): os.makedirs(core.config.debugpath) + elif cseqenv.debug: + shutil.rmtree(core.config.debugpath) + os.makedirs(core.config.debugpath) + + +def run(): + if cseqenv.debug or cseqenv.verbosity == 2: + print ("cseq resource ata: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_DATA) ) + print ("cseq resource stack: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_STACK) ) + print ("cseq resource resident size: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_RSS) ) + print ("cseq resource memlock: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_MEMLOCK) ) + print ("cseq resource as: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_AS) ) + + if cseqenv.verbosity == 2: + print ("Configuration [%s%s%s] loaded" % (colors.FAINT,cseqenv.chainfile,colors.NO)) + print("%s%s%s" % (core.utils.colors.FAINT,cseqenv.chaincomment,core.utils.colors.NO)) + + ''' ''' + ''' III. Merging ''' + ''' ''' + # Load the input file. + # print ("Merging") + input = core.utils.printFileRows(cseqenv.inputfile) + + # Might need to sanitise preprocessed (.i) files due to non-standard syntax. + if cseqenv.inputfile.endswith(".i"): + input = core.utils._sanitiseinput(input) + #input = core.utils._gnu_extension_fix(input) + + # Merge all the source files into a single string. + try: + timeBefore = time.time() + fileno = str(cseqenv.transforms).zfill(2) + + if cseqenv.debug or cseqenv.debugextended: + print("[%s] %s" % (fileno, 'merger')) + + cseqenv.moduleID = 'merger' + + Merger = core.merger.Merger() + Merger.loadfromstring(input,cseqenv) + output = Merger.getoutput() + cseqenv.transforms += 1 + + if cseqenv.debug: + core.utils.saveFile('%s/_00_input___merger.c' % core.config.debugpath, input) + core.utils.saveFile('%s/_00_marked__merger.c' % cseqenv.debugpath,Merger.markedoutput) + core.utils.saveFile('%s/_00_output__merger.c' % core.config.debugpath,output) + core.utils.saveFile('%s/_00_linemap__merger.c' % core.config.debugpath,Merger.getlinenumbertable()) + + if cseqenv.debugextended: + dump = input + print('[%s] %s _00_input___merger.c begin' % (fileno,30*' -')) + print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + print('[%s] %s _00_input___merger.c end' % (fileno,30*' -')) + dump = output + print('[%s] %s _00_output___merger.c begin' % (fileno,30*' -')) + print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + print('[%s] %s _00_output___merger.c end' % (fileno,30*' -')) + #dump = Merger.markedoutput + #print('[%s] %s _00_marked___merger.c begin' % (fileno,30*' -')) + #print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + #print('[%s] %s _00_marked___merger.c end' % (fileno,30*' -')) + #dump = Merger.getlinenumbertable() + #print('[%s] %s _00_linemap___merger.c begin' % (fileno,30*' -')) + #print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + #print('[%s] %s _00_linemap___merger.c end' % (fileno,30*' -')) + + if cseqenv.debug or cseqenv.debugextended: + print("[%s] %s %0.2fs " % (fileno,'merger',time.time()-timeBefore)) + + except pycparser.plyparser.ParseError as e: + print("Parse error (%s):\n" % str(e)) + print("%s%s%s" % (colors.HIGHLIGHT, core.utils.snippet(output,Merger.getLineNo(e),Merger.getColumnNo(e),5,True), colors.NO)) + sys.exit(1) + except SystemExit as e: # the module invoked sys.exit() + sys.exit(1) + except: + traceback.print_exc(file=sys.stdout) + sys.exit(1) + + if cseqenv.showsymbols: + Parser = core.parser.Parser() + Parser.loadfromstring(output) + Parser.printsymbols() + sys.exit(0) + + if cseqenv.showast: + Parser = core.parser.Parser() + Parser.loadfromstring(output) + Parser.ast.show() + sys.exit(0) + + if cseqenv.shownodes: + Parser = core.parser.Parser() + Parser.loadfromstring(output) + Parser.shownodes() + sys.exit(0) + + ''' ''' + ''' IV. Transformation ''' + ''' ''' + cseqenv.maps.append(Merger.outputtoinput) + cseqenv.outputtofiles = Merger.outputtofiles + + # Run all modules in a sequence + for cseqenv.transforms, m in enumerate(cseqenv.modules): + if cseqenv.transforms in cseqenv.modulecomment: + # print (">>%s" % cseqenv.modulecomment[cseqenv.transforms]) + if cseqenv.modulecomment[cseqenv.transforms] == "Analysis": + # print("FOUND") Stop here to print the code + break + + try: + timeBefore = time.time() + fileno = str(cseqenv.transforms+1).zfill(2) + + if cseqenv.debug or cseqenv.debugextended: + print("[%s] %s" % (fileno, m.getname())) + + m.initParams(cseqenv) + m.loadfromstring(output, cseqenv) + output = m.getoutput() + + if 'inputtooutput' in dir(m): # linemapping only works on Translator (C-to-C) modules + cseqenv.maps.append(m.outputtoinput) + cseqenv.lastlinenoinlastmodule = m.output.count('\n') + + if cseqenv.debugextended: + #dump = input + #print('[%s] %s _00_input___merger.c begin' % (fileno,30*' -')) + #print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + #print('[%s] %s _00_input___merger.c end' % (fileno,30*' -')) + dump = output + print('[%s] %s _00_output___%s.c begin' % (fileno,30*' -',m.getname())) + print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + print('[%s] %s _00_output___%s.c end' % (fileno,30*' -',m.getname())) + + if cseqenv.debugextended and 'markedoutput' in dir(m): # only if the current module is a Translator + pass + #dump = Merger.markedoutput + #print('[%s] %s _00_marked___merger.c begin' % (fileno,30*' -')) + #print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + #print('[%s] %s _00_marked___merger.c end' % (fileno,30*' -')) + #dump = Merger.getlinenumbertable() + #print('[%s] %s _00_linemap___merger.c begin' % (fileno,30*' -')) + #print('%s' % (core.utils.indent(dump,char='[%s] '%fileno,space='')), end='') + #print('[%s] %s _00_linemap___merger.c end' % (fileno,30*' -')) + + if cseqenv.debug: + core.utils.saveFile('%s/_%s_input___%s.c' % (cseqenv.debugpath,fileno,m.getname()),m.input) + core.utils.saveFile('%s/_%s_output__%s.c' % (cseqenv.debugpath,fileno,m.getname()),m.output) + #core.utils.saveFile('_%s_%s.ast.c' % (cseqenv.transforms,moduleName),str(m.Parser.ast.show())) TODO + #core.utils.saveFile('_%s_%s.symbols.c' % (cseqenv.transforms,moduleName),str(m.Parser.printsymbols())) TODO + print("[%s] %s %0.2fs " % (fileno,m.getname(),time.time()-timeBefore)) + + if cseqenv.debug and 'markedoutput' in dir(m): # only if the current module is a Translator + core.utils.saveFile('%s/_%s_marked__%s.c' % (cseqenv.debugpath,fileno,m.getname()),m.markedoutput) + core.utils.saveFile('%s/_%s_linemap__%s.c' % (cseqenv.debugpath,fileno,m.getname()),m.getlinenumbertable()) + + except pycparser.plyparser.ParseError as e: + if cseqenv.transforms == 0: + print("%ssyntax error%s (%s):\n" % (colors.HIGHLIGHT,colors.NO,str(e))) + snip = core.utils.snippet(output,m.getLineNo(e),m.getColumnNo(e),5,True) + print("%s%s%s" % (colors.FAINT,snip,colors.NO)) + else: # code broken in the last tranformation step + print("%serror%s (%s) while performing %s->%s:\n" % (colors.HIGHLIGHT,colors.NO,str(e),cseqenv.modules[cseqenv.transforms-1].getname() if cseqenv.transforms>0 else '', cseqenv.modules[cseqenv.transforms].getname())) + print("%s%s%s" % (colors.FAINT,core.utils.snippet(output,m.getLineNo(e),m.getColumnNo(e),5,True),colors.NO)) + sys.exit(1) + except core.module.ModuleParamError as e: + print("%serror%s: module %s:\n" % (colors.HIGHLIGHT,colors.NO,str(e))) + sys.exit(1) + except core.module.ModuleError as e: + tag = '%serror%s: module %s:' % (colors.HIGHLIGHT,colors.NO,cseqenv.modules[cseqenv.transforms].getname()) + #print(tag) #print colors.RED +tag+ colors.NO, + #taglen = len(tag) + print(tag, end='') #print colors.RED +tag+ colors.NO, + ####print('\n'+' '*taglen).join([l for l in str(e)[1:-1].split('\n')]) + print(str(e)) + sys.exit(1) + except core.module.ModuleSyntaxError as e: + tag = '%serror%s: module %s:' % (colors.HIGHLIGHT,colors.NO,cseqenv.modules[cseqenv.transforms].getname()) + print(tag, end=' ') #print colors.RED +tag+ colors.NO, + coords = m.getlastcoords() + print(coords+str(e)) + snip = core.utils.snippet(cseqenv.modules[cseqenv.transforms].input,cseqenv.modules[cseqenv.transforms].currentInputLineNumber,0,5,True), + #snip = snip.splitlines() + snip = '\n'.join(snip) + print("\n%s%s%s" % (colors.FAINT,snip,colors.NO)) + sys.exit(1) + except KeyboardInterrupt as e: + sys.exit(1) + except ImportError as e: + print("Import error (%s),\nplease re-install the tool.\n" % str(e)) + traceback.print_exc(file=sys.stdout) + sys.exit(1) + except Exception as e: + print("%serror%s (%s) while performing %s->%s:\n" % (colors.HIGHLIGHT,colors.NO,str(e),cseqenv.modules[cseqenv.transforms-1].getname() if cseqenv.transforms>0 else '', cseqenv.modules[cseqenv.transforms].getname())) + ####print("%s%s%s" % (colors.FAINT,core.utils.snippet(output,m.getLineNo(e),m.getColumnNo(e),5,True),colors.NO)) + print(colors.FAINT,end='') + traceback.print_exc(file=sys.stdout) + print(colors.NO,end='') + sys.exit(1) + + + print(output) + + if cseqenv.showlinemap: + _showfullmapback() + + sys.exit(1) + + ######### print output #print core.utils.strip(output) + return + + +def main(): + # Basic environment check. + check() + + # Initialise modules and parse command-line parameters. + init() + + # Merge and preprocess source file(s). + # Go through the given module chain. + run() + + +if __name__ == "__main__": + main() + + + + + + + diff --git a/utils/cseq-1.9/examples/lazy01.i b/utils/cseq-1.9/examples/lazy01.i new file mode 100644 index 000000000..3bc08edcb --- /dev/null +++ b/utils/cseq-1.9/examples/lazy01.i @@ -0,0 +1,720 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); +typedef unsigned char __u_char; +typedef unsigned short int __u_short; +typedef unsigned int __u_int; +typedef unsigned long int __u_long; +typedef signed char __int8_t; +typedef unsigned char __uint8_t; +typedef signed short int __int16_t; +typedef unsigned short int __uint16_t; +typedef signed int __int32_t; +typedef unsigned int __uint32_t; +__extension__ typedef signed long long int __int64_t; +__extension__ typedef unsigned long long int __uint64_t; +__extension__ typedef long long int __quad_t; +__extension__ typedef unsigned long long int __u_quad_t; +__extension__ typedef long long int __intmax_t; +__extension__ typedef unsigned long long int __uintmax_t; +__extension__ typedef __u_quad_t __dev_t; +__extension__ typedef unsigned int __uid_t; +__extension__ typedef unsigned int __gid_t; +__extension__ typedef unsigned long int __ino_t; +__extension__ typedef __u_quad_t __ino64_t; +__extension__ typedef unsigned int __mode_t; +__extension__ typedef unsigned int __nlink_t; +__extension__ typedef long int __off_t; +__extension__ typedef __quad_t __off64_t; +__extension__ typedef int __pid_t; +__extension__ typedef struct { int __val[2]; } __fsid_t; +__extension__ typedef long int __clock_t; +__extension__ typedef unsigned long int __rlim_t; +__extension__ typedef __u_quad_t __rlim64_t; +__extension__ typedef unsigned int __id_t; +__extension__ typedef long int __time_t; +__extension__ typedef unsigned int __useconds_t; +__extension__ typedef long int __suseconds_t; +__extension__ typedef int __daddr_t; +__extension__ typedef int __key_t; +__extension__ typedef int __clockid_t; +__extension__ typedef void * __timer_t; +__extension__ typedef long int __blksize_t; +__extension__ typedef long int __blkcnt_t; +__extension__ typedef __quad_t __blkcnt64_t; +__extension__ typedef unsigned long int __fsblkcnt_t; +__extension__ typedef __u_quad_t __fsblkcnt64_t; +__extension__ typedef unsigned long int __fsfilcnt_t; +__extension__ typedef __u_quad_t __fsfilcnt64_t; +__extension__ typedef int __fsword_t; +__extension__ typedef int __ssize_t; +__extension__ typedef long int __syscall_slong_t; +__extension__ typedef unsigned long int __syscall_ulong_t; +typedef __off64_t __loff_t; +typedef char *__caddr_t; +__extension__ typedef int __intptr_t; +__extension__ typedef unsigned int __socklen_t; +typedef int __sig_atomic_t; +static __inline unsigned int +__bswap_32 (unsigned int __bsx) +{ + return __builtin_bswap32 (__bsx); +} +static __inline __uint64_t +__bswap_64 (__uint64_t __bsx) +{ + return __builtin_bswap64 (__bsx); +} +static __inline __uint16_t +__uint16_identity (__uint16_t __x) +{ + return __x; +} +static __inline __uint32_t +__uint32_identity (__uint32_t __x) +{ + return __x; +} +static __inline __uint64_t +__uint64_identity (__uint64_t __x) +{ + return __x; +} +typedef unsigned int size_t; +typedef __time_t time_t; +struct timespec +{ + __time_t tv_sec; + __syscall_slong_t tv_nsec; +}; +typedef __pid_t pid_t; +struct sched_param +{ + int sched_priority; +}; + + +typedef unsigned long int __cpu_mask; +typedef struct +{ + __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))]; +} cpu_set_t; + +extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp) + __attribute__ ((__nothrow__ , __leaf__)); +extern cpu_set_t *__sched_cpualloc (size_t __count) __attribute__ ((__nothrow__ , __leaf__)) ; +extern void __sched_cpufree (cpu_set_t *__set) __attribute__ ((__nothrow__ , __leaf__)); + + +extern int sched_setparam (__pid_t __pid, const struct sched_param *__param) + __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_getparam (__pid_t __pid, struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_setscheduler (__pid_t __pid, int __policy, + const struct sched_param *__param) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_getscheduler (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_yield (void) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_get_priority_max (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_get_priority_min (int __algorithm) __attribute__ ((__nothrow__ , __leaf__)); +extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) __attribute__ ((__nothrow__ , __leaf__)); + +typedef __clock_t clock_t; +struct tm +{ + int tm_sec; + int tm_min; + int tm_hour; + int tm_mday; + int tm_mon; + int tm_year; + int tm_wday; + int tm_yday; + int tm_isdst; + long int tm_gmtoff; + const char *tm_zone; +}; +typedef __clockid_t clockid_t; +typedef __timer_t timer_t; +struct itimerspec + { + struct timespec it_interval; + struct timespec it_value; + }; +struct sigevent; +struct __locale_struct +{ + struct __locale_data *__locales[13]; + const unsigned short int *__ctype_b; + const int *__ctype_tolower; + const int *__ctype_toupper; + const char *__names[13]; +}; +typedef struct __locale_struct *__locale_t; +typedef __locale_t locale_t; + +extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__)); +extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); +extern double difftime (time_t __time1, time_t __time0) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); +extern size_t strftime (char *__restrict __s, size_t __maxsize, + const char *__restrict __format, + const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); +extern size_t strftime_l (char *__restrict __s, size_t __maxsize, + const char *__restrict __format, + const struct tm *__restrict __tp, + locale_t __loc) __attribute__ ((__nothrow__ , __leaf__)); +extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); +extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); +extern struct tm *gmtime_r (const time_t *__restrict __timer, + struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); +extern struct tm *localtime_r (const time_t *__restrict __timer, + struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__)); +extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); +extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__)); +extern char *asctime_r (const struct tm *__restrict __tp, + char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); +extern char *ctime_r (const time_t *__restrict __timer, + char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)); +extern char *__tzname[2]; +extern int __daylight; +extern long int __timezone; +extern char *tzname[2]; +extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__)); +extern int daylight; +extern long int timezone; +extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__)); +extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); +extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__)); +extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int nanosleep (const struct timespec *__requested_time, + struct timespec *__remaining); +extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__)); +extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__)); +extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) + __attribute__ ((__nothrow__ , __leaf__)); +extern int clock_nanosleep (clockid_t __clock_id, int __flags, + const struct timespec *__req, + struct timespec *__rem); +extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__)); +extern int timer_create (clockid_t __clock_id, + struct sigevent *__restrict __evp, + timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__)); +extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); +extern int timer_settime (timer_t __timerid, int __flags, + const struct itimerspec *__restrict __value, + struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__)); +extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) + __attribute__ ((__nothrow__ , __leaf__)); +extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__)); +extern int timespec_get (struct timespec *__ts, int __base) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); + +struct __pthread_rwlock_arch_t +{ + unsigned int __readers; + unsigned int __writers; + unsigned int __wrphase_futex; + unsigned int __writers_futex; + unsigned int __pad3; + unsigned int __pad4; + unsigned char __flags; + unsigned char __shared; + signed char __rwelision; + unsigned char __pad2; + int __cur_writer; +}; +typedef struct __pthread_internal_slist +{ + struct __pthread_internal_slist *__next; +} __pthread_slist_t; +struct __pthread_mutex_s +{ + int __lock ; + unsigned int __count; + int __owner; + int __kind; + + unsigned int __nusers; + __extension__ union + { + struct { short __espins; short __eelision; } __elision_data; + __pthread_slist_t __list; + }; + +}; +struct __pthread_cond_s +{ + __extension__ union + { + __extension__ unsigned long long int __wseq; + struct + { + unsigned int __low; + unsigned int __high; + } __wseq32; + }; + __extension__ union + { + __extension__ unsigned long long int __g1_start; + struct + { + unsigned int __low; + unsigned int __high; + } __g1_start32; + }; + unsigned int __g_refs[2] ; + unsigned int __g_size[2]; + unsigned int __g1_orig_size; + unsigned int __wrefs; + unsigned int __g_signals[2]; +}; +typedef unsigned long int pthread_t; +typedef union +{ + char __size[4]; + int __align; +} pthread_mutexattr_t; +typedef union +{ + char __size[4]; + int __align; +} pthread_condattr_t; +typedef unsigned int pthread_key_t; +typedef int pthread_once_t; +union pthread_attr_t +{ + char __size[36]; + long int __align; +}; +typedef union pthread_attr_t pthread_attr_t; +typedef union +{ + struct __pthread_mutex_s __data; + char __size[24]; + long int __align; +} pthread_mutex_t; +typedef union +{ + struct __pthread_cond_s __data; + char __size[48]; + __extension__ long long int __align; +} pthread_cond_t; +typedef union +{ + struct __pthread_rwlock_arch_t __data; + char __size[32]; + long int __align; +} pthread_rwlock_t; +typedef union +{ + char __size[8]; + long int __align; +} pthread_rwlockattr_t; +typedef volatile int pthread_spinlock_t; +typedef union +{ + char __size[20]; + long int __align; +} pthread_barrier_t; +typedef union +{ + char __size[4]; + int __align; +} pthread_barrierattr_t; +typedef int __jmp_buf[6]; +enum +{ + PTHREAD_CREATE_JOINABLE, + PTHREAD_CREATE_DETACHED +}; +enum +{ + PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_ADAPTIVE_NP + , + PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP, + PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP, + PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP, + PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL +}; +enum +{ + PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED, + PTHREAD_MUTEX_ROBUST, + PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST +}; +enum +{ + PTHREAD_PRIO_NONE, + PTHREAD_PRIO_INHERIT, + PTHREAD_PRIO_PROTECT +}; +enum +{ + PTHREAD_RWLOCK_PREFER_READER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NP, + PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, + PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP +}; +enum +{ + PTHREAD_INHERIT_SCHED, + PTHREAD_EXPLICIT_SCHED +}; +enum +{ + PTHREAD_SCOPE_SYSTEM, + PTHREAD_SCOPE_PROCESS +}; +enum +{ + PTHREAD_PROCESS_PRIVATE, + PTHREAD_PROCESS_SHARED +}; +struct _pthread_cleanup_buffer +{ + void (*__routine) (void *); + void *__arg; + int __canceltype; + struct _pthread_cleanup_buffer *__prev; +}; +enum +{ + PTHREAD_CANCEL_ENABLE, + PTHREAD_CANCEL_DISABLE +}; +enum +{ + PTHREAD_CANCEL_DEFERRED, + PTHREAD_CANCEL_ASYNCHRONOUS +}; + +extern int pthread_create (pthread_t *__restrict __newthread, + const pthread_attr_t *__restrict __attr, + void *(*__start_routine) (void *), + void *__restrict __arg) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 3))); +extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__)); +extern int pthread_join (pthread_t __th, void **__thread_return); +extern int pthread_detach (pthread_t __th) __attribute__ ((__nothrow__ , __leaf__)); +extern pthread_t pthread_self (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)); +extern int pthread_attr_init (pthread_attr_t *__attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_destroy (pthread_attr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getdetachstate (const pthread_attr_t *__attr, + int *__detachstate) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setdetachstate (pthread_attr_t *__attr, + int __detachstate) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getguardsize (const pthread_attr_t *__attr, + size_t *__guardsize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setguardsize (pthread_attr_t *__attr, + size_t __guardsize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getschedparam (const pthread_attr_t *__restrict __attr, + struct sched_param *__restrict __param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr, + const struct sched_param *__restrict + __param) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_getschedpolicy (const pthread_attr_t *__restrict + __attr, int *__restrict __policy) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getinheritsched (const pthread_attr_t *__restrict + __attr, int *__restrict __inherit) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setinheritsched (pthread_attr_t *__attr, + int __inherit) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getscope (const pthread_attr_t *__restrict __attr, + int *__restrict __scope) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getstackaddr (const pthread_attr_t *__restrict + __attr, void **__restrict __stackaddr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__)); +extern int pthread_attr_setstackaddr (pthread_attr_t *__attr, + void *__stackaddr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)); +extern int pthread_attr_getstacksize (const pthread_attr_t *__restrict + __attr, size_t *__restrict __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_attr_setstacksize (pthread_attr_t *__attr, + size_t __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_attr_getstack (const pthread_attr_t *__restrict __attr, + void **__restrict __stackaddr, + size_t *__restrict __stacksize) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))); +extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr, + size_t __stacksize) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_setschedparam (pthread_t __target_thread, int __policy, + const struct sched_param *__param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))); +extern int pthread_getschedparam (pthread_t __target_thread, + int *__restrict __policy, + struct sched_param *__restrict __param) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))); +extern int pthread_setschedprio (pthread_t __target_thread, int __prio) + __attribute__ ((__nothrow__ , __leaf__)); +extern int pthread_once (pthread_once_t *__once_control, + void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_setcancelstate (int __state, int *__oldstate); +extern int pthread_setcanceltype (int __type, int *__oldtype); +extern int pthread_cancel (pthread_t __th); +extern void pthread_testcancel (void); +typedef struct +{ + struct + { + __jmp_buf __cancel_jmp_buf; + int __mask_was_saved; + } __cancel_jmp_buf[1]; + void *__pad[4]; +} __pthread_unwind_buf_t __attribute__ ((__aligned__)); +struct __pthread_cleanup_frame +{ + void (*__cancel_routine) (void *); + void *__cancel_arg; + int __do_it; + int __cancel_type; +}; +extern void __pthread_register_cancel (__pthread_unwind_buf_t *__buf) + __attribute__ ((__regparm__ (1))); +extern void __pthread_unregister_cancel (__pthread_unwind_buf_t *__buf) + __attribute__ ((__regparm__ (1))); +extern void __pthread_unwind_next (__pthread_unwind_buf_t *__buf) + __attribute__ ((__regparm__ (1))) __attribute__ ((__noreturn__)) + __attribute__ ((__weak__)) + ; +struct __jmp_buf_tag; +extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) __attribute__ ((__nothrow__)); +extern int pthread_mutex_init (pthread_mutex_t *__mutex, + const pthread_mutexattr_t *__mutexattr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutex_destroy (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutex_trylock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutex_lock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutex_unlock (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutex_getprioceiling (const pthread_mutex_t * + __restrict __mutex, + int *__restrict __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex, + int __prioceiling, + int *__restrict __old_ceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))); +extern int pthread_mutex_consistent (pthread_mutex_t *__mutex) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_getpshared (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_gettype (const pthread_mutexattr_t *__restrict + __attr, int *__restrict __kind) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_getprotocol (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __protocol) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr, + int __protocol) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_getprioceiling (const pthread_mutexattr_t * + __restrict __attr, + int *__restrict __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr, + int __prioceiling) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_mutexattr_getrobust (const pthread_mutexattr_t *__attr, + int *__robustness) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr, + int __robustness) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock, + const pthread_rwlockattr_t *__restrict + __attr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock, + const struct timespec *__restrict + __abstime) __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlockattr_getpshared (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_rwlockattr_getkind_np (const pthread_rwlockattr_t * + __restrict __attr, + int *__restrict __pref) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr, + int __pref) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_cond_init (pthread_cond_t *__restrict __cond, + const pthread_condattr_t *__restrict __cond_attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_cond_destroy (pthread_cond_t *__cond) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_cond_signal (pthread_cond_t *__cond) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_cond_broadcast (pthread_cond_t *__cond) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_cond_wait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex) + __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond, + pthread_mutex_t *__restrict __mutex, + const struct timespec *__restrict __abstime) + __attribute__ ((__nonnull__ (1, 2, 3))); +extern int pthread_condattr_init (pthread_condattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_condattr_destroy (pthread_condattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_condattr_getpshared (const pthread_condattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_condattr_setpshared (pthread_condattr_t *__attr, + int __pshared) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_condattr_getclock (const pthread_condattr_t * + __restrict __attr, + __clockid_t *__restrict __clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_condattr_setclock (pthread_condattr_t *__attr, + __clockid_t __clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_destroy (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_lock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_trylock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_spin_unlock (pthread_spinlock_t *__lock) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier, + const pthread_barrierattr_t *__restrict + __attr, unsigned int __count) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrier_destroy (pthread_barrier_t *__barrier) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrier_wait (pthread_barrier_t *__barrier) + __attribute__ ((__nothrow__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_barrierattr_getpshared (const pthread_barrierattr_t * + __restrict __attr, + int *__restrict __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))); +extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr, + int __pshared) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_key_create (pthread_key_t *__key, + void (*__destr_function) (void *)) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))); +extern int pthread_key_delete (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); +extern void *pthread_getspecific (pthread_key_t __key) __attribute__ ((__nothrow__ , __leaf__)); +extern int pthread_setspecific (pthread_key_t __key, + const void *__pointer) __attribute__ ((__nothrow__ , __leaf__)) ; +extern int pthread_getcpuclockid (pthread_t __thread_id, + __clockid_t *__clock_id) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))); +extern int pthread_atfork (void (*__prepare) (void), + void (*__parent) (void), + void (*__child) (void)) __attribute__ ((__nothrow__ , __leaf__)); + + +extern void __assert_fail (const char *__assertion, const char *__file, + unsigned int __line, const char *__function) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); +extern void __assert_perror_fail (int __errnum, const char *__file, + unsigned int __line, const char *__function) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); +extern void __assert (const char *__assertion, const char *__file, int __line) + __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); + +pthread_mutex_t mutex; +int data = 0; +void *thread1(void *arg) +{ + pthread_mutex_lock(&mutex); + data++; + pthread_mutex_unlock(&mutex); + return 0; +} +void *thread2(void *arg) +{ + pthread_mutex_lock(&mutex); + data+=2; + pthread_mutex_unlock(&mutex); + return 0; +} +void *thread3(void *arg) +{ + pthread_mutex_lock(&mutex); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&mutex); + return 0; +} +int main() +{ + pthread_mutex_init(&mutex, 0); + pthread_t t1, t2, t3; + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + return 0; +} diff --git a/utils/cseq-1.9/examples/lazy_unsafe.c b/utils/cseq-1.9/examples/lazy_unsafe.c new file mode 100644 index 000000000..9f141dfc6 --- /dev/null +++ b/utils/cseq-1.9/examples/lazy_unsafe.c @@ -0,0 +1,51 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +#include +#include + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} diff --git a/utils/cseq-1.9/examples/lazy_unsafe.c.testcase b/utils/cseq-1.9/examples/lazy_unsafe.c.testcase new file mode 100644 index 000000000..ab6512cab --- /dev/null +++ b/utils/cseq-1.9/examples/lazy_unsafe.c.testcase @@ -0,0 +1,59 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +#include +#include + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} + +unsigned map2check_counter = 0; +long map2check_input_array[] = {}; +unsigned __VERIFIER_nondet_uint() { return (unsigned)map2check_input_array[map2check_counter++]; } +int __VERIFIER_nondet_int() { return (int)map2check_input_array[map2check_counter++]; } +char __VERIFIER_nondet_char() { return (char)map2check_input_array[map2check_counter++]; } +void* __VERIFIER_nondet_void() { return (void*)(long)map2check_input_array[map2check_counter++]; } +long __VERIFIER_nondet_long() { return (long)map2check_input_array[map2check_counter++]; } diff --git a/utils/cseq-1.9/examples/peterson.c b/utils/cseq-1.9/examples/peterson.c new file mode 100644 index 000000000..f069d30b9 --- /dev/null +++ b/utils/cseq-1.9/examples/peterson.c @@ -0,0 +1,30 @@ +#include +#include + +int flag1 = 0, flag2 = 0; +int turn; +int x; +void *thr1() { + flag1 = 1; + turn = 1; + while (flag2==1 && turn==1) {}; + x = 0; + if (!(x<=0)) assert(0); + flag1 = 0; +} +void *thr2() { + flag2 = 1; + turn = 0; + while (flag1==1 && turn==0) {}; + x = 1; + if (!(x>=1)) {flag1 = flag1; flag2 = flag2; assert(0);} + flag2 = 0; +} +int main() { + pthread_t t1, t2; + pthread_create(&t1, 0, thr1, 0); + pthread_create(&t2, 0, thr2, 0); + pthread_join(t1, 0); + pthread_join(t2, 0); + return 0; +} diff --git a/utils/cseq-1.9/lazy-cseq.py b/utils/cseq-1.9/lazy-cseq.py new file mode 100755 index 000000000..5ac723971 --- /dev/null +++ b/utils/cseq-1.9/lazy-cseq.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python2.7 +''' + CSeq 1.9 wrapper script for Lazy Configuration, SV-COMP 2020 + + previous versions: + CSeq 1.6 wrapper script for Lazy Configuration, SV-COMP 2019 + Lazy-CSeq 1.1 SV-COMP 2017 wrapper script + + Lazy-CSeq 1.1 SV-COMP 2016 wrapper script + + October 2015 SV-COMP 2016 VERSION + July 2015 adapted to CSeq-1.0 new command-line format + October 2014 SV-COMP 2015 VERSION + November 2013 original version +''' +VERSION = "CSeq-1.9--lazy +SV-COMP2020" + +import sys, getopt, os.path, shlex, subprocess, time, resource +import core.utils as utils +import re + +svcompparams = [] +''' +lazy-cseq 1.0 SVCOMP2017 +svcompparams.append('--time=120 --svcomp --stop-on-fail --depth=1400 --unwind-for=1 --unwind-while=1 --unwind-for-max=50 --softunwindbound --rounds=2 -l lazy --atomicparameter') +svcompparams.append('--time=90 --svcomp --stop-on-fail --depth=350 --unwind-for=2 --unwind-while=2 --rounds=2 -l lazy --atomicparameter') +svcompparams.append('--time=60 --svcomp --stop-on-fail --depth=250 --unwind-for=16 --unwind-while=3 --rounds=1 -l lazy --atomicparameter') +svcompparams.append('--time=90 --svcomp --stop-on-fail --depth=500 --softunwindbound --unwind-while=1 --unwind-for-max=11 --rounds=11 --norobin -l lazy --atomicparameter') +svcompparams.append('--time=240 --svcomp --stop-on-fail --depth=560 --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3 --rounds 4 -l lazy --atomicparameter') + +lazy-cseq-abs SVCOMP2017 +svcompparams.append('--time=120 --svcomp --stop-on-fail --depth=1400 --unwind-for=1 --unwind-while=1 --unwind-for-max=50 --softunwindbound --rounds=2 -l lazy+ai') +svcompparams.append('--time=70 --svcomp --stop-on-fail --depth=350 --unwind-for=2 --unwind-while=2 --rounds=2 -l lazy+ai') +svcompparams.append('--time=60 --svcomp --stop-on-fail --depth=250 --unwind-for=16 --unwind-while=3 --rounds=1 -l lazy+ai') +svcompparams.append('--time=70 --svcomp --stop-on-fail --depth=500 --softunwindbound --unwind-while=1 --unwind-for-max=11 --rounds=11 --norobin -l lazy+ai') +svcompparams.append('--time=200 --svcomp --stop-on-fail --depth=560 --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3 --rounds 4 -l lazy+ai') +svcompparams.append('--time=200 --svcomp --depth=1000 --unwind=1 --rounds=2 -l ase --path-backend=./core/cde-package/cbmc-5.4') +''' + +''' +svcompparams.append('--sv-comp -X -l lazy --rounds=2 --time=1 --depth=1400 --atomicparameters --svcomp --softunwindbound --unwind-while=1 --unwind-for=1 --unwind-for-max=50') +svcompparams.append('--sv-comp -l lazy --rounds=2 --time=1 --depth=350 --atomicparameters --svcomp --unwind-while=2 --unwind-for=2') +svcompparams.append('--sv-comp -l lazy --rounds=1 --time=1 --depth=250 --atomicparameters --svcomp --unwind-while=3 --unwind-for=16') +svcompparams.append('--sv-comp -l lazy --rounds=11 --time=1 --depth=500 --atomicparameters --svcomp --softunwindbound --unwind-while=1 --unwind-for-max=11 --norobin') +svcompparams.append('--sv-comp -l lazy --rounds 4 --time=1 --depth=560 --atomicparameters --svcomp --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3') +''' + +# due to condvar +#####svcompparams.append('--cex --sv-comp -l lazy --rounds=2 --time=150 --depth=1400 --well-nested-locks --softunwindbound --unwind-while=1 --unwind-for=1 --unwind-for-max=50') +svcompparams.append('--cex --deep-propagation --extra-tracking --sv-comp -l lazy --rounds=2 --time=200 --depth=1400 --nondet-condvar-wakeups --softunwindbound --unwind-while=1 --unwind-for=1 --unwind-for-max=100') + +####svcompparams.append('--cex --sv-comp -l lazy --rounds=2 --time=90 --depth=350 --atomic-parameters --svcomp --unwind-while=2 --unwind-for=2') +##########svcompparams.append('--cex --sv-comp -l lazy --rounds=2 --time=125 --depth=350 --atomic-parameter --well-nested-locks --unwind-while=2 --unwind-for=2') +svcompparams.append('--cex --deep-propagation --extra-tracking --sv-comp -l lazy --rounds=2 --time=150 --depth=1400 --atomic-parameter --well-nested-locks --unwind-while=2 --unwind-for=2') + +svcompparams.append('--cex --deep-propagation --extra-tracking --sv-comp -l lazy --rounds=1 --time=60 --depth=400 --atomic-parameters --well-nested-locks --unwind-while=3 --unwind-for=16') + +####svcompparams.append('--cex --sv-comp -l lazy --rounds=11 --time=90 --depth=500 --atomic-parameters --svcomp --softunwindbound --unwind-while=1 --unwind-for-max=11 --norobin') +svcompparams.append('--cex --deep-propagation --extra-tracking --sv-comp -l lazy --rounds=20 --time=250 --depth=750 --atomic-parameter --well-nested-locks --softunwindbound --unwind-while=1 --unwind-for-max=20 --norobin') + +# time 240->500 due to safestack (needs longer timeout) +####svcompparams.append('--cex --sv-comp -l lazy --rounds 4 --time=240 --depth=560 --atomic-parameters --well-nested-locks --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3 --simplify-args') +svcompparams.append('--cex --deep-propagation --sv-comp -l lazy --rounds 4 --time=500 --depth=560 --atomic-parameters --well-nested-locks --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3 --simplify-args') + + +''' --stop-on-fail -----parameters when preprocessing with abstract-interpretation +svcompparams.append('-l lazy+ai --rounds=2 --time=120 --depth=1400 --atomicparameter --svcomp --softunwindbound --unwind-while=1 --unwind-for=1 --unwind-for-max=50') +svcompparams.append('-l lazy+ai --rounds=2 --time=70 --depth=350 --atomicparameter --svcomp --unwind-while=2 --unwind-for=2') +svcompparams.append('-l lazy+ai --rounds=1 --time=60 --depth=250 --atomicparameter --svcomp --unwind-while=3 --unwind-for=16') +svcompparams.append('-l lazy+ai --rounds=11 --time=70 --depth=500 --atomicparameter --svcomp --softunwindbound --unwind-while=1 --unwind-for-max=11 --norobin') +svcompparams.append('-l lazy+ai --rounds=4 --time=200 --depth=560 --atomicparameter --svcomp --softunwindbound --unwind-while=1 --unwind-for=2 --unwind-for-max=3') +svcompparams.append('-l ase --rounds=2 --time=200 --depth=1000 --unwind=1 --path-backend=./core/cde-package/cbmc-5.4') +''' + + + +def usage(cmd, errormsg): + print "Lazy-Cseq SV-COMP2020 wrapper script\n" + + print "Warning: This is a wrapper script for the software verification competition." + print " For any other purpose, please use CSeq's main command-line frontend (cseq.py) instead." + print " (also see README file).\n" + + print " Usage:" + print " -h, --help display this help screen" + print "" + print " -i, --input= read input from the filename" + print " -s, --spec= SV-COMP specfile (default:ALL.prp)" + print " -w, --witness= counterexample output file (default:a.log)" + print " -q, --quick only run the first step with timeout 2 seconds" + print " -V, --version print version" + print '\n' + errormsg + '\n' + sys.exit(1) + +def indent(s): + t = '' + for l in s.splitlines(): t += ' |'+l+'\n' + return t + +def main(args): + quick = False + + realstarttime = time.time() # save wall time + cmd = args[0] + + try: + opts, args = getopt.getopt(sys.argv[1:], "hi:s:w:qV", ["help", "input=", "spec=", "witness=", "quick", "version"]) + except getopt.GetoptError, err: + print "error" + usage(cmd, 'error: ' +str(err)) + + inputfile = spec = witness = '' + + for o, a in opts: + if o == "-v": verbose = True + elif o in ("-h", "--help"): usage(cmd, "") + elif o in ("-w", "--witness"): witness = a + elif o in ("-s", "--spec"): spec = a + elif o in ("-i", "--input"): inputfile = a + elif o in ("-q", "--quick"): + quick = True + global svcompparams + svcompparams[0] = re.sub(' --time=[0-9]+ ', ' --time=2 ', svcompparams[0]) + svcompparams = svcompparams[:1] + print svcompparams + elif o in ("-V", "--version"): + print VERSION + sys.exit(0) + else: assert False, "unhandled option" + + # Check parameters + if inputfile == '': + print "Warning: This is a wrapper script for the software verification competition." + print " For any other purpose, please use CSeq's main command-line frontend (cseq.py) instead." + print " (also see README file).\n" + + print 'error: input file name not specified' + sys.exit(1) + + if not os.path.isfile(inputfile): + print 'error: unable to open input file (%s)' % inputfile + sys.exit(1) + + if witness == '': witness = inputfile + '.log' + + if spec == '': spec = 'ALL.prp' + + # if not os.path.isfile(spec): + # print 'error: unable to open spec file (%s)' % spec + # sys.exit(1) + + # Start the algorithm + print VERSION +"\n" + + print "Warning: This is a wrapper script for the software verification competition." + print " For any other purpose, please use CSeq's main command-line frontend (cseq.py) instead." + print " (also see README file).\n" + + + last = lazyout = '' + maxmem = 0 + + try: + resource.setrlimit(resource.RLIMIT_STACK, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) + resource.setrlimit(resource.RLIMIT_AS, (resource.RLIM_INFINITY, resource.RLIM_INFINITY)) + except: + print ("Warning: unable to set resource limits, current limits:") + print (" RLIMIT_DATA: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_DATA) ) + print (" RLIMIT_STACK: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_STACK) ) + print (" RLIMIT_RSS: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_RSS) ) + print (" RLIMIT_MEMLOCK: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_MEMLOCK) ) + print (" RLIMIT_AS: soft:%s hard:%s" % resource.getrlimit(resource.RLIMIT_AS) ) + + + + for i,params in enumerate(svcompparams): + # After the first analysis pass, + # reuse the sanitised input file saved previously. + #if i>0: inputfile = inputfile[:-2] + '.c' + + cmdline = './cseq.py %s --input %s --witness %s' % (params, inputfile, witness) + + # Move on to the next input file + # as soon as a reachable bug is found, or + # the tool crashes. + if last == 'UNSAFE': + lazyout += '0.00,0.00, ' + continue + elif last == 'UNKNOWN': + lazyout += '0.00,0.00, ' + continue + elif last == 'BACKENDREJECT': + lazyout += '0.00,0.00, ' + continue + + indentedout = '' + + try: + print cmdline + + p = subprocess.Popen(shlex.split(cmdline), stdout=subprocess.PIPE) + out, err = p.communicate() + + print indent(out) + + # Only get the last line + out = out.splitlines()[-1] + out = out.replace(utils.colors.BLINK, '') + out = out.replace(utils.colors.GREEN, '') + out = out.replace(utils.colors.DARKRED, '') + out = out.replace(utils.colors.RED, '') + out = out.replace(utils.colors.BLACK, '') + out = out.replace(utils.colors.NO, '') + + #print "OUT -> " + out + lasttime = float(out[out[:out.rfind(', ')].rfind(", ") + 2:out.rfind(', ')].strip()) + lastmem = out[out.rfind(', ')+2:].replace('MB','') + #print "MEM -> --" + lastmem + '--' + if float(lastmem) > maxmem: maxmem = float(lastmem) + str = '%2.2f,%s, ' % (float(lasttime), lastmem) + lazyout += str + + if 'UNSAFE' in out: + last = 'UNSAFE' + continue + + if 'BACKENDREJECT' in out: + last = 'BACKENDREJECT' + continue + + last = 'SAFE' + except: ### subprocess.CalledProcessError, err: + last = 'UNKNOWN'; + lazyout += '0.00,0.00, ' + continue + + # Change SAFE and UNSAFE into TRUE and FALSE, for SVCOMP + if last == 'SAFE': last = 'TRUE' + elif last == 'UNSAFE': last = 'FALSE' + + # If the tool crashed on the first attempt conclude that the file cannot be analysed. + # If the tool crashed on the last attempt (with experimental ptr simplification), + # conclude that no bugs can be found. + ###elif last == 'BACKENDREJECT' and lazyout.endswith('0.00,0.00, '*(len(svcompparams)-1)): last = 'UNKNOWN' + elif last == 'BACKENDREJECT': last = 'UNKNOWN' + + # Also conclude that we have been unable to find bugs if the analysis does not even start. + elif last == 'UNKNOWN' and lazyout != '0.0,0.0, '*len(svcompparams): last = 'UNKNOWN' + + + print "%s %s, %s, %2.1f,%2.1f" % (lazyout, last, witness, (time.time() - realstarttime), maxmem) + + +if __name__ == "__main__": + main(sys.argv[0:]) + diff --git a/utils/cseq-1.9/log/_00_input___merger.c b/utils/cseq-1.9/log/_00_input___merger.c new file mode 100644 index 000000000..9f141dfc6 --- /dev/null +++ b/utils/cseq-1.9/log/_00_input___merger.c @@ -0,0 +1,51 @@ +extern void __VERIFIER_error() __attribute__ ((__noreturn__)); + +#include +#include + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} diff --git a/utils/cseq-1.9/log/_00_linemap__merger.c b/utils/cseq-1.9/log/_00_linemap__merger.c new file mode 100644 index 000000000..a6f23cb98 --- /dev/null +++ b/utils/cseq-1.9/log/_00_linemap__merger.c @@ -0,0 +1,222 @@ +1,examples/lazy_unsafe.c <- 1 +2,examples/lazy_unsafe.c <- 2 +1,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 3 +2,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 4 +3,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 5 +4,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 6 +5,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 7 +6,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 8 +7,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 9 +8,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 10 +9,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 11 +10,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 12 +11,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 13 +12,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 14 +13,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 15 +14,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 16 +15,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 17 +16,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 18 +17,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 19 +18,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 20 +19,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 21 +20,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 22 +21,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 23 +22,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 24 +23,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 25 +24,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 26 +25,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 27 +26,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 28 +27,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 29 +28,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 30 +29,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 31 +30,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 32 +31,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 33 +32,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 34 +33,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 35 +34,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 36 +35,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 37 +36,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 38 +37,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 39 +38,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 40 +39,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 41 +40,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 42 +41,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 43 +42,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 44 +43,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 45 +44,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 46 +45,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 47 +46,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 48 +47,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 49 +48,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 50 +49,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 51 +50,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 52 +51,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 53 +52,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 54 +53,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 55 +54,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 56 +55,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 57 +56,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 58 +57,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 59 +58,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 60 +59,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 61 +60,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 62 +61,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 63 +62,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 64 +63,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 65 +64,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 66 +65,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 67 +66,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 68 +67,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 69 +68,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 70 +69,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 71 +70,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 72 +71,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 73 +72,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 74 +73,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 75 +74,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 76 +75,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 77 +76,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 78 +77,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 79 +78,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 80 +79,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 81 +80,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 82 +81,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 83 +82,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 84 +83,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 85 +84,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 86 +85,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 87 +86,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 88 +87,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 89 +88,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 90 +89,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 91 +90,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 92 +91,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 93 +92,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 94 +93,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 95 +94,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 96 +95,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 97 +96,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 98 +97,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 99 +98,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 100 +99,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 101 +100,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 102 +101,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 103 +102,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 104 +103,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 105 +104,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 106 +105,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 107 +106,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 108 +107,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 109 +108,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 110 +109,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 111 +110,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 112 +111,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 113 +112,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 114 +113,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 115 +114,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 116 +115,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 117 +116,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 118 +117,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 119 +118,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 120 +119,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 121 +120,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 122 +121,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 123 +122,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 124 +123,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 125 +124,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 126 +125,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 127 +126,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 128 +127,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 129 +128,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 130 +129,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 131 +130,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 132 +131,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 133 +132,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 134 +133,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 135 +134,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 136 +135,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 137 +136,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 138 +137,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 139 +138,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 140 +139,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 141 +140,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 142 +141,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 143 +142,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 144 +143,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 145 +144,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 146 +145,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 147 +146,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 148 +147,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 149 +148,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 150 +149,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 151 +150,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 152 +151,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 153 +152,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 154 +153,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 155 +154,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 156 +155,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 157 +156,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 158 +157,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 159 +158,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 160 +159,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 161 +160,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 162 +161,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 163 +162,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 164 +163,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 165 +164,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 166 +165,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 167 +166,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 168 +167,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 169 +168,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 170 +169,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 171 +170,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 172 +171,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 173 +172,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 174 +173,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 175 +174,/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h <- 176 +5,examples/lazy_unsafe.c <- 177 +6,examples/lazy_unsafe.c <- 178 +7,examples/lazy_unsafe.c <- 179 +8,examples/lazy_unsafe.c <- 180 +9,examples/lazy_unsafe.c <- 181 +10,examples/lazy_unsafe.c <- 182 +11,examples/lazy_unsafe.c <- 183 +12,examples/lazy_unsafe.c <- 184 +13,examples/lazy_unsafe.c <- 185 +14,examples/lazy_unsafe.c <- 186 +15,examples/lazy_unsafe.c <- 187 +16,examples/lazy_unsafe.c <- 188 +17,examples/lazy_unsafe.c <- 189 +18,examples/lazy_unsafe.c <- 190 +19,examples/lazy_unsafe.c <- 191 +20,examples/lazy_unsafe.c <- 192 +21,examples/lazy_unsafe.c <- 193 +22,examples/lazy_unsafe.c <- 194 +23,examples/lazy_unsafe.c <- 195 +24,examples/lazy_unsafe.c <- 196 +25,examples/lazy_unsafe.c <- 197 +26,examples/lazy_unsafe.c <- 198 +27,examples/lazy_unsafe.c <- 199 +28,examples/lazy_unsafe.c <- 200 +29,examples/lazy_unsafe.c <- 201 +30,examples/lazy_unsafe.c <- 202 +31,examples/lazy_unsafe.c <- 203 +32,examples/lazy_unsafe.c <- 204 +33,examples/lazy_unsafe.c <- 205 +34,examples/lazy_unsafe.c <- 206 +35,examples/lazy_unsafe.c <- 207 +36,examples/lazy_unsafe.c <- 208 +37,examples/lazy_unsafe.c <- 209 +38,examples/lazy_unsafe.c <- 210 +39,examples/lazy_unsafe.c <- 211 +40,examples/lazy_unsafe.c <- 212 +41,examples/lazy_unsafe.c <- 213 +42,examples/lazy_unsafe.c <- 214 +43,examples/lazy_unsafe.c <- 215 +44,examples/lazy_unsafe.c <- 216 +45,examples/lazy_unsafe.c <- 217 +46,examples/lazy_unsafe.c <- 218 +47,examples/lazy_unsafe.c <- 219 +48,examples/lazy_unsafe.c <- 220 +49,examples/lazy_unsafe.c <- 221 +50,examples/lazy_unsafe.c <- 222 diff --git a/utils/cseq-1.9/log/_00_marked__merger.c b/utils/cseq-1.9/log/_00_marked__merger.c new file mode 100644 index 000000000..d7b8fbe18 --- /dev/null +++ b/utils/cseq-1.9/log/_00_marked__merger.c @@ -0,0 +1,235 @@ +# 1 "" +# 1 "" +# 1 "" +# 1 "" +extern void __VERIFIER_error() ; + +# 1 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/pthread.h" 1 +# 1 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_defines.h" 1 +# 2 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/pthread.h" 2 +# 1 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/_fake_typedefs.h" 1 + + +typedef int _____STARTSTRIPPINGFROMHERE_____; +typedef int __cs_barrier_t; +typedef int __cs_barrierattr_t; +typedef int __cs_attr_t; +typedef int __cs_cond_t; +typedef int __cs_condattr_t; +typedef int __cs_key_t; +typedef int __cs_mutex_t; +typedef int __cs_mutexattr_t; +typedef int __cs_once_t; +typedef int __cs_rwlock_t; +typedef int __cs_rwlockattr_t; +typedef int __cs_t; +typedef int size_t; +typedef int __builtin_va_list; +typedef int __gnuc_va_list; +typedef int __int8_t; +typedef int __uint8_t; +typedef int __int16_t; +typedef int __uint16_t; +typedef int __int_least16_t; +typedef int __uint_least16_t; +typedef int __int32_t; +typedef int __uint32_t; +typedef int __int64_t; +typedef int __uint64_t; +typedef int __int_least32_t; +typedef int __uint_least32_t; +typedef int __s8; +typedef int __u8; +typedef int __s16; +typedef int __u16; +typedef int __s32; +typedef int __u32; +typedef int __s64; +typedef int __u64; +typedef int _LOCK_T; +typedef int _LOCK_RECURSIVE_T; +typedef int _off_t; +typedef int __dev_t; +typedef int __uid_t; +typedef int __gid_t; +typedef int _off64_t; +typedef int _fpos_t; +typedef int _ssize_t; +typedef int wint_t; +typedef int _mbstate_t; +typedef int _flock_t; +typedef int _iconv_t; +typedef int __ULong; +typedef int __FILE; +typedef int ptrdiff_t; +typedef int wchar_t; +typedef int __off_t; +typedef int __pid_t; +typedef int __loff_t; +typedef int u_char; +typedef int u_short; +typedef int u_int; +typedef int u_long; +typedef int ushort; +typedef int uint; +typedef int clock_t; +typedef int time_t; +typedef int daddr_t; +typedef int caddr_t; +typedef int ino_t; +typedef int off_t; +typedef int dev_t; +typedef int uid_t; +typedef int gid_t; +typedef int pid_t; +typedef int key_t; +typedef int ssize_t; +typedef int mode_t; +typedef int nlink_t; +typedef int fd_mask; +typedef int _types_fd_set; +typedef int fd_set; +typedef int clockid_t; +typedef int timer_t; +typedef int useconds_t; +typedef int suseconds_t; +typedef int FILE; +typedef int fpos_t; +typedef int cookie_read_function_t; +typedef int cookie_write_function_t; +typedef int cookie_seek_function_t; +typedef int cookie_close_function_t; +typedef int cookie_io_functions_t; +typedef int div_t; +typedef int ldiv_t; +typedef int lldiv_t; +typedef int sigset_t; +typedef int __sigset_t; +typedef int _sig_func_ptr; +typedef int sig_atomic_t; +typedef int __tzrule_type; +typedef int __tzinfo_type; +typedef int mbstate_t; +typedef int sem_t; +typedef int pthread_t; +typedef int pthread_attr_t; +typedef int pthread_mutex_t; +typedef int pthread_mutexattr_t; +typedef int pthread_cond_t; +typedef int pthread_condattr_t; +typedef int pthread_key_t; +typedef int pthread_once_t; +typedef int pthread_rwlock_t; +typedef int pthread_rwlockattr_t; +typedef int pthread_spinlock_t; +typedef int pthread_barrier_t; +typedef int pthread_barrierattr_t; +typedef int jmp_buf; +typedef int rlim_t; +typedef int sa_family_t; +typedef int sigjmp_buf; +typedef int stack_t; +typedef int siginfo_t; +typedef int z_stream; + + +typedef int int8_t; +typedef int uint8_t; +typedef int int16_t; +typedef int uint16_t; +typedef int int32_t; +typedef int uint32_t; +typedef int int64_t; +typedef int uint64_t; + + +typedef int int_least8_t; +typedef int uint_least8_t; +typedef int int_least16_t; +typedef int uint_least16_t; +typedef int int_least32_t; +typedef int uint_least32_t; +typedef int int_least64_t; +typedef int uint_least64_t; + + +typedef int int_fast8_t; +typedef int uint_fast8_t; +typedef int int_fast16_t; +typedef int uint_fast16_t; +typedef int int_fast32_t; +typedef int uint_fast32_t; +typedef int int_fast64_t; +typedef int uint_fast64_t; + + +typedef int intptr_t; +typedef int uintptr_t; + + +typedef int intmax_t; +typedef int uintmax_t; + + +typedef _Bool bool; + + +typedef void BZFILE; + +typedef int va_list; + + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; +# 2 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/pthread.h" 2 +# 4 "" 2 +# 1 "/mnt/9e4daa88-9e4f-4a65-85c9-dd4d195cbb1c/Documents/Projects/Map2Check/utils/cseq-1.9/core/include/assert.h" 1 +# 5 "" 2 + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} diff --git a/utils/cseq-1.9/log/_00_output__merger.c b/utils/cseq-1.9/log/_00_output__merger.c new file mode 100644 index 000000000..1ab4cd87d --- /dev/null +++ b/utils/cseq-1.9/log/_00_output__merger.c @@ -0,0 +1,223 @@ +extern void __VERIFIER_error() ; + + + +typedef int _____STARTSTRIPPINGFROMHERE_____; +typedef int __cs_barrier_t; +typedef int __cs_barrierattr_t; +typedef int __cs_attr_t; +typedef int __cs_cond_t; +typedef int __cs_condattr_t; +typedef int __cs_key_t; +typedef int __cs_mutex_t; +typedef int __cs_mutexattr_t; +typedef int __cs_once_t; +typedef int __cs_rwlock_t; +typedef int __cs_rwlockattr_t; +typedef int __cs_t; +typedef int size_t; +typedef int __builtin_va_list; +typedef int __gnuc_va_list; +typedef int __int8_t; +typedef int __uint8_t; +typedef int __int16_t; +typedef int __uint16_t; +typedef int __int_least16_t; +typedef int __uint_least16_t; +typedef int __int32_t; +typedef int __uint32_t; +typedef int __int64_t; +typedef int __uint64_t; +typedef int __int_least32_t; +typedef int __uint_least32_t; +typedef int __s8; +typedef int __u8; +typedef int __s16; +typedef int __u16; +typedef int __s32; +typedef int __u32; +typedef int __s64; +typedef int __u64; +typedef int _LOCK_T; +typedef int _LOCK_RECURSIVE_T; +typedef int _off_t; +typedef int __dev_t; +typedef int __uid_t; +typedef int __gid_t; +typedef int _off64_t; +typedef int _fpos_t; +typedef int _ssize_t; +typedef int wint_t; +typedef int _mbstate_t; +typedef int _flock_t; +typedef int _iconv_t; +typedef int __ULong; +typedef int __FILE; +typedef int ptrdiff_t; +typedef int wchar_t; +typedef int __off_t; +typedef int __pid_t; +typedef int __loff_t; +typedef int u_char; +typedef int u_short; +typedef int u_int; +typedef int u_long; +typedef int ushort; +typedef int uint; +typedef int clock_t; +typedef int time_t; +typedef int daddr_t; +typedef int caddr_t; +typedef int ino_t; +typedef int off_t; +typedef int dev_t; +typedef int uid_t; +typedef int gid_t; +typedef int pid_t; +typedef int key_t; +typedef int ssize_t; +typedef int mode_t; +typedef int nlink_t; +typedef int fd_mask; +typedef int _types_fd_set; +typedef int fd_set; +typedef int clockid_t; +typedef int timer_t; +typedef int useconds_t; +typedef int suseconds_t; +typedef int FILE; +typedef int fpos_t; +typedef int cookie_read_function_t; +typedef int cookie_write_function_t; +typedef int cookie_seek_function_t; +typedef int cookie_close_function_t; +typedef int cookie_io_functions_t; +typedef int div_t; +typedef int ldiv_t; +typedef int lldiv_t; +typedef int sigset_t; +typedef int __sigset_t; +typedef int _sig_func_ptr; +typedef int sig_atomic_t; +typedef int __tzrule_type; +typedef int __tzinfo_type; +typedef int mbstate_t; +typedef int sem_t; +typedef int pthread_t; +typedef int pthread_attr_t; +typedef int pthread_mutex_t; +typedef int pthread_mutexattr_t; +typedef int pthread_cond_t; +typedef int pthread_condattr_t; +typedef int pthread_key_t; +typedef int pthread_once_t; +typedef int pthread_rwlock_t; +typedef int pthread_rwlockattr_t; +typedef int pthread_spinlock_t; +typedef int pthread_barrier_t; +typedef int pthread_barrierattr_t; +typedef int jmp_buf; +typedef int rlim_t; +typedef int sa_family_t; +typedef int sigjmp_buf; +typedef int stack_t; +typedef int siginfo_t; +typedef int z_stream; + + +typedef int int8_t; +typedef int uint8_t; +typedef int int16_t; +typedef int uint16_t; +typedef int int32_t; +typedef int uint32_t; +typedef int int64_t; +typedef int uint64_t; + + +typedef int int_least8_t; +typedef int uint_least8_t; +typedef int int_least16_t; +typedef int uint_least16_t; +typedef int int_least32_t; +typedef int uint_least32_t; +typedef int int_least64_t; +typedef int uint_least64_t; + + +typedef int int_fast8_t; +typedef int uint_fast8_t; +typedef int int_fast16_t; +typedef int uint_fast16_t; +typedef int int_fast32_t; +typedef int uint_fast32_t; +typedef int int_fast64_t; +typedef int uint_fast64_t; + + +typedef int intptr_t; +typedef int uintptr_t; + + +typedef int intmax_t; +typedef int uintmax_t; + + +typedef _Bool bool; + + +typedef void BZFILE; + +typedef int va_list; + + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} diff --git a/utils/cseq-1.9/log/_01_input___workarounds.c b/utils/cseq-1.9/log/_01_input___workarounds.c new file mode 100644 index 000000000..1ab4cd87d --- /dev/null +++ b/utils/cseq-1.9/log/_01_input___workarounds.c @@ -0,0 +1,223 @@ +extern void __VERIFIER_error() ; + + + +typedef int _____STARTSTRIPPINGFROMHERE_____; +typedef int __cs_barrier_t; +typedef int __cs_barrierattr_t; +typedef int __cs_attr_t; +typedef int __cs_cond_t; +typedef int __cs_condattr_t; +typedef int __cs_key_t; +typedef int __cs_mutex_t; +typedef int __cs_mutexattr_t; +typedef int __cs_once_t; +typedef int __cs_rwlock_t; +typedef int __cs_rwlockattr_t; +typedef int __cs_t; +typedef int size_t; +typedef int __builtin_va_list; +typedef int __gnuc_va_list; +typedef int __int8_t; +typedef int __uint8_t; +typedef int __int16_t; +typedef int __uint16_t; +typedef int __int_least16_t; +typedef int __uint_least16_t; +typedef int __int32_t; +typedef int __uint32_t; +typedef int __int64_t; +typedef int __uint64_t; +typedef int __int_least32_t; +typedef int __uint_least32_t; +typedef int __s8; +typedef int __u8; +typedef int __s16; +typedef int __u16; +typedef int __s32; +typedef int __u32; +typedef int __s64; +typedef int __u64; +typedef int _LOCK_T; +typedef int _LOCK_RECURSIVE_T; +typedef int _off_t; +typedef int __dev_t; +typedef int __uid_t; +typedef int __gid_t; +typedef int _off64_t; +typedef int _fpos_t; +typedef int _ssize_t; +typedef int wint_t; +typedef int _mbstate_t; +typedef int _flock_t; +typedef int _iconv_t; +typedef int __ULong; +typedef int __FILE; +typedef int ptrdiff_t; +typedef int wchar_t; +typedef int __off_t; +typedef int __pid_t; +typedef int __loff_t; +typedef int u_char; +typedef int u_short; +typedef int u_int; +typedef int u_long; +typedef int ushort; +typedef int uint; +typedef int clock_t; +typedef int time_t; +typedef int daddr_t; +typedef int caddr_t; +typedef int ino_t; +typedef int off_t; +typedef int dev_t; +typedef int uid_t; +typedef int gid_t; +typedef int pid_t; +typedef int key_t; +typedef int ssize_t; +typedef int mode_t; +typedef int nlink_t; +typedef int fd_mask; +typedef int _types_fd_set; +typedef int fd_set; +typedef int clockid_t; +typedef int timer_t; +typedef int useconds_t; +typedef int suseconds_t; +typedef int FILE; +typedef int fpos_t; +typedef int cookie_read_function_t; +typedef int cookie_write_function_t; +typedef int cookie_seek_function_t; +typedef int cookie_close_function_t; +typedef int cookie_io_functions_t; +typedef int div_t; +typedef int ldiv_t; +typedef int lldiv_t; +typedef int sigset_t; +typedef int __sigset_t; +typedef int _sig_func_ptr; +typedef int sig_atomic_t; +typedef int __tzrule_type; +typedef int __tzinfo_type; +typedef int mbstate_t; +typedef int sem_t; +typedef int pthread_t; +typedef int pthread_attr_t; +typedef int pthread_mutex_t; +typedef int pthread_mutexattr_t; +typedef int pthread_cond_t; +typedef int pthread_condattr_t; +typedef int pthread_key_t; +typedef int pthread_once_t; +typedef int pthread_rwlock_t; +typedef int pthread_rwlockattr_t; +typedef int pthread_spinlock_t; +typedef int pthread_barrier_t; +typedef int pthread_barrierattr_t; +typedef int jmp_buf; +typedef int rlim_t; +typedef int sa_family_t; +typedef int sigjmp_buf; +typedef int stack_t; +typedef int siginfo_t; +typedef int z_stream; + + +typedef int int8_t; +typedef int uint8_t; +typedef int int16_t; +typedef int uint16_t; +typedef int int32_t; +typedef int uint32_t; +typedef int int64_t; +typedef int uint64_t; + + +typedef int int_least8_t; +typedef int uint_least8_t; +typedef int int_least16_t; +typedef int uint_least16_t; +typedef int int_least32_t; +typedef int uint_least32_t; +typedef int int_least64_t; +typedef int uint_least64_t; + + +typedef int int_fast8_t; +typedef int uint_fast8_t; +typedef int int_fast16_t; +typedef int uint_fast16_t; +typedef int int_fast32_t; +typedef int uint_fast32_t; +typedef int int_fast64_t; +typedef int uint_fast64_t; + + +typedef int intptr_t; +typedef int uintptr_t; + + +typedef int intmax_t; +typedef int uintmax_t; + + +typedef _Bool bool; + + +typedef void BZFILE; + +typedef int va_list; + + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; +int data = 0; + +void *thread1(void *arg) +{ + pthread_mutex_lock(&m); + data++; + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) +{ + pthread_mutex_lock(&m); + data+=2; + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) +{ + pthread_mutex_lock(&m); + if (data >= 3){ + ERROR: __VERIFIER_error(); + ; + } + pthread_mutex_unlock(&m); +} + + +int main() +{ + pthread_mutex_init(&m, 0); + + pthread_t t1, t2, t3; + + pthread_create(&t1, 0, thread1, 0); + pthread_create(&t2, 0, thread2, 0); + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + pthread_join(t2, 0); + pthread_join(t3, 0); + + return 0; +} diff --git a/utils/cseq-1.9/log/_01_linemap__workarounds.c b/utils/cseq-1.9/log/_01_linemap__workarounds.c new file mode 100644 index 000000000..d656ecf8a --- /dev/null +++ b/utils/cseq-1.9/log/_01_linemap__workarounds.c @@ -0,0 +1,214 @@ +1 <- 2 +5 <- 4 +6 <- 6 +7 <- 8 +8 <- 10 +9 <- 12 +10 <- 14 +11 <- 16 +12 <- 18 +13 <- 20 +14 <- 22 +15 <- 24 +16 <- 26 +17 <- 28 +18 <- 30 +19 <- 32 +20 <- 34 +21 <- 36 +22 <- 38 +23 <- 40 +24 <- 42 +25 <- 44 +26 <- 46 +27 <- 48 +28 <- 50 +29 <- 52 +30 <- 54 +31 <- 56 +32 <- 58 +33 <- 60 +34 <- 62 +35 <- 64 +36 <- 66 +37 <- 68 +38 <- 70 +39 <- 72 +40 <- 74 +41 <- 76 +42 <- 78 +43 <- 80 +44 <- 82 +45 <- 84 +46 <- 86 +47 <- 88 +48 <- 90 +49 <- 92 +50 <- 94 +51 <- 96 +52 <- 98 +53 <- 100 +54 <- 102 +55 <- 104 +56 <- 106 +57 <- 108 +58 <- 110 +59 <- 112 +60 <- 114 +61 <- 116 +62 <- 118 +63 <- 120 +64 <- 122 +65 <- 124 +66 <- 126 +67 <- 128 +68 <- 130 +69 <- 132 +70 <- 134 +71 <- 136 +72 <- 138 +73 <- 140 +74 <- 142 +75 <- 144 +76 <- 146 +77 <- 148 +78 <- 150 +79 <- 152 +80 <- 154 +81 <- 156 +82 <- 158 +83 <- 160 +84 <- 162 +85 <- 164 +86 <- 166 +87 <- 168 +88 <- 170 +89 <- 172 +90 <- 174 +91 <- 176 +92 <- 178 +93 <- 180 +94 <- 182 +95 <- 184 +96 <- 186 +97 <- 188 +98 <- 190 +99 <- 192 +100 <- 194 +101 <- 196 +102 <- 198 +103 <- 200 +104 <- 202 +105 <- 204 +106 <- 206 +107 <- 208 +108 <- 210 +109 <- 212 +110 <- 214 +111 <- 216 +112 <- 218 +113 <- 220 +114 <- 222 +115 <- 224 +116 <- 226 +117 <- 228 +118 <- 230 +119 <- 232 +120 <- 234 +121 <- 236 +122 <- 238 +123 <- 240 +124 <- 242 +125 <- 244 +128 <- 246 +129 <- 248 +130 <- 250 +131 <- 252 +132 <- 254 +133 <- 256 +134 <- 258 +135 <- 260 +138 <- 262 +139 <- 264 +140 <- 266 +141 <- 268 +142 <- 270 +143 <- 272 +144 <- 274 +145 <- 276 +148 <- 278 +149 <- 280 +150 <- 282 +151 <- 284 +152 <- 286 +153 <- 288 +154 <- 290 +155 <- 292 +158 <- 294 +159 <- 296 +162 <- 298 +163 <- 300 +166 <- 302 +169 <- 304 +171 <- 306 +174 <- 308 +176 <- 310 +178 <- 312 +179 <- 314 +181 <- 316 +182 <- 318 +182 <- 319 +183 <- 320 +183 <- 321 +184 <- 322 +184 <- 323 +185 <- 324 +185 <- 325 +189 <- 328 +190 <- 330 +190 <- 331 +191 <- 332 +191 <- 333 +192 <- 334 +192 <- 335 +193 <- 336 +193 <- 337 +197 <- 340 +198 <- 342 +198 <- 343 +199 <- 344 +199 <- 345 +200 <- 346 +200 <- 347 +200 <- 348 +201 <- 349 +201 <- 350 +201 <- 352 +202 <- 353 +202 <- 354 +202 <- 356 +204 <- 357 +204 <- 358 +208 <- 361 +209 <- 363 +209 <- 364 +210 <- 365 +210 <- 366 +212 <- 367 +212 <- 368 +212 <- 369 +212 <- 370 +214 <- 371 +214 <- 372 +215 <- 373 +215 <- 374 +216 <- 375 +216 <- 376 +218 <- 377 +218 <- 378 +219 <- 379 +219 <- 380 +220 <- 381 +220 <- 382 +222 <- 383 +222 <- 384 diff --git a/utils/cseq-1.9/log/_01_marked__workarounds.c b/utils/cseq-1.9/log/_01_marked__workarounds.c new file mode 100644 index 000000000..599b181f3 --- /dev/null +++ b/utils/cseq-1.9/log/_01_marked__workarounds.c @@ -0,0 +1,570 @@ + +# 1 "" +void __VERIFIER_error(); + +# 5 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 7 "" +typedef int __cs_barrierattr_t; + +# 8 "" +typedef int __cs_attr_t; + +# 9 "" +typedef int __cs_cond_t; + +# 10 "" +typedef int __cs_condattr_t; + +# 11 "" +typedef int __cs_key_t; + +# 12 "" +typedef int __cs_mutex_t; + +# 13 "" +typedef int __cs_mutexattr_t; + +# 14 "" +typedef int __cs_once_t; + +# 15 "" +typedef int __cs_rwlock_t; + +# 16 "" +typedef int __cs_rwlockattr_t; + +# 17 "" +typedef int __cs_t; + +# 18 "" +typedef int size_t; + +# 19 "" +typedef int __builtin_va_list; + +# 20 "" +typedef int __gnuc_va_list; + +# 21 "" +typedef int __int8_t; + +# 22 "" +typedef int __uint8_t; + +# 23 "" +typedef int __int16_t; + +# 24 "" +typedef int __uint16_t; + +# 25 "" +typedef int __int_least16_t; + +# 26 "" +typedef int __uint_least16_t; + +# 27 "" +typedef int __int32_t; + +# 28 "" +typedef int __uint32_t; + +# 29 "" +typedef int __int64_t; + +# 30 "" +typedef int __uint64_t; + +# 31 "" +typedef int __int_least32_t; + +# 32 "" +typedef int __uint_least32_t; + +# 33 "" +typedef int __s8; + +# 34 "" +typedef int __u8; + +# 35 "" +typedef int __s16; + +# 36 "" +typedef int __u16; + +# 37 "" +typedef int __s32; + +# 38 "" +typedef int __u32; + +# 39 "" +typedef int __s64; + +# 40 "" +typedef int __u64; + +# 41 "" +typedef int _LOCK_T; + +# 42 "" +typedef int _LOCK_RECURSIVE_T; + +# 43 "" +typedef int _off_t; + +# 44 "" +typedef int __dev_t; + +# 45 "" +typedef int __uid_t; + +# 46 "" +typedef int __gid_t; + +# 47 "" +typedef int _off64_t; + +# 48 "" +typedef int _fpos_t; + +# 49 "" +typedef int _ssize_t; + +# 50 "" +typedef int wint_t; + +# 51 "" +typedef int _mbstate_t; + +# 52 "" +typedef int _flock_t; + +# 53 "" +typedef int _iconv_t; + +# 54 "" +typedef int __ULong; + +# 55 "" +typedef int __FILE; + +# 56 "" +typedef int ptrdiff_t; + +# 57 "" +typedef int wchar_t; + +# 58 "" +typedef int __off_t; + +# 59 "" +typedef int __pid_t; + +# 60 "" +typedef int __loff_t; + +# 61 "" +typedef int u_char; + +# 62 "" +typedef int u_short; + +# 63 "" +typedef int u_int; + +# 64 "" +typedef int u_long; + +# 65 "" +typedef int ushort; + +# 66 "" +typedef int uint; + +# 67 "" +typedef int clock_t; + +# 68 "" +typedef int time_t; + +# 69 "" +typedef int daddr_t; + +# 70 "" +typedef int caddr_t; + +# 71 "" +typedef int ino_t; + +# 72 "" +typedef int off_t; + +# 73 "" +typedef int dev_t; + +# 74 "" +typedef int uid_t; + +# 75 "" +typedef int gid_t; + +# 76 "" +typedef int pid_t; + +# 77 "" +typedef int key_t; + +# 78 "" +typedef int ssize_t; + +# 79 "" +typedef int mode_t; + +# 80 "" +typedef int nlink_t; + +# 81 "" +typedef int fd_mask; + +# 82 "" +typedef int _types_fd_set; + +# 83 "" +typedef int fd_set; + +# 84 "" +typedef int clockid_t; + +# 85 "" +typedef int timer_t; + +# 86 "" +typedef int useconds_t; + +# 87 "" +typedef int suseconds_t; + +# 88 "" +typedef int FILE; + +# 89 "" +typedef int fpos_t; + +# 90 "" +typedef int cookie_read_function_t; + +# 91 "" +typedef int cookie_write_function_t; + +# 92 "" +typedef int cookie_seek_function_t; + +# 93 "" +typedef int cookie_close_function_t; + +# 94 "" +typedef int cookie_io_functions_t; + +# 95 "" +typedef int div_t; + +# 96 "" +typedef int ldiv_t; + +# 97 "" +typedef int lldiv_t; + +# 98 "" +typedef int sigset_t; + +# 99 "" +typedef int __sigset_t; + +# 100 "" +typedef int _sig_func_ptr; + +# 101 "" +typedef int sig_atomic_t; + +# 102 "" +typedef int __tzrule_type; + +# 103 "" +typedef int __tzinfo_type; + +# 104 "" +typedef int mbstate_t; + +# 105 "" +typedef int sem_t; + +# 106 "" +typedef int pthread_t; + +# 107 "" +typedef int pthread_attr_t; + +# 108 "" +typedef int pthread_mutex_t; + +# 109 "" +typedef int pthread_mutexattr_t; + +# 110 "" +typedef int pthread_cond_t; + +# 111 "" +typedef int pthread_condattr_t; + +# 112 "" +typedef int pthread_key_t; + +# 113 "" +typedef int pthread_once_t; + +# 114 "" +typedef int pthread_rwlock_t; + +# 115 "" +typedef int pthread_rwlockattr_t; + +# 116 "" +typedef int pthread_spinlock_t; + +# 117 "" +typedef int pthread_barrier_t; + +# 118 "" +typedef int pthread_barrierattr_t; + +# 119 "" +typedef int jmp_buf; + +# 120 "" +typedef int rlim_t; + +# 121 "" +typedef int sa_family_t; + +# 122 "" +typedef int sigjmp_buf; + +# 123 "" +typedef int stack_t; + +# 124 "" +typedef int siginfo_t; + +# 125 "" +typedef int z_stream; + +# 128 "" +typedef int int8_t; + +# 129 "" +typedef int uint8_t; + +# 130 "" +typedef int int16_t; + +# 131 "" +typedef int uint16_t; + +# 132 "" +typedef int int32_t; + +# 133 "" +typedef int uint32_t; + +# 134 "" +typedef int int64_t; + +# 135 "" +typedef int uint64_t; + +# 138 "" +typedef int int_least8_t; + +# 139 "" +typedef int uint_least8_t; + +# 140 "" +typedef int int_least16_t; + +# 141 "" +typedef int uint_least16_t; + +# 142 "" +typedef int int_least32_t; + +# 143 "" +typedef int uint_least32_t; + +# 144 "" +typedef int int_least64_t; + +# 145 "" +typedef int uint_least64_t; + +# 148 "" +typedef int int_fast8_t; + +# 149 "" +typedef int uint_fast8_t; + +# 150 "" +typedef int int_fast16_t; + +# 151 "" +typedef int uint_fast16_t; + +# 152 "" +typedef int int_fast32_t; + +# 153 "" +typedef int uint_fast32_t; + +# 154 "" +typedef int int_fast64_t; + +# 155 "" +typedef int uint_fast64_t; + +# 158 "" +typedef int intptr_t; + +# 159 "" +typedef int uintptr_t; + +# 162 "" +typedef int intmax_t; + +# 163 "" +typedef int uintmax_t; + +# 166 "" +typedef _Bool bool; + +# 169 "" +typedef void BZFILE; + +# 171 "" +typedef int va_list; + +# 174 "" +typedef int loff_t; + +# 176 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 178 "" +pthread_mutex_t m; + +# 179 "" +int data = 0; + +# 181 "" +void *thread1(void *arg) + +# 182 "" +{ + +# 183 "" + pthread_mutex_lock(& m); + +# 184 "" + data++; + +# 185 "" + pthread_mutex_unlock(& m); +} + + +# 189 "" +void *thread2(void *arg) + +# 190 "" +{ + +# 191 "" + pthread_mutex_lock(& m); + +# 192 "" + data += (2); + +# 193 "" + pthread_mutex_unlock(& m); +} + + +# 197 "" +void *thread3(void *arg) + +# 198 "" +{ + +# 199 "" + pthread_mutex_lock(& m); + +# 200 "" + if (data >= 3) + { + +# 201 "" + ERROR: + __VERIFIER_error(); + + +# 202 "" + ; + } + + +# 204 "" + pthread_mutex_unlock(& m); +} + + +# 208 "" +int main() + +# 209 "" +{ + +# 210 "" + pthread_mutex_init(& m, 0); + +# 212 "" + pthread_t t1; + pthread_t t2; + pthread_t t3; + +# 214 "" + pthread_create(& t1, 0, thread1, 0); + +# 215 "" + pthread_create(& t2, 0, thread2, 0); + +# 216 "" + pthread_create(& t3, 0, thread3, 0); + +# 218 "" + pthread_join(t1, 0); + +# 219 "" + pthread_join(t2, 0); + +# 220 "" + pthread_join(t3, 0); + +# 222 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_01_output__workarounds.c b/utils/cseq-1.9/log/_01_output__workarounds.c new file mode 100644 index 000000000..775580beb --- /dev/null +++ b/utils/cseq-1.9/log/_01_output__workarounds.c @@ -0,0 +1,385 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + { + + ERROR: + __VERIFIER_error(); + + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + pthread_t t2; + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_02_input___functiontracker.c b/utils/cseq-1.9/log/_02_input___functiontracker.c new file mode 100644 index 000000000..775580beb --- /dev/null +++ b/utils/cseq-1.9/log/_02_input___functiontracker.c @@ -0,0 +1,385 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + { + + ERROR: + __VERIFIER_error(); + + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + pthread_t t2; + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_02_linemap__functiontracker.c b/utils/cseq-1.9/log/_02_linemap__functiontracker.c new file mode 100644 index 000000000..0bdef82c7 --- /dev/null +++ b/utils/cseq-1.9/log/_02_linemap__functiontracker.c @@ -0,0 +1,217 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +347 <- 348 +347 <- 349 +349 <- 350 +349 <- 351 +350 <- 352 +350 <- 354 +353 <- 355 +353 <- 356 +353 <- 358 +357 <- 359 +357 <- 360 +361 <- 363 +363 <- 365 +363 <- 366 +365 <- 367 +365 <- 368 +367 <- 369 +367 <- 370 +368 <- 371 +368 <- 372 +369 <- 373 +369 <- 374 +371 <- 375 +371 <- 376 +373 <- 377 +373 <- 378 +375 <- 379 +375 <- 380 +377 <- 381 +377 <- 382 +379 <- 383 +379 <- 384 +381 <- 385 +381 <- 386 +383 <- 387 +383 <- 388 diff --git a/utils/cseq-1.9/log/_02_marked__functiontracker.c b/utils/cseq-1.9/log/_02_marked__functiontracker.c new file mode 100644 index 000000000..2d3b101f0 --- /dev/null +++ b/utils/cseq-1.9/log/_02_marked__functiontracker.c @@ -0,0 +1,578 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + if (data >= 3) + +# 347 "" + { + +# 349 "" + ERROR: + +# 350 "" + __VERIFIER_error(); + + +# 353 "" + ; + } + + +# 357 "" + pthread_mutex_unlock(& m); +} + + +# 361 "" +int main() + +# 363 "" +{ + +# 365 "" + pthread_mutex_init(& m, 0); + +# 367 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 369 "" + pthread_t t3; + +# 371 "" + pthread_create(& t1, 0, thread1, 0); + +# 373 "" + pthread_create(& t2, 0, thread2, 0); + +# 375 "" + pthread_create(& t3, 0, thread3, 0); + +# 377 "" + pthread_join(t1, 0); + +# 379 "" + pthread_join(t2, 0); + +# 381 "" + pthread_join(t3, 0); + +# 383 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_02_output__functiontracker.c b/utils/cseq-1.9/log/_02_output__functiontracker.c new file mode 100644 index 000000000..1f155ac37 --- /dev/null +++ b/utils/cseq-1.9/log/_02_output__functiontracker.c @@ -0,0 +1,389 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + ERROR: + + __VERIFIER_error(); + + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_03_input___preinstrumenter.c b/utils/cseq-1.9/log/_03_input___preinstrumenter.c new file mode 100644 index 000000000..1f155ac37 --- /dev/null +++ b/utils/cseq-1.9/log/_03_input___preinstrumenter.c @@ -0,0 +1,389 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + ERROR: + + __VERIFIER_error(); + + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_03_linemap__preinstrumenter.c b/utils/cseq-1.9/log/_03_linemap__preinstrumenter.c new file mode 100644 index 000000000..8344e88ae --- /dev/null +++ b/utils/cseq-1.9/log/_03_linemap__preinstrumenter.c @@ -0,0 +1,215 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +348 <- 348 +348 <- 349 +350 <- 350 +350 <- 351 +355 <- 352 +355 <- 353 +355 <- 355 +359 <- 356 +359 <- 357 +363 <- 360 +365 <- 362 +365 <- 363 +367 <- 364 +367 <- 365 +369 <- 366 +369 <- 367 +371 <- 368 +371 <- 369 +373 <- 370 +373 <- 371 +375 <- 372 +375 <- 373 +377 <- 374 +377 <- 375 +379 <- 376 +379 <- 377 +381 <- 378 +381 <- 379 +383 <- 380 +383 <- 381 +385 <- 382 +385 <- 383 +387 <- 384 +387 <- 385 diff --git a/utils/cseq-1.9/log/_03_marked__preinstrumenter.c b/utils/cseq-1.9/log/_03_marked__preinstrumenter.c new file mode 100644 index 000000000..e5265b75a --- /dev/null +++ b/utils/cseq-1.9/log/_03_marked__preinstrumenter.c @@ -0,0 +1,574 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + if (data >= 3) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 355 "" + ; + } + + +# 359 "" + pthread_mutex_unlock(& m); +} + + +# 363 "" +int main() + +# 365 "" +{ + +# 367 "" + pthread_mutex_init(& m, 0); + +# 369 "" + pthread_t t1; + +# 371 "" + pthread_t t2; + +# 373 "" + pthread_t t3; + +# 375 "" + pthread_create(& t1, 0, thread1, 0); + +# 377 "" + pthread_create(& t2, 0, thread2, 0); + +# 379 "" + pthread_create(& t3, 0, thread3, 0); + +# 381 "" + pthread_join(t1, 0); + +# 383 "" + pthread_join(t2, 0); + +# 385 "" + pthread_join(t3, 0); + +# 387 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_03_output__preinstrumenter.c b/utils/cseq-1.9/log/_03_output__preinstrumenter.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_03_output__preinstrumenter.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_04_input___constants.c b/utils/cseq-1.9/log/_04_input___constants.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_04_input___constants.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_04_linemap__constants.c b/utils/cseq-1.9/log/_04_linemap__constants.c new file mode 100644 index 000000000..3441f7ff0 --- /dev/null +++ b/utils/cseq-1.9/log/_04_linemap__constants.c @@ -0,0 +1,215 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +348 <- 348 +348 <- 349 +350 <- 350 +350 <- 351 +352 <- 352 +352 <- 353 +352 <- 355 +356 <- 356 +356 <- 357 +360 <- 360 +362 <- 362 +362 <- 363 +364 <- 364 +364 <- 365 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +372 <- 372 +372 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 379 +380 <- 380 +380 <- 381 +382 <- 382 +382 <- 383 +384 <- 384 +384 <- 385 diff --git a/utils/cseq-1.9/log/_04_marked__constants.c b/utils/cseq-1.9/log/_04_marked__constants.c new file mode 100644 index 000000000..7a78b57fc --- /dev/null +++ b/utils/cseq-1.9/log/_04_marked__constants.c @@ -0,0 +1,574 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(&m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(&m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(&m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(&m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(&m); + +# 346 "" + if (data >= 3) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 352 "" + ; + } + + +# 356 "" + pthread_mutex_unlock(&m); +} + + +# 360 "" +int main() + +# 362 "" +{ + +# 364 "" + pthread_mutex_init(&m, 0); + +# 366 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 370 "" + pthread_t t3; + +# 372 "" + pthread_create(&t1, 0, thread1, 0); + +# 374 "" + pthread_create(&t2, 0, thread2, 0); + +# 376 "" + pthread_create(&t3, 0, thread3, 0); + +# 378 "" + pthread_join(t1, 0); + +# 380 "" + pthread_join(t2, 0); + +# 382 "" + pthread_join(t3, 0); + +# 384 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_04_output__constants.c b/utils/cseq-1.9/log/_04_output__constants.c new file mode 100644 index 000000000..45a5bdaf7 --- /dev/null +++ b/utils/cseq-1.9/log/_04_output__constants.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(&m); + + data++; + + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(&m); + + data += (2); + + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(&m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(&m); +} + + +int main() + +{ + + pthread_mutex_init(&m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(&t1, 0, thread1, 0); + + pthread_create(&t2, 0, thread2, 0); + + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_05_input___spinlock.c b/utils/cseq-1.9/log/_05_input___spinlock.c new file mode 100644 index 000000000..45a5bdaf7 --- /dev/null +++ b/utils/cseq-1.9/log/_05_input___spinlock.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(&m); + + data++; + + pthread_mutex_unlock(&m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(&m); + + data += (2); + + pthread_mutex_unlock(&m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(&m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(&m); +} + + +int main() + +{ + + pthread_mutex_init(&m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(&t1, 0, thread1, 0); + + pthread_create(&t2, 0, thread2, 0); + + pthread_create(&t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_05_linemap__spinlock.c b/utils/cseq-1.9/log/_05_linemap__spinlock.c new file mode 100644 index 000000000..3441f7ff0 --- /dev/null +++ b/utils/cseq-1.9/log/_05_linemap__spinlock.c @@ -0,0 +1,215 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +348 <- 348 +348 <- 349 +350 <- 350 +350 <- 351 +352 <- 352 +352 <- 353 +352 <- 355 +356 <- 356 +356 <- 357 +360 <- 360 +362 <- 362 +362 <- 363 +364 <- 364 +364 <- 365 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +372 <- 372 +372 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 379 +380 <- 380 +380 <- 381 +382 <- 382 +382 <- 383 +384 <- 384 +384 <- 385 diff --git a/utils/cseq-1.9/log/_05_marked__spinlock.c b/utils/cseq-1.9/log/_05_marked__spinlock.c new file mode 100644 index 000000000..db2999ff3 --- /dev/null +++ b/utils/cseq-1.9/log/_05_marked__spinlock.c @@ -0,0 +1,574 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + if (data >= 3) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 352 "" + ; + } + + +# 356 "" + pthread_mutex_unlock(& m); +} + + +# 360 "" +int main() + +# 362 "" +{ + +# 364 "" + pthread_mutex_init(& m, 0); + +# 366 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 370 "" + pthread_t t3; + +# 372 "" + pthread_create(& t1, 0, thread1, 0); + +# 374 "" + pthread_create(& t2, 0, thread2, 0); + +# 376 "" + pthread_create(& t3, 0, thread3, 0); + +# 378 "" + pthread_join(t1, 0); + +# 380 "" + pthread_join(t2, 0); + +# 382 "" + pthread_join(t3, 0); + +# 384 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_05_output__spinlock.c b/utils/cseq-1.9/log/_05_output__spinlock.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_05_output__spinlock.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_06_input___switchtransformer.c b/utils/cseq-1.9/log/_06_input___switchtransformer.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_06_input___switchtransformer.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_06_linemap__switchtransformer.c b/utils/cseq-1.9/log/_06_linemap__switchtransformer.c new file mode 100644 index 000000000..3441f7ff0 --- /dev/null +++ b/utils/cseq-1.9/log/_06_linemap__switchtransformer.c @@ -0,0 +1,215 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +348 <- 348 +348 <- 349 +350 <- 350 +350 <- 351 +352 <- 352 +352 <- 353 +352 <- 355 +356 <- 356 +356 <- 357 +360 <- 360 +362 <- 362 +362 <- 363 +364 <- 364 +364 <- 365 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +372 <- 372 +372 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 379 +380 <- 380 +380 <- 381 +382 <- 382 +382 <- 383 +384 <- 384 +384 <- 385 diff --git a/utils/cseq-1.9/log/_06_marked__switchtransformer.c b/utils/cseq-1.9/log/_06_marked__switchtransformer.c new file mode 100644 index 000000000..db2999ff3 --- /dev/null +++ b/utils/cseq-1.9/log/_06_marked__switchtransformer.c @@ -0,0 +1,574 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + if (data >= 3) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 352 "" + ; + } + + +# 356 "" + pthread_mutex_unlock(& m); +} + + +# 360 "" +int main() + +# 362 "" +{ + +# 364 "" + pthread_mutex_init(& m, 0); + +# 366 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 370 "" + pthread_t t3; + +# 372 "" + pthread_create(& t1, 0, thread1, 0); + +# 374 "" + pthread_create(& t2, 0, thread2, 0); + +# 376 "" + pthread_create(& t3, 0, thread3, 0); + +# 378 "" + pthread_join(t1, 0); + +# 380 "" + pthread_join(t2, 0); + +# 382 "" + pthread_join(t3, 0); + +# 384 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_06_output__switchtransformer.c b/utils/cseq-1.9/log/_06_output__switchtransformer.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_06_output__switchtransformer.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_07_input___dowhileconverter.c b/utils/cseq-1.9/log/_07_input___dowhileconverter.c new file mode 100644 index 000000000..df26bc601 --- /dev/null +++ b/utils/cseq-1.9/log/_07_input___dowhileconverter.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_07_linemap__dowhileconverter.c b/utils/cseq-1.9/log/_07_linemap__dowhileconverter.c new file mode 100644 index 000000000..3441f7ff0 --- /dev/null +++ b/utils/cseq-1.9/log/_07_linemap__dowhileconverter.c @@ -0,0 +1,215 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +348 <- 348 +348 <- 349 +350 <- 350 +350 <- 351 +352 <- 352 +352 <- 353 +352 <- 355 +356 <- 356 +356 <- 357 +360 <- 360 +362 <- 362 +362 <- 363 +364 <- 364 +364 <- 365 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +372 <- 372 +372 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 379 +380 <- 380 +380 <- 381 +382 <- 382 +382 <- 383 +384 <- 384 +384 <- 385 diff --git a/utils/cseq-1.9/log/_07_marked__dowhileconverter.c b/utils/cseq-1.9/log/_07_marked__dowhileconverter.c new file mode 100644 index 000000000..3f3bf293c --- /dev/null +++ b/utils/cseq-1.9/log/_07_marked__dowhileconverter.c @@ -0,0 +1,574 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + if (data >= 3) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 352 "" + ; + } + + +# 356 "" + pthread_mutex_unlock(& m); +} + + +# 360 "" +int main() + +# 362 "" +{ + +# 364 "" + pthread_mutex_init(& m, 0); + +# 366 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 370 "" + pthread_t t3; + +# 372 "" + pthread_create(& t1, 0, thread1, 0); + +# 374 "" + pthread_create(& t2, 0, thread2, 0); + +# 376 "" + pthread_create(& t3, 0, thread3, 0); + +# 378 "" + pthread_join(t1, 0); + +# 380 "" + pthread_join(t2, 0); + +# 382 "" + pthread_join(t3, 0); + +# 384 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_07_output__dowhileconverter.c b/utils/cseq-1.9/log/_07_output__dowhileconverter.c new file mode 100644 index 000000000..920136ec7 --- /dev/null +++ b/utils/cseq-1.9/log/_07_output__dowhileconverter.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_08_input___conditionextractor.c b/utils/cseq-1.9/log/_08_input___conditionextractor.c new file mode 100644 index 000000000..920136ec7 --- /dev/null +++ b/utils/cseq-1.9/log/_08_input___conditionextractor.c @@ -0,0 +1,386 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + if (data >= 3) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_08_linemap__conditionextractor.c b/utils/cseq-1.9/log/_08_linemap__conditionextractor.c new file mode 100644 index 000000000..91e4deb4c --- /dev/null +++ b/utils/cseq-1.9/log/_08_linemap__conditionextractor.c @@ -0,0 +1,216 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +346 <- 347 +348 <- 349 +348 <- 350 +350 <- 351 +350 <- 352 +352 <- 353 +352 <- 354 +352 <- 356 +356 <- 357 +356 <- 358 +360 <- 361 +362 <- 363 +362 <- 364 +364 <- 365 +364 <- 366 +366 <- 367 +366 <- 368 +368 <- 369 +368 <- 370 +370 <- 371 +370 <- 372 +372 <- 373 +372 <- 374 +374 <- 375 +374 <- 376 +376 <- 377 +376 <- 378 +378 <- 379 +378 <- 380 +380 <- 381 +380 <- 382 +382 <- 383 +382 <- 384 +384 <- 385 +384 <- 386 diff --git a/utils/cseq-1.9/log/_08_marked__conditionextractor.c b/utils/cseq-1.9/log/_08_marked__conditionextractor.c new file mode 100644 index 000000000..5fb38d9f1 --- /dev/null +++ b/utils/cseq-1.9/log/_08_marked__conditionextractor.c @@ -0,0 +1,575 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + _Bool __cs_tmp_if_cond_0; __cs_tmp_if_cond_0 = (data >= 3); + if (__cs_tmp_if_cond_0) + +# 348 "" + { + +# 350 "" + __VERIFIER_assert(0); + +# 352 "" + ; + } + + +# 356 "" + pthread_mutex_unlock(& m); +} + + +# 360 "" +int main() + +# 362 "" +{ + +# 364 "" + pthread_mutex_init(& m, 0); + +# 366 "" + pthread_t t1; + +# 368 "" + pthread_t t2; + +# 370 "" + pthread_t t3; + +# 372 "" + pthread_create(& t1, 0, thread1, 0); + +# 374 "" + pthread_create(& t2, 0, thread2, 0); + +# 376 "" + pthread_create(& t3, 0, thread3, 0); + +# 378 "" + pthread_join(t1, 0); + +# 380 "" + pthread_join(t2, 0); + +# 382 "" + pthread_join(t3, 0); + +# 384 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_08_output__conditionextractor.c b/utils/cseq-1.9/log/_08_output__conditionextractor.c new file mode 100644 index 000000000..b9bdf50c9 --- /dev/null +++ b/utils/cseq-1.9/log/_08_output__conditionextractor.c @@ -0,0 +1,387 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_tmp_if_cond_0; __cs_tmp_if_cond_0 = (data >= 3); + if (__cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_09_input___varnames.c b/utils/cseq-1.9/log/_09_input___varnames.c new file mode 100644 index 000000000..b9bdf50c9 --- /dev/null +++ b/utils/cseq-1.9/log/_09_input___varnames.c @@ -0,0 +1,387 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_tmp_if_cond_0; __cs_tmp_if_cond_0 = (data >= 3); + if (__cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t t1; + + pthread_t t2; + + pthread_t t3; + + pthread_create(& t1, 0, thread1, 0); + + pthread_create(& t2, 0, thread2, 0); + + pthread_create(& t3, 0, thread3, 0); + + pthread_join(t1, 0); + + pthread_join(t2, 0); + + pthread_join(t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_09_linemap__varnames.c b/utils/cseq-1.9/log/_09_linemap__varnames.c new file mode 100644 index 000000000..44bdf6cc4 --- /dev/null +++ b/utils/cseq-1.9/log/_09_linemap__varnames.c @@ -0,0 +1,218 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +346 <- 347 +346 <- 348 +347 <- 349 +349 <- 351 +349 <- 352 +351 <- 353 +351 <- 354 +353 <- 355 +353 <- 356 +353 <- 358 +357 <- 359 +357 <- 360 +361 <- 363 +363 <- 365 +363 <- 366 +365 <- 367 +365 <- 368 +367 <- 369 +367 <- 370 +369 <- 371 +369 <- 372 +371 <- 373 +371 <- 374 +373 <- 375 +373 <- 376 +375 <- 377 +375 <- 378 +377 <- 379 +377 <- 380 +379 <- 381 +379 <- 382 +381 <- 383 +381 <- 384 +383 <- 385 +383 <- 386 +385 <- 387 +385 <- 388 diff --git a/utils/cseq-1.9/log/_09_marked__varnames.c b/utils/cseq-1.9/log/_09_marked__varnames.c new file mode 100644 index 000000000..fefb234bf --- /dev/null +++ b/utils/cseq-1.9/log/_09_marked__varnames.c @@ -0,0 +1,578 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *__cs_param_thread2_arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *__cs_param_thread3_arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 347 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 349 "" + { + +# 351 "" + __VERIFIER_assert(0); + +# 353 "" + ; + } + + +# 357 "" + pthread_mutex_unlock(& m); +} + + +# 361 "" +int main() + +# 363 "" +{ + +# 365 "" + pthread_mutex_init(& m, 0); + +# 367 "" + pthread_t __cs_local_main_t1; + +# 369 "" + pthread_t __cs_local_main_t2; + +# 371 "" + pthread_t __cs_local_main_t3; + +# 373 "" + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + +# 375 "" + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + +# 377 "" + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + +# 379 "" + pthread_join(__cs_local_main_t1, 0); + +# 381 "" + pthread_join(__cs_local_main_t2, 0); + +# 383 "" + pthread_join(__cs_local_main_t3, 0); + +# 385 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_09_output__varnames.c b/utils/cseq-1.9/log/_09_output__varnames.c new file mode 100644 index 000000000..21bf24daa --- /dev/null +++ b/utils/cseq-1.9/log/_09_output__varnames.c @@ -0,0 +1,389 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_10_input___preinliner.c b/utils/cseq-1.9/log/_10_input___preinliner.c new file mode 100644 index 000000000..21bf24daa --- /dev/null +++ b/utils/cseq-1.9/log/_10_input___preinliner.c @@ -0,0 +1,389 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_10_linemap__preinliner.c b/utils/cseq-1.9/log/_10_linemap__preinliner.c new file mode 100644 index 000000000..98afdeb2a --- /dev/null +++ b/utils/cseq-1.9/log/_10_linemap__preinliner.c @@ -0,0 +1,219 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +346 <- 347 +347 <- 348 +347 <- 349 +349 <- 350 +351 <- 352 +351 <- 353 +353 <- 354 +353 <- 355 +355 <- 356 +355 <- 357 +355 <- 359 +359 <- 360 +359 <- 361 +363 <- 364 +365 <- 366 +365 <- 367 +367 <- 368 +367 <- 369 +369 <- 370 +369 <- 371 +371 <- 372 +371 <- 373 +373 <- 374 +373 <- 375 +375 <- 376 +375 <- 377 +377 <- 378 +377 <- 379 +379 <- 380 +379 <- 381 +381 <- 382 +381 <- 383 +383 <- 384 +383 <- 385 +385 <- 386 +385 <- 387 +387 <- 388 +387 <- 389 diff --git a/utils/cseq-1.9/log/_10_marked__preinliner.c b/utils/cseq-1.9/log/_10_marked__preinliner.c new file mode 100644 index 000000000..e361799b3 --- /dev/null +++ b/utils/cseq-1.9/log/_10_marked__preinliner.c @@ -0,0 +1,580 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); +} + + +# 328 "" +void *thread2(void *__cs_param_thread2_arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); +} + + +# 340 "" +void *thread3(void *__cs_param_thread3_arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 347 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 349 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 351 "" + { + +# 353 "" + __VERIFIER_assert(0); + +# 355 "" + ; + } + + +# 359 "" + pthread_mutex_unlock(& m); +} + + +# 363 "" +int main() + +# 365 "" +{ + +# 367 "" + pthread_mutex_init(& m, 0); + +# 369 "" + pthread_t __cs_local_main_t1; + +# 371 "" + pthread_t __cs_local_main_t2; + +# 373 "" + pthread_t __cs_local_main_t3; + +# 375 "" + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + +# 377 "" + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + +# 379 "" + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + +# 381 "" + pthread_join(__cs_local_main_t1, 0); + +# 383 "" + pthread_join(__cs_local_main_t2, 0); + +# 385 "" + pthread_join(__cs_local_main_t3, 0); + +# 387 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_10_output__preinliner.c b/utils/cseq-1.9/log/_10_output__preinliner.c new file mode 100644 index 000000000..9f57e7729 --- /dev/null +++ b/utils/cseq-1.9/log/_10_output__preinliner.c @@ -0,0 +1,390 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_11_input___inliner.c b/utils/cseq-1.9/log/_11_input___inliner.c new file mode 100644 index 000000000..9f57e7729 --- /dev/null +++ b/utils/cseq-1.9/log/_11_input___inliner.c @@ -0,0 +1,390 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + return (0); +} + diff --git a/utils/cseq-1.9/log/_11_linemap__inliner.c b/utils/cseq-1.9/log/_11_linemap__inliner.c new file mode 100644 index 000000000..efca7bd72 --- /dev/null +++ b/utils/cseq-1.9/log/_11_linemap__inliner.c @@ -0,0 +1,223 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +324 <- 326 +328 <- 328 +330 <- 330 +330 <- 331 +332 <- 332 +332 <- 333 +334 <- 334 +334 <- 335 +336 <- 336 +336 <- 337 +336 <- 338 +340 <- 340 +342 <- 342 +342 <- 343 +344 <- 344 +344 <- 345 +346 <- 346 +346 <- 347 +348 <- 348 +348 <- 349 +350 <- 350 +352 <- 352 +352 <- 353 +354 <- 354 +354 <- 355 +356 <- 356 +356 <- 357 +356 <- 359 +360 <- 360 +360 <- 361 +360 <- 362 +364 <- 364 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +372 <- 372 +372 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 379 +380 <- 380 +380 <- 381 +382 <- 382 +382 <- 383 +384 <- 384 +384 <- 385 +386 <- 386 +386 <- 387 +388 <- 388 +388 <- 389 +388 <- 390 diff --git a/utils/cseq-1.9/log/_11_marked__inliner.c b/utils/cseq-1.9/log/_11_marked__inliner.c new file mode 100644 index 000000000..e0851b371 --- /dev/null +++ b/utils/cseq-1.9/log/_11_marked__inliner.c @@ -0,0 +1,580 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(&m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(&m); + __exit_thread1: ; pthread_exit(0); +} + +# 328 "" +void *thread2(void *__cs_param_thread2_arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(&m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(&m); + __exit_thread2: ; pthread_exit(0); +} + +# 340 "" +void *thread3(void *__cs_param_thread3_arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(&m); + +# 346 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 348 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 350 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 352 "" + { + +# 354 "" + __VERIFIER_assert(0); + +# 356 "" + ; + } + + +# 360 "" + pthread_mutex_unlock(&m); + __exit_thread3: ; pthread_exit(0); +} + +# 364 "" +int main() + +# 366 "" +{ + +# 368 "" + pthread_mutex_init(&m, 0); + +# 370 "" + pthread_t __cs_local_main_t1; + +# 372 "" + pthread_t __cs_local_main_t2; + +# 374 "" + pthread_t __cs_local_main_t3; + +# 376 "" + pthread_create(&__cs_local_main_t1, 0, thread1, 0); + +# 378 "" + pthread_create(&__cs_local_main_t2, 0, thread2, 0); + +# 380 "" + pthread_create(&__cs_local_main_t3, 0, thread3, 0); + +# 382 "" + pthread_join(__cs_local_main_t1, 0); + +# 384 "" + pthread_join(__cs_local_main_t2, 0); + +# 386 "" + pthread_join(__cs_local_main_t3, 0); + +# 388 "" + goto __exit_main; + __exit_main: ; pthread_exit(0); +} diff --git a/utils/cseq-1.9/log/_11_output__inliner.c b/utils/cseq-1.9/log/_11_output__inliner.c new file mode 100644 index 000000000..822362439 --- /dev/null +++ b/utils/cseq-1.9/log/_11_output__inliner.c @@ -0,0 +1,390 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(&m); + + data++; + + pthread_mutex_unlock(&m); + __exit_thread1: ; pthread_exit(0); +} + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(&m); + + data += (2); + + pthread_mutex_unlock(&m); + __exit_thread2: ; pthread_exit(0); +} + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(&m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(&m); + __exit_thread3: ; pthread_exit(0); +} + +int main() + +{ + + pthread_mutex_init(&m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(&__cs_local_main_t1, 0, thread1, 0); + + pthread_create(&__cs_local_main_t2, 0, thread2, 0); + + pthread_create(&__cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + __exit_main: ; pthread_exit(0); +} diff --git a/utils/cseq-1.9/log/_12_input___unroller.c b/utils/cseq-1.9/log/_12_input___unroller.c new file mode 100644 index 000000000..822362439 --- /dev/null +++ b/utils/cseq-1.9/log/_12_input___unroller.c @@ -0,0 +1,390 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(&m); + + data++; + + pthread_mutex_unlock(&m); + __exit_thread1: ; pthread_exit(0); +} + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(&m); + + data += (2); + + pthread_mutex_unlock(&m); + __exit_thread2: ; pthread_exit(0); +} + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(&m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(&m); + __exit_thread3: ; pthread_exit(0); +} + +int main() + +{ + + pthread_mutex_init(&m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(&__cs_local_main_t1, 0, thread1, 0); + + pthread_create(&__cs_local_main_t2, 0, thread2, 0); + + pthread_create(&__cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + __exit_main: ; pthread_exit(0); +} diff --git a/utils/cseq-1.9/log/_12_linemap__unroller.c b/utils/cseq-1.9/log/_12_linemap__unroller.c new file mode 100644 index 000000000..9eee55c12 --- /dev/null +++ b/utils/cseq-1.9/log/_12_linemap__unroller.c @@ -0,0 +1,235 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +325 <- 326 +325 <- 327 +325 <- 329 +325 <- 330 +328 <- 333 +330 <- 335 +330 <- 336 +332 <- 337 +332 <- 338 +334 <- 339 +334 <- 340 +336 <- 341 +336 <- 342 +337 <- 343 +337 <- 344 +337 <- 346 +337 <- 347 +340 <- 350 +342 <- 352 +342 <- 353 +344 <- 354 +344 <- 355 +346 <- 356 +346 <- 357 +348 <- 358 +348 <- 359 +350 <- 360 +352 <- 362 +352 <- 363 +354 <- 364 +354 <- 365 +356 <- 366 +356 <- 367 +356 <- 369 +360 <- 370 +360 <- 371 +361 <- 372 +361 <- 373 +361 <- 375 +361 <- 376 +364 <- 379 +366 <- 381 +366 <- 382 +368 <- 383 +368 <- 384 +370 <- 385 +370 <- 386 +372 <- 387 +372 <- 388 +374 <- 389 +374 <- 390 +376 <- 391 +376 <- 392 +378 <- 393 +378 <- 394 +380 <- 395 +380 <- 396 +382 <- 397 +382 <- 398 +384 <- 399 +384 <- 400 +386 <- 401 +386 <- 402 +388 <- 403 +388 <- 404 +389 <- 405 +389 <- 406 +389 <- 408 +389 <- 409 diff --git a/utils/cseq-1.9/log/_12_marked__unroller.c b/utils/cseq-1.9/log/_12_marked__unroller.c new file mode 100644 index 000000000..8735c34fb --- /dev/null +++ b/utils/cseq-1.9/log/_12_marked__unroller.c @@ -0,0 +1,604 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); + +# 325 "" + __exit_thread1: + ; + + pthread_exit(0); +} + + +# 328 "" +void *thread2(void *__cs_param_thread2_arg) + +# 330 "" +{ + +# 332 "" + pthread_mutex_lock(& m); + +# 334 "" + data += (2); + +# 336 "" + pthread_mutex_unlock(& m); + +# 337 "" + __exit_thread2: + ; + + pthread_exit(0); +} + + +# 340 "" +void *thread3(void *__cs_param_thread3_arg) + +# 342 "" +{ + +# 344 "" + pthread_mutex_lock(& m); + +# 346 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 348 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 350 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 352 "" + { + +# 354 "" + __VERIFIER_assert(0); + +# 356 "" + ; + } + + +# 360 "" + pthread_mutex_unlock(& m); + +# 361 "" + __exit_thread3: + ; + + pthread_exit(0); +} + + +# 364 "" +int main() + +# 366 "" +{ + +# 368 "" + pthread_mutex_init(& m, 0); + +# 370 "" + pthread_t __cs_local_main_t1; + +# 372 "" + pthread_t __cs_local_main_t2; + +# 374 "" + pthread_t __cs_local_main_t3; + +# 376 "" + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + +# 378 "" + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + +# 380 "" + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + +# 382 "" + pthread_join(__cs_local_main_t1, 0); + +# 384 "" + pthread_join(__cs_local_main_t2, 0); + +# 386 "" + pthread_join(__cs_local_main_t3, 0); + +# 388 "" + goto __exit_main; + +# 389 "" + __exit_main: + ; + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_12_output__unroller.c b/utils/cseq-1.9/log/_12_output__unroller.c new file mode 100644 index 000000000..5a317571b --- /dev/null +++ b/utils/cseq-1.9/log/_12_output__unroller.c @@ -0,0 +1,410 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + ; + + pthread_exit(0); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + ; + + pthread_exit(0); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + ; + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + ; + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_13_input___duplicator.c b/utils/cseq-1.9/log/_13_input___duplicator.c new file mode 100644 index 000000000..5a317571b --- /dev/null +++ b/utils/cseq-1.9/log/_13_input___duplicator.c @@ -0,0 +1,410 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + ; + + pthread_exit(0); +} + + +void *thread2(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + ; + + pthread_exit(0); +} + + +void *thread3(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + ; + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + ; + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_13_linemap__duplicator.c b/utils/cseq-1.9/log/_13_linemap__duplicator.c new file mode 100644 index 000000000..8d3d2a5e5 --- /dev/null +++ b/utils/cseq-1.9/log/_13_linemap__duplicator.c @@ -0,0 +1,243 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +326 <- 326 +326 <- 327 +327 <- 328 +327 <- 330 +329 <- 331 +329 <- 332 +333 <- 335 +335 <- 337 +335 <- 338 +337 <- 339 +337 <- 340 +339 <- 341 +339 <- 342 +341 <- 343 +341 <- 344 +343 <- 345 +343 <- 346 +344 <- 347 +344 <- 349 +346 <- 350 +346 <- 351 +350 <- 354 +352 <- 356 +352 <- 357 +354 <- 358 +354 <- 359 +356 <- 360 +356 <- 361 +358 <- 362 +358 <- 363 +360 <- 364 +362 <- 366 +362 <- 367 +364 <- 368 +364 <- 369 +366 <- 370 +366 <- 371 +366 <- 373 +370 <- 374 +370 <- 375 +372 <- 376 +372 <- 377 +373 <- 378 +373 <- 380 +375 <- 381 +375 <- 382 +379 <- 385 +381 <- 387 +381 <- 388 +383 <- 389 +383 <- 390 +385 <- 391 +385 <- 392 +387 <- 393 +387 <- 394 +389 <- 395 +389 <- 396 +391 <- 397 +391 <- 398 +393 <- 399 +393 <- 400 +395 <- 401 +395 <- 402 +397 <- 403 +397 <- 404 +399 <- 405 +399 <- 406 +401 <- 407 +401 <- 408 +403 <- 409 +403 <- 410 +405 <- 411 +405 <- 412 +406 <- 413 +406 <- 415 +408 <- 416 +408 <- 417 diff --git a/utils/cseq-1.9/log/_13_marked__duplicator.c b/utils/cseq-1.9/log/_13_marked__duplicator.c new file mode 100644 index 000000000..b11d2f27d --- /dev/null +++ b/utils/cseq-1.9/log/_13_marked__duplicator.c @@ -0,0 +1,620 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1_0(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); + +# 326 "" + __exit_thread1: + +# 327 "" + ; + + +# 329 "" + pthread_exit(0); +} + + +# 333 "" +void *thread2_0(void *__cs_param_thread2_arg) + +# 335 "" +{ + +# 337 "" + pthread_mutex_lock(& m); + +# 339 "" + data += (2); + +# 341 "" + pthread_mutex_unlock(& m); + +# 343 "" + __exit_thread2: + +# 344 "" + ; + + +# 346 "" + pthread_exit(0); +} + + +# 350 "" +void *thread3_0(void *__cs_param_thread3_arg) + +# 352 "" +{ + +# 354 "" + pthread_mutex_lock(& m); + +# 356 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 358 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 360 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 362 "" + { + +# 364 "" + __VERIFIER_assert(0); + +# 366 "" + ; + } + + +# 370 "" + pthread_mutex_unlock(& m); + +# 372 "" + __exit_thread3: + +# 373 "" + ; + + +# 375 "" + pthread_exit(0); +} + + +# 379 "" +int main() + +# 381 "" +{ + +# 383 "" + pthread_mutex_init(& m, 0); + +# 385 "" + pthread_t __cs_local_main_t1; + +# 387 "" + pthread_t __cs_local_main_t2; + +# 389 "" + pthread_t __cs_local_main_t3; + +# 391 "" + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + +# 393 "" + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + +# 395 "" + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + +# 397 "" + pthread_join(__cs_local_main_t1, 0); + +# 399 "" + pthread_join(__cs_local_main_t2, 0); + +# 401 "" + pthread_join(__cs_local_main_t3, 0); + +# 403 "" + goto __exit_main; + +# 405 "" + __exit_main: + +# 406 "" + ; + + +# 408 "" + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_13_output__duplicator.c b/utils/cseq-1.9/log/_13_output__duplicator.c new file mode 100644 index 000000000..5b0948f2f --- /dev/null +++ b/utils/cseq-1.9/log/_13_output__duplicator.c @@ -0,0 +1,418 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + + ; + + + pthread_exit(0); +} + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + + ; + + + pthread_exit(0); +} + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + + ; + + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + + ; + + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_14_input___condwaitconverter.c b/utils/cseq-1.9/log/_14_input___condwaitconverter.c new file mode 100644 index 000000000..5b0948f2f --- /dev/null +++ b/utils/cseq-1.9/log/_14_input___condwaitconverter.c @@ -0,0 +1,418 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + + ; + + + pthread_exit(0); +} + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + + ; + + + pthread_exit(0); +} + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + + ; + + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + + ; + + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_14_linemap__condwaitconverter.c b/utils/cseq-1.9/log/_14_linemap__condwaitconverter.c new file mode 100644 index 000000000..df5db66a0 --- /dev/null +++ b/utils/cseq-1.9/log/_14_linemap__condwaitconverter.c @@ -0,0 +1,243 @@ +2 <- 2 +4 <- 4 +6 <- 6 +8 <- 8 +10 <- 10 +12 <- 12 +14 <- 14 +16 <- 16 +18 <- 18 +20 <- 20 +22 <- 22 +24 <- 24 +26 <- 26 +28 <- 28 +30 <- 30 +32 <- 32 +34 <- 34 +36 <- 36 +38 <- 38 +40 <- 40 +42 <- 42 +44 <- 44 +46 <- 46 +48 <- 48 +50 <- 50 +52 <- 52 +54 <- 54 +56 <- 56 +58 <- 58 +60 <- 60 +62 <- 62 +64 <- 64 +66 <- 66 +68 <- 68 +70 <- 70 +72 <- 72 +74 <- 74 +76 <- 76 +78 <- 78 +80 <- 80 +82 <- 82 +84 <- 84 +86 <- 86 +88 <- 88 +90 <- 90 +92 <- 92 +94 <- 94 +96 <- 96 +98 <- 98 +100 <- 100 +102 <- 102 +104 <- 104 +106 <- 106 +108 <- 108 +110 <- 110 +112 <- 112 +114 <- 114 +116 <- 116 +118 <- 118 +120 <- 120 +122 <- 122 +124 <- 124 +126 <- 126 +128 <- 128 +130 <- 130 +132 <- 132 +134 <- 134 +136 <- 136 +138 <- 138 +140 <- 140 +142 <- 142 +144 <- 144 +146 <- 146 +148 <- 148 +150 <- 150 +152 <- 152 +154 <- 154 +156 <- 156 +158 <- 158 +160 <- 160 +162 <- 162 +164 <- 164 +166 <- 166 +168 <- 168 +170 <- 170 +172 <- 172 +174 <- 174 +176 <- 176 +178 <- 178 +180 <- 180 +182 <- 182 +184 <- 184 +186 <- 186 +188 <- 188 +190 <- 190 +192 <- 192 +194 <- 194 +196 <- 196 +198 <- 198 +200 <- 200 +202 <- 202 +204 <- 204 +206 <- 206 +208 <- 208 +210 <- 210 +212 <- 212 +214 <- 214 +216 <- 216 +218 <- 218 +220 <- 220 +222 <- 222 +224 <- 224 +226 <- 226 +228 <- 228 +230 <- 230 +232 <- 232 +234 <- 234 +236 <- 236 +238 <- 238 +240 <- 240 +242 <- 242 +244 <- 244 +246 <- 246 +248 <- 248 +250 <- 250 +252 <- 252 +254 <- 254 +256 <- 256 +258 <- 258 +260 <- 260 +262 <- 262 +264 <- 264 +266 <- 266 +268 <- 268 +270 <- 270 +272 <- 272 +274 <- 274 +276 <- 276 +278 <- 278 +280 <- 280 +282 <- 282 +284 <- 284 +286 <- 286 +288 <- 288 +290 <- 290 +292 <- 292 +294 <- 294 +296 <- 296 +298 <- 298 +300 <- 300 +302 <- 302 +304 <- 304 +306 <- 306 +308 <- 308 +310 <- 310 +312 <- 312 +314 <- 314 +316 <- 316 +318 <- 318 +318 <- 319 +320 <- 320 +320 <- 321 +322 <- 322 +322 <- 323 +324 <- 324 +324 <- 325 +326 <- 326 +326 <- 327 +328 <- 328 +328 <- 330 +331 <- 331 +331 <- 332 +335 <- 335 +337 <- 337 +337 <- 338 +339 <- 339 +339 <- 340 +341 <- 341 +341 <- 342 +343 <- 343 +343 <- 344 +345 <- 345 +345 <- 346 +347 <- 347 +347 <- 349 +350 <- 350 +350 <- 351 +354 <- 354 +356 <- 356 +356 <- 357 +358 <- 358 +358 <- 359 +360 <- 360 +360 <- 361 +362 <- 362 +362 <- 363 +364 <- 364 +366 <- 366 +366 <- 367 +368 <- 368 +368 <- 369 +370 <- 370 +370 <- 371 +370 <- 373 +374 <- 374 +374 <- 375 +376 <- 376 +376 <- 377 +378 <- 378 +378 <- 380 +381 <- 381 +381 <- 382 +385 <- 385 +387 <- 387 +387 <- 388 +389 <- 389 +389 <- 390 +391 <- 391 +391 <- 392 +393 <- 393 +393 <- 394 +395 <- 395 +395 <- 396 +397 <- 397 +397 <- 398 +399 <- 399 +399 <- 400 +401 <- 401 +401 <- 402 +403 <- 403 +403 <- 404 +405 <- 405 +405 <- 406 +407 <- 407 +407 <- 408 +409 <- 409 +409 <- 410 +411 <- 411 +411 <- 412 +413 <- 413 +413 <- 415 +416 <- 416 +416 <- 417 diff --git a/utils/cseq-1.9/log/_14_marked__condwaitconverter.c b/utils/cseq-1.9/log/_14_marked__condwaitconverter.c new file mode 100644 index 000000000..1d96fbfd6 --- /dev/null +++ b/utils/cseq-1.9/log/_14_marked__condwaitconverter.c @@ -0,0 +1,620 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1_0(void *__cs_param_thread1_arg) + +# 318 "" +{ + +# 320 "" + pthread_mutex_lock(& m); + +# 322 "" + data++; + +# 324 "" + pthread_mutex_unlock(& m); + +# 326 "" + __exit_thread1: + +# 328 "" + ; + + +# 331 "" + pthread_exit(0); +} + + +# 335 "" +void *thread2_0(void *__cs_param_thread2_arg) + +# 337 "" +{ + +# 339 "" + pthread_mutex_lock(& m); + +# 341 "" + data += (2); + +# 343 "" + pthread_mutex_unlock(& m); + +# 345 "" + __exit_thread2: + +# 347 "" + ; + + +# 350 "" + pthread_exit(0); +} + + +# 354 "" +void *thread3_0(void *__cs_param_thread3_arg) + +# 356 "" +{ + +# 358 "" + pthread_mutex_lock(& m); + +# 360 "" + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 362 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 364 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 366 "" + { + +# 368 "" + __VERIFIER_assert(0); + +# 370 "" + ; + } + + +# 374 "" + pthread_mutex_unlock(& m); + +# 376 "" + __exit_thread3: + +# 378 "" + ; + + +# 381 "" + pthread_exit(0); +} + + +# 385 "" +int main() + +# 387 "" +{ + +# 389 "" + pthread_mutex_init(& m, 0); + +# 391 "" + pthread_t __cs_local_main_t1; + +# 393 "" + pthread_t __cs_local_main_t2; + +# 395 "" + pthread_t __cs_local_main_t3; + +# 397 "" + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + +# 399 "" + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + +# 401 "" + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + +# 403 "" + pthread_join(__cs_local_main_t1, 0); + +# 405 "" + pthread_join(__cs_local_main_t2, 0); + +# 407 "" + pthread_join(__cs_local_main_t3, 0); + +# 409 "" + goto __exit_main; + +# 411 "" + __exit_main: + +# 413 "" + ; + + +# 416 "" + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_14_output__condwaitconverter.c b/utils/cseq-1.9/log/_14_output__condwaitconverter.c new file mode 100644 index 000000000..5b0948f2f --- /dev/null +++ b/utils/cseq-1.9/log/_14_output__condwaitconverter.c @@ -0,0 +1,418 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + + ; + + + pthread_exit(0); +} + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + + ; + + + pthread_exit(0); +} + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + + ; + + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + + ; + + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_15_input___lazyseq.c b/utils/cseq-1.9/log/_15_input___lazyseq.c new file mode 100644 index 000000000..5b0948f2f --- /dev/null +++ b/utils/cseq-1.9/log/_15_input___lazyseq.c @@ -0,0 +1,418 @@ + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ + + pthread_mutex_lock(& m); + + data++; + + pthread_mutex_unlock(& m); + + __exit_thread1: + + ; + + + pthread_exit(0); +} + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ + + pthread_mutex_lock(& m); + + data += (2); + + pthread_mutex_unlock(& m); + + __exit_thread2: + + ; + + + pthread_exit(0); +} + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ + + pthread_mutex_lock(& m); + + _Bool __cs_local_thread3___cs_tmp_if_cond_0; + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ; + } + + + pthread_mutex_unlock(& m); + + __exit_thread3: + + ; + + + pthread_exit(0); +} + + +int main() + +{ + + pthread_mutex_init(& m, 0); + + pthread_t __cs_local_main_t1; + + pthread_t __cs_local_main_t2; + + pthread_t __cs_local_main_t3; + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0); + + pthread_join(__cs_local_main_t1, 0); + + pthread_join(__cs_local_main_t2, 0); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + + __exit_main: + + ; + + + pthread_exit(0); +} + diff --git a/utils/cseq-1.9/log/_15_linemap__lazyseq.c b/utils/cseq-1.9/log/_15_linemap__lazyseq.c new file mode 100644 index 000000000..976dba530 --- /dev/null +++ b/utils/cseq-1.9/log/_15_linemap__lazyseq.c @@ -0,0 +1,328 @@ +-1 <- 2 +-1 <- 4 +-1 <- 6 +-1 <- 8 +-1 <- 10 +-1 <- 12 +-1 <- 14 +-1 <- 16 +-1 <- 18 +-1 <- 20 +-1 <- 22 +-1 <- 24 +-1 <- 26 +-1 <- 28 +-1 <- 30 +-1 <- 32 +-1 <- 34 +-1 <- 36 +-1 <- 38 +-1 <- 40 +-1 <- 42 +-1 <- 44 +-1 <- 46 +-1 <- 48 +-1 <- 50 +-1 <- 52 +-1 <- 54 +-1 <- 56 +-1 <- 58 +-1 <- 60 +-1 <- 62 +-1 <- 64 +-1 <- 66 +-1 <- 68 +-1 <- 70 +-1 <- 72 +-1 <- 74 +-1 <- 76 +-1 <- 78 +-1 <- 80 +-1 <- 82 +-1 <- 84 +-1 <- 86 +-1 <- 88 +-1 <- 90 +-1 <- 92 +-1 <- 94 +-1 <- 96 +-1 <- 98 +-1 <- 100 +-1 <- 102 +-1 <- 104 +-1 <- 106 +-1 <- 108 +-1 <- 110 +-1 <- 112 +-1 <- 114 +-1 <- 116 +-1 <- 118 +-1 <- 120 +-1 <- 122 +-1 <- 124 +-1 <- 126 +-1 <- 128 +-1 <- 130 +-1 <- 132 +-1 <- 134 +-1 <- 136 +-1 <- 138 +-1 <- 140 +-1 <- 142 +-1 <- 144 +-1 <- 146 +-1 <- 148 +-1 <- 150 +-1 <- 152 +-1 <- 154 +-1 <- 156 +-1 <- 158 +-1 <- 160 +-1 <- 162 +-1 <- 164 +2 <- 165 +-1 <- 166 +4 <- 167 +-1 <- 168 +6 <- 169 +-1 <- 170 +8 <- 171 +-1 <- 172 +10 <- 173 +-1 <- 174 +12 <- 175 +-1 <- 176 +14 <- 177 +-1 <- 178 +16 <- 179 +-1 <- 180 +18 <- 181 +-1 <- 182 +20 <- 183 +-1 <- 184 +22 <- 185 +-1 <- 186 +24 <- 187 +-1 <- 188 +26 <- 189 +-1 <- 190 +28 <- 191 +-1 <- 192 +30 <- 193 +-1 <- 194 +32 <- 195 +-1 <- 196 +34 <- 197 +-1 <- 198 +36 <- 199 +-1 <- 200 +38 <- 201 +-1 <- 202 +40 <- 203 +-1 <- 204 +42 <- 205 +-1 <- 206 +44 <- 207 +-1 <- 208 +46 <- 209 +-1 <- 210 +48 <- 211 +-1 <- 212 +50 <- 213 +-1 <- 214 +52 <- 215 +-1 <- 216 +54 <- 217 +-1 <- 218 +56 <- 219 +-1 <- 220 +58 <- 221 +-1 <- 222 +60 <- 223 +-1 <- 224 +62 <- 225 +-1 <- 226 +64 <- 227 +-1 <- 228 +66 <- 229 +-1 <- 230 +68 <- 231 +-1 <- 232 +70 <- 233 +-1 <- 234 +72 <- 235 +-1 <- 236 +74 <- 237 +-1 <- 238 +76 <- 239 +-1 <- 240 +78 <- 241 +-1 <- 242 +80 <- 243 +-1 <- 244 +82 <- 245 +-1 <- 246 +84 <- 247 +-1 <- 248 +86 <- 249 +-1 <- 250 +88 <- 251 +-1 <- 252 +90 <- 253 +-1 <- 254 +92 <- 255 +-1 <- 256 +94 <- 257 +-1 <- 258 +96 <- 259 +-1 <- 260 +98 <- 261 +-1 <- 262 +100 <- 263 +-1 <- 264 +102 <- 265 +-1 <- 266 +104 <- 267 +-1 <- 268 +106 <- 269 +-1 <- 270 +108 <- 271 +-1 <- 272 +110 <- 273 +-1 <- 274 +112 <- 275 +-1 <- 276 +114 <- 277 +-1 <- 278 +116 <- 279 +-1 <- 280 +118 <- 281 +-1 <- 282 +120 <- 283 +-1 <- 284 +122 <- 285 +-1 <- 286 +124 <- 287 +-1 <- 288 +126 <- 289 +-1 <- 290 +128 <- 291 +-1 <- 292 +130 <- 293 +-1 <- 294 +132 <- 295 +-1 <- 296 +134 <- 297 +-1 <- 298 +136 <- 299 +-1 <- 300 +138 <- 301 +-1 <- 302 +140 <- 303 +-1 <- 304 +142 <- 305 +-1 <- 306 +144 <- 307 +-1 <- 308 +146 <- 309 +-1 <- 310 +148 <- 311 +-1 <- 312 +150 <- 313 +-1 <- 314 +152 <- 315 +-1 <- 316 +154 <- 317 +-1 <- 318 +156 <- 319 +158 <- 321 +-1 <- 322 +160 <- 323 +-1 <- 324 +162 <- 325 +164 <- 327 +-1 <- 328 +166 <- 329 +168 <- 331 +170 <- 333 +-1 <- 334 +172 <- 335 +174 <- 337 +176 <- 339 +178 <- 341 +-1 <- 342 +180 <- 343 +-1 <- 344 +182 <- 345 +184 <- 347 +-1 <- 348 +186 <- 349 +-1 <- 350 +188 <- 351 +-1 <- 352 +190 <- 353 +-1 <- 354 +192 <- 355 +-1 <- 356 +194 <- 357 +196 <- 359 +198 <- 361 +-1 <- 362 +200 <- 363 +-1 <- 364 +202 <- 365 +204 <- 367 +206 <- 369 +-1 <- 370 +208 <- 371 +-1 <- 372 +210 <- 373 +-1 <- 374 +212 <- 375 +-1 <- 376 +214 <- 377 +-1 <- 378 +216 <- 379 +-1 <- 380 +218 <- 381 +-1 <- 382 +220 <- 383 +222 <- 385 +-1 <- 386 +224 <- 387 +226 <- 389 +228 <- 391 +-1 <- 392 +230 <- 393 +232 <- 395 +234 <- 397 +-1 <- 398 +236 <- 399 +238 <- 401 +240 <- 403 +242 <- 405 +244 <- 407 +246 <- 409 +-1 <- 410 +248 <- 411 +-1 <- 412 +250 <- 413 +252 <- 415 +-1 <- 416 +254 <- 417 +-1 <- 418 +256 <- 419 +258 <- 421 +-1 <- 422 +260 <- 423 +-1 <- 424 +262 <- 425 +-1 <- 426 +264 <- 427 +-1 <- 428 +266 <- 429 +-1 <- 430 +268 <- 431 +-1 <- 432 +270 <- 433 +272 <- 435 diff --git a/utils/cseq-1.9/log/_15_marked__lazyseq.c b/utils/cseq-1.9/log/_15_marked__lazyseq.c new file mode 100644 index 000000000..82692aa01 --- /dev/null +++ b/utils/cseq-1.9/log/_15_marked__lazyseq.c @@ -0,0 +1,629 @@ + +# 2 "" +void __VERIFIER_error(); + +# 4 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 6 "" +typedef int __cs_barrier_t; + +# 8 "" +typedef int __cs_barrierattr_t; + +# 10 "" +typedef int __cs_attr_t; + +# 12 "" +typedef int __cs_cond_t; + +# 14 "" +typedef int __cs_condattr_t; + +# 16 "" +typedef int __cs_key_t; + +# 18 "" +typedef int __cs_mutex_t; + +# 20 "" +typedef int __cs_mutexattr_t; + +# 22 "" +typedef int __cs_once_t; + +# 24 "" +typedef int __cs_rwlock_t; + +# 26 "" +typedef int __cs_rwlockattr_t; + +# 28 "" +typedef int __cs_t; + +# 30 "" +typedef int size_t; + +# 32 "" +typedef int __builtin_va_list; + +# 34 "" +typedef int __gnuc_va_list; + +# 36 "" +typedef int __int8_t; + +# 38 "" +typedef int __uint8_t; + +# 40 "" +typedef int __int16_t; + +# 42 "" +typedef int __uint16_t; + +# 44 "" +typedef int __int_least16_t; + +# 46 "" +typedef int __uint_least16_t; + +# 48 "" +typedef int __int32_t; + +# 50 "" +typedef int __uint32_t; + +# 52 "" +typedef int __int64_t; + +# 54 "" +typedef int __uint64_t; + +# 56 "" +typedef int __int_least32_t; + +# 58 "" +typedef int __uint_least32_t; + +# 60 "" +typedef int __s8; + +# 62 "" +typedef int __u8; + +# 64 "" +typedef int __s16; + +# 66 "" +typedef int __u16; + +# 68 "" +typedef int __s32; + +# 70 "" +typedef int __u32; + +# 72 "" +typedef int __s64; + +# 74 "" +typedef int __u64; + +# 76 "" +typedef int _LOCK_T; + +# 78 "" +typedef int _LOCK_RECURSIVE_T; + +# 80 "" +typedef int _off_t; + +# 82 "" +typedef int __dev_t; + +# 84 "" +typedef int __uid_t; + +# 86 "" +typedef int __gid_t; + +# 88 "" +typedef int _off64_t; + +# 90 "" +typedef int _fpos_t; + +# 92 "" +typedef int _ssize_t; + +# 94 "" +typedef int wint_t; + +# 96 "" +typedef int _mbstate_t; + +# 98 "" +typedef int _flock_t; + +# 100 "" +typedef int _iconv_t; + +# 102 "" +typedef int __ULong; + +# 104 "" +typedef int __FILE; + +# 106 "" +typedef int ptrdiff_t; + +# 108 "" +typedef int wchar_t; + +# 110 "" +typedef int __off_t; + +# 112 "" +typedef int __pid_t; + +# 114 "" +typedef int __loff_t; + +# 116 "" +typedef int u_char; + +# 118 "" +typedef int u_short; + +# 120 "" +typedef int u_int; + +# 122 "" +typedef int u_long; + +# 124 "" +typedef int ushort; + +# 126 "" +typedef int uint; + +# 128 "" +typedef int clock_t; + +# 130 "" +typedef int time_t; + +# 132 "" +typedef int daddr_t; + +# 134 "" +typedef int caddr_t; + +# 136 "" +typedef int ino_t; + +# 138 "" +typedef int off_t; + +# 140 "" +typedef int dev_t; + +# 142 "" +typedef int uid_t; + +# 144 "" +typedef int gid_t; + +# 146 "" +typedef int pid_t; + +# 148 "" +typedef int key_t; + +# 150 "" +typedef int ssize_t; + +# 152 "" +typedef int mode_t; + +# 154 "" +typedef int nlink_t; + +# 156 "" +typedef int fd_mask; + +# 158 "" +typedef int _types_fd_set; + +# 160 "" +typedef int fd_set; + +# 162 "" +typedef int clockid_t; + +# 164 "" +typedef int timer_t; + +# 166 "" +typedef int useconds_t; + +# 168 "" +typedef int suseconds_t; + +# 170 "" +typedef int FILE; + +# 172 "" +typedef int fpos_t; + +# 174 "" +typedef int cookie_read_function_t; + +# 176 "" +typedef int cookie_write_function_t; + +# 178 "" +typedef int cookie_seek_function_t; + +# 180 "" +typedef int cookie_close_function_t; + +# 182 "" +typedef int cookie_io_functions_t; + +# 184 "" +typedef int div_t; + +# 186 "" +typedef int ldiv_t; + +# 188 "" +typedef int lldiv_t; + +# 190 "" +typedef int sigset_t; + +# 192 "" +typedef int __sigset_t; + +# 194 "" +typedef int _sig_func_ptr; + +# 196 "" +typedef int sig_atomic_t; + +# 198 "" +typedef int __tzrule_type; + +# 200 "" +typedef int __tzinfo_type; + +# 202 "" +typedef int mbstate_t; + +# 204 "" +typedef int sem_t; + +# 206 "" +typedef int pthread_t; + +# 208 "" +typedef int pthread_attr_t; + +# 210 "" +typedef int pthread_mutex_t; + +# 212 "" +typedef int pthread_mutexattr_t; + +# 214 "" +typedef int pthread_cond_t; + +# 216 "" +typedef int pthread_condattr_t; + +# 218 "" +typedef int pthread_key_t; + +# 220 "" +typedef int pthread_once_t; + +# 222 "" +typedef int pthread_rwlock_t; + +# 224 "" +typedef int pthread_rwlockattr_t; + +# 226 "" +typedef int pthread_spinlock_t; + +# 228 "" +typedef int pthread_barrier_t; + +# 230 "" +typedef int pthread_barrierattr_t; + +# 232 "" +typedef int jmp_buf; + +# 234 "" +typedef int rlim_t; + +# 236 "" +typedef int sa_family_t; + +# 238 "" +typedef int sigjmp_buf; + +# 240 "" +typedef int stack_t; + +# 242 "" +typedef int siginfo_t; + +# 244 "" +typedef int z_stream; + +# 246 "" +typedef int int8_t; + +# 248 "" +typedef int uint8_t; + +# 250 "" +typedef int int16_t; + +# 252 "" +typedef int uint16_t; + +# 254 "" +typedef int int32_t; + +# 256 "" +typedef int uint32_t; + +# 258 "" +typedef int int64_t; + +# 260 "" +typedef int uint64_t; + +# 262 "" +typedef int int_least8_t; + +# 264 "" +typedef int uint_least8_t; + +# 266 "" +typedef int int_least16_t; + +# 268 "" +typedef int uint_least16_t; + +# 270 "" +typedef int int_least32_t; + +# 272 "" +typedef int uint_least32_t; + +# 274 "" +typedef int int_least64_t; + +# 276 "" +typedef int uint_least64_t; + +# 278 "" +typedef int int_fast8_t; + +# 280 "" +typedef int uint_fast8_t; + +# 282 "" +typedef int int_fast16_t; + +# 284 "" +typedef int uint_fast16_t; + +# 286 "" +typedef int int_fast32_t; + +# 288 "" +typedef int uint_fast32_t; + +# 290 "" +typedef int int_fast64_t; + +# 292 "" +typedef int uint_fast64_t; + +# 294 "" +typedef int intptr_t; + +# 296 "" +typedef int uintptr_t; + +# 298 "" +typedef int intmax_t; + +# 300 "" +typedef int uintmax_t; + +# 302 "" +typedef _Bool bool; + +# 304 "" +typedef void BZFILE; + +# 306 "" +typedef int va_list; + +# 308 "" +typedef int loff_t; + +# 310 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 312 "" +pthread_mutex_t m; + +# 314 "" +int data = 0; + +# 316 "" +void *thread1_0(void *__cs_param_thread1_arg) + +# 318 "" +{ +__CSEQ_rawline("IF(1,0,tthread1_0_1)"); + +# 320 "" + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread1_0_1: IF(1,1,tthread1_0_2)"); + +# 322 "" + data++; +__CSEQ_rawline("tthread1_0_2: IF(1,2,tthread1_0_3)"); + +# 324 "" + pthread_mutex_unlock(& m); + __exit_thread1: __VERIFIER_assume( __cs_pc_cs[1] >= 3 ); +;; + +__CSEQ_rawline("tthread1_0_3: "); + +# 331 "" + pthread_exit(0); +} + + + + +# 335 "" +void *thread2_0(void *__cs_param_thread2_arg) + +# 337 "" +{ +__CSEQ_rawline("IF(2,0,tthread2_0_1)"); + +# 339 "" + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread2_0_1: IF(2,1,tthread2_0_2)"); + +# 341 "" + data += (2); +__CSEQ_rawline("tthread2_0_2: IF(2,2,tthread2_0_3)"); + +# 343 "" + pthread_mutex_unlock(& m); + __exit_thread2: __VERIFIER_assume( __cs_pc_cs[2] >= 3 ); +;; + +__CSEQ_rawline("tthread2_0_3: "); + +# 350 "" + pthread_exit(0); +} + + + + +# 354 "" +void *thread3_0(void *__cs_param_thread3_arg) + +# 356 "" +{ +__CSEQ_rawline("IF(3,0,tthread3_0_1)"); + +# 358 "" + pthread_mutex_lock(& m); + +# 360 "" + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; +__CSEQ_rawline("tthread3_0_1: IF(3,1,tthread3_0_2)"); + +# 362 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 364 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 366 "" + { + +# 368 "" + __VERIFIER_assert(0); + +# 370 "" + ;; + } + ; +__CSEQ_rawline("tthread3_0_2: IF(3,2,tthread3_0_3)"); + +# 374 "" + pthread_mutex_unlock(& m); + __exit_thread3: __VERIFIER_assume( __cs_pc_cs[3] >= 3 ); +;; + +__CSEQ_rawline("tthread3_0_3: "); + +# 381 "" + pthread_exit(0); +} + + + + +# 385 "" +int main_thread(void) +{ +__CSEQ_rawline("IF(0,0,tmain_1)"); + +# 389 "" + pthread_mutex_init(& m, 0); + +# 391 "" + static pthread_t __cs_local_main_t1; __cs_init_scalar(&__cs_local_main_t1, sizeof(cspthread_t)); + +# 393 "" + static pthread_t __cs_local_main_t2; __cs_init_scalar(&__cs_local_main_t2, sizeof(cspthread_t)); + +# 395 "" + static pthread_t __cs_local_main_t3; __cs_init_scalar(&__cs_local_main_t3, sizeof(cspthread_t)); + +# 397 "" + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); +__CSEQ_rawline("tmain_1: IF(0,1,tmain_2)"); + +# 399 "" + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); +__CSEQ_rawline("tmain_2: IF(0,2,tmain_3)"); + +# 401 "" + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); +__CSEQ_rawline("tmain_3: IF(0,3,tmain_4)"); + +# 403 "" + pthread_join(__cs_local_main_t1, 0); +__CSEQ_rawline("tmain_4: IF(0,4,tmain_5)"); + +# 405 "" + pthread_join(__cs_local_main_t2, 0); +__CSEQ_rawline("tmain_5: IF(0,5,tmain_6)"); + +# 407 "" + pthread_join(__cs_local_main_t3, 0); + +# 409 "" + goto __exit_main;; + __exit_main: __VERIFIER_assume( __cs_pc_cs[0] >= 6 ); +;; + +__CSEQ_rawline("tmain_6: "); + +# 416 "" + pthread_exit(0); +} + + + diff --git a/utils/cseq-1.9/log/_15_output__lazyseq.c b/utils/cseq-1.9/log/_15_output__lazyseq.c new file mode 100644 index 000000000..57bb9fb51 --- /dev/null +++ b/utils/cseq-1.9/log/_15_output__lazyseq.c @@ -0,0 +1,652 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assume(*__cs_mutex_to_lock==-1); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +void __CSEQ_noop(void) {}; + + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ +__CSEQ_rawline("IF(1,0,tthread1_0_1)"); + + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread1_0_1: IF(1,1,tthread1_0_2)"); + + data++; +__CSEQ_rawline("tthread1_0_2: IF(1,2,tthread1_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread1: __VERIFIER_assume( __cs_pc_cs[1] >= 3 ); +;; + +__CSEQ_rawline("tthread1_0_3: "); + + pthread_exit(0); +} + + + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ +__CSEQ_rawline("IF(2,0,tthread2_0_1)"); + + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread2_0_1: IF(2,1,tthread2_0_2)"); + + data += (2); +__CSEQ_rawline("tthread2_0_2: IF(2,2,tthread2_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread2: __VERIFIER_assume( __cs_pc_cs[2] >= 3 ); +;; + +__CSEQ_rawline("tthread2_0_3: "); + + pthread_exit(0); +} + + + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ +__CSEQ_rawline("IF(3,0,tthread3_0_1)"); + + pthread_mutex_lock(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; +__CSEQ_rawline("tthread3_0_1: IF(3,1,tthread3_0_2)"); + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ;; + } + ; +__CSEQ_rawline("tthread3_0_2: IF(3,2,tthread3_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread3: __VERIFIER_assume( __cs_pc_cs[3] >= 3 ); +;; + +__CSEQ_rawline("tthread3_0_3: "); + + pthread_exit(0); +} + + + + +int main_thread(void) +{ +__CSEQ_rawline("IF(0,0,tmain_1)"); + + pthread_mutex_init(& m, 0); + + static pthread_t __cs_local_main_t1; __cs_init_scalar(&__cs_local_main_t1, sizeof(cspthread_t)); + + static pthread_t __cs_local_main_t2; __cs_init_scalar(&__cs_local_main_t2, sizeof(cspthread_t)); + + static pthread_t __cs_local_main_t3; __cs_init_scalar(&__cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); +__CSEQ_rawline("tmain_1: IF(0,1,tmain_2)"); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); +__CSEQ_rawline("tmain_2: IF(0,2,tmain_3)"); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); +__CSEQ_rawline("tmain_3: IF(0,3,tmain_4)"); + + pthread_join(__cs_local_main_t1, 0); +__CSEQ_rawline("tmain_4: IF(0,4,tmain_5)"); + + pthread_join(__cs_local_main_t2, 0); +__CSEQ_rawline("tmain_5: IF(0,5,tmain_6)"); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main;; + __exit_main: __VERIFIER_assume( __cs_pc_cs[0] >= 6 ); +;; + +__CSEQ_rawline("tmain_6: "); + + pthread_exit(0); +} + + + +int main(void) { +__CSEQ_rawline("/* round 0 */"); +__CSEQ_rawline(" /* main */"); + __cs_thread_index = 0; + unsigned int __cs_tmp_t0_r0; + __cs_pc_cs[0] = __cs_tmp_t0_r0; + __VERIFIER_assume(__cs_pc_cs[0] > 0); + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + main_thread(); + __cs_pc[0] = __cs_pc_cs[0]; + +__CSEQ_rawline(" /* thread1_0 */"); + unsigned int __cs_tmp_t1_r0; + if (__cs_active_thread[1]) { + __cs_thread_index = 1; + __cs_pc_cs[1] = __cs_tmp_t1_r0; + __VERIFIER_assume(__cs_pc_cs[1] <= 3); + thread1_0(__cs_threadargs[1]); + __cs_pc[1] = __cs_pc_cs[1]; + } + +__CSEQ_rawline(" /* thread2_0 */"); + unsigned int __cs_tmp_t2_r0; + if (__cs_active_thread[2]) { + __cs_thread_index = 2; + __cs_pc_cs[2] = __cs_tmp_t2_r0; + __VERIFIER_assume(__cs_pc_cs[2] <= 3); + thread2_0(__cs_threadargs[2]); + __cs_pc[2] = __cs_pc_cs[2]; + } + +__CSEQ_rawline(" /* thread3_0 */"); + unsigned int __cs_tmp_t3_r0; + if (__cs_active_thread[3]) { + __cs_thread_index = 3; + __cs_pc_cs[3] = __cs_tmp_t3_r0; + __VERIFIER_assume(__cs_pc_cs[3] <= 3); + thread3_0(__cs_threadargs[3]); + __cs_pc[3] = __cs_pc_cs[3]; + } + + unsigned int __cs_tmp_t0_r1; + if (__cs_active_thread[0]) { + __cs_thread_index = 0; + __cs_pc_cs[0] = __cs_tmp_t0_r1; + __VERIFIER_assume(__cs_pc_cs[0] >= __cs_pc[0]); + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + main_thread(); + } + + return 0; +} + diff --git a/utils/cseq-1.9/log/_16_input___instrumenter.c b/utils/cseq-1.9/log/_16_input___instrumenter.c new file mode 100644 index 000000000..57bb9fb51 --- /dev/null +++ b/utils/cseq-1.9/log/_16_input___instrumenter.c @@ -0,0 +1,652 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assume(*__cs_mutex_to_lock==-1); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +void __CSEQ_noop(void) {}; + + +void __VERIFIER_error(); + +typedef int _____STARTSTRIPPINGFROMHERE_____; + +typedef int __cs_barrier_t; + +typedef int __cs_barrierattr_t; + +typedef int __cs_attr_t; + +typedef int __cs_cond_t; + +typedef int __cs_condattr_t; + +typedef int __cs_key_t; + +typedef int __cs_mutex_t; + +typedef int __cs_mutexattr_t; + +typedef int __cs_once_t; + +typedef int __cs_rwlock_t; + +typedef int __cs_rwlockattr_t; + +typedef int __cs_t; + +typedef int size_t; + +typedef int __builtin_va_list; + +typedef int __gnuc_va_list; + +typedef int __int8_t; + +typedef int __uint8_t; + +typedef int __int16_t; + +typedef int __uint16_t; + +typedef int __int_least16_t; + +typedef int __uint_least16_t; + +typedef int __int32_t; + +typedef int __uint32_t; + +typedef int __int64_t; + +typedef int __uint64_t; + +typedef int __int_least32_t; + +typedef int __uint_least32_t; + +typedef int __s8; + +typedef int __u8; + +typedef int __s16; + +typedef int __u16; + +typedef int __s32; + +typedef int __u32; + +typedef int __s64; + +typedef int __u64; + +typedef int _LOCK_T; + +typedef int _LOCK_RECURSIVE_T; + +typedef int _off_t; + +typedef int __dev_t; + +typedef int __uid_t; + +typedef int __gid_t; + +typedef int _off64_t; + +typedef int _fpos_t; + +typedef int _ssize_t; + +typedef int wint_t; + +typedef int _mbstate_t; + +typedef int _flock_t; + +typedef int _iconv_t; + +typedef int __ULong; + +typedef int __FILE; + +typedef int ptrdiff_t; + +typedef int wchar_t; + +typedef int __off_t; + +typedef int __pid_t; + +typedef int __loff_t; + +typedef int u_char; + +typedef int u_short; + +typedef int u_int; + +typedef int u_long; + +typedef int ushort; + +typedef int uint; + +typedef int clock_t; + +typedef int time_t; + +typedef int daddr_t; + +typedef int caddr_t; + +typedef int ino_t; + +typedef int off_t; + +typedef int dev_t; + +typedef int uid_t; + +typedef int gid_t; + +typedef int pid_t; + +typedef int key_t; + +typedef int ssize_t; + +typedef int mode_t; + +typedef int nlink_t; + +typedef int fd_mask; + +typedef int _types_fd_set; + +typedef int fd_set; + +typedef int clockid_t; + +typedef int timer_t; + +typedef int useconds_t; + +typedef int suseconds_t; + +typedef int FILE; + +typedef int fpos_t; + +typedef int cookie_read_function_t; + +typedef int cookie_write_function_t; + +typedef int cookie_seek_function_t; + +typedef int cookie_close_function_t; + +typedef int cookie_io_functions_t; + +typedef int div_t; + +typedef int ldiv_t; + +typedef int lldiv_t; + +typedef int sigset_t; + +typedef int __sigset_t; + +typedef int _sig_func_ptr; + +typedef int sig_atomic_t; + +typedef int __tzrule_type; + +typedef int __tzinfo_type; + +typedef int mbstate_t; + +typedef int sem_t; + +typedef int pthread_t; + +typedef int pthread_attr_t; + +typedef int pthread_mutex_t; + +typedef int pthread_mutexattr_t; + +typedef int pthread_cond_t; + +typedef int pthread_condattr_t; + +typedef int pthread_key_t; + +typedef int pthread_once_t; + +typedef int pthread_rwlock_t; + +typedef int pthread_rwlockattr_t; + +typedef int pthread_spinlock_t; + +typedef int pthread_barrier_t; + +typedef int pthread_barrierattr_t; + +typedef int jmp_buf; + +typedef int rlim_t; + +typedef int sa_family_t; + +typedef int sigjmp_buf; + +typedef int stack_t; + +typedef int siginfo_t; + +typedef int z_stream; + +typedef int int8_t; + +typedef int uint8_t; + +typedef int int16_t; + +typedef int uint16_t; + +typedef int int32_t; + +typedef int uint32_t; + +typedef int int64_t; + +typedef int uint64_t; + +typedef int int_least8_t; + +typedef int uint_least8_t; + +typedef int int_least16_t; + +typedef int uint_least16_t; + +typedef int int_least32_t; + +typedef int uint_least32_t; + +typedef int int_least64_t; + +typedef int uint_least64_t; + +typedef int int_fast8_t; + +typedef int uint_fast8_t; + +typedef int int_fast16_t; + +typedef int uint_fast16_t; + +typedef int int_fast32_t; + +typedef int uint_fast32_t; + +typedef int int_fast64_t; + +typedef int uint_fast64_t; + +typedef int intptr_t; + +typedef int uintptr_t; + +typedef int intmax_t; + +typedef int uintmax_t; + +typedef _Bool bool; + +typedef void BZFILE; + +typedef int va_list; + +typedef int loff_t; + +typedef int _____STOPSTRIPPINGFROMHERE_____; + +pthread_mutex_t m; + +int data = 0; + +void *thread1_0(void *__cs_param_thread1_arg) + +{ +__CSEQ_rawline("IF(1,0,tthread1_0_1)"); + + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread1_0_1: IF(1,1,tthread1_0_2)"); + + data++; +__CSEQ_rawline("tthread1_0_2: IF(1,2,tthread1_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread1: __VERIFIER_assume( __cs_pc_cs[1] >= 3 ); +;; + +__CSEQ_rawline("tthread1_0_3: "); + + pthread_exit(0); +} + + + + +void *thread2_0(void *__cs_param_thread2_arg) + +{ +__CSEQ_rawline("IF(2,0,tthread2_0_1)"); + + pthread_mutex_lock(& m); +__CSEQ_rawline("tthread2_0_1: IF(2,1,tthread2_0_2)"); + + data += (2); +__CSEQ_rawline("tthread2_0_2: IF(2,2,tthread2_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread2: __VERIFIER_assume( __cs_pc_cs[2] >= 3 ); +;; + +__CSEQ_rawline("tthread2_0_3: "); + + pthread_exit(0); +} + + + + +void *thread3_0(void *__cs_param_thread3_arg) + +{ +__CSEQ_rawline("IF(3,0,tthread3_0_1)"); + + pthread_mutex_lock(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; +__CSEQ_rawline("tthread3_0_1: IF(3,1,tthread3_0_2)"); + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + __VERIFIER_assert(0); + + ;; + } + ; +__CSEQ_rawline("tthread3_0_2: IF(3,2,tthread3_0_3)"); + + pthread_mutex_unlock(& m); + __exit_thread3: __VERIFIER_assume( __cs_pc_cs[3] >= 3 ); +;; + +__CSEQ_rawline("tthread3_0_3: "); + + pthread_exit(0); +} + + + + +int main_thread(void) +{ +__CSEQ_rawline("IF(0,0,tmain_1)"); + + pthread_mutex_init(& m, 0); + + static pthread_t __cs_local_main_t1; __cs_init_scalar(&__cs_local_main_t1, sizeof(cspthread_t)); + + static pthread_t __cs_local_main_t2; __cs_init_scalar(&__cs_local_main_t2, sizeof(cspthread_t)); + + static pthread_t __cs_local_main_t3; __cs_init_scalar(&__cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); +__CSEQ_rawline("tmain_1: IF(0,1,tmain_2)"); + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); +__CSEQ_rawline("tmain_2: IF(0,2,tmain_3)"); + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); +__CSEQ_rawline("tmain_3: IF(0,3,tmain_4)"); + + pthread_join(__cs_local_main_t1, 0); +__CSEQ_rawline("tmain_4: IF(0,4,tmain_5)"); + + pthread_join(__cs_local_main_t2, 0); +__CSEQ_rawline("tmain_5: IF(0,5,tmain_6)"); + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main;; + __exit_main: __VERIFIER_assume( __cs_pc_cs[0] >= 6 ); +;; + +__CSEQ_rawline("tmain_6: "); + + pthread_exit(0); +} + + + +int main(void) { +__CSEQ_rawline("/* round 0 */"); +__CSEQ_rawline(" /* main */"); + __cs_thread_index = 0; + unsigned int __cs_tmp_t0_r0; + __cs_pc_cs[0] = __cs_tmp_t0_r0; + __VERIFIER_assume(__cs_pc_cs[0] > 0); + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + main_thread(); + __cs_pc[0] = __cs_pc_cs[0]; + +__CSEQ_rawline(" /* thread1_0 */"); + unsigned int __cs_tmp_t1_r0; + if (__cs_active_thread[1]) { + __cs_thread_index = 1; + __cs_pc_cs[1] = __cs_tmp_t1_r0; + __VERIFIER_assume(__cs_pc_cs[1] <= 3); + thread1_0(__cs_threadargs[1]); + __cs_pc[1] = __cs_pc_cs[1]; + } + +__CSEQ_rawline(" /* thread2_0 */"); + unsigned int __cs_tmp_t2_r0; + if (__cs_active_thread[2]) { + __cs_thread_index = 2; + __cs_pc_cs[2] = __cs_tmp_t2_r0; + __VERIFIER_assume(__cs_pc_cs[2] <= 3); + thread2_0(__cs_threadargs[2]); + __cs_pc[2] = __cs_pc_cs[2]; + } + +__CSEQ_rawline(" /* thread3_0 */"); + unsigned int __cs_tmp_t3_r0; + if (__cs_active_thread[3]) { + __cs_thread_index = 3; + __cs_pc_cs[3] = __cs_tmp_t3_r0; + __VERIFIER_assume(__cs_pc_cs[3] <= 3); + thread3_0(__cs_threadargs[3]); + __cs_pc[3] = __cs_pc_cs[3]; + } + + unsigned int __cs_tmp_t0_r1; + if (__cs_active_thread[0]) { + __cs_thread_index = 0; + __cs_pc_cs[0] = __cs_tmp_t0_r1; + __VERIFIER_assume(__cs_pc_cs[0] >= __cs_pc[0]); + __VERIFIER_assume(__cs_pc_cs[0] <= 6); + main_thread(); + } + + return 0; +} + diff --git a/utils/cseq-1.9/log/_16_linemap__instrumenter.c b/utils/cseq-1.9/log/_16_linemap__instrumenter.c new file mode 100644 index 000000000..e69de29bb diff --git a/utils/cseq-1.9/log/_16_marked__instrumenter.c b/utils/cseq-1.9/log/_16_marked__instrumenter.c new file mode 100644 index 000000000..1201ec85b --- /dev/null +++ b/utils/cseq-1.9/log/_16_marked__instrumenter.c @@ -0,0 +1,1231 @@ + +# 1 "" +unsigned int __cs_active_thread[THREADS + 1] = {1}; + +# 2 "" +unsigned int __cs_pc[THREADS + 1]; + +# 3 "" +unsigned int __cs_pc_cs[THREADS + 1]; + +# 4 "" +unsigned int __cs_thread_index; + +# 5 "" +unsigned int __cs_last_thread; + +# 6 "" +unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + +# 8 "" +void *__cs_safe_malloc(unsigned int __cs_size) +{ + +# 9 "" + void *__cs_ptr = (malloc(__cs_size)); + +# 10 "" + KLEE_assume(__cs_ptr); + return (__cs_ptr); +} + + +# 13 "" +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) +{ + +# 14 "" + if (__cs_size == (sizeof(int))) + +# 15 "" + * ((int *) __cs_var) = (KLEE_nondet_int()); + else + +# 16 "" + { + +# 17 "" + __cs_var = (malloc(__cs_size)); + } + +} + + +# 21 "" +void __CSEQ_message(char *__cs_message) +{ + ; +} + + +# 23 "" +typedef int cspthread_t; + +# 25 "" +void *__cs_threadargs[THREADS + 1]; + +# 27 "" +typedef int cspthread_key_t; + +# 29 "" +cspthread_key_t __cs_keys[1][THREADS + 2]; + +# 30 "" +void (*__cs_key_destructor[1])(void *); + +# 32 "" +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void *), void *__cs_arg, int __cs_threadID) +{ + +# 33 "" + if (__cs_threadID > THREADS) + return (0); + + +# 34 "" + * __cs_new_thread_id = (__cs_threadID); + +# 35 "" + __cs_active_thread[__cs_threadID] = (1); + +# 36 "" + __cs_threadargs[__cs_threadID] = (__cs_arg); + +# 37 "" + __CSEQ_message("thread spawned"); + +# 38 "" + return (0); +} + + +# 41 "" +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) +{ + +# 42 "" + KLEE_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + +# 43 "" + return (0); +} + + +# 46 "" +int pthread_exit(void *__cs_value_ptr) +{ + +# 47 "" + if ((__cs_key_destructor[0] != 0) && (__cs_keys[0][__cs_thread_index + 1] != 0)) + { + +# 48 "" + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index + 1]); + } + +} + + +# 52 "" +int pthread_self(void) +{ + return (__cs_thread_index + 1); +} + + +# 54 "" +typedef int cspthread_mutex_t; + +# 56 "" +int pthread_mutex_init(cspthread_mutex_t *__cs_m, int __cs_val) +{ + +# 57 "" + * __cs_m = (- 1); + +# 58 "" + return (0); +} + + +# 61 "" +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) +{ + +# 62 "" + * __cs_mutex_to_destroy = (- 2); + +# 63 "" + __CSEQ_message("lock destroyed"); + +# 64 "" + return (0); +} + + +# 67 "" +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) +{ + +# 68 "" + KLEE_assume((* __cs_mutex_to_lock) == (- 1)); + +# 69 "" + * __cs_mutex_to_lock = (__cs_thread_index + 1); + +# 70 "" + __CSEQ_message("lock acquired"); + +# 71 "" + return (0); +} + + +# 74 "" +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) +{ + +# 75 "" + KLEE_assume((* __cs_mutex_to_unlock) == (__cs_thread_index + 1)); + +# 76 "" + * __cs_mutex_to_unlock = (- 1); + +# 77 "" + __CSEQ_message("lock released"); + +# 78 "" + return (0); +} + + +# 81 "" +typedef int cspthread_cond_t; + +# 83 "" +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) +{ + +# 84 "" + * __cs_cond_to_init = (- 1); + +# 85 "" + return (0); +} + + +# 88 "" +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) +{ + +# 89 "" + * __cs_cond_to_destroy = (- 2); + +# 90 "" + return (0); +} + + +# 93 "" +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) +{ + +# 94 "" + pthread_mutex_unlock(__cs_m); + +# 95 "" + return (0); +} + + +# 98 "" +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) +{ + +# 99 "" + KLEE_assume((* __cs_cond_to_wait_for) == 1); + +# 100 "" + pthread_mutex_lock(__cs_m); + +# 101 "" + return (0); +} + + +# 104 "" +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) +{ + +# 105 "" + * __cs_cond_to_signal = (1); + +# 106 "" + __CSEQ_message("conditional variable signal"); + +# 107 "" + return (0); +} + + +# 110 "" +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) +{ + +# 111 "" + * __cs_cond_to_broadcast = (1); + +# 112 "" + __CSEQ_message("conditional variable broadcast"); + +# 113 "" + return (0); +} + + +# 119 "" +typedef struct cspthread_barrier_t +{ + +# 117 "" + unsigned int init; + +# 118 "" + unsigned int current; +} cspthread_barrier_t; + +# 121 "" +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void *__cs_attr, unsigned int count) +{ + +# 122 "" + __cs_barrier_to_init->current = (count); + +# 123 "" + __cs_barrier_to_init->init = (count); + +# 124 "" + return (0); +} + + +# 127 "" +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) +{ + +# 128 "" + __cs_barrier_to_destroy->init = (- 1); + +# 129 "" + __cs_barrier_to_destroy->current = (- 1); + +# 130 "" + return (0); +} + + +# 134 "" +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait) +{ + +# 135 "" + __cs_barrier_to_wait->current--; + +# 136 "" + return (0); +} + + +# 139 "" +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait) +{ + +# 140 "" + KLEE_assume(__cs_barrier_to_wait->current == 0); + +# 141 "" + __cs_barrier_to_wait->current = (__cs_barrier_to_wait->init); + +# 142 "" + return (0); +} + + +# 145 "" +int pthread_key_create(cspthread_key_t *key, void (*destructor)(void *)) +{ + +# 146 "" + static int currentkey = (0); + +# 147 "" + __cs_key_destructor[0] = (destructor); + +# 148 "" + * key = (currentkey++); + +# 149 "" + return (0); +} + + +# 152 "" +int pthread_setspecific(cspthread_key_t key, const void *value) +{ + +# 153 "" + __cs_keys[key][__cs_thread_index + 1] = (value); + +# 154 "" + return (0); +} + + +# 157 "" +void *pthread_getspecific(cspthread_key_t key) +{ + +# 158 "" + return (__cs_keys[key][__cs_thread_index + 1]); +} + + +# 162 "" +void __CSEQ_noop(void) +{ +} + + +# 165 "" +void __VERIFIER_error(); + +# 167 "" +typedef int _____STARTSTRIPPINGFROMHERE_____; + +# 169 "" +typedef int __cs_barrier_t; + +# 171 "" +typedef int __cs_barrierattr_t; + +# 173 "" +typedef int __cs_attr_t; + +# 175 "" +typedef int __cs_cond_t; + +# 177 "" +typedef int __cs_condattr_t; + +# 179 "" +typedef int __cs_key_t; + +# 181 "" +typedef int __cs_mutex_t; + +# 183 "" +typedef int __cs_mutexattr_t; + +# 185 "" +typedef int __cs_once_t; + +# 187 "" +typedef int __cs_rwlock_t; + +# 189 "" +typedef int __cs_rwlockattr_t; + +# 191 "" +typedef int __cs_t; + +# 193 "" +typedef int size_t; + +# 195 "" +typedef int __builtin_va_list; + +# 197 "" +typedef int __gnuc_va_list; + +# 199 "" +typedef int __int8_t; + +# 201 "" +typedef int __uint8_t; + +# 203 "" +typedef int __int16_t; + +# 205 "" +typedef int __uint16_t; + +# 207 "" +typedef int __int_least16_t; + +# 209 "" +typedef int __uint_least16_t; + +# 211 "" +typedef int __int32_t; + +# 213 "" +typedef int __uint32_t; + +# 215 "" +typedef int __int64_t; + +# 217 "" +typedef int __uint64_t; + +# 219 "" +typedef int __int_least32_t; + +# 221 "" +typedef int __uint_least32_t; + +# 223 "" +typedef int __s8; + +# 225 "" +typedef int __u8; + +# 227 "" +typedef int __s16; + +# 229 "" +typedef int __u16; + +# 231 "" +typedef int __s32; + +# 233 "" +typedef int __u32; + +# 235 "" +typedef int __s64; + +# 237 "" +typedef int __u64; + +# 239 "" +typedef int _LOCK_T; + +# 241 "" +typedef int _LOCK_RECURSIVE_T; + +# 243 "" +typedef int _off_t; + +# 245 "" +typedef int __dev_t; + +# 247 "" +typedef int __uid_t; + +# 249 "" +typedef int __gid_t; + +# 251 "" +typedef int _off64_t; + +# 253 "" +typedef int _fpos_t; + +# 255 "" +typedef int _ssize_t; + +# 257 "" +typedef int wint_t; + +# 259 "" +typedef int _mbstate_t; + +# 261 "" +typedef int _flock_t; + +# 263 "" +typedef int _iconv_t; + +# 265 "" +typedef int __ULong; + +# 267 "" +typedef int __FILE; + +# 269 "" +typedef int ptrdiff_t; + +# 271 "" +typedef int wchar_t; + +# 273 "" +typedef int __off_t; + +# 275 "" +typedef int __pid_t; + +# 277 "" +typedef int __loff_t; + +# 279 "" +typedef int u_char; + +# 281 "" +typedef int u_short; + +# 283 "" +typedef int u_int; + +# 285 "" +typedef int u_long; + +# 287 "" +typedef int ushort; + +# 289 "" +typedef int uint; + +# 291 "" +typedef int clock_t; + +# 293 "" +typedef int time_t; + +# 295 "" +typedef int daddr_t; + +# 297 "" +typedef int caddr_t; + +# 299 "" +typedef int ino_t; + +# 301 "" +typedef int off_t; + +# 303 "" +typedef int dev_t; + +# 305 "" +typedef int uid_t; + +# 307 "" +typedef int gid_t; + +# 309 "" +typedef int pid_t; + +# 311 "" +typedef int key_t; + +# 313 "" +typedef int ssize_t; + +# 315 "" +typedef int mode_t; + +# 317 "" +typedef int nlink_t; + +# 319 "" +typedef int fd_mask; + +# 321 "" +typedef int _types_fd_set; + +# 323 "" +typedef int fd_set; + +# 325 "" +typedef int clockid_t; + +# 327 "" +typedef int timer_t; + +# 329 "" +typedef int useconds_t; + +# 331 "" +typedef int suseconds_t; + +# 333 "" +typedef int FILE; + +# 335 "" +typedef int fpos_t; + +# 337 "" +typedef int cookie_read_function_t; + +# 339 "" +typedef int cookie_write_function_t; + +# 341 "" +typedef int cookie_seek_function_t; + +# 343 "" +typedef int cookie_close_function_t; + +# 345 "" +typedef int cookie_io_functions_t; + +# 347 "" +typedef int div_t; + +# 349 "" +typedef int ldiv_t; + +# 351 "" +typedef int lldiv_t; + +# 353 "" +typedef int sigset_t; + +# 355 "" +typedef int __sigset_t; + +# 357 "" +typedef int _sig_func_ptr; + +# 359 "" +typedef int sig_atomic_t; + +# 361 "" +typedef int __tzrule_type; + +# 363 "" +typedef int __tzinfo_type; + +# 365 "" +typedef int mbstate_t; + +# 367 "" +typedef int sem_t; + +# 369 "" +typedef int pthread_t; + +# 371 "" +typedef int pthread_attr_t; + +# 373 "" +typedef int pthread_mutex_t; + +# 375 "" +typedef int pthread_mutexattr_t; + +# 377 "" +typedef int pthread_cond_t; + +# 379 "" +typedef int pthread_condattr_t; + +# 381 "" +typedef int pthread_key_t; + +# 383 "" +typedef int pthread_once_t; + +# 385 "" +typedef int pthread_rwlock_t; + +# 387 "" +typedef int pthread_rwlockattr_t; + +# 389 "" +typedef int pthread_spinlock_t; + +# 391 "" +typedef int pthread_barrier_t; + +# 393 "" +typedef int pthread_barrierattr_t; + +# 395 "" +typedef int jmp_buf; + +# 397 "" +typedef int rlim_t; + +# 399 "" +typedef int sa_family_t; + +# 401 "" +typedef int sigjmp_buf; + +# 403 "" +typedef int stack_t; + +# 405 "" +typedef int siginfo_t; + +# 407 "" +typedef int z_stream; + +# 409 "" +typedef int int8_t; + +# 411 "" +typedef int uint8_t; + +# 413 "" +typedef int int16_t; + +# 415 "" +typedef int uint16_t; + +# 417 "" +typedef int int32_t; + +# 419 "" +typedef int uint32_t; + +# 421 "" +typedef int int64_t; + +# 423 "" +typedef int uint64_t; + +# 425 "" +typedef int int_least8_t; + +# 427 "" +typedef int uint_least8_t; + +# 429 "" +typedef int int_least16_t; + +# 431 "" +typedef int uint_least16_t; + +# 433 "" +typedef int int_least32_t; + +# 435 "" +typedef int uint_least32_t; + +# 437 "" +typedef int int_least64_t; + +# 439 "" +typedef int uint_least64_t; + +# 441 "" +typedef int int_fast8_t; + +# 443 "" +typedef int uint_fast8_t; + +# 445 "" +typedef int int_fast16_t; + +# 447 "" +typedef int uint_fast16_t; + +# 449 "" +typedef int int_fast32_t; + +# 451 "" +typedef int uint_fast32_t; + +# 453 "" +typedef int int_fast64_t; + +# 455 "" +typedef int uint_fast64_t; + +# 457 "" +typedef int intptr_t; + +# 459 "" +typedef int uintptr_t; + +# 461 "" +typedef int intmax_t; + +# 463 "" +typedef int uintmax_t; + +# 465 "" +typedef _Bool bool; + +# 467 "" +typedef void BZFILE; + +# 469 "" +typedef int va_list; + +# 471 "" +typedef int loff_t; + +# 473 "" +typedef int _____STOPSTRIPPINGFROMHERE_____; + +# 475 "" +cspthread_mutex_t m; + +# 477 "" +int data = (0); + +# 479 "" +void *thread1_0(void *__cs_param_thread1_arg) + +# 481 "" +{ + +# 482 "" + IF(1,0,tthread1_0_1)__CSEQ_removeindent; + +# 484 "" + pthread_mutex_lock(& m); + +# 485 "" + tthread1_0_1: IF(1,1,tthread1_0_2)__CSEQ_removeindent; + +# 487 "" + data++; + +# 488 "" + tthread1_0_2: IF(1,2,tthread1_0_3)__CSEQ_removeindent; + +# 490 "" + pthread_mutex_unlock(& m); + +# 491 "" + __exit_thread1: + KLEE_assume(__cs_pc_cs[1] >= 3); + + +# 492 "" + ; + ; + +# 494 "" + tthread1_0_3: __CSEQ_removeindent; + +# 496 "" + pthread_exit(0); +} + + +# 502 "" +void *thread2_0(void *__cs_param_thread2_arg) + +# 504 "" +{ + +# 505 "" + IF(2,0,tthread2_0_1)__CSEQ_removeindent; + +# 507 "" + pthread_mutex_lock(& m); + +# 508 "" + tthread2_0_1: IF(2,1,tthread2_0_2)__CSEQ_removeindent; + +# 510 "" + data += (2); + +# 511 "" + tthread2_0_2: IF(2,2,tthread2_0_3)__CSEQ_removeindent; + +# 513 "" + pthread_mutex_unlock(& m); + +# 514 "" + __exit_thread2: + KLEE_assume(__cs_pc_cs[2] >= 3); + + +# 515 "" + ; + ; + +# 517 "" + tthread2_0_3: __CSEQ_removeindent; + +# 519 "" + pthread_exit(0); +} + + +# 525 "" +void *thread3_0(void *__cs_param_thread3_arg) + +# 527 "" +{ + +# 528 "" + IF(3,0,tthread3_0_1)__CSEQ_removeindent; + +# 530 "" + pthread_mutex_lock(& m); + +# 532 "" + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +# 533 "" + tthread3_0_1: IF(3,1,tthread3_0_2)__CSEQ_removeindent; + +# 535 "" + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + +# 537 "" + if (__cs_local_thread3___cs_tmp_if_cond_0) + +# 539 "" + { + +# 541 "" + KLEE_assert(0); + +# 543 "" + ; + ; + } + + +# 545 "" + ; + +# 546 "" + tthread3_0_2: IF(3,2,tthread3_0_3)__CSEQ_removeindent; + +# 548 "" + pthread_mutex_unlock(& m); + +# 549 "" + __exit_thread3: + KLEE_assume(__cs_pc_cs[3] >= 3); + + +# 550 "" + ; + ; + +# 552 "" + tthread3_0_3: __CSEQ_removeindent; + +# 554 "" + pthread_exit(0); +} + + +# 560 "" +int main_thread(void) + +# 561 "" +{ + +# 562 "" + IF(0,0,tmain_1)__CSEQ_removeindent; + +# 564 "" + pthread_mutex_init(& m, 0); + +# 566 "" + static cspthread_t __cs_local_main_t1; + __cs_init_scalar(& __cs_local_main_t1, sizeof(cspthread_t)); + +# 568 "" + static cspthread_t __cs_local_main_t2; + __cs_init_scalar(& __cs_local_main_t2, sizeof(cspthread_t)); + +# 570 "" + static cspthread_t __cs_local_main_t3; + __cs_init_scalar(& __cs_local_main_t3, sizeof(cspthread_t)); + +# 572 "" + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); + +# 573 "" + tmain_1: IF(0,1,tmain_2)__CSEQ_removeindent; + +# 575 "" + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); + +# 576 "" + tmain_2: IF(0,2,tmain_3)__CSEQ_removeindent; + +# 578 "" + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); + +# 579 "" + tmain_3: IF(0,3,tmain_4)__CSEQ_removeindent; + +# 581 "" + pthread_join(__cs_local_main_t1, 0); + +# 582 "" + tmain_4: IF(0,4,tmain_5)__CSEQ_removeindent; + +# 584 "" + pthread_join(__cs_local_main_t2, 0); + +# 585 "" + tmain_5: IF(0,5,tmain_6)__CSEQ_removeindent; + +# 587 "" + pthread_join(__cs_local_main_t3, 0); + +# 589 "" + goto __exit_main; + ; + +# 590 "" + __exit_main: + KLEE_assume(__cs_pc_cs[0] >= 6); + + +# 591 "" + ; + ; + +# 593 "" + tmain_6: __CSEQ_removeindent; + +# 595 "" + pthread_exit(0); +} + + +# 600 "" +int main(void) +{ + +# 601 "" + /* round 0 */__CSEQ_removeindent; + +# 602 "" + /* main */__CSEQ_removeindent; + +# 603 "" + __cs_thread_index = (0); + +# 604 "" + unsigned int __cs_tmp_t0_r0; + +# 605 "" + __cs_pc_cs[0] = (__cs_tmp_t0_r0); + +# 606 "" + KLEE_assume(__cs_pc_cs[0] > 0); + +# 607 "" + KLEE_assume(__cs_pc_cs[0] <= 6); + +# 608 "" + main_thread(); + +# 609 "" + __cs_pc[0] = (__cs_pc_cs[0]); + +# 611 "" + /* thread1_0 */__CSEQ_removeindent; + +# 612 "" + unsigned int __cs_tmp_t1_r0; + +# 613 "" + if (__cs_active_thread[1]) + { + +# 614 "" + __cs_thread_index = (1); + +# 615 "" + __cs_pc_cs[1] = (__cs_tmp_t1_r0); + +# 616 "" + KLEE_assume(__cs_pc_cs[1] <= 3); + +# 617 "" + thread1_0(__cs_threadargs[1]); + +# 618 "" + __cs_pc[1] = (__cs_pc_cs[1]); + } + + +# 621 "" + /* thread2_0 */__CSEQ_removeindent; + +# 622 "" + unsigned int __cs_tmp_t2_r0; + +# 623 "" + if (__cs_active_thread[2]) + { + +# 624 "" + __cs_thread_index = (2); + +# 625 "" + __cs_pc_cs[2] = (__cs_tmp_t2_r0); + +# 626 "" + KLEE_assume(__cs_pc_cs[2] <= 3); + +# 627 "" + thread2_0(__cs_threadargs[2]); + +# 628 "" + __cs_pc[2] = (__cs_pc_cs[2]); + } + + +# 631 "" + /* thread3_0 */__CSEQ_removeindent; + +# 632 "" + unsigned int __cs_tmp_t3_r0; + +# 633 "" + if (__cs_active_thread[3]) + { + +# 634 "" + __cs_thread_index = (3); + +# 635 "" + __cs_pc_cs[3] = (__cs_tmp_t3_r0); + +# 636 "" + KLEE_assume(__cs_pc_cs[3] <= 3); + +# 637 "" + thread3_0(__cs_threadargs[3]); + +# 638 "" + __cs_pc[3] = (__cs_pc_cs[3]); + } + + +# 641 "" + unsigned int __cs_tmp_t0_r1; + +# 642 "" + if (__cs_active_thread[0]) + { + +# 643 "" + __cs_thread_index = (0); + +# 644 "" + __cs_pc_cs[0] = (__cs_tmp_t0_r1); + +# 645 "" + KLEE_assume(__cs_pc_cs[0] >= __cs_pc[0]); + +# 646 "" + KLEE_assume(__cs_pc_cs[0] <= 6); + +# 647 "" + main_thread(); + } + + +# 650 "" + return (0); +} + diff --git a/utils/cseq-1.9/log/_16_output__instrumenter.c b/utils/cseq-1.9/log/_16_output__instrumenter.c new file mode 100644 index 000000000..2eaccb696 --- /dev/null +++ b/utils/cseq-1.9/log/_16_output__instrumenter.c @@ -0,0 +1,662 @@ +/* + * generated by CSeq [ 0000 / 0000 ] 2020-07-11 18:03:22 + * + * [ 0000 merger-2019.11.15 + * 0000 parser-2019.11.27 + * 0000 module-0.0-2019.11.27 ] + * + * params: + * -D , -b , -i examples/lazy_unsafe.c, --backend klee, --output examples/test.c + * + * modules: + * 0000 workarounds () + * 0000 functiontracker () + * 0000 preinstrumenter (error-label) + * 0000 constants (deep-propagation) + * 0000 spinlock () + * 0000 switchtransformer () + * 0000 dowhileconverter () + * 0000 conditionextractor () + * 0000 varnames () + * 0000 preinliner () + * 0000 inliner (atomic-parameters simplify-args) + * 0000 unroller (unwind unwind-while unwind-for unwind-for-max softunwindbound varnamesmap varscopesmap extra-tracking) + * 0000 duplicator () + * 0000 condwaitconverter () + * 0000 lazyseq (rounds threads schedule deadlock norobin preanalysis nondet-condvar-wakeups) + * 0000 instrumenter (backend bitwidth header well-nested-locks emptystructs) + * 0000 feeder (backend time llvm depth slevel output no-simplify) + * 0000 cex (backend cex exitcode threadnamesmap threadindexes threadindextoname varnamesmap coordstofunctions sv-comp witness entry threadsizes threadendlines loopheads) + * + */ +#define __cs_MUTEX_INITIALIZER -1 +#define __cs_COND_INITIALIZER -1 +#define __cs_RWLOCK_INITIALIZER -1 +#define __cs_BARRIER_SERIAL_THREAD 0 +#define __cs_CANCEL_ASYNCHRONOUS 0 +#define __cs_CANCEL_ENABLE 0 +#define __cs_CANCEL_DEFERRED 0 +#define __cs_CANCEL_DISABLE 0 +#define __cs_CANCELED 0 +#define __cs_CREATE_DETACHED 0 +#define __cs_CREATE_JOINABLE 0 +#define __cs_EXPLICIT_SCHED 0 +#define __cs_INHERIT_SCHED 0 +#define __cs_MUTEX_DEFAULT 0 +#define __cs_MUTEX_ERRORCHECK 0 +#define __cs_MUTEX_NORMAL 0 +#define __cs_MUTEX_RECURSIVE 0 +#define __cs_MUTEX_ROBUST 0 +#define __cs_MUTEX_STALLED 0 +#define __cs_ONCE_INIT 0 +#define __cs_PRIO_INHERIT 0 +#define __cs_PRIO_NONE 0 +#define __cs_PRIO_PROTECT 0 +#define __cs_PROCESS_SHARED 0 +#define __cs_PROCESS_PRIVATE 0 +#define __cs_SCOPE_PROCESS 0 +#define __cs_SCOPE_SYSTEM 0 +#include +#include +#include + +#define __VERIFIER_assume KLEE_assume +#define __VERIFIER_assert KLEE_assert + +void KLEE_assume(int condition) { + // Guard the condition we assume so that if it is not + // satisfiable we don't flag up an error. Instead we'll + // just silently terminate this state. + if (condition) { + klee_assume(condition); + } else { + klee_silent_exit(0); + } +} + +#define KLEE_assert(cond) {if (!(cond)) klee_report_error(__FILE__, __LINE__ , "svcomp assert failed", "svcomp.assertfail"); } + +void __VERIFIER_error() { + klee_report_error(__FILE__, __LINE__, "svcomp error", "svcomp.err"); +} + +#define __VERIFIER_nondet_int KLEE_nondet_int +// int KLEE_nondet_int() { int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +int KLEE_nondet_int() { return klee_int("x"); } +#define __VERIFIER_nondet_uint KLEE_nondet_uint +unsigned int KLEE_nondet_uint() { unsigned int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_bool KLEE_nondet_bool +// _Bool KLEE_nondet_bool() { _Bool x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +_Bool KLEE_nondet_bool() { return klee_range(0, 2, "x"); } +#define __VERIFIER_nondet_char KLEE_nondet_char +char KLEE_nondet_char() { char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_uchar KLEE_nondet_uchar +unsigned char KLEE_nondet_uchar() { unsigned char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +//#include +//#include +#define THREADS 3 +#define ROUNDS 1 +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; +#define IF(T,A,B) if ((__cs_pc[T] > A) | (A >= __cs_pc_cs[T])) goto B; +#ifndef NULL +#define NULL 0 +#endif + + unsigned int __cs_active_thread[THREADS + 1] = {1}; + + unsigned int __cs_pc[THREADS + 1]; + + unsigned int __cs_pc_cs[THREADS + 1]; + + unsigned int __cs_thread_index; + + unsigned int __cs_last_thread; + + unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + + void *__cs_safe_malloc(unsigned int __cs_size) + { + + void *__cs_ptr = (malloc(__cs_size)); + + KLEE_assume(__cs_ptr); + return (__cs_ptr); + } + + + void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) + { + + if (__cs_size == (sizeof(int))) + + * ((int *) __cs_var) = (KLEE_nondet_int()); + else + + { + + __cs_var = (malloc(__cs_size)); + } + + } + + + void __CSEQ_message(char *__cs_message) + { + ; + } + + + typedef int cspthread_t; + + void *__cs_threadargs[THREADS + 1]; + + typedef int cspthread_key_t; + + cspthread_key_t __cs_keys[1][THREADS + 2]; + + void (*__cs_key_destructor[1])(void *); + + int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void *), void *__cs_arg, int __cs_threadID) + { + + if (__cs_threadID > THREADS) + return (0); + + + * __cs_new_thread_id = (__cs_threadID); + + __cs_active_thread[__cs_threadID] = (1); + + __cs_threadargs[__cs_threadID] = (__cs_arg); + + __CSEQ_message("thread spawned"); + + return (0); + } + + + int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) + { + + KLEE_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + + return (0); + } + + + int pthread_exit(void *__cs_value_ptr) + { + + if ((__cs_key_destructor[0] != 0) && (__cs_keys[0][__cs_thread_index + 1] != 0)) + { + + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index + 1]); + } + + } + + + int pthread_self(void) + { + return (__cs_thread_index + 1); + } + + + typedef int cspthread_mutex_t; + + int pthread_mutex_init(cspthread_mutex_t *__cs_m, int __cs_val) + { + + * __cs_m = (- 1); + + return (0); + } + + + int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) + { + + * __cs_mutex_to_destroy = (- 2); + + __CSEQ_message("lock destroyed"); + + return (0); + } + + + int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) + { + + KLEE_assume((* __cs_mutex_to_lock) == (- 1)); + + * __cs_mutex_to_lock = (__cs_thread_index + 1); + + __CSEQ_message("lock acquired"); + + return (0); + } + + + int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) + { + + KLEE_assume((* __cs_mutex_to_unlock) == (__cs_thread_index + 1)); + + * __cs_mutex_to_unlock = (- 1); + + __CSEQ_message("lock released"); + + return (0); + } + + + typedef int cspthread_cond_t; + + int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) + { + + * __cs_cond_to_init = (- 1); + + return (0); + } + + + int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) + { + + * __cs_cond_to_destroy = (- 2); + + return (0); + } + + + int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + pthread_mutex_unlock(__cs_m); + + return (0); + } + + + int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + KLEE_assume((* __cs_cond_to_wait_for) == 1); + + pthread_mutex_lock(__cs_m); + + return (0); + } + + + int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) + { + + * __cs_cond_to_signal = (1); + + __CSEQ_message("conditional variable signal"); + + return (0); + } + + + int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) + { + + * __cs_cond_to_broadcast = (1); + + __CSEQ_message("conditional variable broadcast"); + + return (0); + } + + + typedef struct cspthread_barrier_t + { + + unsigned int init; + + unsigned int current; + } cspthread_barrier_t; + + int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void *__cs_attr, unsigned int count) + { + + __cs_barrier_to_init->current = (count); + + __cs_barrier_to_init->init = (count); + + return (0); + } + + + int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) + { + + __cs_barrier_to_destroy->init = (- 1); + + __cs_barrier_to_destroy->current = (- 1); + + return (0); + } + + + int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __cs_barrier_to_wait->current--; + + return (0); + } + + + int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait) + { + + KLEE_assume(__cs_barrier_to_wait->current == 0); + + __cs_barrier_to_wait->current = (__cs_barrier_to_wait->init); + + return (0); + } + + + int pthread_key_create(cspthread_key_t *key, void (*destructor)(void *)) + { + + static int currentkey = (0); + + __cs_key_destructor[0] = (destructor); + + * key = (currentkey++); + + return (0); + } + + + int pthread_setspecific(cspthread_key_t key, const void *value) + { + + __cs_keys[key][__cs_thread_index + 1] = (value); + + return (0); + } + + + void *pthread_getspecific(cspthread_key_t key) + { + + return (__cs_keys[key][__cs_thread_index + 1]); + } + + + void __CSEQ_noop(void) + { + } + + + void __VERIFIER_error(); + + + cspthread_mutex_t m; + + int data = (0); + + void *thread1_0(void *__cs_param_thread1_arg) + + { + +IF(1,0,tthread1_0_1) + + pthread_mutex_lock(& m); + +tthread1_0_1: IF(1,1,tthread1_0_2) + + data++; + +tthread1_0_2: IF(1,2,tthread1_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread1: + KLEE_assume(__cs_pc_cs[1] >= 3); + + + ; + ; + +tthread1_0_3: + + pthread_exit(0); + } + + + void *thread2_0(void *__cs_param_thread2_arg) + + { + +IF(2,0,tthread2_0_1) + + pthread_mutex_lock(& m); + +tthread2_0_1: IF(2,1,tthread2_0_2) + + data += (2); + +tthread2_0_2: IF(2,2,tthread2_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread2: + KLEE_assume(__cs_pc_cs[2] >= 3); + + + ; + ; + +tthread2_0_3: + + pthread_exit(0); + } + + + void *thread3_0(void *__cs_param_thread3_arg) + + { + +IF(3,0,tthread3_0_1) + + pthread_mutex_lock(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +tthread3_0_1: IF(3,1,tthread3_0_2) + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + KLEE_assert(0); + + ; + ; + } + + + ; + +tthread3_0_2: IF(3,2,tthread3_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread3: + KLEE_assume(__cs_pc_cs[3] >= 3); + + + ; + ; + +tthread3_0_3: + + pthread_exit(0); + } + + + int main_thread(void) + + { + +IF(0,0,tmain_1) + + pthread_mutex_init(& m, 0); + + static cspthread_t __cs_local_main_t1; + __cs_init_scalar(& __cs_local_main_t1, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t2; + __cs_init_scalar(& __cs_local_main_t2, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t3; + __cs_init_scalar(& __cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); + +tmain_1: IF(0,1,tmain_2) + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); + +tmain_2: IF(0,2,tmain_3) + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); + +tmain_3: IF(0,3,tmain_4) + + pthread_join(__cs_local_main_t1, 0); + +tmain_4: IF(0,4,tmain_5) + + pthread_join(__cs_local_main_t2, 0); + +tmain_5: IF(0,5,tmain_6) + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + ; + + __exit_main: + KLEE_assume(__cs_pc_cs[0] >= 6); + + + ; + ; + +tmain_6: + + pthread_exit(0); + } + + + int main(void) + { + +/* round 0 */ + +/* main */ + + __cs_thread_index = (0); + + unsigned int __cs_tmp_t0_r0; + + __cs_pc_cs[0] = (__cs_tmp_t0_r0); + + KLEE_assume(__cs_pc_cs[0] > 0); + + KLEE_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + + __cs_pc[0] = (__cs_pc_cs[0]); + +/* thread1_0 */ + + unsigned int __cs_tmp_t1_r0; + + if (__cs_active_thread[1]) + { + + __cs_thread_index = (1); + + __cs_pc_cs[1] = (__cs_tmp_t1_r0); + + KLEE_assume(__cs_pc_cs[1] <= 3); + + thread1_0(__cs_threadargs[1]); + + __cs_pc[1] = (__cs_pc_cs[1]); + } + + +/* thread2_0 */ + + unsigned int __cs_tmp_t2_r0; + + if (__cs_active_thread[2]) + { + + __cs_thread_index = (2); + + __cs_pc_cs[2] = (__cs_tmp_t2_r0); + + KLEE_assume(__cs_pc_cs[2] <= 3); + + thread2_0(__cs_threadargs[2]); + + __cs_pc[2] = (__cs_pc_cs[2]); + } + + +/* thread3_0 */ + + unsigned int __cs_tmp_t3_r0; + + if (__cs_active_thread[3]) + { + + __cs_thread_index = (3); + + __cs_pc_cs[3] = (__cs_tmp_t3_r0); + + KLEE_assume(__cs_pc_cs[3] <= 3); + + thread3_0(__cs_threadargs[3]); + + __cs_pc[3] = (__cs_pc_cs[3]); + } + + + unsigned int __cs_tmp_t0_r1; + + if (__cs_active_thread[0]) + { + + __cs_thread_index = (0); + + __cs_pc_cs[0] = (__cs_tmp_t0_r1); + + KLEE_assume(__cs_pc_cs[0] >= __cs_pc[0]); + + KLEE_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + } + + + return (0); + } + + diff --git a/utils/cseq-1.9/modules/cbmc_extra.c b/utils/cseq-1.9/modules/cbmc_extra.c new file mode 100644 index 000000000..7df21f800 --- /dev/null +++ b/utils/cseq-1.9/modules/cbmc_extra.c @@ -0,0 +1,10 @@ +int __VERIFIER_nondet_int(); +int nondet_int(); +unsigned int __VERIFIER_nondet_uint(); +unsigned int nondet_uint(); +_Bool __VERIFIER_nondet_bool(); +_Bool nondet_bool(); +char __VERIFIER_nondet_char(); +char nondet_char(); +unsigned char __VERIFIER_nondet_uchar(); +unsigned char nondet_uchar(); diff --git a/utils/cseq-1.9/modules/constants.chain b/utils/cseq-1.9/modules/constants.chain new file mode 100644 index 000000000..a08ff5073 --- /dev/null +++ b/utils/cseq-1.9/modules/constants.chain @@ -0,0 +1,3 @@ +constants +noop + diff --git a/utils/cseq-1.9/modules/cpa_extra.c b/utils/cseq-1.9/modules/cpa_extra.c new file mode 100644 index 000000000..ddf562201 --- /dev/null +++ b/utils/cseq-1.9/modules/cpa_extra.c @@ -0,0 +1,7 @@ +void __VERIFIER_assert(int x) { if(!(x)) {ERROR: goto ERROR;}} +extern void __VERIFIER_assume(int); +extern int __VERIFIER_nondet_int(void); +extern unsigned int __VERIFIER_nondet_uint(void); +extern _Bool __VERIFIER_nondet_bool(void); +extern char __VERIFIER_nondet_char(void); +extern unsigned char __VERIFIER_nondet_uchar(void); \ No newline at end of file diff --git a/utils/cseq-1.9/modules/klee_extra.c b/utils/cseq-1.9/modules/klee_extra.c new file mode 100644 index 000000000..a6e2fecc0 --- /dev/null +++ b/utils/cseq-1.9/modules/klee_extra.c @@ -0,0 +1,35 @@ +#include +#include + +#define __VERIFIER_assume KLEE_assume +#define __VERIFIER_assert KLEE_assert + +void KLEE_assume(int condition) { + // Guard the condition we assume so that if it is not + // satisfiable we don't flag up an error. Instead we'll + // just silently terminate this state. + if (condition) { + klee_assume(condition); + } else { + klee_silent_exit(0); + } +} + +#define KLEE_assert(cond) {if (!(cond)) klee_report_error(__FILE__, __LINE__ , "svcomp assert failed", "svcomp.assertfail"); } + +void __VERIFIER_error() { + klee_report_error(__FILE__, __LINE__, "svcomp error", "svcomp.err"); +} + +#define __VERIFIER_nondet_int KLEE_nondet_int +// int KLEE_nondet_int() { int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +int KLEE_nondet_int() { return klee_int("x"); } +#define __VERIFIER_nondet_uint KLEE_nondet_uint +unsigned int KLEE_nondet_uint() { unsigned int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_bool KLEE_nondet_bool +// _Bool KLEE_nondet_bool() { _Bool x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +_Bool KLEE_nondet_bool() { return klee_range(0, 2, "x"); } +#define __VERIFIER_nondet_char KLEE_nondet_char +char KLEE_nondet_char() { char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_uchar KLEE_nondet_uchar +unsigned char KLEE_nondet_uchar() { unsigned char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } diff --git a/utils/cseq-1.9/modules/lazy.chain b/utils/cseq-1.9/modules/lazy.chain new file mode 100644 index 000000000..5b95d3902 --- /dev/null +++ b/utils/cseq-1.9/modules/lazy.chain @@ -0,0 +1,38 @@ +### CSeq Lazy sequentialisation +### based on +### "Bounded Model Checking of Multi-threaded C Programs via Lazy Sequentialization" (CAV 2014) and +### "Lazy-CSeq: A Context-Bounded Model Checking Tool for Multi-threaded C-Programs" (ASE 2015). +### Improved version for SVCOMP 2019. + +## Program simplification +workarounds +functiontracker + +preinstrumenter +constants +spinlock + +## Loop and control-flow transformation +switchtransformer +dowhileconverter +conditionextractor + +## Program flattening +varnames +preinliner +inliner +unroller + +## Sequentialization +#preinstrumenter +duplicator +condwaitconverter +lazyseq +#newschedule + +## Instrumentation +instrumenter + +## Analysis +feeder +cex diff --git a/utils/cseq-1.9/modules/lazyseqA.c b/utils/cseq-1.9/modules/lazyseqA.c new file mode 100644 index 000000000..8b825f6ca --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqA.c @@ -0,0 +1,10 @@ +//#include +//#include +#define THREADS +#define ROUNDS +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; +#define IF(T,A,B) if ((__cs_pc[T] > A) | (A >= __cs_pc_cs[T])) goto B; +#ifndef NULL +#define NULL 0 +#endif diff --git a/utils/cseq-1.9/modules/lazyseqB.FULL.c b/utils/cseq-1.9/modules/lazyseqB.FULL.c new file mode 100644 index 000000000..d4a55052e --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqB.FULL.c @@ -0,0 +1,201 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + __VERIFIER_assertext(*__cs_mutex_to_destroy!=0,"attempt to destroy an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_destroy!=-2,"attempt to destroy a previously destroyed mutex"); + __VERIFIER_assertext(*__cs_mutex_to_destroy==-1,"attempt to destroy a locked mutex"); + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assertext(*__cs_mutex_to_lock!=0,"attempt to lock an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_lock!=-2,"attempt to lock a destroyed mutex"); + __VERIFIER_assume(*__cs_mutex_to_lock==-1); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assertext(*__cs_mutex_to_unlock!=0,"attempt to unlock an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_unlock!=-2,"attempt to unlock a destroyed mutex"); + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assertext(*__cs_cond_to_wait_for!=0,"attempt to use an uninitialized conditional variable"); + __VERIFIER_assertext(*__cs_cond_to_wait_for!=-2,"attempt to use a destroyed conditional variable"); + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __VERIFIER_assertext(count > 0, "count must be greater than 0"); + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __VERIFIER_assertext(currentkey < 1, "multiple thread-specific keys not supported"); + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +typedef int __cs_attr_t; + +struct cssched_param { + int sched_priority; +}; + +int __cs_attr_init(__cs_attr_t *) { return 0;} +int __cs_attr_destroy(__cs_attr_t *) { return 0;} +int __cs_attr_getdetachstate(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getguardsize(const __cs_attr_t *, unsigned int * s) { return 0;} +int __cs_attr_getinheritsched(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getschedparam(const __cs_attr_t *, struct sched_param * s) { return 0;} +int __cs_attr_getschedpolicy(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getscope(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getstackaddr(const __cs_attr_t *, void ** s) { return 0;} +int __cs_attr_getstacksize(const __cs_attr_t *, unsigned int *s) { return 0;} +int __cs_attr_setdetachstate(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setguardsize(__cs_attr_t *, unsigned int s) { return 0;} +int __cs_attr_setinheritsched(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setschedparam(__cs_attr_t *, const struct sched_param * s) { return 0;} +int __cs_attr_setschedpolicy(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setscope(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setstackaddr(__cs_attr_t *, void * s) { return 0;} +int __cs_attr_setstacksize(__cs_attr_t *, unsigned int s) { return 0;} + +void __CSEQ_noop(void) {}; + diff --git a/utils/cseq-1.9/modules/lazyseqB.c b/utils/cseq-1.9/modules/lazyseqB.c new file mode 100644 index 000000000..921a89f31 --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqB.c @@ -0,0 +1,163 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assume(*__cs_mutex_to_lock==-1); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +void __CSEQ_noop(void) {}; + diff --git a/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.FULL.c b/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.FULL.c new file mode 100644 index 000000000..0b39cd81e --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.FULL.c @@ -0,0 +1,169 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assume(*__cs_mutex_to_lock==-1 || *__cs_mutex_to_lock==0); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + _Bool b; + if (b) __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __VERIFIER_assertext(count > 0, "count must be greater than 0"); + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + _Bool b; + if (b) __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __VERIFIER_assertext(currentkey < 1, "multiple thread-specific keys not supported"); + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +void __CSEQ_noop(void) {}; + diff --git a/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.c b/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.c new file mode 100644 index 000000000..a3c3e3eca --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqB.nondet-condvar-wakeups.c @@ -0,0 +1,165 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assume(*__cs_mutex_to_lock==-1 || *__cs_mutex_to_lock==0); + *__cs_mutex_to_lock = __cs_thread_index+1; + __CSEQ_message("lock acquired"); + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assume(*__cs_mutex_to_unlock==(__cs_thread_index+1)); + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + _Bool b; + if (b) __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) { + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + _Bool b; + if (b) __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +void __CSEQ_noop(void) {}; + diff --git a/utils/cseq-1.9/modules/lazyseqBdeadlock.c b/utils/cseq-1.9/modules/lazyseqBdeadlock.c new file mode 100644 index 000000000..32ffe4d7f --- /dev/null +++ b/utils/cseq-1.9/modules/lazyseqBdeadlock.c @@ -0,0 +1,227 @@ +unsigned int __cs_active_thread[THREADS+1]={1}; +unsigned int __cs_pc[THREADS+1]; +unsigned int __cs_pc_cs[THREADS+1]; +unsigned int __cs_thread_index; +unsigned int __cs_last_thread; +unsigned int __cs_thread_lines[] = {}; + +void *__cs_safe_malloc(unsigned int __cs_size) { + void *__cs_ptr = malloc(__cs_size); + __VERIFIER_assume(__cs_ptr); return __cs_ptr; +} + +void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) { + if (__cs_size == sizeof(int)) + *(int *)__cs_var = __VERIFIER_nondet_int(); + else { + __cs_var = malloc(__cs_size); + } +} + +void __CSEQ_message(char *__cs_message) { ; } + +typedef int cspthread_t; + +void *__cs_threadargs[THREADS+1]; + +typedef int cspthread_key_t; + +cspthread_key_t __cs_keys[1][THREADS+2]; +void (*__cs_key_destructor[1])(void*); + +int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void*), void *__cs_arg, int __cs_threadID) { + if (__cs_threadID > THREADS) return 0; + *__cs_new_thread_id = __cs_threadID; + __cs_active_thread[__cs_threadID] = 1; + __cs_threadargs[__cs_threadID] = __cs_arg; + __CSEQ_message("thread spawned"); + return 0; +} + +int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) { + __VERIFIER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + return 0; +} + +int pthread_exit(void *__cs_value_ptr) { + if (__cs_key_destructor[0]!=0 && __cs_keys[0][__cs_thread_index+1]!=0) { + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index+1]); + } +} + +int pthread_self(void) { return __cs_thread_index+1; } + +typedef int cspthread_mutex_t; + +int pthread_mutex_init (cspthread_mutex_t *__cs_m, int __cs_val) { + *__cs_m = -1; + return 0; +} + +int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) { + __VERIFIER_assertext(*__cs_mutex_to_destroy!=0,"attempt to destroy an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_destroy!=-2,"attempt to destroy a previously destroyed mutex"); + __VERIFIER_assertext(*__cs_mutex_to_destroy==-1,"attempt to destroy a locked mutex"); + *__cs_mutex_to_destroy = -2; + __CSEQ_message("lock destroyed"); + return 0; +} + +int *__cs_secondlock; +int __cs_chaincounter = 0; +unsigned int __cs_chain[THREADS + 1] ; + +int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) { + __VERIFIER_assertext(*__cs_mutex_to_lock!=0,"attempt to lock an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_lock!=-2,"attempt to lock a destroyed mutex"); + + if (*__cs_mutex_to_lock==-1) { + *__cs_mutex_to_lock = __cs_thread_index+1; + if (__cs_chaincounter==0 & nondet_int()) { + __cs_chain[0] = __cs_thread_index+1; + __cs_chaincounter = 1; + } + __CSEQ_message("lock acquired"); + } else { + __CSEQ_message("thread blocked on acquiring lock"); + __VERIFIER_assertext(!(__cs_chaincounter>1 && __cs_chain[0]==__cs_thread_index+1 && *__cs_mutex_to_lock==__cs_chain[__cs_chaincounter-1]), "deadlock detected"); + + __cs_active_thread[__cs_thread_index] = 0; + __cs_pc_cs[__cs_thread_index] = 0; + + if (__cs_chaincounter > 0 & __cs_chain[__cs_chaincounter-1]==*__cs_mutex_to_lock & nondet_int()) { + __cs_chain[__cs_chaincounter] = __cs_thread_index+1; + if (__cs_chaincounter==1) __cs_secondlock = __cs_mutex_to_lock; + __cs_chaincounter++; + } + } + + return 0; +} + +int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) { + __VERIFIER_assertext(*__cs_mutex_to_unlock!=0,"attempt to unlock an uninitialized mutex"); + __VERIFIER_assertext(*__cs_mutex_to_unlock!=-2,"attempt to unlock a destroyed mutex"); + __VERIFIER_assertext(*__cs_mutex_to_unlock==__cs_thread_index+1,"attempt to release a lock held by another thread"); + + if (__cs_chaincounter>1) __VERIFIER_assume(__cs_mutex_to_unlock!=__cs_secondlock); + + *__cs_mutex_to_unlock = -1; + __CSEQ_message("lock released"); + return 0; +} + +typedef int cspthread_cond_t; + +int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) { + *__cs_cond_to_init = -1; + return 0; +} + +int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) { + *__cs_cond_to_destroy = -2; + return 0; +} + +int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assertext(*__cs_cond_to_wait_for!=0,"attempt to use an uninitialized conditional variable"); + __VERIFIER_assertext(*__cs_cond_to_wait_for!=-2,"attempt to use a destroyed conditional variable"); + pthread_mutex_unlock(__cs_m); + return 0; +} + +int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) { + __VERIFIER_assume(*__cs_cond_to_wait_for == 1); + pthread_mutex_lock(__cs_m); + return 0; +} + +int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) { + *__cs_cond_to_signal = 1; + __CSEQ_message("conditional variable signal"); + return 0; +} + +int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) { + *__cs_cond_to_broadcast = 1; + __CSEQ_message("conditional variable broadcast"); + return 0; +} + +typedef struct cspthread_barrier_t { + unsigned int init; + unsigned int current; +} cspthread_barrier_t; + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __VERIFIER_assertext(count > 0, "count must be greater than 0"); + __cs_barrier_to_init->current = count; + __cs_barrier_to_init->init = count; + return 0; +} + +int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void * __cs_attr, unsigned int count){ + __cs_barrier_to_destroy->init = -1; + __cs_barrier_to_destroy->current = -1; + return 0; +} + + +int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + __cs_barrier_to_wait->current--; + return 0; +} + +int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait){ + __VERIFIER_assertext(__cs_barrier_to_wait->init > 0, "attempt to use an uninitialized barrier variable"); + __VERIFIER_assume(__cs_barrier_to_wait->current == 0); + __cs_barrier_to_wait->current = __cs_barrier_to_wait->init; + return 0; +} + +pthread_key_create(cspthread_key_t *key, void (*destructor)(void*)) { + static int currentkey = 0; + __VERIFIER_assertext(currentkey < 1, "multiple thread-specific keys not supported"); + __cs_key_destructor[0] = destructor; + *key = currentkey++; + return 0; +} + +int pthread_setspecific(cspthread_key_t key, const void *value) { + __cs_keys[key][__cs_thread_index+1] = value; + return 0; +} + +void *pthread_getspecific(cspthread_key_t key) { + return __cs_keys[key][__cs_thread_index+1]; +} + + +typedef int __cs_attr_t; + +struct cssched_param { + int sched_priority; +}; + +int __cs_attr_init(__cs_attr_t *) { return 0;} +int __cs_attr_destroy(__cs_attr_t *) { return 0;} +int __cs_attr_getdetachstate(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getguardsize(const __cs_attr_t *, unsigned int * s) { return 0;} +int __cs_attr_getinheritsched(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getschedparam(const __cs_attr_t *, struct sched_param * s) { return 0;} +int __cs_attr_getschedpolicy(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getscope(const __cs_attr_t *, int * s) { return 0;} +int __cs_attr_getstackaddr(const __cs_attr_t *, void ** s) { return 0;} +int __cs_attr_getstacksize(const __cs_attr_t *, unsigned int *s) { return 0;} +int __cs_attr_setdetachstate(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setguardsize(__cs_attr_t *, unsigned int s) { return 0;} +int __cs_attr_setinheritsched(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setschedparam(__cs_attr_t *, const struct sched_param * s) { return 0;} +int __cs_attr_setschedpolicy(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setscope(__cs_attr_t *, int s) { return 0;} +int __cs_attr_setstackaddr(__cs_attr_t *, void * s) { return 0;} +int __cs_attr_setstacksize(__cs_attr_t *, unsigned int s) { return 0;} + +void __CSEQ_noop(void) {}; + diff --git a/utils/cseq-1.9/modules/preinline.chain b/utils/cseq-1.9/modules/preinline.chain new file mode 100644 index 000000000..cf8643fc5 --- /dev/null +++ b/utils/cseq-1.9/modules/preinline.chain @@ -0,0 +1,2 @@ +preinliner + diff --git a/utils/cseq-1.9/modules/pthread_defs.c b/utils/cseq-1.9/modules/pthread_defs.c new file mode 100644 index 000000000..3d45dd24f --- /dev/null +++ b/utils/cseq-1.9/modules/pthread_defs.c @@ -0,0 +1,27 @@ +#define __cs_MUTEX_INITIALIZER -1 +#define __cs_COND_INITIALIZER -1 +#define __cs_RWLOCK_INITIALIZER -1 +#define __cs_BARRIER_SERIAL_THREAD 0 +#define __cs_CANCEL_ASYNCHRONOUS 0 +#define __cs_CANCEL_ENABLE 0 +#define __cs_CANCEL_DEFERRED 0 +#define __cs_CANCEL_DISABLE 0 +#define __cs_CANCELED 0 +#define __cs_CREATE_DETACHED 0 +#define __cs_CREATE_JOINABLE 0 +#define __cs_EXPLICIT_SCHED 0 +#define __cs_INHERIT_SCHED 0 +#define __cs_MUTEX_DEFAULT 0 +#define __cs_MUTEX_ERRORCHECK 0 +#define __cs_MUTEX_NORMAL 0 +#define __cs_MUTEX_RECURSIVE 0 +#define __cs_MUTEX_ROBUST 0 +#define __cs_MUTEX_STALLED 0 +#define __cs_ONCE_INIT 0 +#define __cs_PRIO_INHERIT 0 +#define __cs_PRIO_NONE 0 +#define __cs_PRIO_PROTECT 0 +#define __cs_PROCESS_SHARED 0 +#define __cs_PROCESS_PRIVATE 0 +#define __cs_SCOPE_PROCESS 0 +#define __cs_SCOPE_SYSTEM 0 diff --git a/utils/cseq-1.9/output.c b/utils/cseq-1.9/output.c new file mode 100644 index 000000000..e681e1d35 --- /dev/null +++ b/utils/cseq-1.9/output.c @@ -0,0 +1,734 @@ +cseq resource ata: soft:-1 hard:-1 +cseq resource stack: soft:8388608 hard:-1 +cseq resource resident size: soft:-1 hard:-1 +cseq resource memlock: soft:67108864 hard:67108864 +cseq resource as: soft:-1 hard:-1 +Configuration [modules/lazy.chain] loaded +CSeq Lazy sequentialisation +based on +"Bounded Model Checking of Multi-threaded C Programs via Lazy Sequentialization" (CAV 2014) and +"Lazy-CSeq: A Context-Bounded Model Checking Tool for Multi-threaded C-Programs" (ASE 2015). +Improved version for SVCOMP 2019. +Merging +[00] merger +[00] merger 0.01s +>>>>>>>>>>>>>>>>... +>>Program simplification +[01] workarounds +[01] workarounds 0.04s +>>>>>>>>>>>>>>>>... +[02] functiontracker +[02] functiontracker 0.02s +>>>>>>>>>>>>>>>>... +[03] preinstrumenter +[03] preinstrumenter 0.02s +>>>>>>>>>>>>>>>>... +[04] constants +[04] constants 0.02s +>>>>>>>>>>>>>>>>... +[05] spinlock +[05] spinlock 0.02s +>>>>>>>>>>>>>>>>... +>>Loop and control-flow transformation +[06] switchtransformer +[06] switchtransformer 0.02s +>>>>>>>>>>>>>>>>... +[07] dowhileconverter +[07] dowhileconverter 0.02s +>>>>>>>>>>>>>>>>... +[08] conditionextractor +[08] conditionextractor 0.02s +>>>>>>>>>>>>>>>>... +>>Program flattening +[09] varnames +[09] varnames 0.02s +>>>>>>>>>>>>>>>>... +[10] preinliner +[10] preinliner 0.02s +>>>>>>>>>>>>>>>>... +[11] inliner +[11] inliner 0.02s +>>>>>>>>>>>>>>>>... +[12] unroller +[12] unroller 0.02s +>>>>>>>>>>>>>>>>... +>>Sequentialization +[13] duplicator +[13] duplicator 0.02s +>>>>>>>>>>>>>>>>... +[14] condwaitconverter +[14] condwaitconverter 0.02s +>>>>>>>>>>>>>>>>... +[15] lazyseq +[15] lazyseq 0.02s +>>>>>>>>>>>>>>>>... +>>Instrumentation +[16] instrumenter +[16] instrumenter 0.05s +>>>>>>>>>>>>>>>>... +>>Analysis +FOUND +>>>>>>>>>>>>>>>>... +/* + * generated by CSeq [ 0000 / 0000 ] 2020-07-11 18:03:22 + * + * [ 0000 merger-2019.11.15 + * 0000 parser-2019.11.27 + * 0000 module-0.0-2019.11.27 ] + * + * params: + * -D , -b , -i examples/lazy_unsafe.c, --backend klee, --output examples/test.c + * + * modules: + * 0000 workarounds () + * 0000 functiontracker () + * 0000 preinstrumenter (error-label) + * 0000 constants (deep-propagation) + * 0000 spinlock () + * 0000 switchtransformer () + * 0000 dowhileconverter () + * 0000 conditionextractor () + * 0000 varnames () + * 0000 preinliner () + * 0000 inliner (atomic-parameters simplify-args) + * 0000 unroller (unwind unwind-while unwind-for unwind-for-max softunwindbound varnamesmap varscopesmap extra-tracking) + * 0000 duplicator () + * 0000 condwaitconverter () + * 0000 lazyseq (rounds threads schedule deadlock norobin preanalysis nondet-condvar-wakeups) + * 0000 instrumenter (backend bitwidth header well-nested-locks emptystructs) + * 0000 feeder (backend time llvm depth slevel output no-simplify) + * 0000 cex (backend cex exitcode threadnamesmap threadindexes threadindextoname varnamesmap coordstofunctions sv-comp witness entry threadsizes threadendlines loopheads) + * + */ +#define __cs_MUTEX_INITIALIZER -1 +#define __cs_COND_INITIALIZER -1 +#define __cs_RWLOCK_INITIALIZER -1 +#define __cs_BARRIER_SERIAL_THREAD 0 +#define __cs_CANCEL_ASYNCHRONOUS 0 +#define __cs_CANCEL_ENABLE 0 +#define __cs_CANCEL_DEFERRED 0 +#define __cs_CANCEL_DISABLE 0 +#define __cs_CANCELED 0 +#define __cs_CREATE_DETACHED 0 +#define __cs_CREATE_JOINABLE 0 +#define __cs_EXPLICIT_SCHED 0 +#define __cs_INHERIT_SCHED 0 +#define __cs_MUTEX_DEFAULT 0 +#define __cs_MUTEX_ERRORCHECK 0 +#define __cs_MUTEX_NORMAL 0 +#define __cs_MUTEX_RECURSIVE 0 +#define __cs_MUTEX_ROBUST 0 +#define __cs_MUTEX_STALLED 0 +#define __cs_ONCE_INIT 0 +#define __cs_PRIO_INHERIT 0 +#define __cs_PRIO_NONE 0 +#define __cs_PRIO_PROTECT 0 +#define __cs_PROCESS_SHARED 0 +#define __cs_PROCESS_PRIVATE 0 +#define __cs_SCOPE_PROCESS 0 +#define __cs_SCOPE_SYSTEM 0 +#include +#include +#include + +#define __VERIFIER_assume KLEE_assume +#define __VERIFIER_assert KLEE_assert + +void KLEE_assume(int condition) { + // Guard the condition we assume so that if it is not + // satisfiable we don't flag up an error. Instead we'll + // just silently terminate this state. + if (condition) { + klee_assume(condition); + } else { + klee_silent_exit(0); + } +} + +#define KLEE_assert(cond) {if (!(cond)) klee_report_error(__FILE__, __LINE__ , "svcomp assert failed", "svcomp.assertfail"); } + +void __VERIFIER_error() { + klee_report_error(__FILE__, __LINE__, "svcomp error", "svcomp.err"); +} + +#define __VERIFIER_nondet_int KLEE_nondet_int +// int KLEE_nondet_int() { int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +int KLEE_nondet_int() { return klee_int("x"); } +#define __VERIFIER_nondet_uint KLEE_nondet_uint +unsigned int KLEE_nondet_uint() { unsigned int x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_bool KLEE_nondet_bool +// _Bool KLEE_nondet_bool() { _Bool x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +_Bool KLEE_nondet_bool() { return klee_range(0, 2, "x"); } +#define __VERIFIER_nondet_char KLEE_nondet_char +char KLEE_nondet_char() { char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +#define __VERIFIER_nondet_uchar KLEE_nondet_uchar +unsigned char KLEE_nondet_uchar() { unsigned char x; klee_make_symbolic(&x, sizeof(x), "x"); return x; } +//#include +//#include +#define THREADS 3 +#define ROUNDS 1 +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; +#define IF(T,A,B) if ((__cs_pc[T] > A) | (A >= __cs_pc_cs[T])) goto B; +#ifndef NULL +#define NULL 0 +#endif + + unsigned int __cs_active_thread[THREADS + 1] = {1}; + + unsigned int __cs_pc[THREADS + 1]; + + unsigned int __cs_pc_cs[THREADS + 1]; + + unsigned int __cs_thread_index; + + unsigned int __cs_last_thread; + + unsigned int __cs_thread_lines[] = {6, 3, 3, 3}; + + void *__cs_safe_malloc(unsigned int __cs_size) + { + + void *__cs_ptr = (malloc(__cs_size)); + + KLEE_assume(__cs_ptr); + return (__cs_ptr); + } + + + void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) + { + + if (__cs_size == (sizeof(int))) + + * ((int *) __cs_var) = (KLEE_nondet_int()); + else + + { + + __cs_var = (malloc(__cs_size)); + } + + } + + + void __CSEQ_message(char *__cs_message) + { + ; + } + + + typedef int cspthread_t; + + void *__cs_threadargs[THREADS + 1]; + + typedef int cspthread_key_t; + + cspthread_key_t __cs_keys[1][THREADS + 2]; + + void (*__cs_key_destructor[1])(void *); + + int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void *), void *__cs_arg, int __cs_threadID) + { + + if (__cs_threadID > THREADS) + return (0); + + + * __cs_new_thread_id = (__cs_threadID); + + __cs_active_thread[__cs_threadID] = (1); + + __cs_threadargs[__cs_threadID] = (__cs_arg); + + __CSEQ_message("thread spawned"); + + return (0); + } + + + int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) + { + + KLEE_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + + return (0); + } + + + int pthread_exit(void *__cs_value_ptr) + { + + if ((__cs_key_destructor[0] != 0) && (__cs_keys[0][__cs_thread_index + 1] != 0)) + { + + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index + 1]); + } + + } + + + int pthread_self(void) + { + return (__cs_thread_index + 1); + } + + + typedef int cspthread_mutex_t; + + int pthread_mutex_init(cspthread_mutex_t *__cs_m, int __cs_val) + { + + * __cs_m = (- 1); + + return (0); + } + + + int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) + { + + * __cs_mutex_to_destroy = (- 2); + + __CSEQ_message("lock destroyed"); + + return (0); + } + + + int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) + { + + KLEE_assume((* __cs_mutex_to_lock) == (- 1)); + + * __cs_mutex_to_lock = (__cs_thread_index + 1); + + __CSEQ_message("lock acquired"); + + return (0); + } + + + int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) + { + + KLEE_assume((* __cs_mutex_to_unlock) == (__cs_thread_index + 1)); + + * __cs_mutex_to_unlock = (- 1); + + __CSEQ_message("lock released"); + + return (0); + } + + + typedef int cspthread_cond_t; + + int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) + { + + * __cs_cond_to_init = (- 1); + + return (0); + } + + + int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) + { + + * __cs_cond_to_destroy = (- 2); + + return (0); + } + + + int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + pthread_mutex_unlock(__cs_m); + + return (0); + } + + + int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + KLEE_assume((* __cs_cond_to_wait_for) == 1); + + pthread_mutex_lock(__cs_m); + + return (0); + } + + + int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) + { + + * __cs_cond_to_signal = (1); + + __CSEQ_message("conditional variable signal"); + + return (0); + } + + + int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) + { + + * __cs_cond_to_broadcast = (1); + + __CSEQ_message("conditional variable broadcast"); + + return (0); + } + + + typedef struct cspthread_barrier_t + { + + unsigned int init; + + unsigned int current; + } cspthread_barrier_t; + + int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void *__cs_attr, unsigned int count) + { + + __cs_barrier_to_init->current = (count); + + __cs_barrier_to_init->init = (count); + + return (0); + } + + + int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) + { + + __cs_barrier_to_destroy->init = (- 1); + + __cs_barrier_to_destroy->current = (- 1); + + return (0); + } + + + int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __cs_barrier_to_wait->current--; + + return (0); + } + + + int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait) + { + + KLEE_assume(__cs_barrier_to_wait->current == 0); + + __cs_barrier_to_wait->current = (__cs_barrier_to_wait->init); + + return (0); + } + + + int pthread_key_create(cspthread_key_t *key, void (*destructor)(void *)) + { + + static int currentkey = (0); + + __cs_key_destructor[0] = (destructor); + + * key = (currentkey++); + + return (0); + } + + + int pthread_setspecific(cspthread_key_t key, const void *value) + { + + __cs_keys[key][__cs_thread_index + 1] = (value); + + return (0); + } + + + void *pthread_getspecific(cspthread_key_t key) + { + + return (__cs_keys[key][__cs_thread_index + 1]); + } + + + void __CSEQ_noop(void) + { + } + + + void __VERIFIER_error(); + + + cspthread_mutex_t m; + + int data = (0); + + void *thread1_0(void *__cs_param_thread1_arg) + + { + +IF(1,0,tthread1_0_1) + + pthread_mutex_lock(& m); + +tthread1_0_1: IF(1,1,tthread1_0_2) + + data++; + +tthread1_0_2: IF(1,2,tthread1_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread1: + KLEE_assume(__cs_pc_cs[1] >= 3); + + + ; + ; + +tthread1_0_3: + + pthread_exit(0); + } + + + void *thread2_0(void *__cs_param_thread2_arg) + + { + +IF(2,0,tthread2_0_1) + + pthread_mutex_lock(& m); + +tthread2_0_1: IF(2,1,tthread2_0_2) + + data += (2); + +tthread2_0_2: IF(2,2,tthread2_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread2: + KLEE_assume(__cs_pc_cs[2] >= 3); + + + ; + ; + +tthread2_0_3: + + pthread_exit(0); + } + + + void *thread3_0(void *__cs_param_thread3_arg) + + { + +IF(3,0,tthread3_0_1) + + pthread_mutex_lock(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +tthread3_0_1: IF(3,1,tthread3_0_2) + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + KLEE_assert(0); + + ; + ; + } + + + ; + +tthread3_0_2: IF(3,2,tthread3_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread3: + KLEE_assume(__cs_pc_cs[3] >= 3); + + + ; + ; + +tthread3_0_3: + + pthread_exit(0); + } + + + int main_thread(void) + + { + +IF(0,0,tmain_1) + + pthread_mutex_init(& m, 0); + + static cspthread_t __cs_local_main_t1; + __cs_init_scalar(& __cs_local_main_t1, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t2; + __cs_init_scalar(& __cs_local_main_t2, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t3; + __cs_init_scalar(& __cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); + +tmain_1: IF(0,1,tmain_2) + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); + +tmain_2: IF(0,2,tmain_3) + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); + +tmain_3: IF(0,3,tmain_4) + + pthread_join(__cs_local_main_t1, 0); + +tmain_4: IF(0,4,tmain_5) + + pthread_join(__cs_local_main_t2, 0); + +tmain_5: IF(0,5,tmain_6) + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + ; + + __exit_main: + KLEE_assume(__cs_pc_cs[0] >= 6); + + + ; + ; + +tmain_6: + + pthread_exit(0); + } + + + int main(void) + { + +/* round 0 */ + +/* main */ + + __cs_thread_index = (0); + + unsigned int __cs_tmp_t0_r0; + + __cs_pc_cs[0] = (__cs_tmp_t0_r0); + + KLEE_assume(__cs_pc_cs[0] > 0); + + KLEE_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + + __cs_pc[0] = (__cs_pc_cs[0]); + +/* thread1_0 */ + + unsigned int __cs_tmp_t1_r0; + + if (__cs_active_thread[1]) + { + + __cs_thread_index = (1); + + __cs_pc_cs[1] = (__cs_tmp_t1_r0); + + KLEE_assume(__cs_pc_cs[1] <= 3); + + thread1_0(__cs_threadargs[1]); + + __cs_pc[1] = (__cs_pc_cs[1]); + } + + +/* thread2_0 */ + + unsigned int __cs_tmp_t2_r0; + + if (__cs_active_thread[2]) + { + + __cs_thread_index = (2); + + __cs_pc_cs[2] = (__cs_tmp_t2_r0); + + KLEE_assume(__cs_pc_cs[2] <= 3); + + thread2_0(__cs_threadargs[2]); + + __cs_pc[2] = (__cs_pc_cs[2]); + } + + +/* thread3_0 */ + + unsigned int __cs_tmp_t3_r0; + + if (__cs_active_thread[3]) + { + + __cs_thread_index = (3); + + __cs_pc_cs[3] = (__cs_tmp_t3_r0); + + KLEE_assume(__cs_pc_cs[3] <= 3); + + thread3_0(__cs_threadargs[3]); + + __cs_pc[3] = (__cs_pc_cs[3]); + } + + + unsigned int __cs_tmp_t0_r1; + + if (__cs_active_thread[0]) + { + + __cs_thread_index = (0); + + __cs_pc_cs[0] = (__cs_tmp_t0_r1); + + KLEE_assume(__cs_pc_cs[0] >= __cs_pc[0]); + + KLEE_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + } + + + return (0); + } + + + diff --git a/utils/cseq-1.9/pycparser/__init__.py b/utils/cseq-1.9/pycparser/__init__.py new file mode 100644 index 000000000..e08916643 --- /dev/null +++ b/utils/cseq-1.9/pycparser/__init__.py @@ -0,0 +1,93 @@ +#----------------------------------------------------------------- +# pycparser: __init__.py +# +# This package file exports some convenience functions for +# interacting with pycparser +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- +__all__ = ['c_lexer', 'c_parser', 'c_ast'] +__version__ = '2.18' + +from subprocess import Popen, PIPE +from .c_parser import CParser + + +def preprocess_file(filename, cpp_path='cpp', cpp_args=''): + """ Preprocess a file using cpp. + + filename: + Name of the file you want to preprocess. + + cpp_path: + cpp_args: + Refer to the documentation of parse_file for the meaning of these + arguments. + + When successful, returns the preprocessed file's contents. + Errors from cpp will be printed out. + """ + path_list = [cpp_path] + if isinstance(cpp_args, list): + path_list += cpp_args + elif cpp_args != '': + path_list += [cpp_args] + path_list += [filename] + + try: + # Note the use of universal_newlines to treat all newlines + # as \n for Python's purpose + # + pipe = Popen( path_list, + stdout=PIPE, + universal_newlines=True) + text = pipe.communicate()[0] + except OSError as e: + raise RuntimeError("Unable to invoke 'cpp'. " + + 'Make sure its path was passed correctly\n' + + ('Original error: %s' % e)) + + return text + + +def parse_file(filename, use_cpp=False, cpp_path='cpp', cpp_args='', + parser=None): + """ Parse a C file using pycparser. + + filename: + Name of the file you want to parse. + + use_cpp: + Set to True if you want to execute the C pre-processor + on the file prior to parsing it. + + cpp_path: + If use_cpp is True, this is the path to 'cpp' on your + system. If no path is provided, it attempts to just + execute 'cpp', so it must be in your PATH. + + cpp_args: + If use_cpp is True, set this to the command line arguments strings + to cpp. Be careful with quotes - it's best to pass a raw string + (r'') here. For example: + r'-I../utils/fake_libc_include' + If several arguments are required, pass a list of strings. + + parser: + Optional parser object to be used instead of the default CParser + + When successful, an AST is returned. ParseError can be + thrown if the file doesn't parse successfully. + + Errors from cpp will be printed out. + """ + if use_cpp: + text = preprocess_file(filename, cpp_path, cpp_args) + else: + with open(filename, 'rU') as f: + text = f.read() + + if parser is None: + parser = CParser() + return parser.parse(text, filename) diff --git a/utils/cseq-1.9/pycparser/_ast_gen.py b/utils/cseq-1.9/pycparser/_ast_gen.py new file mode 100644 index 000000000..669c303ee --- /dev/null +++ b/utils/cseq-1.9/pycparser/_ast_gen.py @@ -0,0 +1,278 @@ +#----------------------------------------------------------------- +# _ast_gen.py +# +# Generates the AST Node classes from a specification given in +# a configuration file +# +# The design of this module was inspired by astgen.py from the +# Python 2.5 code-base. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- +import pprint +from string import Template + + +class ASTCodeGenerator(object): + def __init__(self, cfg_filename='_c_ast.cfg'): + """ Initialize the code generator from a configuration + file. + """ + self.cfg_filename = cfg_filename + self.node_cfg = [NodeCfg(name, contents) + for (name, contents) in self.parse_cfgfile(cfg_filename)] + + def generate(self, file=None): + """ Generates the code into file, an open file buffer. + """ + src = Template(_PROLOGUE_COMMENT).substitute( + cfg_filename=self.cfg_filename) + + src += _PROLOGUE_CODE + for node_cfg in self.node_cfg: + src += node_cfg.generate_source() + '\n\n' + + file.write(src) + + def parse_cfgfile(self, filename): + """ Parse the configuration file and yield pairs of + (name, contents) for each node. + """ + with open(filename, "r") as f: + for line in f: + line = line.strip() + if not line or line.startswith('#'): + continue + colon_i = line.find(':') + lbracket_i = line.find('[') + rbracket_i = line.find(']') + if colon_i < 1 or lbracket_i <= colon_i or rbracket_i <= lbracket_i: + raise RuntimeError("Invalid line in %s:\n%s\n" % (filename, line)) + + name = line[:colon_i] + val = line[lbracket_i + 1:rbracket_i] + vallist = [v.strip() for v in val.split(',')] if val else [] + yield name, vallist + + +class NodeCfg(object): + """ Node configuration. + + name: node name + contents: a list of contents - attributes and child nodes + See comment at the top of the configuration file for details. + """ + def __init__(self, name, contents): + self.name = name + self.all_entries = [] + self.attr = [] + self.child = [] + self.seq_child = [] + + for entry in contents: + clean_entry = entry.rstrip('*') + self.all_entries.append(clean_entry) + + if entry.endswith('**'): + self.seq_child.append(clean_entry) + elif entry.endswith('*'): + self.child.append(clean_entry) + else: + self.attr.append(entry) + + def generate_source(self): + src = self._gen_init() + src += '\n' + self._gen_children() + src += '\n' + self._gen_attr_names() + return src + + def _gen_init(self): + src = "class %s(Node):\n" % self.name + + if self.all_entries: + args = ', '.join(self.all_entries) + slots = ', '.join("'{0}'".format(e) for e in self.all_entries) + slots += ", 'coord', '__weakref__'" + arglist = '(self, %s, coord=None)' % args + else: + slots = "'coord', '__weakref__'" + arglist = '(self, coord=None)' + + src += " __slots__ = (%s)\n" % slots + src += " def __init__%s:\n" % arglist + + for name in self.all_entries + ['coord']: + src += " self.%s = %s\n" % (name, name) + + return src + + def _gen_children(self): + src = ' def children(self):\n' + + if self.all_entries: + src += ' nodelist = []\n' + + for child in self.child: + src += ( + ' if self.%(child)s is not None:' + + ' nodelist.append(("%(child)s", self.%(child)s))\n') % ( + dict(child=child)) + + for seq_child in self.seq_child: + src += ( + ' for i, child in enumerate(self.%(child)s or []):\n' + ' nodelist.append(("%(child)s[%%d]" %% i, child))\n') % ( + dict(child=seq_child)) + + src += ' return tuple(nodelist)\n' + else: + src += ' return ()\n' + + return src + + def _gen_attr_names(self): + src = " attr_names = (" + ''.join("%r, " % nm for nm in self.attr) + ')' + return src + + +_PROLOGUE_COMMENT = \ +r'''#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# $cfg_filename +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- + +''' + +_PROLOGUE_CODE = r''' +import sys + + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + def visit(self, node): + """ Visit a node. + """ + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c_name, c in node.children(): + self.visit(c) + + +''' + + +if __name__ == "__main__": + import sys + ast_gen = ASTCodeGenerator('_c_ast.cfg') + ast_gen.generate(open('c_ast.py', 'w')) + diff --git a/utils/cseq-1.9/pycparser/_build_tables.py b/utils/cseq-1.9/pycparser/_build_tables.py new file mode 100644 index 000000000..a8a9dcff4 --- /dev/null +++ b/utils/cseq-1.9/pycparser/_build_tables.py @@ -0,0 +1,33 @@ +#----------------------------------------------------------------- +# pycparser: _build_tables.py +# +# A dummy for generating the lexing/parsing tables and and +# compiling them into .pyc for faster execution in optimized mode. +# Also generates AST code from the configuration file. +# Should be called from the pycparser directory. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- + +# Generate c_ast.py +from _ast_gen import ASTCodeGenerator +ast_gen = ASTCodeGenerator('_c_ast.cfg') +ast_gen.generate(open('c_ast.py', 'w')) + +import sys +sys.path[0:0] = ['.', '..'] +from pycparser import c_parser + +# Generates the tables +# +c_parser.CParser( + lex_optimize=True, + yacc_debug=False, + yacc_optimize=True) + +# Load to compile into .pyc +# +import lextab +import yacctab +import c_ast diff --git a/utils/cseq-1.9/pycparser/_c_ast.cfg b/utils/cseq-1.9/pycparser/_c_ast.cfg new file mode 100644 index 000000000..7dfcd0c45 --- /dev/null +++ b/utils/cseq-1.9/pycparser/_c_ast.cfg @@ -0,0 +1,191 @@ +#----------------------------------------------------------------- +# pycparser: _c_ast.cfg +# +# Defines the AST Node classes used in pycparser. +# +# Each entry is a Node sub-class name, listing the attributes +# and child nodes of the class: +# * - a child node +# ** - a sequence of child nodes +# - an attribute +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- + +# ArrayDecl is a nested declaration of an array with the given type. +# dim: the dimension (for example, constant 42) +# dim_quals: list of dimension qualifiers, to support C99's allowing 'const' +# and 'static' within the array dimension in function declarations. +ArrayDecl: [type*, dim*, dim_quals] + +ArrayRef: [name*, subscript*] + +# op: =, +=, /= etc. +# +Assignment: [op, lvalue*, rvalue*] + +BinaryOp: [op, left*, right*] + +Break: [] + +Case: [expr*, stmts**] + +Cast: [to_type*, expr*] + +# Compound statement in C99 is a list of block items (declarations or +# statements). +# +Compound: [block_items**] + +# Compound literal (anonymous aggregate) for C99. +# (type-name) {initializer_list} +# type: the typename +# init: InitList for the initializer list +# +CompoundLiteral: [type*, init*] + +# type: int, char, float, etc. see CLexer for constant token types +# +Constant: [type, value] + +Continue: [] + +# name: the variable being declared +# quals: list of qualifiers (const, volatile) +# funcspec: list function specifiers (i.e. inline in C99) +# storage: list of storage specifiers (extern, register, etc.) +# type: declaration type (probably nested with all the modifiers) +# init: initialization value, or None +# bitsize: bit field size, or None +# +Decl: [name, quals, storage, funcspec, type*, init*, bitsize*] + +DeclList: [decls**] + +Default: [stmts**] + +DoWhile: [cond*, stmt*] + +# Represents the ellipsis (...) parameter in a function +# declaration +# +EllipsisParam: [] + +# An empty statement (a semicolon ';' on its own) +# +EmptyStatement: [] + +# Enumeration type specifier +# name: an optional ID +# values: an EnumeratorList +# +Enum: [name, values*] + +# A name/value pair for enumeration values +# +Enumerator: [name, value*] + +# A list of enumerators +# +EnumeratorList: [enumerators**] + +# A list of expressions separated by the comma operator. +# +ExprList: [exprs**] + +# This is the top of the AST, representing a single C file (a +# translation unit in K&R jargon). It contains a list of +# "external-declaration"s, which is either declarations (Decl), +# Typedef or function definitions (FuncDef). +# +FileAST: [ext**] + +# for (init; cond; next) stmt +# +For: [init*, cond*, next*, stmt*] + +# name: Id +# args: ExprList +# +FuncCall: [name*, args*] + +# type (args) +# +FuncDecl: [args*, type*] + +# Function definition: a declarator for the function name and +# a body, which is a compound statement. +# There's an optional list of parameter declarations for old +# K&R-style definitions +# +FuncDef: [decl*, param_decls**, body*] + +Goto: [name] + +ID: [name] + +# Holder for types that are a simple identifier (e.g. the built +# ins void, char etc. and typedef-defined types) +# +IdentifierType: [names] + +If: [cond*, iftrue*, iffalse*] + +# An initialization list used for compound literals. +# +InitList: [exprs**] + +Label: [name, stmt*] + +# A named initializer for C99. +# The name of a NamedInitializer is a sequence of Nodes, because +# names can be hierarchical and contain constant expressions. +# +NamedInitializer: [name**, expr*] + +# a list of comma separated function parameter declarations +# +ParamList: [params**] + +PtrDecl: [quals, type*] + +Return: [expr*] + +# name: struct tag name +# decls: declaration of members +# +Struct: [name, decls**] + +# type: . or -> +# name.field or name->field +# +StructRef: [name*, type, field*] + +Switch: [cond*, stmt*] + +# cond ? iftrue : iffalse +# +TernaryOp: [cond*, iftrue*, iffalse*] + +# A base type declaration +# +TypeDecl: [declname, quals, type*] + +# A typedef declaration. +# Very similar to Decl, but without some attributes +# +Typedef: [name, quals, storage, type*] + +Typename: [name, quals, type*] + +UnaryOp: [op, expr*] + +# name: union tag name +# decls: declaration of members +# +Union: [name, decls**] + +While: [cond*, stmt*] + +Pragma: [string] diff --git a/utils/cseq-1.9/pycparser/ast_transforms.py b/utils/cseq-1.9/pycparser/ast_transforms.py new file mode 100644 index 000000000..623821d4b --- /dev/null +++ b/utils/cseq-1.9/pycparser/ast_transforms.py @@ -0,0 +1,105 @@ +#------------------------------------------------------------------------------ +# pycparser: ast_transforms.py +# +# Some utilities used by the parser to create a friendlier AST. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#------------------------------------------------------------------------------ + +from . import c_ast + + +def fix_switch_cases(switch_node): + """ The 'case' statements in a 'switch' come out of parsing with one + child node, so subsequent statements are just tucked to the parent + Compound. Additionally, consecutive (fall-through) case statements + come out messy. This is a peculiarity of the C grammar. The following: + + switch (myvar) { + case 10: + k = 10; + p = k + 1; + return 10; + case 20: + case 30: + return 20; + default: + break; + } + + Creates this tree (pseudo-dump): + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + The goal of this transform is to fix this mess, turning it into the + following: + + Switch + ID: myvar + Compound: + Case 10: + k = 10 + p = k + 1 + return 10 + Case 20: + Case 30: + return 20 + Default: + break + + A fixed AST node is returned. The argument may be modified. + """ + assert isinstance(switch_node, c_ast.Switch) + if not isinstance(switch_node.stmt, c_ast.Compound): + return switch_node + + # The new Compound child for the Switch, which will collect children in the + # correct order + new_compound = c_ast.Compound([], switch_node.stmt.coord) + + # The last Case/Default node + last_case = None + + # Goes over the children of the Compound below the Switch, adding them + # either directly below new_compound or below the last Case as appropriate + for child in switch_node.stmt.block_items: + if isinstance(child, (c_ast.Case, c_ast.Default)): + # If it's a Case/Default: + # 1. Add it to the Compound and mark as "last case" + # 2. If its immediate child is also a Case or Default, promote it + # to a sibling. + new_compound.block_items.append(child) + _extract_nested_case(child, new_compound.block_items) + last_case = new_compound.block_items[-1] + else: + # Other statements are added as children to the last case, if it + # exists. + if last_case is None: + new_compound.block_items.append(child) + else: + last_case.stmts.append(child) + + switch_node.stmt = new_compound + return switch_node + + +def _extract_nested_case(case_node, stmts_list): + """ Recursively extract consecutive Case statements that are made nested + by the parser and add them to the stmts_list. + """ + if isinstance(case_node.stmts[0], (c_ast.Case, c_ast.Default)): + stmts_list.append(case_node.stmts.pop()) + _extract_nested_case(stmts_list[-1], stmts_list) + diff --git a/utils/cseq-1.9/pycparser/c_ast.py b/utils/cseq-1.9/pycparser/c_ast.py new file mode 100644 index 000000000..5e81648d6 --- /dev/null +++ b/utils/cseq-1.9/pycparser/c_ast.py @@ -0,0 +1,809 @@ +#----------------------------------------------------------------- +# ** ATTENTION ** +# This code was automatically generated from the file: +# _c_ast.cfg +# +# Do not modify it directly. Modify the configuration file and +# run the generator again. +# ** ** *** ** ** +# +# pycparser: c_ast.py +# +# AST Node classes. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- + + +import sys + + +class Node(object): + __slots__ = () + """ Abstract base class for AST nodes. + """ + def children(self): + """ A sequence of all children that are Nodes + """ + pass + + def show(self, buf=sys.stdout, offset=0, attrnames=False, nodenames=False, showcoord=False, _my_node_name=None): + """ Pretty print the Node and all its attributes and + children (recursively) to a buffer. + + buf: + Open IO buffer into which the Node is printed. + + offset: + Initial offset (amount of leading spaces) + + attrnames: + True if you want to see the attribute names in + name=value pairs. False to only see the values. + + nodenames: + True if you want to see the actual node names + within their parents. + + showcoord: + Do you want the coordinates of each Node to be + displayed. + """ + lead = ' ' * offset + if nodenames and _my_node_name is not None: + buf.write(lead + self.__class__.__name__+ ' <' + _my_node_name + '>: ') + else: + buf.write(lead + self.__class__.__name__+ ': ') + + if self.attr_names: + if attrnames: + nvlist = [(n, getattr(self,n)) for n in self.attr_names] + attrstr = ', '.join('%s=%s' % nv for nv in nvlist) + else: + vlist = [getattr(self, n) for n in self.attr_names] + attrstr = ', '.join('%s' % v for v in vlist) + buf.write(attrstr) + + if showcoord: + buf.write(' (at %s)' % self.coord) + buf.write('\n') + + for (child_name, child) in self.children(): + child.show( + buf, + offset=offset + 2, + attrnames=attrnames, + nodenames=nodenames, + showcoord=showcoord, + _my_node_name=child_name) + + +class NodeVisitor(object): + """ A base NodeVisitor class for visiting c_ast nodes. + Subclass it and define your own visit_XXX methods, where + XXX is the class name you want to visit with these + methods. + + For example: + + class ConstantVisitor(NodeVisitor): + def __init__(self): + self.values = [] + + def visit_Constant(self, node): + self.values.append(node.value) + + Creates a list of values of all the constant nodes + encountered below the given node. To use it: + + cv = ConstantVisitor() + cv.visit(node) + + Notes: + + * generic_visit() will be called for AST nodes for which + no visit_XXX method was defined. + * The children of nodes for which a visit_XXX was + defined will not be visited - if you need this, call + generic_visit() on the node. + You can use: + NodeVisitor.generic_visit(self, node) + * Modeled after Python's own AST visiting facilities + (the ast module of Python 3.0) + """ + def visit(self, node): + """ Visit a node. + """ + method = 'visit_' + node.__class__.__name__ + visitor = getattr(self, method, self.generic_visit) + return visitor(node) + + def generic_visit(self, node): + """ Called if no explicit visitor function exists for a + node. Implements preorder visiting of the node. + """ + for c_name, c in node.children(): + self.visit(c) + + +class ArrayDecl(Node): + __slots__ = ('type', 'dim', 'dim_quals', 'coord', '__weakref__') + def __init__(self, type, dim, dim_quals, coord=None): + self.type = type + self.dim = dim + self.dim_quals = dim_quals + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.dim is not None: nodelist.append(("dim", self.dim)) + return tuple(nodelist) + + attr_names = ('dim_quals', ) + +class ArrayRef(Node): + __slots__ = ('name', 'subscript', 'coord', '__weakref__') + def __init__(self, name, subscript, coord=None): + self.name = name + self.subscript = subscript + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.subscript is not None: nodelist.append(("subscript", self.subscript)) + return tuple(nodelist) + + attr_names = () + +class Assignment(Node): + __slots__ = ('op', 'lvalue', 'rvalue', 'coord', '__weakref__') + def __init__(self, op, lvalue, rvalue, coord=None): + self.op = op + self.lvalue = lvalue + self.rvalue = rvalue + self.coord = coord + + def children(self): + nodelist = [] + if self.lvalue is not None: nodelist.append(("lvalue", self.lvalue)) + if self.rvalue is not None: nodelist.append(("rvalue", self.rvalue)) + return tuple(nodelist) + + attr_names = ('op', ) + +class BinaryOp(Node): + __slots__ = ('op', 'left', 'right', 'coord', '__weakref__') + def __init__(self, op, left, right, coord=None): + self.op = op + self.left = left + self.right = right + self.coord = coord + + def children(self): + nodelist = [] + if self.left is not None: nodelist.append(("left", self.left)) + if self.right is not None: nodelist.append(("right", self.right)) + return tuple(nodelist) + + attr_names = ('op', ) + +class Break(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + attr_names = () + +class Case(Node): + __slots__ = ('expr', 'stmts', 'coord', '__weakref__') + def __init__(self, expr, stmts, coord=None): + self.expr = expr + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class Cast(Node): + __slots__ = ('to_type', 'expr', 'coord', '__weakref__') + def __init__(self, to_type, expr, coord=None): + self.to_type = to_type + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.to_type is not None: nodelist.append(("to_type", self.to_type)) + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + attr_names = () + +class Compound(Node): + __slots__ = ('block_items', 'coord', '__weakref__') + def __init__(self, block_items, coord=None): + self.block_items = block_items + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.block_items or []): + nodelist.append(("block_items[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class CompoundLiteral(Node): + __slots__ = ('type', 'init', 'coord', '__weakref__') + def __init__(self, type, init, coord=None): + self.type = type + self.init = init + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + return tuple(nodelist) + + attr_names = () + +class Constant(Node): + __slots__ = ('type', 'value', 'coord', '__weakref__') + def __init__(self, type, value, coord=None): + self.type = type + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + attr_names = ('type', 'value', ) + +class Continue(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + attr_names = () + +class Decl(Node): + __slots__ = ('name', 'quals', 'storage', 'funcspec', 'type', 'init', 'bitsize', 'coord', '__weakref__') + def __init__(self, name, quals, storage, funcspec, type, init, bitsize, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.funcspec = funcspec + self.type = type + self.init = init + self.bitsize = bitsize + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + if self.init is not None: nodelist.append(("init", self.init)) + if self.bitsize is not None: nodelist.append(("bitsize", self.bitsize)) + return tuple(nodelist) + + attr_names = ('name', 'quals', 'storage', 'funcspec', ) + +class DeclList(Node): + __slots__ = ('decls', 'coord', '__weakref__') + def __init__(self, decls, coord=None): + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class Default(Node): + __slots__ = ('stmts', 'coord', '__weakref__') + def __init__(self, stmts, coord=None): + self.stmts = stmts + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.stmts or []): + nodelist.append(("stmts[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class DoWhile(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + attr_names = () + +class EllipsisParam(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + attr_names = () + +class EmptyStatement(Node): + __slots__ = ('coord', '__weakref__') + def __init__(self, coord=None): + self.coord = coord + + def children(self): + return () + + attr_names = () + +class Enum(Node): + __slots__ = ('name', 'values', 'coord', '__weakref__') + def __init__(self, name, values, coord=None): + self.name = name + self.values = values + self.coord = coord + + def children(self): + nodelist = [] + if self.values is not None: nodelist.append(("values", self.values)) + return tuple(nodelist) + + attr_names = ('name', ) + +class Enumerator(Node): + __slots__ = ('name', 'value', 'coord', '__weakref__') + def __init__(self, name, value, coord=None): + self.name = name + self.value = value + self.coord = coord + + def children(self): + nodelist = [] + if self.value is not None: nodelist.append(("value", self.value)) + return tuple(nodelist) + + attr_names = ('name', ) + +class EnumeratorList(Node): + __slots__ = ('enumerators', 'coord', '__weakref__') + def __init__(self, enumerators, coord=None): + self.enumerators = enumerators + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.enumerators or []): + nodelist.append(("enumerators[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class ExprList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class FileAST(Node): + __slots__ = ('ext', 'coord', '__weakref__') + def __init__(self, ext, coord=None): + self.ext = ext + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.ext or []): + nodelist.append(("ext[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class For(Node): + __slots__ = ('init', 'cond', 'next', 'stmt', 'coord', '__weakref__') + def __init__(self, init, cond, next, stmt, coord=None): + self.init = init + self.cond = cond + self.next = next + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.init is not None: nodelist.append(("init", self.init)) + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.next is not None: nodelist.append(("next", self.next)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + attr_names = () + +class FuncCall(Node): + __slots__ = ('name', 'args', 'coord', '__weakref__') + def __init__(self, name, args, coord=None): + self.name = name + self.args = args + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.args is not None: nodelist.append(("args", self.args)) + return tuple(nodelist) + + attr_names = () + +class FuncDecl(Node): + __slots__ = ('args', 'type', 'coord', '__weakref__') + def __init__(self, args, type, coord=None): + self.args = args + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.args is not None: nodelist.append(("args", self.args)) + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + attr_names = () + +class FuncDef(Node): + __slots__ = ('decl', 'param_decls', 'body', 'coord', '__weakref__') + def __init__(self, decl, param_decls, body, coord=None): + self.decl = decl + self.param_decls = param_decls + self.body = body + self.coord = coord + + def children(self): + nodelist = [] + if self.decl is not None: nodelist.append(("decl", self.decl)) + if self.body is not None: nodelist.append(("body", self.body)) + for i, child in enumerate(self.param_decls or []): + nodelist.append(("param_decls[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class Goto(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + attr_names = ('name', ) + +class ID(Node): + __slots__ = ('name', 'coord', '__weakref__') + def __init__(self, name, coord=None): + self.name = name + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + attr_names = ('name', ) + +class IdentifierType(Node): + __slots__ = ('names', 'coord', '__weakref__') + def __init__(self, names, coord=None): + self.names = names + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + attr_names = ('names', ) + +class If(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + attr_names = () + +class InitList(Node): + __slots__ = ('exprs', 'coord', '__weakref__') + def __init__(self, exprs, coord=None): + self.exprs = exprs + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.exprs or []): + nodelist.append(("exprs[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class Label(Node): + __slots__ = ('name', 'stmt', 'coord', '__weakref__') + def __init__(self, name, stmt, coord=None): + self.name = name + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + attr_names = ('name', ) + +class NamedInitializer(Node): + __slots__ = ('name', 'expr', 'coord', '__weakref__') + def __init__(self, name, expr, coord=None): + self.name = name + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + for i, child in enumerate(self.name or []): + nodelist.append(("name[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class ParamList(Node): + __slots__ = ('params', 'coord', '__weakref__') + def __init__(self, params, coord=None): + self.params = params + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.params or []): + nodelist.append(("params[%d]" % i, child)) + return tuple(nodelist) + + attr_names = () + +class PtrDecl(Node): + __slots__ = ('quals', 'type', 'coord', '__weakref__') + def __init__(self, quals, type, coord=None): + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + attr_names = ('quals', ) + +class Return(Node): + __slots__ = ('expr', 'coord', '__weakref__') + def __init__(self, expr, coord=None): + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + attr_names = () + +class Struct(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + attr_names = ('name', ) + +class StructRef(Node): + __slots__ = ('name', 'type', 'field', 'coord', '__weakref__') + def __init__(self, name, type, field, coord=None): + self.name = name + self.type = type + self.field = field + self.coord = coord + + def children(self): + nodelist = [] + if self.name is not None: nodelist.append(("name", self.name)) + if self.field is not None: nodelist.append(("field", self.field)) + return tuple(nodelist) + + attr_names = ('type', ) + +class Switch(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + attr_names = () + +class TernaryOp(Node): + __slots__ = ('cond', 'iftrue', 'iffalse', 'coord', '__weakref__') + def __init__(self, cond, iftrue, iffalse, coord=None): + self.cond = cond + self.iftrue = iftrue + self.iffalse = iffalse + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.iftrue is not None: nodelist.append(("iftrue", self.iftrue)) + if self.iffalse is not None: nodelist.append(("iffalse", self.iffalse)) + return tuple(nodelist) + + attr_names = () + +class TypeDecl(Node): + __slots__ = ('declname', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, declname, quals, type, coord=None): + self.declname = declname + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + attr_names = ('declname', 'quals', ) + +class Typedef(Node): + __slots__ = ('name', 'quals', 'storage', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, storage, type, coord=None): + self.name = name + self.quals = quals + self.storage = storage + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + attr_names = ('name', 'quals', 'storage', ) + +class Typename(Node): + __slots__ = ('name', 'quals', 'type', 'coord', '__weakref__') + def __init__(self, name, quals, type, coord=None): + self.name = name + self.quals = quals + self.type = type + self.coord = coord + + def children(self): + nodelist = [] + if self.type is not None: nodelist.append(("type", self.type)) + return tuple(nodelist) + + attr_names = ('name', 'quals', ) + +class UnaryOp(Node): + __slots__ = ('op', 'expr', 'coord', '__weakref__') + def __init__(self, op, expr, coord=None): + self.op = op + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + attr_names = ('op', ) + +class Union(Node): + __slots__ = ('name', 'decls', 'coord', '__weakref__') + def __init__(self, name, decls, coord=None): + self.name = name + self.decls = decls + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.decls or []): + nodelist.append(("decls[%d]" % i, child)) + return tuple(nodelist) + + attr_names = ('name', ) + +class While(Node): + __slots__ = ('cond', 'stmt', 'coord', '__weakref__') + def __init__(self, cond, stmt, coord=None): + self.cond = cond + self.stmt = stmt + self.coord = coord + + def children(self): + nodelist = [] + if self.cond is not None: nodelist.append(("cond", self.cond)) + if self.stmt is not None: nodelist.append(("stmt", self.stmt)) + return tuple(nodelist) + + attr_names = () + +class Pragma(Node): + __slots__ = ('string', 'coord', '__weakref__') + def __init__(self, string, coord=None): + self.string = string + self.coord = coord + + def children(self): + nodelist = [] + return tuple(nodelist) + + attr_names = ('string', ) + diff --git a/utils/cseq-1.9/pycparser/c_generator.py b/utils/cseq-1.9/pycparser/c_generator.py new file mode 100644 index 000000000..73e7f1b9e --- /dev/null +++ b/utils/cseq-1.9/pycparser/c_generator.py @@ -0,0 +1,411 @@ +#------------------------------------------------------------------------------ +# pycparser: c_generator.py +# +# C code generator from pycparser AST nodes. +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#------------------------------------------------------------------------------ +from . import c_ast + + +class CGenerator(object): + """ Uses the same visitor pattern as c_ast.NodeVisitor, but modified to + return a value from each visit method, using string accumulation in + generic_visit. + """ + def __init__(self): + # Statements start with indentation of self.indent_level spaces, using + # the _make_indent method + # + self.indent_level = 0 + + def _make_indent(self): + return ' ' * self.indent_level + + def visit(self, node): + method = 'visit_' + node.__class__.__name__ + return getattr(self, method, self.generic_visit)(node) + + def generic_visit(self, node): + #~ print('generic:', type(node)) + if node is None: + return '' + else: + return ''.join(self.visit(c) for c_name, c in node.children()) + + def visit_Constant(self, n): + return n.value + + def visit_ID(self, n): + return n.name + + def visit_Pragma(self, n): + ret = '#pragma' + if n.string: + ret += ' ' + n.string + return ret + + def visit_ArrayRef(self, n): + arrref = self._parenthesize_unless_simple(n.name) + return arrref + '[' + self.visit(n.subscript) + ']' + + def visit_StructRef(self, n): + sref = self._parenthesize_unless_simple(n.name) + return sref + n.type + self.visit(n.field) + + def visit_FuncCall(self, n): + fref = self._parenthesize_unless_simple(n.name) + return fref + '(' + self.visit(n.args) + ')' + + def visit_UnaryOp(self, n): + operand = self._parenthesize_unless_simple(n.expr) + if n.op == 'p++': + return '%s++' % operand + elif n.op == 'p--': + return '%s--' % operand + elif n.op == 'sizeof': + # Always parenthesize the argument of sizeof since it can be + # a name. + return 'sizeof(%s)' % self.visit(n.expr) + else: + return '%s%s' % (n.op, operand) + + def visit_BinaryOp(self, n): + lval_str = self._parenthesize_if(n.left, + lambda d: not self._is_simple_node(d)) + rval_str = self._parenthesize_if(n.right, + lambda d: not self._is_simple_node(d)) + return '%s %s %s' % (lval_str, n.op, rval_str) + + def visit_Assignment(self, n): + rval_str = self._parenthesize_if( + n.rvalue, + lambda n: isinstance(n, c_ast.Assignment)) + return '%s %s %s' % (self.visit(n.lvalue), n.op, rval_str) + + def visit_IdentifierType(self, n): + return ' '.join(n.names) + + def _visit_expr(self, n): + if isinstance(n, c_ast.InitList): + return '{' + self.visit(n) + '}' + elif isinstance(n, c_ast.ExprList): + return '(' + self.visit(n) + ')' + else: + return self.visit(n) + + def visit_Decl(self, n, no_type=False): + # no_type is used when a Decl is part of a DeclList, where the type is + # explicitly only for the first declaration in a list. + # + s = n.name if no_type else self._generate_decl(n) + if n.bitsize: s += ' : ' + self.visit(n.bitsize) + if n.init: + s += ' = ' + self._visit_expr(n.init) + return s + + def visit_DeclList(self, n): + s = self.visit(n.decls[0]) + if len(n.decls) > 1: + s += ', ' + ', '.join(self.visit_Decl(decl, no_type=True) + for decl in n.decls[1:]) + return s + + def visit_Typedef(self, n): + s = '' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def visit_Cast(self, n): + s = '(' + self._generate_type(n.to_type) + ')' + return s + ' ' + self._parenthesize_unless_simple(n.expr) + + def visit_ExprList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_InitList(self, n): + visited_subexprs = [] + for expr in n.exprs: + visited_subexprs.append(self._visit_expr(expr)) + return ', '.join(visited_subexprs) + + def visit_Enum(self, n): + s = 'enum' + if n.name: s += ' ' + n.name + if n.values: + s += ' {' + for i, enumerator in enumerate(n.values.enumerators): + s += enumerator.name + if enumerator.value: + s += ' = ' + self.visit(enumerator.value) + if i != len(n.values.enumerators) - 1: + s += ', ' + s += '}' + return s + + def visit_FuncDef(self, n): + decl = self.visit(n.decl) + self.indent_level = 0 + body = self.visit(n.body) + if n.param_decls: + knrdecls = ';\n'.join(self.visit(p) for p in n.param_decls) + return decl + '\n' + knrdecls + ';\n' + body + '\n' + else: + return decl + '\n' + body + '\n' + + def visit_FileAST(self, n): + s = '' + for ext in n.ext: + if isinstance(ext, c_ast.FuncDef): + s += self.visit(ext) + elif isinstance(ext, c_ast.Pragma): + s += self.visit(ext) + '\n' + else: + s += self.visit(ext) + ';\n' + return s + + def visit_Compound(self, n): + s = self._make_indent() + '{\n' + self.indent_level += 2 + if n.block_items: + s += ''.join(self._generate_stmt(stmt) for stmt in n.block_items) + self.indent_level -= 2 + s += self._make_indent() + '}\n' + return s + + def visit_CompoundLiteral(self, n): + return '(' + self.visit(n.type) + '){' + self.visit(n.init) + '}' + + + def visit_EmptyStatement(self, n): + return ';' + + def visit_ParamList(self, n): + return ', '.join(self.visit(param) for param in n.params) + + def visit_Return(self, n): + s = 'return' + if n.expr: s += ' ' + self.visit(n.expr) + return s + ';' + + def visit_Break(self, n): + return 'break;' + + def visit_Continue(self, n): + return 'continue;' + + def visit_TernaryOp(self, n): + s = '(' + self._visit_expr(n.cond) + ') ? ' + s += '(' + self._visit_expr(n.iftrue) + ') : ' + s += '(' + self._visit_expr(n.iffalse) + ')' + return s + + def visit_If(self, n): + s = 'if (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.iftrue, add_indent=True) + if n.iffalse: + s += self._make_indent() + 'else\n' + s += self._generate_stmt(n.iffalse, add_indent=True) + return s + + def visit_For(self, n): + s = 'for (' + if n.init: s += self.visit(n.init) + s += ';' + if n.cond: s += ' ' + self.visit(n.cond) + s += ';' + if n.next: s += ' ' + self.visit(n.next) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_While(self, n): + s = 'while (' + if n.cond: s += self.visit(n.cond) + s += ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_DoWhile(self, n): + s = 'do\n' + s += self._generate_stmt(n.stmt, add_indent=True) + s += self._make_indent() + 'while (' + if n.cond: s += self.visit(n.cond) + s += ');' + return s + + def visit_Switch(self, n): + s = 'switch (' + self.visit(n.cond) + ')\n' + s += self._generate_stmt(n.stmt, add_indent=True) + return s + + def visit_Case(self, n): + s = 'case ' + self.visit(n.expr) + ':\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Default(self, n): + s = 'default:\n' + for stmt in n.stmts: + s += self._generate_stmt(stmt, add_indent=True) + return s + + def visit_Label(self, n): + return n.name + ':\n' + self._generate_stmt(n.stmt) + + def visit_Goto(self, n): + return 'goto ' + n.name + ';' + + def visit_EllipsisParam(self, n): + return '...' + + def visit_Struct(self, n): + return self._generate_struct_union(n, 'struct') + + def visit_Typename(self, n): + return self._generate_type(n.type) + + def visit_Union(self, n): + return self._generate_struct_union(n, 'union') + + def visit_NamedInitializer(self, n): + s = '' + for name in n.name: + if isinstance(name, c_ast.ID): + s += '.' + name.name + elif isinstance(name, c_ast.Constant): + s += '[' + name.value + ']' + s += ' = ' + self._visit_expr(n.expr) + return s + + def visit_FuncDecl(self, n): + return self._generate_type(n) + + def _generate_struct_union(self, n, name): + """ Generates code for structs and unions. name should be either + 'struct' or union. + """ + s = name + ' ' + (n.name or '') + if n.decls: + s += '\n' + s += self._make_indent() + self.indent_level += 2 + s += '{\n' + for decl in n.decls: + s += self._generate_stmt(decl) + self.indent_level -= 2 + s += self._make_indent() + '}' + return s + + def _generate_stmt(self, n, add_indent=False): + """ Generation from a statement node. This method exists as a wrapper + for individual visit_* methods to handle different treatment of + some statements in this context. + """ + typ = type(n) + if add_indent: self.indent_level += 2 + indent = self._make_indent() + if add_indent: self.indent_level -= 2 + + if typ in ( + c_ast.Decl, c_ast.Assignment, c_ast.Cast, c_ast.UnaryOp, + c_ast.BinaryOp, c_ast.TernaryOp, c_ast.FuncCall, c_ast.ArrayRef, + c_ast.StructRef, c_ast.Constant, c_ast.ID, c_ast.Typedef, + c_ast.ExprList): + # These can also appear in an expression context so no semicolon + # is added to them automatically + # + return indent + self.visit(n) + ';\n' + elif typ in (c_ast.Compound,): + # No extra indentation required before the opening brace of a + # compound - because it consists of multiple lines it has to + # compute its own indentation. + # + return self.visit(n) + else: + return indent + self.visit(n) + '\n' + + def _generate_decl(self, n): + """ Generation from a Decl node. + """ + s = '' + if n.funcspec: s = ' '.join(n.funcspec) + ' ' + if n.storage: s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def _generate_type(self, n, modifiers=[]): + """ Recursive generation from a type node. n is the type node. + modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers + encountered on the way down to a TypeDecl, to allow proper + generation from it. + """ + typ = type(n) + #~ print(n, modifiers) + + if typ == c_ast.TypeDecl: + s = '' + if n.quals: s += ' '.join(n.quals) + ' ' + s += self.visit(n.type) + + nstr = n.declname if n.declname else '' + # Resolve modifiers. + # Wrap in parens to distinguish pointer to array and pointer to + # function syntax. + # + for i, modifier in enumerate(modifiers): + if isinstance(modifier, c_ast.ArrayDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + self.visit(modifier.dim) + ']' + elif isinstance(modifier, c_ast.FuncDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '(' + self.visit(modifier.args) + ')' + elif isinstance(modifier, c_ast.PtrDecl): + if modifier.quals: + nstr = '* %s %s' % (' '.join(modifier.quals), nstr) + else: + nstr = '*' + nstr + if nstr: s += ' ' + nstr + return s + elif typ == c_ast.Decl: + return self._generate_decl(n.type) + elif typ == c_ast.Typename: + return self._generate_type(n.type) + elif typ == c_ast.IdentifierType: + return ' '.join(n.names) + ' ' + elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl): + return self._generate_type(n.type, modifiers + [n]) + else: + return self.visit(n) + + def _parenthesize_if(self, n, condition): + """ Visits 'n' and returns its string representation, parenthesized + if the condition function applied to the node returns True. + """ + s = self._visit_expr(n) + if condition(n): + return '(' + s + ')' + else: + return s + + def _parenthesize_unless_simple(self, n): + """ Common use case for _parenthesize_if + """ + return self._parenthesize_if(n, lambda d: not self._is_simple_node(d)) + + def _is_simple_node(self, n): + """ Returns True for nodes that are "simple" - i.e. nodes that always + have higher precedence than operators. + """ + return isinstance(n,( c_ast.Constant, c_ast.ID, c_ast.ArrayRef, + c_ast.StructRef, c_ast.FuncCall)) diff --git a/utils/cseq-1.9/pycparser/c_lexer.py b/utils/cseq-1.9/pycparser/c_lexer.py new file mode 100644 index 000000000..d9941c18e --- /dev/null +++ b/utils/cseq-1.9/pycparser/c_lexer.py @@ -0,0 +1,485 @@ +#------------------------------------------------------------------------------ +# pycparser: c_lexer.py +# +# CLexer class: lexer for the C language +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#------------------------------------------------------------------------------ +import re +import sys + +from .ply import lex +from .ply.lex import TOKEN + + +class CLexer(object): + """ A lexer for the C language. After building it, set the + input text with input(), and call token() to get new + tokens. + + The public attribute filename can be set to an initial + filaneme, but the lexer will update it upon #line + directives. + """ + def __init__(self, error_func, on_lbrace_func, on_rbrace_func, + type_lookup_func): + """ Create a new Lexer. + + error_func: + An error function. Will be called with an error + message, line and column as arguments, in case of + an error during lexing. + + on_lbrace_func, on_rbrace_func: + Called when an LBRACE or RBRACE is encountered + (likely to push/pop type_lookup_func's scope) + + type_lookup_func: + A type lookup function. Given a string, it must + return True IFF this string is a name of a type + that was defined with a typedef earlier. + """ + self.error_func = error_func + self.on_lbrace_func = on_lbrace_func + self.on_rbrace_func = on_rbrace_func + self.type_lookup_func = type_lookup_func + self.filename = '' + + # Keeps track of the last token returned from self.token() + self.last_token = None + + # Allow either "# line" or "# " to support GCC's + # cpp output + # + self.line_pattern = re.compile(r'([ \t]*line\W)|([ \t]*\d+)') + self.pragma_pattern = re.compile(r'[ \t]*pragma\W') + + def build(self, **kwargs): + """ Builds the lexer from the specification. Must be + called after the lexer object is created. + + This method exists separately, because the PLY + manual warns against calling lex.lex inside + __init__ + """ + self.lexer = lex.lex(object=self, **kwargs) + + def reset_lineno(self): + """ Resets the internal line number counter of the lexer. + """ + self.lexer.lineno = 1 + + def input(self, text): + self.lexer.input(text) + + def token(self): + self.last_token = self.lexer.token() + return self.last_token + + def find_tok_column(self, token): + """ Find the column of the token in its line. + """ + last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos) + return token.lexpos - last_cr + + ######################-- PRIVATE --###################### + + ## + ## Internal auxiliary methods + ## + def _error(self, msg, token): + location = self._make_tok_location(token) + self.error_func(msg, location[0], location[1]) + self.lexer.skip(1) + + def _make_tok_location(self, token): + return (token.lineno, self.find_tok_column(token)) + + ## + ## Reserved keywords + ## + keywords = ( + '_BOOL', '_COMPLEX', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CONST', + 'CONTINUE', 'DEFAULT', 'DO', 'DOUBLE', 'ELSE', 'ENUM', 'EXTERN', + 'FLOAT', 'FOR', 'GOTO', 'IF', 'INLINE', 'INT', 'LONG', + 'REGISTER', 'OFFSETOF', + 'RESTRICT', 'RETURN', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRUCT', + 'SWITCH', 'TYPEDEF', 'UNION', 'UNSIGNED', 'VOID', + 'VOLATILE', 'WHILE', '__INT128', + ) + + keyword_map = {} + for keyword in keywords: + if keyword == '_BOOL': + keyword_map['_Bool'] = keyword + elif keyword == '_COMPLEX': + keyword_map['_Complex'] = keyword + else: + keyword_map[keyword.lower()] = keyword + + ## + ## All the tokens recognized by the lexer + ## + tokens = keywords + ( + # Identifiers + 'ID', + + # Type identifiers (identifiers previously defined as + # types with typedef) + 'TYPEID', + + # constants + 'INT_CONST_DEC', 'INT_CONST_OCT', 'INT_CONST_HEX', 'INT_CONST_BIN', + 'FLOAT_CONST', 'HEX_FLOAT_CONST', + 'CHAR_CONST', + 'WCHAR_CONST', + + # String literals + 'STRING_LITERAL', + 'WSTRING_LITERAL', + + # Operators + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MOD', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', + 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', + 'OREQUAL', + + # Increment/decrement + 'PLUSPLUS', 'MINUSMINUS', + + # Structure dereference (->) + 'ARROW', + + # Conditional operator (?) + 'CONDOP', + + # Delimeters + 'LPAREN', 'RPAREN', # ( ) + 'LBRACKET', 'RBRACKET', # [ ] + 'LBRACE', 'RBRACE', # { } + 'COMMA', 'PERIOD', # . , + 'SEMI', 'COLON', # ; : + + # Ellipsis (...) + 'ELLIPSIS', + + # pre-processor + 'PPHASH', # '#' + 'PPPRAGMA', # 'pragma' + 'PPPRAGMASTR', + ) + + ## + ## Regexes for use in tokens + ## + ## + + # valid C identifiers (K&R2: A.2.3), plus '$' (supported by some compilers) + identifier = r'[a-zA-Z_$][0-9a-zA-Z_$]*' + + hex_prefix = '0[xX]' + hex_digits = '[0-9a-fA-F]+' + bin_prefix = '0[bB]' + bin_digits = '[01]+' + + # integer constants (K&R2: A.2.5.1) + integer_suffix_opt = r'(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?' + decimal_constant = '(0'+integer_suffix_opt+')|([1-9][0-9]*'+integer_suffix_opt+')' + octal_constant = '0[0-7]*'+integer_suffix_opt + hex_constant = hex_prefix+hex_digits+integer_suffix_opt + bin_constant = bin_prefix+bin_digits+integer_suffix_opt + + bad_octal_constant = '0[0-7]*[89]' + + # character constants (K&R2: A.2.5.2) + # Note: a-zA-Z and '.-~^_!=&;,' are allowed as escape chars to support #line + # directives with Windows paths as filenames (..\..\dir\file) + # For the same reason, decimal_escape allows all digit sequences. We want to + # parse all correct code, even if it means to sometimes parse incorrect + # code. + # + simple_escape = r"""([a-zA-Z._~!=&\^\-\\?'"])""" + decimal_escape = r"""(\d+)""" + hex_escape = r"""(x[0-9a-fA-F]+)""" + bad_escape = r"""([\\][^a-zA-Z._~^!=&\^\-\\?'"x0-7])""" + + escape_sequence = r"""(\\("""+simple_escape+'|'+decimal_escape+'|'+hex_escape+'))' + cconst_char = r"""([^'\\\n]|"""+escape_sequence+')' + char_const = "'"+cconst_char+"'" + wchar_const = 'L'+char_const + unmatched_quote = "('"+cconst_char+"*\\n)|('"+cconst_char+"*$)" + bad_char_const = r"""('"""+cconst_char+"""[^'\n]+')|('')|('"""+bad_escape+r"""[^'\n]*')""" + + # string literals (K&R2: A.2.6) + string_char = r"""([^"\\\n]|"""+escape_sequence+')' + string_literal = '"'+string_char+'*"' + wstring_literal = 'L'+string_literal + bad_string_literal = '"'+string_char+'*?'+bad_escape+string_char+'*"' + + # floating constants (K&R2: A.2.5.3) + exponent_part = r"""([eE][-+]?[0-9]+)""" + fractional_constant = r"""([0-9]*\.[0-9]+)|([0-9]+\.)""" + floating_constant = '(((('+fractional_constant+')'+exponent_part+'?)|([0-9]+'+exponent_part+'))[FfLl]?)' + binary_exponent_part = r'''([pP][+-]?[0-9]+)''' + hex_fractional_constant = '((('+hex_digits+r""")?\."""+hex_digits+')|('+hex_digits+r"""\.))""" + hex_floating_constant = '('+hex_prefix+'('+hex_digits+'|'+hex_fractional_constant+')'+binary_exponent_part+'[FfLl]?)' + + ## + ## Lexer states: used for preprocessor \n-terminated directives + ## + states = ( + # ppline: preprocessor line directives + # + ('ppline', 'exclusive'), + + # pppragma: pragma + # + ('pppragma', 'exclusive'), + ) + + def t_PPHASH(self, t): + r'[ \t]*\#' + if self.line_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('ppline') + self.pp_line = self.pp_filename = None + elif self.pragma_pattern.match(t.lexer.lexdata, pos=t.lexer.lexpos): + t.lexer.begin('pppragma') + else: + t.type = 'PPHASH' + return t + + ## + ## Rules for the ppline state + ## + @TOKEN(string_literal) + def t_ppline_FILENAME(self, t): + if self.pp_line is None: + self._error('filename before line number in #line', t) + else: + self.pp_filename = t.value.lstrip('"').rstrip('"') + + @TOKEN(decimal_constant) + def t_ppline_LINE_NUMBER(self, t): + if self.pp_line is None: + self.pp_line = t.value + else: + # Ignore: GCC's cpp sometimes inserts a numeric flag + # after the file name + pass + + def t_ppline_NEWLINE(self, t): + r'\n' + if self.pp_line is None: + self._error('line number missing in #line', t) + else: + self.lexer.lineno = int(self.pp_line) + + if self.pp_filename is not None: + self.filename = self.pp_filename + + t.lexer.begin('INITIAL') + + def t_ppline_PPLINE(self, t): + r'line' + pass + + t_ppline_ignore = ' \t' + + def t_ppline_error(self, t): + self._error('invalid #line directive', t) + + ## + ## Rules for the pppragma state + ## + def t_pppragma_NEWLINE(self, t): + r'\n' + t.lexer.lineno += 1 + t.lexer.begin('INITIAL') + + def t_pppragma_PPPRAGMA(self, t): + r'pragma' + return t + + t_pppragma_ignore = ' \t' + + def t_pppragma_STR(self, t): + '.+' + t.type = 'PPPRAGMASTR' + return t + + def t_pppragma_error(self, t): + self._error('invalid #pragma directive', t) + + ## + ## Rules for the normal state + ## + t_ignore = ' \t' + + # Newlines + def t_NEWLINE(self, t): + r'\n+' + t.lexer.lineno += t.value.count("\n") + + # Operators + t_PLUS = r'\+' + t_MINUS = r'-' + t_TIMES = r'\*' + t_DIVIDE = r'/' + t_MOD = r'%' + t_OR = r'\|' + t_AND = r'&' + t_NOT = r'~' + t_XOR = r'\^' + t_LSHIFT = r'<<' + t_RSHIFT = r'>>' + t_LOR = r'\|\|' + t_LAND = r'&&' + t_LNOT = r'!' + t_LT = r'<' + t_GT = r'>' + t_LE = r'<=' + t_GE = r'>=' + t_EQ = r'==' + t_NE = r'!=' + + # Assignment operators + t_EQUALS = r'=' + t_TIMESEQUAL = r'\*=' + t_DIVEQUAL = r'/=' + t_MODEQUAL = r'%=' + t_PLUSEQUAL = r'\+=' + t_MINUSEQUAL = r'-=' + t_LSHIFTEQUAL = r'<<=' + t_RSHIFTEQUAL = r'>>=' + t_ANDEQUAL = r'&=' + t_OREQUAL = r'\|=' + t_XOREQUAL = r'\^=' + + # Increment/decrement + t_PLUSPLUS = r'\+\+' + t_MINUSMINUS = r'--' + + # -> + t_ARROW = r'->' + + # ? + t_CONDOP = r'\?' + + # Delimeters + t_LPAREN = r'\(' + t_RPAREN = r'\)' + t_LBRACKET = r'\[' + t_RBRACKET = r'\]' + t_COMMA = r',' + t_PERIOD = r'\.' + t_SEMI = r';' + t_COLON = r':' + t_ELLIPSIS = r'\.\.\.' + + # Scope delimiters + # To see why on_lbrace_func is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # TT x = 5; + # Outside the function, TT is a typedef, but inside (starting and ending + # with the braces) it's a parameter. The trouble begins with yacc's + # lookahead token. If we open a new scope in brace_open, then TT has + # already been read and incorrectly interpreted as TYPEID. So, we need + # to open and close scopes from within the lexer. + # Similar for the TT immediately outside the end of the function. + # + @TOKEN(r'\{') + def t_LBRACE(self, t): + self.on_lbrace_func() + return t + @TOKEN(r'\}') + def t_RBRACE(self, t): + self.on_rbrace_func() + return t + + t_STRING_LITERAL = string_literal + + # The following floating and integer constants are defined as + # functions to impose a strict order (otherwise, decimal + # is placed before the others because its regex is longer, + # and this is bad) + # + @TOKEN(floating_constant) + def t_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_floating_constant) + def t_HEX_FLOAT_CONST(self, t): + return t + + @TOKEN(hex_constant) + def t_INT_CONST_HEX(self, t): + return t + + @TOKEN(bin_constant) + def t_INT_CONST_BIN(self, t): + return t + + @TOKEN(bad_octal_constant) + def t_BAD_CONST_OCT(self, t): + msg = "Invalid octal constant" + self._error(msg, t) + + @TOKEN(octal_constant) + def t_INT_CONST_OCT(self, t): + return t + + @TOKEN(decimal_constant) + def t_INT_CONST_DEC(self, t): + return t + + # Must come before bad_char_const, to prevent it from + # catching valid char constants as invalid + # + @TOKEN(char_const) + def t_CHAR_CONST(self, t): + return t + + @TOKEN(wchar_const) + def t_WCHAR_CONST(self, t): + return t + + @TOKEN(unmatched_quote) + def t_UNMATCHED_QUOTE(self, t): + msg = "Unmatched '" + self._error(msg, t) + + @TOKEN(bad_char_const) + def t_BAD_CHAR_CONST(self, t): + msg = "Invalid char constant %s" % t.value + self._error(msg, t) + + @TOKEN(wstring_literal) + def t_WSTRING_LITERAL(self, t): + return t + + # unmatched string literals are caught by the preprocessor + + @TOKEN(bad_string_literal) + def t_BAD_STRING_LITERAL(self, t): + msg = "String contains invalid escape code" + self._error(msg, t) + + @TOKEN(identifier) + def t_ID(self, t): + t.type = self.keyword_map.get(t.value, "ID") + if t.type == 'ID' and self.type_lookup_func(t.value): + t.type = "TYPEID" + return t + + def t_error(self, t): + msg = 'Illegal character %s' % repr(t.value[0]) + self._error(msg, t) + diff --git a/utils/cseq-1.9/pycparser/c_parser.py b/utils/cseq-1.9/pycparser/c_parser.py new file mode 100644 index 000000000..f84d6bc68 --- /dev/null +++ b/utils/cseq-1.9/pycparser/c_parser.py @@ -0,0 +1,1782 @@ +#------------------------------------------------------------------------------ +# pycparser: c_parser.py +# +# CParser class: Parser and AST builder for the C language +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#------------------------------------------------------------------------------ +import re + +from .ply import yacc + +from . import c_ast +from .c_lexer import CLexer +from .plyparser import PLYParser, Coord, ParseError, parameterized, template +from .ast_transforms import fix_switch_cases + + +@template +class CParser(PLYParser): + def __init__( + self, + lex_optimize=True, + lexer=CLexer, + lextab='pycparser.lextab', + yacc_optimize=True, + yacctab='pycparser.yacctab', + yacc_debug=False, + taboutputdir=''): + """ Create a new CParser. + + Some arguments for controlling the debug/optimization + level of the parser are provided. The defaults are + tuned for release/performance mode. + The simple rules for using them are: + *) When tweaking CParser/CLexer, set these to False + *) When releasing a stable parser, set to True + + lex_optimize: + Set to False when you're modifying the lexer. + Otherwise, changes in the lexer won't be used, if + some lextab.py file exists. + When releasing with a stable lexer, set to True + to save the re-generation of the lexer table on + each run. + + lexer: + Set this parameter to define the lexer to use if + you're not using the default CLexer. + + lextab: + Points to the lex table that's used for optimized + mode. Only if you're modifying the lexer and want + some tests to avoid re-generating the table, make + this point to a local lex table file (that's been + earlier generated with lex_optimize=True) + + yacc_optimize: + Set to False when you're modifying the parser. + Otherwise, changes in the parser won't be used, if + some parsetab.py file exists. + When releasing with a stable parser, set to True + to save the re-generation of the parser table on + each run. + + yacctab: + Points to the yacc table that's used for optimized + mode. Only if you're modifying the parser, make + this point to a local yacc table file + + yacc_debug: + Generate a parser.out file that explains how yacc + built the parsing table from the grammar. + + taboutputdir: + Set this parameter to control the location of generated + lextab and yacctab files. + """ + self.clex = lexer( + error_func=self._lex_error_func, + on_lbrace_func=self._lex_on_lbrace_func, + on_rbrace_func=self._lex_on_rbrace_func, + type_lookup_func=self._lex_type_lookup_func) + + self.clex.build( + optimize=lex_optimize, + lextab=lextab, + outputdir=taboutputdir) + self.tokens = self.clex.tokens + + rules_with_opt = [ + 'abstract_declarator', + 'assignment_expression', + 'declaration_list', + 'declaration_specifiers_no_type', + 'designation', + 'expression', + 'identifier_list', + 'init_declarator_list', + 'id_init_declarator_list', + 'initializer_list', + 'parameter_type_list', + 'block_item_list', + 'type_qualifier_list', + 'struct_declarator_list' + ] + + for rule in rules_with_opt: + self._create_opt_rule(rule) + + self.cparser = yacc.yacc( + module=self, + start='translation_unit_or_empty', + debug=yacc_debug, + optimize=yacc_optimize, + tabmodule=yacctab, + outputdir=taboutputdir) + + # Stack of scopes for keeping track of symbols. _scope_stack[-1] is + # the current (topmost) scope. Each scope is a dictionary that + # specifies whether a name is a type. If _scope_stack[n][name] is + # True, 'name' is currently a type in the scope. If it's False, + # 'name' is used in the scope but not as a type (for instance, if we + # saw: int name; + # If 'name' is not a key in _scope_stack[n] then 'name' was not defined + # in this scope at all. + self._scope_stack = [dict()] + + # Keeps track of the last token given to yacc (the lookahead token) + self._last_yielded_token = None + + def parse(self, text, filename='', debuglevel=0): + """ Parses C code and returns an AST. + + text: + A string containing the C source code + + filename: + Name of the file being parsed (for meaningful + error messages) + + debuglevel: + Debug level to yacc + """ + self.clex.filename = filename + self.clex.reset_lineno() + self._scope_stack = [dict()] + self._last_yielded_token = None + return self.cparser.parse( + input=text, + lexer=self.clex, + debug=debuglevel) + + ######################-- PRIVATE --###################### + + def _push_scope(self): + self._scope_stack.append(dict()) + + def _pop_scope(self): + assert len(self._scope_stack) > 1 + self._scope_stack.pop() + + def _add_typedef_name(self, name, coord): + """ Add a new typedef name (ie a TYPEID) to the current scope + """ + if not self._scope_stack[-1].get(name, True): + self._parse_error( + "Typedef %r previously declared as non-typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = True + + def _add_identifier(self, name, coord): + """ Add a new object, function, or enum member name (ie an ID) to the + current scope + """ + if self._scope_stack[-1].get(name, False): + self._parse_error( + "Non-typedef %r previously declared as typedef " + "in this scope" % name, coord) + self._scope_stack[-1][name] = False + + def _is_type_in_scope(self, name): + """ Is *name* a typedef-name in the current scope? + """ + for scope in reversed(self._scope_stack): + # If name is an identifier in this scope it shadows typedefs in + # higher scopes. + in_scope = scope.get(name) + if in_scope is not None: return in_scope + return False + + def _lex_error_func(self, msg, line, column): + self._parse_error(msg, self._coord(line, column)) + + def _lex_on_lbrace_func(self): + self._push_scope() + + def _lex_on_rbrace_func(self): + self._pop_scope() + + def _lex_type_lookup_func(self, name): + """ Looks up types that were previously defined with + typedef. + Passed to the lexer for recognizing identifiers that + are types. + """ + is_type = self._is_type_in_scope(name) + return is_type + + def _get_yacc_lookahead_token(self): + """ We need access to yacc's lookahead token in certain cases. + This is the last token yacc requested from the lexer, so we + ask the lexer. + """ + return self.clex.last_token + + # To understand what's going on here, read sections A.8.5 and + # A.8.6 of K&R2 very carefully. + # + # A C type consists of a basic type declaration, with a list + # of modifiers. For example: + # + # int *c[5]; + # + # The basic declaration here is 'int c', and the pointer and + # the array are the modifiers. + # + # Basic declarations are represented by TypeDecl (from module c_ast) and the + # modifiers are FuncDecl, PtrDecl and ArrayDecl. + # + # The standard states that whenever a new modifier is parsed, it should be + # added to the end of the list of modifiers. For example: + # + # K&R2 A.8.6.2: Array Declarators + # + # In a declaration T D where D has the form + # D1 [constant-expression-opt] + # and the type of the identifier in the declaration T D1 is + # "type-modifier T", the type of the + # identifier of D is "type-modifier array of T" + # + # This is what this method does. The declarator it receives + # can be a list of declarators ending with TypeDecl. It + # tacks the modifier to the end of this list, just before + # the TypeDecl. + # + # Additionally, the modifier may be a list itself. This is + # useful for pointers, that can come as a chain from the rule + # p_pointer. In this case, the whole modifier list is spliced + # into the new location. + def _type_modify_decl(self, decl, modifier): + """ Tacks a type modifier on a declarator, and returns + the modified declarator. + + Note: the declarator and modifier may be modified + """ + #~ print '****' + #~ decl.show(offset=3) + #~ modifier.show(offset=3) + #~ print '****' + + modifier_head = modifier + modifier_tail = modifier + + # The modifier may be a nested list. Reach its tail. + # + while modifier_tail.type: + modifier_tail = modifier_tail.type + + # If the decl is a basic type, just tack the modifier onto + # it + # + if isinstance(decl, c_ast.TypeDecl): + modifier_tail.type = decl + return modifier + else: + # Otherwise, the decl is a list of modifiers. Reach + # its tail and splice the modifier onto the tail, + # pointing to the underlying basic type. + # + decl_tail = decl + + while not isinstance(decl_tail.type, c_ast.TypeDecl): + decl_tail = decl_tail.type + + modifier_tail.type = decl_tail.type + decl_tail.type = modifier_head + return decl + + # Due to the order in which declarators are constructed, + # they have to be fixed in order to look like a normal AST. + # + # When a declaration arrives from syntax construction, it has + # these problems: + # * The innermost TypeDecl has no type (because the basic + # type is only known at the uppermost declaration level) + # * The declaration has no variable name, since that is saved + # in the innermost TypeDecl + # * The typename of the declaration is a list of type + # specifiers, and not a node. Here, basic identifier types + # should be separated from more complex types like enums + # and structs. + # + # This method fixes these problems. + # + def _fix_decl_name_type(self, decl, typename): + """ Fixes a declaration. Modifies decl. + """ + # Reach the underlying basic type + # + type = decl + while not isinstance(type, c_ast.TypeDecl): + type = type.type + + decl.name = type.declname + type.quals = decl.quals + + # The typename is a list of types. If any type in this + # list isn't an IdentifierType, it must be the only + # type in the list (it's illegal to declare "int enum ..") + # If all the types are basic, they're collected in the + # IdentifierType holder. + # + for tn in typename: + if not isinstance(tn, c_ast.IdentifierType): + if len(typename) > 1: + self._parse_error( + "Invalid multiple types specified", tn.coord) + else: + type.type = tn + return decl + + if not typename: + # Functions default to returning int + # + if not isinstance(decl.type, c_ast.FuncDecl): + self._parse_error( + "Missing type in declaration", decl.coord) + type.type = c_ast.IdentifierType( + ['int'], + coord=decl.coord) + else: + # At this point, we know that typename is a list of IdentifierType + # nodes. Concatenate all the names into a single list. + # + type.type = c_ast.IdentifierType( + [name for id in typename for name in id.names], + coord=typename[0].coord) + return decl + + def _add_declaration_specifier(self, declspec, newspec, kind, append=False): + """ Declaration specifiers are represented by a dictionary + with the entries: + * qual: a list of type qualifiers + * storage: a list of storage type qualifiers + * type: a list of type specifiers + * function: a list of function specifiers + + This method is given a declaration specifier, and a + new specifier of a given kind. + If `append` is True, the new specifier is added to the end of + the specifiers list, otherwise it's added at the beginning. + Returns the declaration specifier, with the new + specifier incorporated. + """ + spec = declspec or dict(qual=[], storage=[], type=[], function=[]) + + if append: + spec[kind].append(newspec) + else: + spec[kind].insert(0, newspec) + + return spec + + def _build_declarations(self, spec, decls, typedef_namespace=False): + """ Builds a list of declarations all sharing the given specifiers. + If typedef_namespace is true, each declared name is added + to the "typedef namespace", which also includes objects, + functions, and enum constants. + """ + is_typedef = 'typedef' in spec['storage'] + declarations = [] + + # Bit-fields are allowed to be unnamed. + # + if decls[0].get('bitsize') is not None: + pass + + # When redeclaring typedef names as identifiers in inner scopes, a + # problem can occur where the identifier gets grouped into + # spec['type'], leaving decl as None. This can only occur for the + # first declarator. + # + elif decls[0]['decl'] is None: + if len(spec['type']) < 2 or len(spec['type'][-1].names) != 1 or \ + not self._is_type_in_scope(spec['type'][-1].names[0]): + coord = '?' + for t in spec['type']: + if hasattr(t, 'coord'): + coord = t.coord + break + self._parse_error('Invalid declaration', coord) + + # Make this look as if it came from "direct_declarator:ID" + decls[0]['decl'] = c_ast.TypeDecl( + declname=spec['type'][-1].names[0], + type=None, + quals=None, + coord=spec['type'][-1].coord) + # Remove the "new" type's name from the end of spec['type'] + del spec['type'][-1] + + # A similar problem can occur where the declaration ends up looking + # like an abstract declarator. Give it a name if this is the case. + # + elif not isinstance(decls[0]['decl'], + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + decls_0_tail = decls[0]['decl'] + while not isinstance(decls_0_tail, c_ast.TypeDecl): + decls_0_tail = decls_0_tail.type + if decls_0_tail.declname is None: + decls_0_tail.declname = spec['type'][-1].names[0] + del spec['type'][-1] + + for decl in decls: + assert decl['decl'] is not None + if is_typedef: + declaration = c_ast.Typedef( + name=None, + quals=spec['qual'], + storage=spec['storage'], + type=decl['decl'], + coord=decl['decl'].coord) + else: + declaration = c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=decl['decl'], + init=decl.get('init'), + bitsize=decl.get('bitsize'), + coord=decl['decl'].coord) + + if isinstance(declaration.type, + (c_ast.Struct, c_ast.Union, c_ast.IdentifierType)): + fixed_decl = declaration + else: + fixed_decl = self._fix_decl_name_type(declaration, spec['type']) + + # Add the type name defined by typedef to a + # symbol table (for usage in the lexer) + # + if typedef_namespace: + if is_typedef: + self._add_typedef_name(fixed_decl.name, fixed_decl.coord) + else: + self._add_identifier(fixed_decl.name, fixed_decl.coord) + + declarations.append(fixed_decl) + + return declarations + + def _build_function_definition(self, spec, decl, param_decls, body): + """ Builds a function definition. + """ + assert 'typedef' not in spec['storage'] + + declaration = self._build_declarations( + spec=spec, + decls=[dict(decl=decl, init=None)], + typedef_namespace=True)[0] + + return c_ast.FuncDef( + decl=declaration, + param_decls=param_decls, + body=body, + coord=decl.coord) + + def _select_struct_union_class(self, token): + """ Given a token (either STRUCT or UNION), selects the + appropriate AST class. + """ + if token == 'struct': + return c_ast.Struct + else: + return c_ast.Union + + ## + ## Precedence and associativity of operators + ## + precedence = ( + ('left', 'LOR'), + ('left', 'LAND'), + ('left', 'OR'), + ('left', 'XOR'), + ('left', 'AND'), + ('left', 'EQ', 'NE'), + ('left', 'GT', 'GE', 'LT', 'LE'), + ('left', 'RSHIFT', 'LSHIFT'), + ('left', 'PLUS', 'MINUS'), + ('left', 'TIMES', 'DIVIDE', 'MOD') + ) + + ## + ## Grammar productions + ## Implementation of the BNF defined in K&R2 A.13 + ## + + # Wrapper around a translation unit, to allow for empty input. + # Not strictly part of the C99 Grammar, but useful in practice. + # + def p_translation_unit_or_empty(self, p): + """ translation_unit_or_empty : translation_unit + | empty + """ + if p[1] is None: + p[0] = c_ast.FileAST([]) + else: + p[0] = c_ast.FileAST(p[1]) + + def p_translation_unit_1(self, p): + """ translation_unit : external_declaration + """ + # Note: external_declaration is already a list + # + p[0] = p[1] + + def p_translation_unit_2(self, p): + """ translation_unit : translation_unit external_declaration + """ + if p[2] is not None: + p[1].extend(p[2]) + p[0] = p[1] + + # Declarations always come as lists (because they can be + # several in one line), so we wrap the function definition + # into a list as well, to make the return value of + # external_declaration homogenous. + # + def p_external_declaration_1(self, p): + """ external_declaration : function_definition + """ + p[0] = [p[1]] + + def p_external_declaration_2(self, p): + """ external_declaration : declaration + """ + p[0] = p[1] + + def p_external_declaration_3(self, p): + """ external_declaration : pp_directive + | pppragma_directive + """ + p[0] = [p[1]] + + def p_external_declaration_4(self, p): + """ external_declaration : SEMI + """ + p[0] = None + + def p_pp_directive(self, p): + """ pp_directive : PPHASH + """ + self._parse_error('Directives not supported yet', + self._token_coord(p, 1)) + + def p_pppragma_directive(self, p): + """ pppragma_directive : PPPRAGMA + | PPPRAGMA PPPRAGMASTR + """ + if len(p) == 3: + p[0] = c_ast.Pragma(p[2], self._token_coord(p, 2)) + else: + p[0] = c_ast.Pragma("", self._token_coord(p, 1)) + + # In function definitions, the declarator can be followed by + # a declaration list, for old "K&R style" function definitios. + # + def p_function_definition_1(self, p): + """ function_definition : id_declarator declaration_list_opt compound_statement + """ + # no declaration specifiers - 'int' becomes the default type + spec = dict( + qual=[], + storage=[], + type=[c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))], + function=[]) + + p[0] = self._build_function_definition( + spec=spec, + decl=p[1], + param_decls=p[2], + body=p[3]) + + def p_function_definition_2(self, p): + """ function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement + """ + spec = p[1] + + p[0] = self._build_function_definition( + spec=spec, + decl=p[2], + param_decls=p[3], + body=p[4]) + + def p_statement(self, p): + """ statement : labeled_statement + | expression_statement + | compound_statement + | selection_statement + | iteration_statement + | jump_statement + | pppragma_directive + """ + p[0] = p[1] + + # In C, declarations can come several in a line: + # int x, *px, romulo = 5; + # + # However, for the AST, we will split them to separate Decl + # nodes. + # + # This rule splits its declarations and always returns a list + # of Decl nodes, even if it's one element long. + # + def p_decl_body(self, p): + """ decl_body : declaration_specifiers init_declarator_list_opt + | declaration_specifiers_no_type id_init_declarator_list_opt + """ + spec = p[1] + + # p[2] (init_declarator_list_opt) is either a list or None + # + if p[2] is None: + # By the standard, you must have at least one declarator unless + # declaring a structure tag, a union tag, or the members of an + # enumeration. + # + ty = spec['type'] + s_u_or_e = (c_ast.Struct, c_ast.Union, c_ast.Enum) + if len(ty) == 1 and isinstance(ty[0], s_u_or_e): + decls = [c_ast.Decl( + name=None, + quals=spec['qual'], + storage=spec['storage'], + funcspec=spec['function'], + type=ty[0], + init=None, + bitsize=None, + coord=ty[0].coord)] + + # However, this case can also occur on redeclared identifiers in + # an inner scope. The trouble is that the redeclared type's name + # gets grouped into declaration_specifiers; _build_declarations + # compensates for this. + # + else: + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)], + typedef_namespace=True) + + else: + decls = self._build_declarations( + spec=spec, + decls=p[2], + typedef_namespace=True) + + p[0] = decls + + # The declaration has been split to a decl_body sub-rule and + # SEMI, because having them in a single rule created a problem + # for defining typedefs. + # + # If a typedef line was directly followed by a line using the + # type defined with the typedef, the type would not be + # recognized. This is because to reduce the declaration rule, + # the parser's lookahead asked for the token after SEMI, which + # was the type from the next line, and the lexer had no chance + # to see the updated type symbol table. + # + # Splitting solves this problem, because after seeing SEMI, + # the parser reduces decl_body, which actually adds the new + # type into the table to be seen by the lexer before the next + # line is reached. + def p_declaration(self, p): + """ declaration : decl_body SEMI + """ + p[0] = p[1] + + # Since each declaration is a list of declarations, this + # rule will combine all the declarations and return a single + # list + # + def p_declaration_list(self, p): + """ declaration_list : declaration + | declaration_list declaration + """ + p[0] = p[1] if len(p) == 2 else p[1] + p[2] + + # To know when declaration-specifiers end and declarators begin, + # we require declaration-specifiers to have at least one + # type-specifier, and disallow typedef-names after we've seen any + # type-specifier. These are both required by the spec. + # + def p_declaration_specifiers_no_type_1(self, p): + """ declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'qual') + + def p_declaration_specifiers_no_type_2(self, p): + """ declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'storage') + + def p_declaration_specifiers_no_type_3(self, p): + """ declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt + """ + p[0] = self._add_declaration_specifier(p[2], p[1], 'function') + + + def p_declaration_specifiers_1(self, p): + """ declaration_specifiers : declaration_specifiers type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_declaration_specifiers_2(self, p): + """ declaration_specifiers : declaration_specifiers storage_class_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'storage', append=True) + + def p_declaration_specifiers_3(self, p): + """ declaration_specifiers : declaration_specifiers function_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'function', append=True) + + def p_declaration_specifiers_4(self, p): + """ declaration_specifiers : declaration_specifiers type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_declaration_specifiers_5(self, p): + """ declaration_specifiers : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_declaration_specifiers_6(self, p): + """ declaration_specifiers : declaration_specifiers_no_type type_specifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + + def p_storage_class_specifier(self, p): + """ storage_class_specifier : AUTO + | REGISTER + | STATIC + | EXTERN + | TYPEDEF + """ + p[0] = p[1] + + def p_function_specifier(self, p): + """ function_specifier : INLINE + """ + p[0] = p[1] + + def p_type_specifier_no_typeid(self, p): + """ type_specifier_no_typeid : VOID + | _BOOL + | CHAR + | SHORT + | INT + | LONG + | FLOAT + | DOUBLE + | _COMPLEX + | SIGNED + | UNSIGNED + | __INT128 + """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_type_specifier(self, p): + """ type_specifier : typedef_name + | enum_specifier + | struct_or_union_specifier + | type_specifier_no_typeid + """ + p[0] = p[1] + + def p_type_qualifier(self, p): + """ type_qualifier : CONST + | RESTRICT + | VOLATILE + """ + p[0] = p[1] + + def p_init_declarator_list(self, p): + """ init_declarator_list : init_declarator + | init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # Returns a {decl= : init=} dictionary + # If there's no initializer, uses None + # + def p_init_declarator(self, p): + """ init_declarator : declarator + | declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + def p_id_init_declarator_list(self, p): + """ id_init_declarator_list : id_init_declarator + | id_init_declarator_list COMMA init_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + def p_id_init_declarator(self, p): + """ id_init_declarator : id_declarator + | id_declarator EQUALS initializer + """ + p[0] = dict(decl=p[1], init=(p[3] if len(p) > 2 else None)) + + # Require at least one type specifier in a specifier-qualifier-list + # + def p_specifier_qualifier_list_1(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'type', append=True) + + def p_specifier_qualifier_list_2(self, p): + """ specifier_qualifier_list : specifier_qualifier_list type_qualifier + """ + p[0] = self._add_declaration_specifier(p[1], p[2], 'qual', append=True) + + def p_specifier_qualifier_list_3(self, p): + """ specifier_qualifier_list : type_specifier + """ + p[0] = self._add_declaration_specifier(None, p[1], 'type') + + def p_specifier_qualifier_list_4(self, p): + """ specifier_qualifier_list : type_qualifier_list type_specifier + """ + spec = dict(qual=p[1], storage=[], type=[], function=[]) + p[0] = self._add_declaration_specifier(spec, p[2], 'type', append=True) + + # TYPEID is allowed here (and in other struct/enum related tag names), because + # struct/enum tags reside in their own namespace and can be named the same as types + # + def p_struct_or_union_specifier_1(self, p): + """ struct_or_union_specifier : struct_or_union ID + | struct_or_union TYPEID + """ + klass = self._select_struct_union_class(p[1]) + p[0] = klass( + name=p[2], + decls=None, + coord=self._token_coord(p, 2)) + + def p_struct_or_union_specifier_2(self, p): + """ struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close + """ + klass = self._select_struct_union_class(p[1]) + p[0] = klass( + name=None, + decls=p[3], + coord=self._token_coord(p, 2)) + + def p_struct_or_union_specifier_3(self, p): + """ struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close + | struct_or_union TYPEID brace_open struct_declaration_list brace_close + """ + klass = self._select_struct_union_class(p[1]) + p[0] = klass( + name=p[2], + decls=p[4], + coord=self._token_coord(p, 2)) + + def p_struct_or_union(self, p): + """ struct_or_union : STRUCT + | UNION + """ + p[0] = p[1] + + # Combine all declarations into a single list + # + def p_struct_declaration_list(self, p): + """ struct_declaration_list : struct_declaration + | struct_declaration_list struct_declaration + """ + if len(p) == 2: + p[0] = p[1] or [] + else: + p[0] = p[1] + (p[2] or []) + + def p_struct_declaration_1(self, p): + """ struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI + """ + spec = p[1] + assert 'typedef' not in spec['storage'] + + if p[2] is not None: + decls = self._build_declarations( + spec=spec, + decls=p[2]) + + elif len(spec['type']) == 1: + # Anonymous struct/union, gcc extension, C1x feature. + # Although the standard only allows structs/unions here, I see no + # reason to disallow other types since some compilers have typedefs + # here, and pycparser isn't about rejecting all invalid code. + # + node = spec['type'][0] + if isinstance(node, c_ast.Node): + decl_type = node + else: + decl_type = c_ast.IdentifierType(node) + + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=decl_type)]) + + else: + # Structure/union members can have the same names as typedefs. + # The trouble is that the member's name gets grouped into + # specifier_qualifier_list; _build_declarations compensates. + # + decls = self._build_declarations( + spec=spec, + decls=[dict(decl=None, init=None)]) + + p[0] = decls + + def p_struct_declaration_2(self, p): + """ struct_declaration : SEMI + """ + p[0] = None + + def p_struct_declarator_list(self, p): + """ struct_declarator_list : struct_declarator + | struct_declarator_list COMMA struct_declarator + """ + p[0] = p[1] + [p[3]] if len(p) == 4 else [p[1]] + + # struct_declarator passes up a dict with the keys: decl (for + # the underlying declarator) and bitsize (for the bitsize) + # + def p_struct_declarator_1(self, p): + """ struct_declarator : declarator + """ + p[0] = {'decl': p[1], 'bitsize': None} + + def p_struct_declarator_2(self, p): + """ struct_declarator : declarator COLON constant_expression + | COLON constant_expression + """ + if len(p) > 3: + p[0] = {'decl': p[1], 'bitsize': p[3]} + else: + p[0] = {'decl': c_ast.TypeDecl(None, None, None), 'bitsize': p[2]} + + def p_enum_specifier_1(self, p): + """ enum_specifier : ENUM ID + | ENUM TYPEID + """ + p[0] = c_ast.Enum(p[2], None, self._token_coord(p, 1)) + + def p_enum_specifier_2(self, p): + """ enum_specifier : ENUM brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(None, p[3], self._token_coord(p, 1)) + + def p_enum_specifier_3(self, p): + """ enum_specifier : ENUM ID brace_open enumerator_list brace_close + | ENUM TYPEID brace_open enumerator_list brace_close + """ + p[0] = c_ast.Enum(p[2], p[4], self._token_coord(p, 1)) + + def p_enumerator_list(self, p): + """ enumerator_list : enumerator + | enumerator_list COMMA + | enumerator_list COMMA enumerator + """ + if len(p) == 2: + p[0] = c_ast.EnumeratorList([p[1]], p[1].coord) + elif len(p) == 3: + p[0] = p[1] + else: + p[1].enumerators.append(p[3]) + p[0] = p[1] + + def p_enumerator(self, p): + """ enumerator : ID + | ID EQUALS constant_expression + """ + if len(p) == 2: + enumerator = c_ast.Enumerator( + p[1], None, + self._token_coord(p, 1)) + else: + enumerator = c_ast.Enumerator( + p[1], p[3], + self._token_coord(p, 1)) + self._add_identifier(enumerator.name, enumerator.coord) + + p[0] = enumerator + + def p_declarator(self, p): + """ declarator : id_declarator + | typeid_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator + """ + p[0] = p[1] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_1(self, p): + """ direct_xxx_declarator : yyy + """ + p[0] = c_ast.TypeDecl( + declname=p[1], + type=None, + quals=None, + coord=self._token_coord(p, 1)) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID')) + def p_direct_xxx_declarator_2(self, p): + """ direct_xxx_declarator : LPAREN xxx_declarator RPAREN + """ + p[0] = p[2] + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_3(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET + """ + quals = (p[3] if len(p) > 5 else []) or [] + # Accept dimension qualifiers + # Per C99 6.7.5.3 p7 + arr = c_ast.ArrayDecl( + type=None, + dim=p[4] if len(p) > 5 else p[3], + dim_quals=quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_4(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET + | direct_xxx_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET + """ + # Using slice notation for PLY objects doesn't work in Python 3 for the + # version of PLY embedded with pycparser; see PLY Google Code issue 30. + # Work around that here by listing the two elements separately. + listed_quals = [item if isinstance(item, list) else [item] + for item in [p[3],p[4]]] + dim_quals = [qual for sublist in listed_quals for qual in sublist + if qual is not None] + arr = c_ast.ArrayDecl( + type=None, + dim=p[5], + dim_quals=dim_quals, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + # Special for VLAs + # + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_5(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[4], self._token_coord(p, 4)), + dim_quals=p[3] if p[3] != None else [], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list RPAREN + | direct_xxx_declarator LPAREN identifier_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + # To see why _get_yacc_lookahead_token is needed, consider: + # typedef char TT; + # void foo(int TT) { TT = 10; } + # Outside the function, TT is a typedef, but inside (starting and + # ending with the braces) it's a parameter. The trouble begins with + # yacc's lookahead token. We don't know if we're declaring or + # defining a function until we see LBRACE, but if we wait for yacc to + # trigger a rule on that token, then TT will have already been read + # and incorrectly interpreted as TYPEID. We need to add the + # parameters to the scope the moment the lexer sees LBRACE. + # + if self._get_yacc_lookahead_token().type == "LBRACE": + if func.args is not None: + for param in func.args.params: + if isinstance(param, c_ast.EllipsisParam): break + self._add_identifier(param.name, param.coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_pointer(self, p): + """ pointer : TIMES type_qualifier_list_opt + | TIMES type_qualifier_list_opt pointer + """ + coord = self._token_coord(p, 1) + # Pointer decls nest from inside out. This is important when different + # levels have different qualifiers. For example: + # + # char * const * p; + # + # Means "pointer to const pointer to char" + # + # While: + # + # char ** const p; + # + # Means "const pointer to pointer to char" + # + # So when we construct PtrDecl nestings, the leftmost pointer goes in + # as the most nested type. + nested_type = c_ast.PtrDecl(quals=p[2] or [], type=None, coord=coord) + if len(p) > 3: + tail_type = p[3] + while tail_type.type is not None: + tail_type = tail_type.type + tail_type.type = nested_type + p[0] = p[3] + else: + p[0] = nested_type + + def p_type_qualifier_list(self, p): + """ type_qualifier_list : type_qualifier + | type_qualifier_list type_qualifier + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_parameter_type_list(self, p): + """ parameter_type_list : parameter_list + | parameter_list COMMA ELLIPSIS + """ + if len(p) > 2: + p[1].params.append(c_ast.EllipsisParam(self._token_coord(p, 3))) + + p[0] = p[1] + + def p_parameter_list(self, p): + """ parameter_list : parameter_declaration + | parameter_list COMMA parameter_declaration + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + # From ISO/IEC 9899:TC2, 6.7.5.3.11: + # "If, in a parameter declaration, an identifier can be treated either + # as a typedef name or as a parameter name, it shall be taken as a + # typedef name." + # + # Inside a parameter declaration, once we've reduced declaration specifiers, + # if we shift in an LPAREN and see a TYPEID, it could be either an abstract + # declarator or a declarator nested inside parens. This rule tells us to + # always treat it as an abstract declarator. Therefore, we only accept + # `id_declarator`s and `typeid_noparen_declarator`s. + def p_parameter_declaration_1(self, p): + """ parameter_declaration : declaration_specifiers id_declarator + | declaration_specifiers typeid_noparen_declarator + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + p[0] = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2])])[0] + + def p_parameter_declaration_2(self, p): + """ parameter_declaration : declaration_specifiers abstract_declarator_opt + """ + spec = p[1] + if not spec['type']: + spec['type'] = [c_ast.IdentifierType(['int'], + coord=self._token_coord(p, 1))] + + # Parameters can have the same names as typedefs. The trouble is that + # the parameter's name gets grouped into declaration_specifiers, making + # it look like an old-style declaration; compensate. + # + if len(spec['type']) > 1 and len(spec['type'][-1].names) == 1 and \ + self._is_type_in_scope(spec['type'][-1].names[0]): + decl = self._build_declarations( + spec=spec, + decls=[dict(decl=p[2], init=None)])[0] + + # This truly is an old-style parameter declaration + # + else: + decl = c_ast.Typename( + name='', + quals=spec['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + typename = spec['type'] + decl = self._fix_decl_name_type(decl, typename) + + p[0] = decl + + def p_identifier_list(self, p): + """ identifier_list : identifier + | identifier_list COMMA identifier + """ + if len(p) == 2: # single parameter + p[0] = c_ast.ParamList([p[1]], p[1].coord) + else: + p[1].params.append(p[3]) + p[0] = p[1] + + def p_initializer_1(self, p): + """ initializer : assignment_expression + """ + p[0] = p[1] + + def p_initializer_2(self, p): + """ initializer : brace_open initializer_list_opt brace_close + | brace_open initializer_list COMMA brace_close + """ + if p[2] is None: + p[0] = c_ast.InitList([], self._token_coord(p, 1)) + else: + p[0] = p[2] + + def p_initializer_list(self, p): + """ initializer_list : designation_opt initializer + | initializer_list COMMA designation_opt initializer + """ + if len(p) == 3: # single initializer + init = p[2] if p[1] is None else c_ast.NamedInitializer(p[1], p[2]) + p[0] = c_ast.InitList([init], p[2].coord) + else: + init = p[4] if p[3] is None else c_ast.NamedInitializer(p[3], p[4]) + p[1].exprs.append(init) + p[0] = p[1] + + def p_designation(self, p): + """ designation : designator_list EQUALS + """ + p[0] = p[1] + + # Designators are represented as a list of nodes, in the order in which + # they're written in the code. + # + def p_designator_list(self, p): + """ designator_list : designator + | designator_list designator + """ + p[0] = [p[1]] if len(p) == 2 else p[1] + [p[2]] + + def p_designator(self, p): + """ designator : LBRACKET constant_expression RBRACKET + | PERIOD identifier + """ + p[0] = p[2] + + def p_type_name(self, p): + """ type_name : specifier_qualifier_list abstract_declarator_opt + """ + typename = c_ast.Typename( + name='', + quals=p[1]['qual'], + type=p[2] or c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 2)) + + p[0] = self._fix_decl_name_type(typename, p[1]['type']) + + def p_abstract_declarator_1(self, p): + """ abstract_declarator : pointer + """ + dummytype = c_ast.TypeDecl(None, None, None) + p[0] = self._type_modify_decl( + decl=dummytype, + modifier=p[1]) + + def p_abstract_declarator_2(self, p): + """ abstract_declarator : pointer direct_abstract_declarator + """ + p[0] = self._type_modify_decl(p[2], p[1]) + + def p_abstract_declarator_3(self, p): + """ abstract_declarator : direct_abstract_declarator + """ + p[0] = p[1] + + # Creating and using direct_abstract_declarator_opt here + # instead of listing both direct_abstract_declarator and the + # lack of it in the beginning of _1 and _2 caused two + # shift/reduce errors. + # + def p_direct_abstract_declarator_1(self, p): + """ direct_abstract_declarator : LPAREN abstract_declarator RPAREN """ + p[0] = p[2] + + def p_direct_abstract_declarator_2(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=p[3], + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_3(self, p): + """ direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=p[2], + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_4(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET + """ + arr = c_ast.ArrayDecl( + type=None, + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=arr) + + def p_direct_abstract_declarator_5(self, p): + """ direct_abstract_declarator : LBRACKET TIMES RBRACKET + """ + p[0] = c_ast.ArrayDecl( + type=c_ast.TypeDecl(None, None, None), + dim=c_ast.ID(p[3], self._token_coord(p, 3)), + dim_quals=[], + coord=self._token_coord(p, 1)) + + def p_direct_abstract_declarator_6(self, p): + """ direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN + """ + func = c_ast.FuncDecl( + args=p[3], + type=None, + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_direct_abstract_declarator_7(self, p): + """ direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN + """ + p[0] = c_ast.FuncDecl( + args=p[2], + type=c_ast.TypeDecl(None, None, None), + coord=self._token_coord(p, 1)) + + # declaration is a list, statement isn't. To make it consistent, block_item + # will always be a list + # + def p_block_item(self, p): + """ block_item : declaration + | statement + """ + p[0] = p[1] if isinstance(p[1], list) else [p[1]] + + # Since we made block_item a list, this just combines lists + # + def p_block_item_list(self, p): + """ block_item_list : block_item + | block_item_list block_item + """ + # Empty block items (plain ';') produce [None], so ignore them + p[0] = p[1] if (len(p) == 2 or p[2] == [None]) else p[1] + p[2] + + def p_compound_statement_1(self, p): + """ compound_statement : brace_open block_item_list_opt brace_close """ + p[0] = c_ast.Compound( + block_items=p[2], + coord=self._token_coord(p, 1)) + + def p_labeled_statement_1(self, p): + """ labeled_statement : ID COLON statement """ + p[0] = c_ast.Label(p[1], p[3], self._token_coord(p, 1)) + + def p_labeled_statement_2(self, p): + """ labeled_statement : CASE constant_expression COLON statement """ + p[0] = c_ast.Case(p[2], [p[4]], self._token_coord(p, 1)) + + def p_labeled_statement_3(self, p): + """ labeled_statement : DEFAULT COLON statement """ + p[0] = c_ast.Default([p[3]], self._token_coord(p, 1)) + + def p_selection_statement_1(self, p): + """ selection_statement : IF LPAREN expression RPAREN statement """ + p[0] = c_ast.If(p[3], p[5], None, self._token_coord(p, 1)) + + def p_selection_statement_2(self, p): + """ selection_statement : IF LPAREN expression RPAREN statement ELSE statement """ + p[0] = c_ast.If(p[3], p[5], p[7], self._token_coord(p, 1)) + + def p_selection_statement_3(self, p): + """ selection_statement : SWITCH LPAREN expression RPAREN statement """ + p[0] = fix_switch_cases( + c_ast.Switch(p[3], p[5], self._token_coord(p, 1))) + + def p_iteration_statement_1(self, p): + """ iteration_statement : WHILE LPAREN expression RPAREN statement """ + p[0] = c_ast.While(p[3], p[5], self._token_coord(p, 1)) + + def p_iteration_statement_2(self, p): + """ iteration_statement : DO statement WHILE LPAREN expression RPAREN SEMI """ + p[0] = c_ast.DoWhile(p[5], p[2], self._token_coord(p, 1)) + + def p_iteration_statement_3(self, p): + """ iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement """ + p[0] = c_ast.For(p[3], p[5], p[7], p[9], self._token_coord(p, 1)) + + def p_iteration_statement_4(self, p): + """ iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement """ + p[0] = c_ast.For(c_ast.DeclList(p[3], self._token_coord(p, 1)), + p[4], p[6], p[8], self._token_coord(p, 1)) + + def p_jump_statement_1(self, p): + """ jump_statement : GOTO ID SEMI """ + p[0] = c_ast.Goto(p[2], self._token_coord(p, 1)) + + def p_jump_statement_2(self, p): + """ jump_statement : BREAK SEMI """ + p[0] = c_ast.Break(self._token_coord(p, 1)) + + def p_jump_statement_3(self, p): + """ jump_statement : CONTINUE SEMI """ + p[0] = c_ast.Continue(self._token_coord(p, 1)) + + def p_jump_statement_4(self, p): + """ jump_statement : RETURN expression SEMI + | RETURN SEMI + """ + p[0] = c_ast.Return(p[2] if len(p) == 4 else None, self._token_coord(p, 1)) + + def p_expression_statement(self, p): + """ expression_statement : expression_opt SEMI """ + if p[1] is None: + p[0] = c_ast.EmptyStatement(self._token_coord(p, 2)) + else: + p[0] = p[1] + + def p_expression(self, p): + """ expression : assignment_expression + | expression COMMA assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + if not isinstance(p[1], c_ast.ExprList): + p[1] = c_ast.ExprList([p[1]], p[1].coord) + + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_typedef_name(self, p): + """ typedef_name : TYPEID """ + p[0] = c_ast.IdentifierType([p[1]], coord=self._token_coord(p, 1)) + + def p_assignment_expression(self, p): + """ assignment_expression : conditional_expression + | unary_expression assignment_operator assignment_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.Assignment(p[2], p[1], p[3], p[1].coord) + + # K&R2 defines these as many separate rules, to encode + # precedence and associativity. Why work hard ? I'll just use + # the built in precedence/associativity specification feature + # of PLY. (see precedence declaration above) + # + def p_assignment_operator(self, p): + """ assignment_operator : EQUALS + | XOREQUAL + | TIMESEQUAL + | DIVEQUAL + | MODEQUAL + | PLUSEQUAL + | MINUSEQUAL + | LSHIFTEQUAL + | RSHIFTEQUAL + | ANDEQUAL + | OREQUAL + """ + p[0] = p[1] + + def p_constant_expression(self, p): + """ constant_expression : conditional_expression """ + p[0] = p[1] + + def p_conditional_expression(self, p): + """ conditional_expression : binary_expression + | binary_expression CONDOP expression COLON conditional_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.TernaryOp(p[1], p[3], p[5], p[1].coord) + + def p_binary_expression(self, p): + """ binary_expression : cast_expression + | binary_expression TIMES binary_expression + | binary_expression DIVIDE binary_expression + | binary_expression MOD binary_expression + | binary_expression PLUS binary_expression + | binary_expression MINUS binary_expression + | binary_expression RSHIFT binary_expression + | binary_expression LSHIFT binary_expression + | binary_expression LT binary_expression + | binary_expression LE binary_expression + | binary_expression GE binary_expression + | binary_expression GT binary_expression + | binary_expression EQ binary_expression + | binary_expression NE binary_expression + | binary_expression AND binary_expression + | binary_expression OR binary_expression + | binary_expression XOR binary_expression + | binary_expression LAND binary_expression + | binary_expression LOR binary_expression + """ + if len(p) == 2: + p[0] = p[1] + else: + p[0] = c_ast.BinaryOp(p[2], p[1], p[3], p[1].coord) + + def p_cast_expression_1(self, p): + """ cast_expression : unary_expression """ + p[0] = p[1] + + def p_cast_expression_2(self, p): + """ cast_expression : LPAREN type_name RPAREN cast_expression """ + p[0] = c_ast.Cast(p[2], p[4], self._token_coord(p, 1)) + + def p_unary_expression_1(self, p): + """ unary_expression : postfix_expression """ + p[0] = p[1] + + def p_unary_expression_2(self, p): + """ unary_expression : PLUSPLUS unary_expression + | MINUSMINUS unary_expression + | unary_operator cast_expression + """ + p[0] = c_ast.UnaryOp(p[1], p[2], p[2].coord) + + def p_unary_expression_3(self, p): + """ unary_expression : SIZEOF unary_expression + | SIZEOF LPAREN type_name RPAREN + """ + p[0] = c_ast.UnaryOp( + p[1], + p[2] if len(p) == 3 else p[3], + self._token_coord(p, 1)) + + def p_unary_operator(self, p): + """ unary_operator : AND + | TIMES + | PLUS + | MINUS + | NOT + | LNOT + """ + p[0] = p[1] + + def p_postfix_expression_1(self, p): + """ postfix_expression : primary_expression """ + p[0] = p[1] + + def p_postfix_expression_2(self, p): + """ postfix_expression : postfix_expression LBRACKET expression RBRACKET """ + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + + def p_postfix_expression_3(self, p): + """ postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN + | postfix_expression LPAREN RPAREN + """ + p[0] = c_ast.FuncCall(p[1], p[3] if len(p) == 5 else None, p[1].coord) + + def p_postfix_expression_4(self, p): + """ postfix_expression : postfix_expression PERIOD ID + | postfix_expression PERIOD TYPEID + | postfix_expression ARROW ID + | postfix_expression ARROW TYPEID + """ + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + + def p_postfix_expression_5(self, p): + """ postfix_expression : postfix_expression PLUSPLUS + | postfix_expression MINUSMINUS + """ + p[0] = c_ast.UnaryOp('p' + p[2], p[1], p[1].coord) + + def p_postfix_expression_6(self, p): + """ postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close + | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close + """ + p[0] = c_ast.CompoundLiteral(p[2], p[5]) + + def p_primary_expression_1(self, p): + """ primary_expression : identifier """ + p[0] = p[1] + + def p_primary_expression_2(self, p): + """ primary_expression : constant """ + p[0] = p[1] + + def p_primary_expression_3(self, p): + """ primary_expression : unified_string_literal + | unified_wstring_literal + """ + p[0] = p[1] + + def p_primary_expression_4(self, p): + """ primary_expression : LPAREN expression RPAREN """ + p[0] = p[2] + + def p_primary_expression_5(self, p): + """ primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN + """ + coord = self._token_coord(p, 1) + p[0] = c_ast.FuncCall(c_ast.ID(p[1], coord), + c_ast.ExprList([p[3], p[5]], coord), + coord) + + def p_offsetof_member_designator(self, p): + """ offsetof_member_designator : identifier + | offsetof_member_designator PERIOD identifier + | offsetof_member_designator LBRACKET expression RBRACKET + """ + if len(p) == 2: + p[0] = p[1] + elif len(p) == 4: + field = c_ast.ID(p[3], self._token_coord(p, 3)) + p[0] = c_ast.StructRef(p[1], p[2], field, p[1].coord) + elif len(p) == 5: + p[0] = c_ast.ArrayRef(p[1], p[3], p[1].coord) + else: + raise NotImplementedError("Unexpected parsing state. len(p): %u" % len(p)) + + def p_argument_expression_list(self, p): + """ argument_expression_list : assignment_expression + | argument_expression_list COMMA assignment_expression + """ + if len(p) == 2: # single expr + p[0] = c_ast.ExprList([p[1]], p[1].coord) + else: + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_identifier(self, p): + """ identifier : ID """ + p[0] = c_ast.ID(p[1], self._token_coord(p, 1)) + + def p_constant_1(self, p): + """ constant : INT_CONST_DEC + | INT_CONST_OCT + | INT_CONST_HEX + | INT_CONST_BIN + """ + p[0] = c_ast.Constant( + 'int', p[1], self._token_coord(p, 1)) + + def p_constant_2(self, p): + """ constant : FLOAT_CONST + | HEX_FLOAT_CONST + """ + p[0] = c_ast.Constant( + 'float', p[1], self._token_coord(p, 1)) + + def p_constant_3(self, p): + """ constant : CHAR_CONST + | WCHAR_CONST + """ + p[0] = c_ast.Constant( + 'char', p[1], self._token_coord(p, 1)) + + # The "unified" string and wstring literal rules are for supporting + # concatenation of adjacent string literals. + # I.e. "hello " "world" is seen by the C compiler as a single string literal + # with the value "hello world" + # + def p_unified_string_literal(self, p): + """ unified_string_literal : STRING_LITERAL + | unified_string_literal STRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value[:-1] + p[2][1:] + p[0] = p[1] + + def p_unified_wstring_literal(self, p): + """ unified_wstring_literal : WSTRING_LITERAL + | unified_wstring_literal WSTRING_LITERAL + """ + if len(p) == 2: # single literal + p[0] = c_ast.Constant( + 'string', p[1], self._token_coord(p, 1)) + else: + p[1].value = p[1].value.rstrip()[:-1] + p[2][2:] + p[0] = p[1] + + def p_brace_open(self, p): + """ brace_open : LBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_brace_close(self, p): + """ brace_close : RBRACE + """ + p[0] = p[1] + p.set_lineno(0, p.lineno(1)) + + def p_empty(self, p): + 'empty : ' + p[0] = None + + def p_error(self, p): + # If error recovery is added here in the future, make sure + # _get_yacc_lookahead_token still works! + # + if p: + self._parse_error( + 'before: %s' % p.value, + self._coord(lineno=p.lineno, + column=self.clex.find_tok_column(p))) + else: + self._parse_error('At end of input', self.clex.filename) + + +#------------------------------------------------------------------------------ +if __name__ == "__main__": + import pprint + import time, sys + + #t1 = time.time() + #parser = CParser(lex_optimize=True, yacc_debug=True, yacc_optimize=False) + #sys.write(time.time() - t1) + + #buf = ''' + #int (*k)(int); + #''' + + ## set debuglevel to 2 for debugging + #t = parser.parse(buf, 'x.c', debuglevel=0) + #t.show(showcoord=True) + diff --git a/utils/cseq-1.9/pycparser/lextab.py b/utils/cseq-1.9/pycparser/lextab.py new file mode 100644 index 000000000..eb3ae07d5 --- /dev/null +++ b/utils/cseq-1.9/pycparser/lextab.py @@ -0,0 +1,10 @@ +# lextab.py. This file automatically created by PLY (version 3.10). Don't edit! +_tabversion = '3.10' +_lextokens = set(('VOID', 'LBRACKET', 'WCHAR_CONST', 'FLOAT_CONST', 'MINUS', 'RPAREN', 'LONG', 'PLUS', 'ELLIPSIS', 'GT', 'GOTO', 'ENUM', 'PERIOD', 'GE', 'INT_CONST_DEC', 'ARROW', '__INT128', 'HEX_FLOAT_CONST', 'DOUBLE', 'MINUSEQUAL', 'INT_CONST_OCT', 'TIMESEQUAL', 'OR', 'SHORT', 'RETURN', 'RSHIFTEQUAL', 'RESTRICT', 'STATIC', 'SIZEOF', 'UNSIGNED', 'UNION', 'COLON', 'WSTRING_LITERAL', 'DIVIDE', 'FOR', 'PLUSPLUS', 'EQUALS', 'ELSE', 'INLINE', 'EQ', 'AND', 'TYPEID', 'LBRACE', 'PPHASH', 'INT', 'SIGNED', 'CONTINUE', 'NOT', 'OREQUAL', 'MOD', 'RSHIFT', 'DEFAULT', 'CHAR', 'WHILE', 'DIVEQUAL', 'EXTERN', 'CASE', 'LAND', 'REGISTER', 'MODEQUAL', 'NE', 'SWITCH', 'INT_CONST_HEX', '_COMPLEX', 'PPPRAGMASTR', 'PLUSEQUAL', 'STRUCT', 'CONDOP', 'BREAK', 'VOLATILE', 'PPPRAGMA', 'ANDEQUAL', 'INT_CONST_BIN', 'DO', 'LNOT', 'CONST', 'LOR', 'CHAR_CONST', 'LSHIFT', 'RBRACE', '_BOOL', 'LE', 'SEMI', 'LT', 'COMMA', 'OFFSETOF', 'TYPEDEF', 'XOR', 'AUTO', 'TIMES', 'LPAREN', 'MINUSMINUS', 'ID', 'IF', 'STRING_LITERAL', 'FLOAT', 'XOREQUAL', 'LSHIFTEQUAL', 'RBRACKET')) +_lexreflags = 64 +_lexliterals = '' +_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} +_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])], 'INITIAL': [('(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))[FfLl]?))|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*?([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} +_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t', 'INITIAL': ' \t'} +_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateeoff = {} diff --git a/utils/cseq-1.9/pycparser/ply/__init__.py b/utils/cseq-1.9/pycparser/ply/__init__.py new file mode 100644 index 000000000..6e53cddcf --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/__init__.py @@ -0,0 +1,5 @@ +# PLY package +# Author: David Beazley (dave@dabeaz.com) + +__version__ = '3.9' +__all__ = ['lex','yacc'] diff --git a/utils/cseq-1.9/pycparser/ply/cpp.py b/utils/cseq-1.9/pycparser/ply/cpp.py new file mode 100644 index 000000000..8ff0be1c8 --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/cpp.py @@ -0,0 +1,907 @@ +# ----------------------------------------------------------------------------- +# cpp.py +# +# Author: David Beazley (http://www.dabeaz.com) +# Copyright (C) 2017 +# All rights reserved +# +# This module implements an ANSI-C style lexical preprocessor for PLY. +# ----------------------------------------------------------------------------- +from __future__ import generators + +import sys + +# Some Python 3 compatibility shims +if sys.version_info.major < 3: + STRING_TYPES = (str, unicode) +else: + STRING_TYPES = str + xrange = range + +# ----------------------------------------------------------------------------- +# Default preprocessor lexer definitions. These tokens are enough to get +# a basic preprocessor working. Other modules may import these if they want +# ----------------------------------------------------------------------------- + +tokens = ( + 'CPP_ID','CPP_INTEGER', 'CPP_FLOAT', 'CPP_STRING', 'CPP_CHAR', 'CPP_WS', 'CPP_COMMENT1', 'CPP_COMMENT2', 'CPP_POUND','CPP_DPOUND' +) + +literals = "+-*/%|&~^<>=!?()[]{}.,;:\\\'\"" + +# Whitespace +def t_CPP_WS(t): + r'\s+' + t.lexer.lineno += t.value.count("\n") + return t + +t_CPP_POUND = r'\#' +t_CPP_DPOUND = r'\#\#' + +# Identifier +t_CPP_ID = r'[A-Za-z_][\w_]*' + +# Integer literal +def CPP_INTEGER(t): + r'(((((0x)|(0X))[0-9a-fA-F]+)|(\d+))([uU][lL]|[lL][uU]|[uU]|[lL])?)' + return t + +t_CPP_INTEGER = CPP_INTEGER + +# Floating literal +t_CPP_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +def t_CPP_STRING(t): + r'\"([^\\\n]|(\\(.|\n)))*?\"' + t.lexer.lineno += t.value.count("\n") + return t + +# Character constant 'c' or L'c' +def t_CPP_CHAR(t): + r'(L)?\'([^\\\n]|(\\(.|\n)))*?\'' + t.lexer.lineno += t.value.count("\n") + return t + +# Comment +def t_CPP_COMMENT1(t): + r'(/\*(.|\n)*?\*/)' + ncr = t.value.count("\n") + t.lexer.lineno += ncr + # replace with one space or a number of '\n' + t.type = 'CPP_WS'; t.value = '\n' * ncr if ncr else ' ' + return t + +# Line comment +def t_CPP_COMMENT2(t): + r'(//.*?(\n|$))' + # replace with '/n' + t.type = 'CPP_WS'; t.value = '\n' + return t + +def t_error(t): + t.type = t.value[0] + t.value = t.value[0] + t.lexer.skip(1) + return t + +import re +import copy +import time +import os.path + +# ----------------------------------------------------------------------------- +# trigraph() +# +# Given an input string, this function replaces all trigraph sequences. +# The following mapping is used: +# +# ??= # +# ??/ \ +# ??' ^ +# ??( [ +# ??) ] +# ??! | +# ??< { +# ??> } +# ??- ~ +# ----------------------------------------------------------------------------- + +_trigraph_pat = re.compile(r'''\?\?[=/\'\(\)\!<>\-]''') +_trigraph_rep = { + '=':'#', + '/':'\\', + "'":'^', + '(':'[', + ')':']', + '!':'|', + '<':'{', + '>':'}', + '-':'~' +} + +def trigraph(input): + return _trigraph_pat.sub(lambda g: _trigraph_rep[g.group()[-1]],input) + +# ------------------------------------------------------------------ +# Macro object +# +# This object holds information about preprocessor macros +# +# .name - Macro name (string) +# .value - Macro value (a list of tokens) +# .arglist - List of argument names +# .variadic - Boolean indicating whether or not variadic macro +# .vararg - Name of the variadic parameter +# +# When a macro is created, the macro replacement token sequence is +# pre-scanned and used to create patch lists that are later used +# during macro expansion +# ------------------------------------------------------------------ + +class Macro(object): + def __init__(self,name,value,arglist=None,variadic=False): + self.name = name + self.value = value + self.arglist = arglist + self.variadic = variadic + if variadic: + self.vararg = arglist[-1] + self.source = None + +# ------------------------------------------------------------------ +# Preprocessor object +# +# Object representing a preprocessor. Contains macro definitions, +# include directories, and other information +# ------------------------------------------------------------------ + +class Preprocessor(object): + def __init__(self,lexer=None): + if lexer is None: + lexer = lex.lexer + self.lexer = lexer + self.macros = { } + self.path = [] + self.temp_path = [] + + # Probe the lexer for selected tokens + self.lexprobe() + + tm = time.localtime() + self.define("__DATE__ \"%s\"" % time.strftime("%b %d %Y",tm)) + self.define("__TIME__ \"%s\"" % time.strftime("%H:%M:%S",tm)) + self.parser = None + + # ----------------------------------------------------------------------------- + # tokenize() + # + # Utility function. Given a string of text, tokenize into a list of tokens + # ----------------------------------------------------------------------------- + + def tokenize(self,text): + tokens = [] + self.lexer.input(text) + while True: + tok = self.lexer.token() + if not tok: break + tokens.append(tok) + return tokens + + # --------------------------------------------------------------------- + # error() + # + # Report a preprocessor error/warning of some kind + # ---------------------------------------------------------------------- + + def error(self,file,line,msg): + print("%s:%d %s" % (file,line,msg)) + + # ---------------------------------------------------------------------- + # lexprobe() + # + # This method probes the preprocessor lexer object to discover + # the token types of symbols that are important to the preprocessor. + # If this works right, the preprocessor will simply "work" + # with any suitable lexer regardless of how tokens have been named. + # ---------------------------------------------------------------------- + + def lexprobe(self): + + # Determine the token type for identifiers + self.lexer.input("identifier") + tok = self.lexer.token() + if not tok or tok.value != "identifier": + print("Couldn't determine identifier type") + else: + self.t_ID = tok.type + + # Determine the token type for integers + self.lexer.input("12345") + tok = self.lexer.token() + if not tok or int(tok.value) != 12345: + print("Couldn't determine integer type") + else: + self.t_INTEGER = tok.type + self.t_INTEGER_TYPE = type(tok.value) + + # Determine the token type for strings enclosed in double quotes + self.lexer.input("\"filename\"") + tok = self.lexer.token() + if not tok or tok.value != "\"filename\"": + print("Couldn't determine string type") + else: + self.t_STRING = tok.type + + # Determine the token type for whitespace--if any + self.lexer.input(" ") + tok = self.lexer.token() + if not tok or tok.value != " ": + self.t_SPACE = None + else: + self.t_SPACE = tok.type + + # Determine the token type for newlines + self.lexer.input("\n") + tok = self.lexer.token() + if not tok or tok.value != "\n": + self.t_NEWLINE = None + print("Couldn't determine token for newlines") + else: + self.t_NEWLINE = tok.type + + self.t_WS = (self.t_SPACE, self.t_NEWLINE) + + # Check for other characters used by the preprocessor + chars = [ '<','>','#','##','\\','(',')',',','.'] + for c in chars: + self.lexer.input(c) + tok = self.lexer.token() + if not tok or tok.value != c: + print("Unable to lex '%s' required for preprocessor" % c) + + # ---------------------------------------------------------------------- + # add_path() + # + # Adds a search path to the preprocessor. + # ---------------------------------------------------------------------- + + def add_path(self,path): + self.path.append(path) + + # ---------------------------------------------------------------------- + # group_lines() + # + # Given an input string, this function splits it into lines. Trailing whitespace + # is removed. Any line ending with \ is grouped with the next line. This + # function forms the lowest level of the preprocessor---grouping into text into + # a line-by-line format. + # ---------------------------------------------------------------------- + + def group_lines(self,input): + lex = self.lexer.clone() + lines = [x.rstrip() for x in input.splitlines()] + for i in xrange(len(lines)): + j = i+1 + while lines[i].endswith('\\') and (j < len(lines)): + lines[i] = lines[i][:-1]+lines[j] + lines[j] = "" + j += 1 + + input = "\n".join(lines) + lex.input(input) + lex.lineno = 1 + + current_line = [] + while True: + tok = lex.token() + if not tok: + break + current_line.append(tok) + if tok.type in self.t_WS and '\n' in tok.value: + yield current_line + current_line = [] + + if current_line: + yield current_line + + # ---------------------------------------------------------------------- + # tokenstrip() + # + # Remove leading/trailing whitespace tokens from a token list + # ---------------------------------------------------------------------- + + def tokenstrip(self,tokens): + i = 0 + while i < len(tokens) and tokens[i].type in self.t_WS: + i += 1 + del tokens[:i] + i = len(tokens)-1 + while i >= 0 and tokens[i].type in self.t_WS: + i -= 1 + del tokens[i+1:] + return tokens + + + # ---------------------------------------------------------------------- + # collect_args() + # + # Collects comma separated arguments from a list of tokens. The arguments + # must be enclosed in parenthesis. Returns a tuple (tokencount,args,positions) + # where tokencount is the number of tokens consumed, args is a list of arguments, + # and positions is a list of integers containing the starting index of each + # argument. Each argument is represented by a list of tokens. + # + # When collecting arguments, leading and trailing whitespace is removed + # from each argument. + # + # This function properly handles nested parenthesis and commas---these do not + # define new arguments. + # ---------------------------------------------------------------------- + + def collect_args(self,tokenlist): + args = [] + positions = [] + current_arg = [] + nesting = 1 + tokenlen = len(tokenlist) + + # Search for the opening '('. + i = 0 + while (i < tokenlen) and (tokenlist[i].type in self.t_WS): + i += 1 + + if (i < tokenlen) and (tokenlist[i].value == '('): + positions.append(i+1) + else: + self.error(self.source,tokenlist[0].lineno,"Missing '(' in macro arguments") + return 0, [], [] + + i += 1 + + while i < tokenlen: + t = tokenlist[i] + if t.value == '(': + current_arg.append(t) + nesting += 1 + elif t.value == ')': + nesting -= 1 + if nesting == 0: + if current_arg: + args.append(self.tokenstrip(current_arg)) + positions.append(i) + return i+1,args,positions + current_arg.append(t) + elif t.value == ',' and nesting == 1: + args.append(self.tokenstrip(current_arg)) + positions.append(i+1) + current_arg = [] + else: + current_arg.append(t) + i += 1 + + # Missing end argument + self.error(self.source,tokenlist[-1].lineno,"Missing ')' in macro arguments") + return 0, [],[] + + # ---------------------------------------------------------------------- + # macro_prescan() + # + # Examine the macro value (token sequence) and identify patch points + # This is used to speed up macro expansion later on---we'll know + # right away where to apply patches to the value to form the expansion + # ---------------------------------------------------------------------- + + def macro_prescan(self,macro): + macro.patch = [] # Standard macro arguments + macro.str_patch = [] # String conversion expansion + macro.var_comma_patch = [] # Variadic macro comma patch + i = 0 + while i < len(macro.value): + if macro.value[i].type == self.t_ID and macro.value[i].value in macro.arglist: + argnum = macro.arglist.index(macro.value[i].value) + # Conversion of argument to a string + if i > 0 and macro.value[i-1].value == '#': + macro.value[i] = copy.copy(macro.value[i]) + macro.value[i].type = self.t_STRING + del macro.value[i-1] + macro.str_patch.append((argnum,i-1)) + continue + # Concatenation + elif (i > 0 and macro.value[i-1].value == '##'): + macro.patch.append(('c',argnum,i-1)) + del macro.value[i-1] + continue + elif ((i+1) < len(macro.value) and macro.value[i+1].value == '##'): + macro.patch.append(('c',argnum,i)) + i += 1 + continue + # Standard expansion + else: + macro.patch.append(('e',argnum,i)) + elif macro.value[i].value == '##': + if macro.variadic and (i > 0) and (macro.value[i-1].value == ',') and \ + ((i+1) < len(macro.value)) and (macro.value[i+1].type == self.t_ID) and \ + (macro.value[i+1].value == macro.vararg): + macro.var_comma_patch.append(i-1) + i += 1 + macro.patch.sort(key=lambda x: x[2],reverse=True) + + # ---------------------------------------------------------------------- + # macro_expand_args() + # + # Given a Macro and list of arguments (each a token list), this method + # returns an expanded version of a macro. The return value is a token sequence + # representing the replacement macro tokens + # ---------------------------------------------------------------------- + + def macro_expand_args(self,macro,args): + # Make a copy of the macro token sequence + rep = [copy.copy(_x) for _x in macro.value] + + # Make string expansion patches. These do not alter the length of the replacement sequence + + str_expansion = {} + for argnum, i in macro.str_patch: + if argnum not in str_expansion: + str_expansion[argnum] = ('"%s"' % "".join([x.value for x in args[argnum]])).replace("\\","\\\\") + rep[i] = copy.copy(rep[i]) + rep[i].value = str_expansion[argnum] + + # Make the variadic macro comma patch. If the variadic macro argument is empty, we get rid + comma_patch = False + if macro.variadic and not args[-1]: + for i in macro.var_comma_patch: + rep[i] = None + comma_patch = True + + # Make all other patches. The order of these matters. It is assumed that the patch list + # has been sorted in reverse order of patch location since replacements will cause the + # size of the replacement sequence to expand from the patch point. + + expanded = { } + for ptype, argnum, i in macro.patch: + # Concatenation. Argument is left unexpanded + if ptype == 'c': + rep[i:i+1] = args[argnum] + # Normal expansion. Argument is macro expanded first + elif ptype == 'e': + if argnum not in expanded: + expanded[argnum] = self.expand_macros(args[argnum]) + rep[i:i+1] = expanded[argnum] + + # Get rid of removed comma if necessary + if comma_patch: + rep = [_i for _i in rep if _i] + + return rep + + + # ---------------------------------------------------------------------- + # expand_macros() + # + # Given a list of tokens, this function performs macro expansion. + # The expanded argument is a dictionary that contains macros already + # expanded. This is used to prevent infinite recursion. + # ---------------------------------------------------------------------- + + def expand_macros(self,tokens,expanded=None): + if expanded is None: + expanded = {} + i = 0 + while i < len(tokens): + t = tokens[i] + if t.type == self.t_ID: + if t.value in self.macros and t.value not in expanded: + # Yes, we found a macro match + expanded[t.value] = True + + m = self.macros[t.value] + if not m.arglist: + # A simple macro + ex = self.expand_macros([copy.copy(_x) for _x in m.value],expanded) + for e in ex: + e.lineno = t.lineno + tokens[i:i+1] = ex + i += len(ex) + else: + # A macro with arguments + j = i + 1 + while j < len(tokens) and tokens[j].type in self.t_WS: + j += 1 + if tokens[j].value == '(': + tokcount,args,positions = self.collect_args(tokens[j:]) + if not m.variadic and len(args) != len(m.arglist): + self.error(self.source,t.lineno,"Macro %s requires %d arguments" % (t.value,len(m.arglist))) + i = j + tokcount + elif m.variadic and len(args) < len(m.arglist)-1: + if len(m.arglist) > 2: + self.error(self.source,t.lineno,"Macro %s must have at least %d arguments" % (t.value, len(m.arglist)-1)) + else: + self.error(self.source,t.lineno,"Macro %s must have at least %d argument" % (t.value, len(m.arglist)-1)) + i = j + tokcount + else: + if m.variadic: + if len(args) == len(m.arglist)-1: + args.append([]) + else: + args[len(m.arglist)-1] = tokens[j+positions[len(m.arglist)-1]:j+tokcount-1] + del args[len(m.arglist):] + + # Get macro replacement text + rep = self.macro_expand_args(m,args) + rep = self.expand_macros(rep,expanded) + for r in rep: + r.lineno = t.lineno + tokens[i:j+tokcount] = rep + i += len(rep) + del expanded[t.value] + continue + elif t.value == '__LINE__': + t.type = self.t_INTEGER + t.value = self.t_INTEGER_TYPE(t.lineno) + + i += 1 + return tokens + + # ---------------------------------------------------------------------- + # evalexpr() + # + # Evaluate an expression token sequence for the purposes of evaluating + # integral expressions. + # ---------------------------------------------------------------------- + + def evalexpr(self,tokens): + # tokens = tokenize(line) + # Search for defined macros + i = 0 + while i < len(tokens): + if tokens[i].type == self.t_ID and tokens[i].value == 'defined': + j = i + 1 + needparen = False + result = "0L" + while j < len(tokens): + if tokens[j].type in self.t_WS: + j += 1 + continue + elif tokens[j].type == self.t_ID: + if tokens[j].value in self.macros: + result = "1L" + else: + result = "0L" + if not needparen: break + elif tokens[j].value == '(': + needparen = True + elif tokens[j].value == ')': + break + else: + self.error(self.source,tokens[i].lineno,"Malformed defined()") + j += 1 + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE(result) + del tokens[i+1:j+1] + i += 1 + tokens = self.expand_macros(tokens) + for i,t in enumerate(tokens): + if t.type == self.t_ID: + tokens[i] = copy.copy(t) + tokens[i].type = self.t_INTEGER + tokens[i].value = self.t_INTEGER_TYPE("0L") + elif t.type == self.t_INTEGER: + tokens[i] = copy.copy(t) + # Strip off any trailing suffixes + tokens[i].value = str(tokens[i].value) + while tokens[i].value[-1] not in "0123456789abcdefABCDEF": + tokens[i].value = tokens[i].value[:-1] + + expr = "".join([str(x.value) for x in tokens]) + expr = expr.replace("&&"," and ") + expr = expr.replace("||"," or ") + expr = expr.replace("!"," not ") + try: + result = eval(expr) + except Exception: + self.error(self.source,tokens[0].lineno,"Couldn't evaluate expression") + result = 0 + return result + + # ---------------------------------------------------------------------- + # parsegen() + # + # Parse an input string/ + # ---------------------------------------------------------------------- + def parsegen(self,input,source=None): + + # Replace trigraph sequences + t = trigraph(input) + lines = self.group_lines(t) + + if not source: + source = "" + + self.define("__FILE__ \"%s\"" % source) + + self.source = source + chunk = [] + enable = True + iftrigger = False + ifstack = [] + + for x in lines: + for i,tok in enumerate(x): + if tok.type not in self.t_WS: break + if tok.value == '#': + # Preprocessor directive + + # insert necessary whitespace instead of eaten tokens + for tok in x: + if tok.type in self.t_WS and '\n' in tok.value: + chunk.append(tok) + + dirtokens = self.tokenstrip(x[i+1:]) + if dirtokens: + name = dirtokens[0].value + args = self.tokenstrip(dirtokens[1:]) + else: + name = "" + args = [] + + if name == 'define': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.define(args) + elif name == 'include': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + oldfile = self.macros['__FILE__'] + for tok in self.include(args): + yield tok + self.macros['__FILE__'] = oldfile + self.source = source + elif name == 'undef': + if enable: + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + self.undef(args) + elif name == 'ifdef': + ifstack.append((enable,iftrigger)) + if enable: + if not args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'ifndef': + ifstack.append((enable,iftrigger)) + if enable: + if args[0].value in self.macros: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'if': + ifstack.append((enable,iftrigger)) + if enable: + result = self.evalexpr(args) + if not result: + enable = False + iftrigger = False + else: + iftrigger = True + elif name == 'elif': + if ifstack: + if ifstack[-1][0]: # We only pay attention if outer "if" allows this + if enable: # If already true, we flip enable False + enable = False + elif not iftrigger: # If False, but not triggered yet, we'll check expression + result = self.evalexpr(args) + if result: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #elif") + + elif name == 'else': + if ifstack: + if ifstack[-1][0]: + if enable: + enable = False + elif not iftrigger: + enable = True + iftrigger = True + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #else") + + elif name == 'endif': + if ifstack: + enable,iftrigger = ifstack.pop() + else: + self.error(self.source,dirtokens[0].lineno,"Misplaced #endif") + else: + # Unknown preprocessor directive + pass + + else: + # Normal text + if enable: + chunk.extend(x) + + for tok in self.expand_macros(chunk): + yield tok + chunk = [] + + # ---------------------------------------------------------------------- + # include() + # + # Implementation of file-inclusion + # ---------------------------------------------------------------------- + + def include(self,tokens): + # Try to extract the filename and then process an include file + if not tokens: + return + if tokens: + if tokens[0].value != '<' and tokens[0].type != self.t_STRING: + tokens = self.expand_macros(tokens) + + if tokens[0].value == '<': + # Include <...> + i = 1 + while i < len(tokens): + if tokens[i].value == '>': + break + i += 1 + else: + print("Malformed #include <...>") + return + filename = "".join([x.value for x in tokens[1:i]]) + path = self.path + [""] + self.temp_path + elif tokens[0].type == self.t_STRING: + filename = tokens[0].value[1:-1] + path = self.temp_path + [""] + self.path + else: + print("Malformed #include statement") + return + for p in path: + iname = os.path.join(p,filename) + try: + data = open(iname,"r").read() + dname = os.path.dirname(iname) + if dname: + self.temp_path.insert(0,dname) + for tok in self.parsegen(data,filename): + yield tok + if dname: + del self.temp_path[0] + break + except IOError: + pass + else: + print("Couldn't find '%s'" % filename) + + # ---------------------------------------------------------------------- + # define() + # + # Define a new macro + # ---------------------------------------------------------------------- + + def define(self,tokens): + if isinstance(tokens,STRING_TYPES): + tokens = self.tokenize(tokens) + + linetok = tokens + try: + name = linetok[0] + if len(linetok) > 1: + mtype = linetok[1] + else: + mtype = None + if not mtype: + m = Macro(name.value,[]) + self.macros[name.value] = m + elif mtype.type in self.t_WS: + # A normal macro + m = Macro(name.value,self.tokenstrip(linetok[2:])) + self.macros[name.value] = m + elif mtype.value == '(': + # A macro with arguments + tokcount, args, positions = self.collect_args(linetok[1:]) + variadic = False + for a in args: + if variadic: + print("No more arguments may follow a variadic argument") + break + astr = "".join([str(_i.value) for _i in a]) + if astr == "...": + variadic = True + a[0].type = self.t_ID + a[0].value = '__VA_ARGS__' + variadic = True + del a[1:] + continue + elif astr[-3:] == "..." and a[0].type == self.t_ID: + variadic = True + del a[1:] + # If, for some reason, "." is part of the identifier, strip off the name for the purposes + # of macro expansion + if a[0].value[-3:] == '...': + a[0].value = a[0].value[:-3] + continue + if len(a) > 1 or a[0].type != self.t_ID: + print("Invalid macro argument") + break + else: + mvalue = self.tokenstrip(linetok[1+tokcount:]) + i = 0 + while i < len(mvalue): + if i+1 < len(mvalue): + if mvalue[i].type in self.t_WS and mvalue[i+1].value == '##': + del mvalue[i] + continue + elif mvalue[i].value == '##' and mvalue[i+1].type in self.t_WS: + del mvalue[i+1] + i += 1 + m = Macro(name.value,mvalue,[x[0].value for x in args],variadic) + self.macro_prescan(m) + self.macros[name.value] = m + else: + print("Bad macro definition") + except LookupError: + print("Bad macro definition") + + # ---------------------------------------------------------------------- + # undef() + # + # Undefine a macro + # ---------------------------------------------------------------------- + + def undef(self,tokens): + id = tokens[0].value + try: + del self.macros[id] + except LookupError: + pass + + # ---------------------------------------------------------------------- + # parse() + # + # Parse input text. + # ---------------------------------------------------------------------- + def parse(self,input,source=None,ignore={}): + self.ignore = ignore + self.parser = self.parsegen(input,source) + + # ---------------------------------------------------------------------- + # token() + # + # Method to return individual tokens + # ---------------------------------------------------------------------- + def token(self): + try: + while True: + tok = next(self.parser) + if tok.type not in self.ignore: return tok + except StopIteration: + self.parser = None + return None + +if __name__ == '__main__': + import ply.lex as lex + lexer = lex.lex() + + # Run a preprocessor + import sys + f = open(sys.argv[1]) + input = f.read() + + p = Preprocessor(lexer) + p.parse(input,sys.argv[1]) + while True: + tok = p.token() + if not tok: break + print(p.source, tok) diff --git a/utils/cseq-1.9/pycparser/ply/ctokens.py b/utils/cseq-1.9/pycparser/ply/ctokens.py new file mode 100644 index 000000000..f6f6952d6 --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/ctokens.py @@ -0,0 +1,133 @@ +# ---------------------------------------------------------------------- +# ctokens.py +# +# Token specifications for symbols in ANSI C and C++. This file is +# meant to be used as a library in other tokenizers. +# ---------------------------------------------------------------------- + +# Reserved words + +tokens = [ + # Literals (identifier, integer constant, float constant, string constant, char const) + 'ID', 'TYPEID', 'INTEGER', 'FLOAT', 'STRING', 'CHARACTER', + + # Operators (+,-,*,/,%,|,&,~,^,<<,>>, ||, &&, !, <, <=, >, >=, ==, !=) + 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', + 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', + 'LOR', 'LAND', 'LNOT', + 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', + + # Assignment (=, *=, /=, %=, +=, -=, <<=, >>=, &=, ^=, |=) + 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', + 'LSHIFTEQUAL','RSHIFTEQUAL', 'ANDEQUAL', 'XOREQUAL', 'OREQUAL', + + # Increment/decrement (++,--) + 'INCREMENT', 'DECREMENT', + + # Structure dereference (->) + 'ARROW', + + # Ternary operator (?) + 'TERNARY', + + # Delimeters ( ) [ ] { } , . ; : + 'LPAREN', 'RPAREN', + 'LBRACKET', 'RBRACKET', + 'LBRACE', 'RBRACE', + 'COMMA', 'PERIOD', 'SEMI', 'COLON', + + # Ellipsis (...) + 'ELLIPSIS', +] + +# Operators +t_PLUS = r'\+' +t_MINUS = r'-' +t_TIMES = r'\*' +t_DIVIDE = r'/' +t_MODULO = r'%' +t_OR = r'\|' +t_AND = r'&' +t_NOT = r'~' +t_XOR = r'\^' +t_LSHIFT = r'<<' +t_RSHIFT = r'>>' +t_LOR = r'\|\|' +t_LAND = r'&&' +t_LNOT = r'!' +t_LT = r'<' +t_GT = r'>' +t_LE = r'<=' +t_GE = r'>=' +t_EQ = r'==' +t_NE = r'!=' + +# Assignment operators + +t_EQUALS = r'=' +t_TIMESEQUAL = r'\*=' +t_DIVEQUAL = r'/=' +t_MODEQUAL = r'%=' +t_PLUSEQUAL = r'\+=' +t_MINUSEQUAL = r'-=' +t_LSHIFTEQUAL = r'<<=' +t_RSHIFTEQUAL = r'>>=' +t_ANDEQUAL = r'&=' +t_OREQUAL = r'\|=' +t_XOREQUAL = r'\^=' + +# Increment/decrement +t_INCREMENT = r'\+\+' +t_DECREMENT = r'--' + +# -> +t_ARROW = r'->' + +# ? +t_TERNARY = r'\?' + +# Delimeters +t_LPAREN = r'\(' +t_RPAREN = r'\)' +t_LBRACKET = r'\[' +t_RBRACKET = r'\]' +t_LBRACE = r'\{' +t_RBRACE = r'\}' +t_COMMA = r',' +t_PERIOD = r'\.' +t_SEMI = r';' +t_COLON = r':' +t_ELLIPSIS = r'\.\.\.' + +# Identifiers +t_ID = r'[A-Za-z_][A-Za-z0-9_]*' + +# Integer literal +t_INTEGER = r'\d+([uU]|[lL]|[uU][lL]|[lL][uU])?' + +# Floating literal +t_FLOAT = r'((\d+)(\.\d+)(e(\+|-)?(\d+))? | (\d+)e(\+|-)?(\d+))([lL]|[fF])?' + +# String literal +t_STRING = r'\"([^\\\n]|(\\.))*?\"' + +# Character constant 'c' or L'c' +t_CHARACTER = r'(L)?\'([^\\\n]|(\\.))*?\'' + +# Comment (C-Style) +def t_COMMENT(t): + r'/\*(.|\n)*?\*/' + t.lexer.lineno += t.value.count('\n') + return t + +# Comment (C++-Style) +def t_CPPCOMMENT(t): + r'//.*\n' + t.lexer.lineno += 1 + return t + + + + + + diff --git a/utils/cseq-1.9/pycparser/ply/lex.py b/utils/cseq-1.9/pycparser/ply/lex.py new file mode 100644 index 000000000..4bdd76ca0 --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/lex.py @@ -0,0 +1,1099 @@ +# ----------------------------------------------------------------------------- +# ply: lex.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- + +__version__ = '3.10' +__tabversion__ = '3.10' + +import re +import sys +import types +import copy +import os +import inspect + +# This tuple contains known string types +try: + # Python 2.6 + StringTypes = (types.StringType, types.UnicodeType) +except AttributeError: + # Python 3.0 + StringTypes = (str, bytes) + +# This regular expression is used to match valid token names +_is_identifier = re.compile(r'^[a-zA-Z0-9_]+$') + +# Exception thrown when invalid token encountered and no default error +# handler is defined. +class LexError(Exception): + def __init__(self, message, s): + self.args = (message,) + self.text = s + + +# Token class. This class is used to represent the tokens produced. +class LexToken(object): + def __str__(self): + return 'LexToken(%s,%r,%d,%d)' % (self.type, self.value, self.lineno, self.lexpos) + + def __repr__(self): + return str(self) + + +# This object is a stand-in for a logging object created by the +# logging module. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def critical(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + info = critical + debug = critical + + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + + +# ----------------------------------------------------------------------------- +# === Lexing Engine === +# +# The following Lexer class implements the lexer runtime. There are only +# a few public methods and attributes: +# +# input() - Store a new string in the lexer +# token() - Get the next token +# clone() - Clone the lexer +# +# lineno - Current line number +# lexpos - Current position in the input string +# ----------------------------------------------------------------------------- + +class Lexer: + def __init__(self): + self.lexre = None # Master regular expression. This is a list of + # tuples (re, findex) where re is a compiled + # regular expression and findex is a list + # mapping regex group numbers to rules + self.lexretext = None # Current regular expression strings + self.lexstatere = {} # Dictionary mapping lexer states to master regexs + self.lexstateretext = {} # Dictionary mapping lexer states to regex strings + self.lexstaterenames = {} # Dictionary mapping lexer states to symbol names + self.lexstate = 'INITIAL' # Current lexer state + self.lexstatestack = [] # Stack of lexer states + self.lexstateinfo = None # State information + self.lexstateignore = {} # Dictionary of ignored characters for each state + self.lexstateerrorf = {} # Dictionary of error functions for each state + self.lexstateeoff = {} # Dictionary of eof functions for each state + self.lexreflags = 0 # Optional re compile flags + self.lexdata = None # Actual input data (as a string) + self.lexpos = 0 # Current position in input text + self.lexlen = 0 # Length of the input text + self.lexerrorf = None # Error rule (if any) + self.lexeoff = None # EOF rule (if any) + self.lextokens = None # List of valid tokens + self.lexignore = '' # Ignored characters + self.lexliterals = '' # Literal characters that can be passed through + self.lexmodule = None # Module + self.lineno = 1 # Current line number + self.lexoptimize = False # Optimized mode + + def clone(self, object=None): + c = copy.copy(self) + + # If the object parameter has been supplied, it means we are attaching the + # lexer to a new object. In this case, we have to rebind all methods in + # the lexstatere and lexstateerrorf tables. + + if object: + newtab = {} + for key, ritem in self.lexstatere.items(): + newre = [] + for cre, findex in ritem: + newfindex = [] + for f in findex: + if not f or not f[0]: + newfindex.append(f) + continue + newfindex.append((getattr(object, f[0].__name__), f[1])) + newre.append((cre, newfindex)) + newtab[key] = newre + c.lexstatere = newtab + c.lexstateerrorf = {} + for key, ef in self.lexstateerrorf.items(): + c.lexstateerrorf[key] = getattr(object, ef.__name__) + c.lexmodule = object + return c + + # ------------------------------------------------------------ + # writetab() - Write lexer information to a table file + # ------------------------------------------------------------ + def writetab(self, lextab, outputdir=''): + if isinstance(lextab, types.ModuleType): + raise IOError("Won't overwrite existing lextab module") + basetabmodule = lextab.split('.')[-1] + filename = os.path.join(outputdir, basetabmodule) + '.py' + with open(filename, 'w') as tf: + tf.write('# %s.py. This file automatically created by PLY (version %s). Don\'t edit!\n' % (basetabmodule, __version__)) + tf.write('_tabversion = %s\n' % repr(__tabversion__)) + tf.write('_lextokens = set(%s)\n' % repr(tuple(self.lextokens))) + tf.write('_lexreflags = %s\n' % repr(self.lexreflags)) + tf.write('_lexliterals = %s\n' % repr(self.lexliterals)) + tf.write('_lexstateinfo = %s\n' % repr(self.lexstateinfo)) + + # Rewrite the lexstatere table, replacing function objects with function names + tabre = {} + for statename, lre in self.lexstatere.items(): + titem = [] + for (pat, func), retext, renames in zip(lre, self.lexstateretext[statename], self.lexstaterenames[statename]): + titem.append((retext, _funcs_to_names(func, renames))) + tabre[statename] = titem + + tf.write('_lexstatere = %s\n' % repr(tabre)) + tf.write('_lexstateignore = %s\n' % repr(self.lexstateignore)) + + taberr = {} + for statename, ef in self.lexstateerrorf.items(): + taberr[statename] = ef.__name__ if ef else None + tf.write('_lexstateerrorf = %s\n' % repr(taberr)) + + tabeof = {} + for statename, ef in self.lexstateeoff.items(): + tabeof[statename] = ef.__name__ if ef else None + tf.write('_lexstateeoff = %s\n' % repr(tabeof)) + + # ------------------------------------------------------------ + # readtab() - Read lexer information from a tab file + # ------------------------------------------------------------ + def readtab(self, tabfile, fdict): + if isinstance(tabfile, types.ModuleType): + lextab = tabfile + else: + exec('import %s' % tabfile) + lextab = sys.modules[tabfile] + + if getattr(lextab, '_tabversion', '0.0') != __tabversion__: + raise ImportError('Inconsistent PLY version') + + self.lextokens = lextab._lextokens + self.lexreflags = lextab._lexreflags + self.lexliterals = lextab._lexliterals + self.lextokens_all = self.lextokens | set(self.lexliterals) + self.lexstateinfo = lextab._lexstateinfo + self.lexstateignore = lextab._lexstateignore + self.lexstatere = {} + self.lexstateretext = {} + for statename, lre in lextab._lexstatere.items(): + titem = [] + txtitem = [] + for pat, func_name in lre: + titem.append((re.compile(pat, lextab._lexreflags), _names_to_funcs(func_name, fdict))) + + self.lexstatere[statename] = titem + self.lexstateretext[statename] = txtitem + + self.lexstateerrorf = {} + for statename, ef in lextab._lexstateerrorf.items(): + self.lexstateerrorf[statename] = fdict[ef] + + self.lexstateeoff = {} + for statename, ef in lextab._lexstateeoff.items(): + self.lexstateeoff[statename] = fdict[ef] + + self.begin('INITIAL') + + # ------------------------------------------------------------ + # input() - Push a new string into the lexer + # ------------------------------------------------------------ + def input(self, s): + # Pull off the first character to see if s looks like a string + c = s[:1] + if not isinstance(c, StringTypes): + raise ValueError('Expected a string') + self.lexdata = s + self.lexpos = 0 + self.lexlen = len(s) + + # ------------------------------------------------------------ + # begin() - Changes the lexing state + # ------------------------------------------------------------ + def begin(self, state): + if state not in self.lexstatere: + raise ValueError('Undefined state') + self.lexre = self.lexstatere[state] + self.lexretext = self.lexstateretext[state] + self.lexignore = self.lexstateignore.get(state, '') + self.lexerrorf = self.lexstateerrorf.get(state, None) + self.lexeoff = self.lexstateeoff.get(state, None) + self.lexstate = state + + # ------------------------------------------------------------ + # push_state() - Changes the lexing state and saves old on stack + # ------------------------------------------------------------ + def push_state(self, state): + self.lexstatestack.append(self.lexstate) + self.begin(state) + + # ------------------------------------------------------------ + # pop_state() - Restores the previous state + # ------------------------------------------------------------ + def pop_state(self): + self.begin(self.lexstatestack.pop()) + + # ------------------------------------------------------------ + # current_state() - Returns the current lexing state + # ------------------------------------------------------------ + def current_state(self): + return self.lexstate + + # ------------------------------------------------------------ + # skip() - Skip ahead n characters + # ------------------------------------------------------------ + def skip(self, n): + self.lexpos += n + + # ------------------------------------------------------------ + # opttoken() - Return the next token from the Lexer + # + # Note: This function has been carefully implemented to be as fast + # as possible. Don't make changes unless you really know what + # you are doing + # ------------------------------------------------------------ + def token(self): + # Make local copies of frequently referenced attributes + lexpos = self.lexpos + lexlen = self.lexlen + lexignore = self.lexignore + lexdata = self.lexdata + + while lexpos < lexlen: + # This code provides some short-circuit code for whitespace, tabs, and other ignored characters + if lexdata[lexpos] in lexignore: + lexpos += 1 + continue + + # Look for a regular expression match + for lexre, lexindexfunc in self.lexre: + m = lexre.match(lexdata, lexpos) + if not m: + continue + + # Create a token for return + tok = LexToken() + tok.value = m.group() + tok.lineno = self.lineno + tok.lexpos = lexpos + + i = m.lastindex + func, tok.type = lexindexfunc[i] + + if not func: + # If no token type was set, it's an ignored token + if tok.type: + self.lexpos = m.end() + return tok + else: + lexpos = m.end() + break + + lexpos = m.end() + + # If token is processed by a function, call it + + tok.lexer = self # Set additional attributes useful in token rules + self.lexmatch = m + self.lexpos = lexpos + + newtok = func(tok) + + # Every function must return a token, if nothing, we just move to next token + if not newtok: + lexpos = self.lexpos # This is here in case user has updated lexpos. + lexignore = self.lexignore # This is here in case there was a state change + break + + # Verify type of the token. If not in the token map, raise an error + if not self.lexoptimize: + if newtok.type not in self.lextokens_all: + raise LexError("%s:%d: Rule '%s' returned an unknown token type '%s'" % ( + func.__code__.co_filename, func.__code__.co_firstlineno, + func.__name__, newtok.type), lexdata[lexpos:]) + + return newtok + else: + # No match, see if in literals + if lexdata[lexpos] in self.lexliterals: + tok = LexToken() + tok.value = lexdata[lexpos] + tok.lineno = self.lineno + tok.type = tok.value + tok.lexpos = lexpos + self.lexpos = lexpos + 1 + return tok + + # No match. Call t_error() if defined. + if self.lexerrorf: + tok = LexToken() + tok.value = self.lexdata[lexpos:] + tok.lineno = self.lineno + tok.type = 'error' + tok.lexer = self + tok.lexpos = lexpos + self.lexpos = lexpos + newtok = self.lexerrorf(tok) + if lexpos == self.lexpos: + # Error method didn't change text position at all. This is an error. + raise LexError("Scanning error. Illegal character '%s'" % (lexdata[lexpos]), lexdata[lexpos:]) + lexpos = self.lexpos + if not newtok: + continue + return newtok + + self.lexpos = lexpos + raise LexError("Illegal character '%s' at index %d" % (lexdata[lexpos], lexpos), lexdata[lexpos:]) + + if self.lexeoff: + tok = LexToken() + tok.type = 'eof' + tok.value = '' + tok.lineno = self.lineno + tok.lexpos = lexpos + tok.lexer = self + self.lexpos = lexpos + newtok = self.lexeoff(tok) + return newtok + + self.lexpos = lexpos + 1 + if self.lexdata is None: + raise RuntimeError('No input string given with input()') + return None + + # Iterator interface + def __iter__(self): + return self + + def next(self): + t = self.token() + if t is None: + raise StopIteration + return t + + __next__ = next + +# ----------------------------------------------------------------------------- +# ==== Lex Builder === +# +# The functions and classes below are used to collect lexing information +# and build a Lexer object from it. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# _get_regex(func) +# +# Returns the regular expression assigned to a function either as a doc string +# or as a .regex attribute attached by the @TOKEN decorator. +# ----------------------------------------------------------------------------- +def _get_regex(func): + return getattr(func, 'regex', func.__doc__) + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# _funcs_to_names() +# +# Given a list of regular expression functions, this converts it to a list +# suitable for output to a table file +# ----------------------------------------------------------------------------- +def _funcs_to_names(funclist, namelist): + result = [] + for f, name in zip(funclist, namelist): + if f and f[0]: + result.append((name, f[1])) + else: + result.append(f) + return result + +# ----------------------------------------------------------------------------- +# _names_to_funcs() +# +# Given a list of regular expression function names, this converts it back to +# functions. +# ----------------------------------------------------------------------------- +def _names_to_funcs(namelist, fdict): + result = [] + for n in namelist: + if n and n[0]: + result.append((fdict[n[0]], n[1])) + else: + result.append(n) + return result + +# ----------------------------------------------------------------------------- +# _form_master_re() +# +# This function takes a list of all of the regex components and attempts to +# form the master regular expression. Given limitations in the Python re +# module, it may be necessary to break the master regex into separate expressions. +# ----------------------------------------------------------------------------- +def _form_master_re(relist, reflags, ldict, toknames): + if not relist: + return [] + regex = '|'.join(relist) + try: + lexre = re.compile(regex, reflags) + + # Build the index to function map for the matching engine + lexindexfunc = [None] * (max(lexre.groupindex.values()) + 1) + lexindexnames = lexindexfunc[:] + + for f, i in lexre.groupindex.items(): + handle = ldict.get(f, None) + if type(handle) in (types.FunctionType, types.MethodType): + lexindexfunc[i] = (handle, toknames[f]) + lexindexnames[i] = f + elif handle is not None: + lexindexnames[i] = f + if f.find('ignore_') > 0: + lexindexfunc[i] = (None, None) + else: + lexindexfunc[i] = (None, toknames[f]) + + return [(lexre, lexindexfunc)], [regex], [lexindexnames] + except Exception: + m = int(len(relist)/2) + if m == 0: + m = 1 + llist, lre, lnames = _form_master_re(relist[:m], reflags, ldict, toknames) + rlist, rre, rnames = _form_master_re(relist[m:], reflags, ldict, toknames) + return (llist+rlist), (lre+rre), (lnames+rnames) + +# ----------------------------------------------------------------------------- +# def _statetoken(s,names) +# +# Given a declaration name s of the form "t_" and a dictionary whose keys are +# state names, this function returns a tuple (states,tokenname) where states +# is a tuple of state names and tokenname is the name of the token. For example, +# calling this with s = "t_foo_bar_SPAM" might return (('foo','bar'),'SPAM') +# ----------------------------------------------------------------------------- +def _statetoken(s, names): + nonstate = 1 + parts = s.split('_') + for i, part in enumerate(parts[1:], 1): + if part not in names and part != 'ANY': + break + + if i > 1: + states = tuple(parts[1:i]) + else: + states = ('INITIAL',) + + if 'ANY' in states: + states = tuple(names) + + tokenname = '_'.join(parts[i:]) + return (states, tokenname) + + +# ----------------------------------------------------------------------------- +# LexerReflect() +# +# This class represents information needed to build a lexer as extracted from a +# user's input file. +# ----------------------------------------------------------------------------- +class LexerReflect(object): + def __init__(self, ldict, log=None, reflags=0): + self.ldict = ldict + self.error_func = None + self.tokens = [] + self.reflags = reflags + self.stateinfo = {'INITIAL': 'inclusive'} + self.modules = set() + self.error = False + self.log = PlyLogger(sys.stderr) if log is None else log + + # Get all of the basic information + def get_all(self): + self.get_tokens() + self.get_literals() + self.get_states() + self.get_rules() + + # Validate all of the information + def validate_all(self): + self.validate_tokens() + self.validate_literals() + self.validate_rules() + return self.error + + # Get the tokens map + def get_tokens(self): + tokens = self.ldict.get('tokens', None) + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + terminals = {} + for n in self.tokens: + if not _is_identifier.match(n): + self.log.error("Bad token name '%s'", n) + self.error = True + if n in terminals: + self.log.warning("Token '%s' multiply defined", n) + terminals[n] = 1 + + # Get the literals specifier + def get_literals(self): + self.literals = self.ldict.get('literals', '') + if not self.literals: + self.literals = '' + + # Validate literals + def validate_literals(self): + try: + for c in self.literals: + if not isinstance(c, StringTypes) or len(c) > 1: + self.log.error('Invalid literal %s. Must be a single character', repr(c)) + self.error = True + + except TypeError: + self.log.error('Invalid literals specification. literals must be a sequence of characters') + self.error = True + + def get_states(self): + self.states = self.ldict.get('states', None) + # Build statemap + if self.states: + if not isinstance(self.states, (tuple, list)): + self.log.error('states must be defined as a tuple or list') + self.error = True + else: + for s in self.states: + if not isinstance(s, tuple) or len(s) != 2: + self.log.error("Invalid state specifier %s. Must be a tuple (statename,'exclusive|inclusive')", repr(s)) + self.error = True + continue + name, statetype = s + if not isinstance(name, StringTypes): + self.log.error('State name %s must be a string', repr(name)) + self.error = True + continue + if not (statetype == 'inclusive' or statetype == 'exclusive'): + self.log.error("State type for state %s must be 'inclusive' or 'exclusive'", name) + self.error = True + continue + if name in self.stateinfo: + self.log.error("State '%s' already defined", name) + self.error = True + continue + self.stateinfo[name] = statetype + + # Get all of the symbols with a t_ prefix and sort them into various + # categories (functions, strings, error functions, and ignore characters) + + def get_rules(self): + tsymbols = [f for f in self.ldict if f[:2] == 't_'] + + # Now build up a list of functions and a list of strings + self.toknames = {} # Mapping of symbols to token names + self.funcsym = {} # Symbols defined as functions + self.strsym = {} # Symbols defined as strings + self.ignore = {} # Ignore strings by state + self.errorf = {} # Error functions by state + self.eoff = {} # EOF functions by state + + for s in self.stateinfo: + self.funcsym[s] = [] + self.strsym[s] = [] + + if len(tsymbols) == 0: + self.log.error('No rules of the form t_rulename are defined') + self.error = True + return + + for f in tsymbols: + t = self.ldict[f] + states, tokname = _statetoken(f, self.stateinfo) + self.toknames[f] = tokname + + if hasattr(t, '__call__'): + if tokname == 'error': + for s in states: + self.errorf[s] = t + elif tokname == 'eof': + for s in states: + self.eoff[s] = t + elif tokname == 'ignore': + line = t.__code__.co_firstlineno + file = t.__code__.co_filename + self.log.error("%s:%d: Rule '%s' must be defined as a string", file, line, t.__name__) + self.error = True + else: + for s in states: + self.funcsym[s].append((f, t)) + elif isinstance(t, StringTypes): + if tokname == 'ignore': + for s in states: + self.ignore[s] = t + if '\\' in t: + self.log.warning("%s contains a literal backslash '\\'", f) + + elif tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", f) + self.error = True + else: + for s in states: + self.strsym[s].append((f, t)) + else: + self.log.error('%s not defined as a function or string', f) + self.error = True + + # Sort the functions by line number + for f in self.funcsym.values(): + f.sort(key=lambda x: x[1].__code__.co_firstlineno) + + # Sort the strings by regular expression length + for s in self.strsym.values(): + s.sort(key=lambda x: len(x[1]), reverse=True) + + # Validate all of the t_rules collected + def validate_rules(self): + for state in self.stateinfo: + # Validate all rules defined by functions + + for fname, f in self.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + tokname = self.toknames[fname] + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + continue + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + continue + + if not _get_regex(f): + self.log.error("%s:%d: No regular expression defined for rule '%s'", file, line, f.__name__) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (fname, _get_regex(f)), self.reflags) + if c.match(''): + self.log.error("%s:%d: Regular expression for rule '%s' matches empty string", file, line, f.__name__) + self.error = True + except re.error as e: + self.log.error("%s:%d: Invalid regular expression for rule '%s'. %s", file, line, f.__name__, e) + if '#' in _get_regex(f): + self.log.error("%s:%d. Make sure '#' in rule '%s' is escaped with '\\#'", file, line, f.__name__) + self.error = True + + # Validate all rules defined by strings + for name, r in self.strsym[state]: + tokname = self.toknames[name] + if tokname == 'error': + self.log.error("Rule '%s' must be defined as a function", name) + self.error = True + continue + + if tokname not in self.tokens and tokname.find('ignore_') < 0: + self.log.error("Rule '%s' defined for an unspecified token %s", name, tokname) + self.error = True + continue + + try: + c = re.compile('(?P<%s>%s)' % (name, r), self.reflags) + if (c.match('')): + self.log.error("Regular expression for rule '%s' matches empty string", name) + self.error = True + except re.error as e: + self.log.error("Invalid regular expression for rule '%s'. %s", name, e) + if '#' in r: + self.log.error("Make sure '#' in rule '%s' is escaped with '\\#'", name) + self.error = True + + if not self.funcsym[state] and not self.strsym[state]: + self.log.error("No rules defined for state '%s'", state) + self.error = True + + # Validate the error function + efunc = self.errorf.get(state, None) + if efunc: + f = efunc + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + module = inspect.getmodule(f) + self.modules.add(module) + + if isinstance(f, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + nargs = f.__code__.co_argcount + if nargs > reqargs: + self.log.error("%s:%d: Rule '%s' has too many arguments", file, line, f.__name__) + self.error = True + + if nargs < reqargs: + self.log.error("%s:%d: Rule '%s' requires an argument", file, line, f.__name__) + self.error = True + + for module in self.modules: + self.validate_module(module) + + # ----------------------------------------------------------------------------- + # validate_module() + # + # This checks to see if there are duplicated t_rulename() functions or strings + # in the parser input file. This is done using a simple regular expression + # match on each line in the source code of the given module. + # ----------------------------------------------------------------------------- + + def validate_module(self, module): + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + return + + fre = re.compile(r'\s*def\s+(t_[a-zA-Z_0-9]*)\(') + sre = re.compile(r'\s*(t_[a-zA-Z_0-9]*)\s*=') + + counthash = {} + linen += 1 + for line in lines: + m = fre.match(line) + if not m: + m = sre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.error('%s:%d: Rule %s redefined. Previously defined on line %d', filename, linen, name, prev) + self.error = True + linen += 1 + +# ----------------------------------------------------------------------------- +# lex(module) +# +# Build all of the regular expression rules from definitions in the supplied module +# ----------------------------------------------------------------------------- +def lex(module=None, object=None, debug=False, optimize=False, lextab='lextab', + reflags=int(re.VERBOSE), nowarn=False, outputdir=None, debuglog=None, errorlog=None): + + if lextab is None: + lextab = 'lextab' + + global lexer + + ldict = None + stateinfo = {'INITIAL': 'inclusive'} + lexobj = Lexer() + lexobj.lexoptimize = optimize + global token, input + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + if debug: + if debuglog is None: + debuglog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the lexer + if object: + module = object + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + ldict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in ldict: + ldict['__file__'] = sys.modules[ldict['__module__']].__file__ + else: + ldict = get_caller_module_dict(2) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = ldict.get('__package__') + if pkg and isinstance(lextab, str): + if '.' not in lextab: + lextab = pkg + '.' + lextab + + # Collect parser information from the dictionary + linfo = LexerReflect(ldict, log=errorlog, reflags=reflags) + linfo.get_all() + if not optimize: + if linfo.validate_all(): + raise SyntaxError("Can't build lexer") + + if optimize and lextab: + try: + lexobj.readtab(lextab, ldict) + token = lexobj.token + input = lexobj.input + lexer = lexobj + return lexobj + + except ImportError: + pass + + # Dump some basic debugging information + if debug: + debuglog.info('lex: tokens = %r', linfo.tokens) + debuglog.info('lex: literals = %r', linfo.literals) + debuglog.info('lex: states = %r', linfo.stateinfo) + + # Build a dictionary of valid token names + lexobj.lextokens = set() + for n in linfo.tokens: + lexobj.lextokens.add(n) + + # Get literals specification + if isinstance(linfo.literals, (list, tuple)): + lexobj.lexliterals = type(linfo.literals[0])().join(linfo.literals) + else: + lexobj.lexliterals = linfo.literals + + lexobj.lextokens_all = lexobj.lextokens | set(lexobj.lexliterals) + + # Get the stateinfo dictionary + stateinfo = linfo.stateinfo + + regexs = {} + # Build the master regular expressions + for state in stateinfo: + regex_list = [] + + # Add rules defined by functions first + for fname, f in linfo.funcsym[state]: + line = f.__code__.co_firstlineno + file = f.__code__.co_filename + regex_list.append('(?P<%s>%s)' % (fname, _get_regex(f))) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", fname, _get_regex(f), state) + + # Now add all of the simple rules + for name, r in linfo.strsym[state]: + regex_list.append('(?P<%s>%s)' % (name, r)) + if debug: + debuglog.info("lex: Adding rule %s -> '%s' (state '%s')", name, r, state) + + regexs[state] = regex_list + + # Build the master regular expressions + + if debug: + debuglog.info('lex: ==== MASTER REGEXS FOLLOW ====') + + for state in regexs: + lexre, re_text, re_names = _form_master_re(regexs[state], reflags, ldict, linfo.toknames) + lexobj.lexstatere[state] = lexre + lexobj.lexstateretext[state] = re_text + lexobj.lexstaterenames[state] = re_names + if debug: + for i, text in enumerate(re_text): + debuglog.info("lex: state '%s' : regex[%d] = '%s'", state, i, text) + + # For inclusive states, we need to add the regular expressions from the INITIAL state + for state, stype in stateinfo.items(): + if state != 'INITIAL' and stype == 'inclusive': + lexobj.lexstatere[state].extend(lexobj.lexstatere['INITIAL']) + lexobj.lexstateretext[state].extend(lexobj.lexstateretext['INITIAL']) + lexobj.lexstaterenames[state].extend(lexobj.lexstaterenames['INITIAL']) + + lexobj.lexstateinfo = stateinfo + lexobj.lexre = lexobj.lexstatere['INITIAL'] + lexobj.lexretext = lexobj.lexstateretext['INITIAL'] + lexobj.lexreflags = reflags + + # Set up ignore variables + lexobj.lexstateignore = linfo.ignore + lexobj.lexignore = lexobj.lexstateignore.get('INITIAL', '') + + # Set up error functions + lexobj.lexstateerrorf = linfo.errorf + lexobj.lexerrorf = linfo.errorf.get('INITIAL', None) + if not lexobj.lexerrorf: + errorlog.warning('No t_error rule is defined') + + # Set up eof functions + lexobj.lexstateeoff = linfo.eoff + lexobj.lexeoff = linfo.eoff.get('INITIAL', None) + + # Check state information for ignore and error rules + for s, stype in stateinfo.items(): + if stype == 'exclusive': + if s not in linfo.errorf: + errorlog.warning("No error rule is defined for exclusive state '%s'", s) + if s not in linfo.ignore and lexobj.lexignore: + errorlog.warning("No ignore rule is defined for exclusive state '%s'", s) + elif stype == 'inclusive': + if s not in linfo.errorf: + linfo.errorf[s] = linfo.errorf.get('INITIAL', None) + if s not in linfo.ignore: + linfo.ignore[s] = linfo.ignore.get('INITIAL', '') + + # Create global versions of the token() and input() functions + token = lexobj.token + input = lexobj.input + lexer = lexobj + + # If in optimize mode, we write the lextab + if lextab and optimize: + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If lextab specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(lextab, types.ModuleType): + srcfile = lextab.__file__ + else: + if '.' not in lextab: + srcfile = ldict['__file__'] + else: + parts = lextab.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + try: + lexobj.writetab(lextab, outputdir) + except IOError as e: + errorlog.warning("Couldn't write lextab module %r. %s" % (lextab, e)) + + return lexobj + +# ----------------------------------------------------------------------------- +# runmain() +# +# This runs the lexer as a main program +# ----------------------------------------------------------------------------- + +def runmain(lexer=None, data=None): + if not data: + try: + filename = sys.argv[1] + f = open(filename) + data = f.read() + f.close() + except IndexError: + sys.stdout.write('Reading from standard input (type EOF to end):\n') + data = sys.stdin.read() + + if lexer: + _input = lexer.input + else: + _input = input + _input(data) + if lexer: + _token = lexer.token + else: + _token = token + + while True: + tok = _token() + if not tok: + break + sys.stdout.write('(%s,%r,%d,%d)\n' % (tok.type, tok.value, tok.lineno, tok.lexpos)) + +# ----------------------------------------------------------------------------- +# @TOKEN(regex) +# +# This decorator function can be used to set the regex expression on a function +# when its docstring might need to be set in an alternative way +# ----------------------------------------------------------------------------- + +def TOKEN(r): + def set_regex(f): + if hasattr(r, '__call__'): + f.regex = _get_regex(r) + else: + f.regex = r + return f + return set_regex + +# Alternative spelling of the TOKEN decorator +Token = TOKEN diff --git a/utils/cseq-1.9/pycparser/ply/yacc.py b/utils/cseq-1.9/pycparser/ply/yacc.py new file mode 100644 index 000000000..03bd86ee0 --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/yacc.py @@ -0,0 +1,3494 @@ +# ----------------------------------------------------------------------------- +# ply: yacc.py +# +# Copyright (C) 2001-2017 +# David M. Beazley (Dabeaz LLC) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# * Neither the name of the David Beazley or Dabeaz LLC may be used to +# endorse or promote products derived from this software without +# specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# ----------------------------------------------------------------------------- +# +# This implements an LR parser that is constructed from grammar rules defined +# as Python functions. The grammer is specified by supplying the BNF inside +# Python documentation strings. The inspiration for this technique was borrowed +# from John Aycock's Spark parsing system. PLY might be viewed as cross between +# Spark and the GNU bison utility. +# +# The current implementation is only somewhat object-oriented. The +# LR parser itself is defined in terms of an object (which allows multiple +# parsers to co-exist). However, most of the variables used during table +# construction are defined in terms of global variables. Users shouldn't +# notice unless they are trying to define multiple parsers at the same +# time using threads (in which case they should have their head examined). +# +# This implementation supports both SLR and LALR(1) parsing. LALR(1) +# support was originally implemented by Elias Ioup (ezioup@alumni.uchicago.edu), +# using the algorithm found in Aho, Sethi, and Ullman "Compilers: Principles, +# Techniques, and Tools" (The Dragon Book). LALR(1) has since been replaced +# by the more efficient DeRemer and Pennello algorithm. +# +# :::::::: WARNING ::::::: +# +# Construction of LR parsing tables is fairly complicated and expensive. +# To make this module run fast, a *LOT* of work has been put into +# optimization---often at the expensive of readability and what might +# consider to be good Python "coding style." Modify the code at your +# own risk! +# ---------------------------------------------------------------------------- + +import re +import types +import sys +import os.path +import inspect +import base64 +import warnings + +__version__ = '3.10' +__tabversion__ = '3.10' + +#----------------------------------------------------------------------------- +# === User configurable parameters === +# +# Change these to modify the default behavior of yacc (if you wish) +#----------------------------------------------------------------------------- + +yaccdebug = True # Debugging mode. If set, yacc generates a + # a 'parser.out' file in the current directory + +debug_file = 'parser.out' # Default name of the debugging file +tab_module = 'parsetab' # Default name of the table module +default_lr = 'LALR' # Default LR table generation method + +error_count = 3 # Number of symbols that must be shifted to leave recovery mode + +yaccdevel = False # Set to True if developing yacc. This turns off optimized + # implementations of certain functions. + +resultlimit = 40 # Size limit of results when running in debug mode. + +pickle_protocol = 0 # Protocol to use when writing pickle files + +# String type-checking compatibility +if sys.version_info[0] < 3: + string_types = basestring +else: + string_types = str + +MAXINT = sys.maxsize + +# This object is a stand-in for a logging object created by the +# logging module. PLY will use this by default to create things +# such as the parser.out file. If a user wants more detailed +# information, they can create their own logging object and pass +# it into PLY. + +class PlyLogger(object): + def __init__(self, f): + self.f = f + + def debug(self, msg, *args, **kwargs): + self.f.write((msg % args) + '\n') + + info = debug + + def warning(self, msg, *args, **kwargs): + self.f.write('WARNING: ' + (msg % args) + '\n') + + def error(self, msg, *args, **kwargs): + self.f.write('ERROR: ' + (msg % args) + '\n') + + critical = debug + +# Null logger is used when no output is generated. Does nothing. +class NullLogger(object): + def __getattribute__(self, name): + return self + + def __call__(self, *args, **kwargs): + return self + +# Exception raised for yacc-related errors +class YaccError(Exception): + pass + +# Format the result message that the parser produces when running in debug mode. +def format_result(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) > resultlimit: + repr_str = repr_str[:resultlimit] + ' ...' + result = '<%s @ 0x%x> (%s)' % (type(r).__name__, id(r), repr_str) + return result + +# Format stack entries when the parser is running in debug mode +def format_stack_entry(r): + repr_str = repr(r) + if '\n' in repr_str: + repr_str = repr(repr_str) + if len(repr_str) < 16: + return repr_str + else: + return '<%s @ 0x%x>' % (type(r).__name__, id(r)) + +# Panic mode error recovery support. This feature is being reworked--much of the +# code here is to offer a deprecation/backwards compatible transition + +_errok = None +_token = None +_restart = None +_warnmsg = '''PLY: Don't use global functions errok(), token(), and restart() in p_error(). +Instead, invoke the methods on the associated parser instance: + + def p_error(p): + ... + # Use parser.errok(), parser.token(), parser.restart() + ... + + parser = yacc.yacc() +''' + +def errok(): + warnings.warn(_warnmsg) + return _errok() + +def restart(): + warnings.warn(_warnmsg) + return _restart() + +def token(): + warnings.warn(_warnmsg) + return _token() + +# Utility function to call the p_error() function with some deprecation hacks +def call_errorfunc(errorfunc, token, parser): + global _errok, _token, _restart + _errok = parser.errok + _token = parser.token + _restart = parser.restart + r = errorfunc(token) + try: + del _errok, _token, _restart + except NameError: + pass + return r + +#----------------------------------------------------------------------------- +# === LR Parsing Engine === +# +# The following classes are used for the LR parser itself. These are not +# used during table construction and are independent of the actual LR +# table generation algorithm +#----------------------------------------------------------------------------- + +# This class is used to hold non-terminal grammar symbols during parsing. +# It normally has the following attributes set: +# .type = Grammar symbol type +# .value = Symbol value +# .lineno = Starting line number +# .endlineno = Ending line number (optional, set automatically) +# .lexpos = Starting lex position +# .endlexpos = Ending lex position (optional, set automatically) + +class YaccSymbol: + def __str__(self): + return self.type + + def __repr__(self): + return str(self) + +# This class is a wrapper around the objects actually passed to each +# grammar rule. Index lookup and assignment actually assign the +# .value attribute of the underlying YaccSymbol object. +# The lineno() method returns the line number of a given +# item (or 0 if not defined). The linespan() method returns +# a tuple of (startline,endline) representing the range of lines +# for a symbol. The lexspan() method returns a tuple (lexpos,endlexpos) +# representing the range of positional information for a symbol. + +class YaccProduction: + def __init__(self, s, stack=None): + self.slice = s + self.stack = stack + self.lexer = None + self.parser = None + + def __getitem__(self, n): + if isinstance(n, slice): + return [s.value for s in self.slice[n]] + elif n >= 0: + return self.slice[n].value + else: + return self.stack[n].value + + def __setitem__(self, n, v): + self.slice[n].value = v + + def __getslice__(self, i, j): + return [s.value for s in self.slice[i:j]] + + def __len__(self): + return len(self.slice) + + def lineno(self, n): + return getattr(self.slice[n], 'lineno', 0) + + def set_lineno(self, n, lineno): + self.slice[n].lineno = lineno + + def linespan(self, n): + startline = getattr(self.slice[n], 'lineno', 0) + endline = getattr(self.slice[n], 'endlineno', startline) + return startline, endline + + def lexpos(self, n): + return getattr(self.slice[n], 'lexpos', 0) + + def lexspan(self, n): + startpos = getattr(self.slice[n], 'lexpos', 0) + endpos = getattr(self.slice[n], 'endlexpos', startpos) + return startpos, endpos + + def error(self): + raise SyntaxError + +# ----------------------------------------------------------------------------- +# == LRParser == +# +# The LR Parsing engine. +# ----------------------------------------------------------------------------- + +class LRParser: + def __init__(self, lrtab, errorf): + self.productions = lrtab.lr_productions + self.action = lrtab.lr_action + self.goto = lrtab.lr_goto + self.errorfunc = errorf + self.set_defaulted_states() + self.errorok = True + + def errok(self): + self.errorok = True + + def restart(self): + del self.statestack[:] + del self.symstack[:] + sym = YaccSymbol() + sym.type = '$end' + self.symstack.append(sym) + self.statestack.append(0) + + # Defaulted state support. + # This method identifies parser states where there is only one possible reduction action. + # For such states, the parser can make a choose to make a rule reduction without consuming + # the next look-ahead token. This delayed invocation of the tokenizer can be useful in + # certain kinds of advanced parsing situations where the lexer and parser interact with + # each other or change states (i.e., manipulation of scope, lexer states, etc.). + # + # See: http://www.gnu.org/software/bison/manual/html_node/Default-Reductions.html#Default-Reductions + def set_defaulted_states(self): + self.defaulted_states = {} + for state, actions in self.action.items(): + rules = list(actions.values()) + if len(rules) == 1 and rules[0] < 0: + self.defaulted_states[state] = rules[0] + + def disable_defaulted_states(self): + self.defaulted_states = {} + + def parse(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + if debug or yaccdevel: + if isinstance(debug, int): + debug = PlyLogger(sys.stderr) + return self.parsedebug(input, lexer, debug, tracking, tokenfunc) + elif tracking: + return self.parseopt(input, lexer, debug, tracking, tokenfunc) + else: + return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc) + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parsedebug(). + # + # This is the debugging enabled version of parse(). All changes made to the + # parsing engine should be made here. Optimized versions of this function + # are automatically created by the ply/ygen.py script. This script cuts out + # sections enclosed in markers such as this: + # + # #--! DEBUG + # statements + # #--! DEBUG + # + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parsedebug(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parsedebug-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + #--! DEBUG + debug.info('PLY: PARSE DEBUG START') + #--! DEBUG + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + #--! DEBUG + debug.debug('') + debug.debug('State : %s', state) + #--! DEBUG + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + #--! DEBUG + debug.debug('Defaulted state %s: Reduce using %d', state, -t) + #--! DEBUG + + #--! DEBUG + debug.debug('Stack : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + #--! DEBUG + debug.debug('Action : Shift and goto state %s', t) + #--! DEBUG + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + #--! DEBUG + if plen: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, + '['+','.join([format_stack_entry(_v.value) for _v in symstack[-plen:]])+']', + goto[statestack[-1-plen]][pname]) + else: + debug.info('Action : Reduce rule [%s] with %s and goto state %d', p.str, [], + goto[statestack[-1]][pname]) + + #--! DEBUG + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + #--! DEBUG + debug.info('Result : %s', format_result(pslice[0])) + #--! DEBUG + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + #--! DEBUG + debug.info('Done : Returning %s', format_result(result)) + debug.info('PLY: PARSE DEBUG END') + #--! DEBUG + return result + + if t is None: + + #--! DEBUG + debug.error('Error : %s', + ('%s . %s' % (' '.join([xx.type for xx in symstack][1:]), str(lookahead))).lstrip()) + #--! DEBUG + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parsedebug-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt(). + # + # Optimized version of parse() method. DO NOT EDIT THIS CODE DIRECTLY! + # This code is automatically generated by the ply/ygen.py script. Make + # changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + #--! TRACKING + if tracking: + t1 = targ[1] + sym.lineno = t1.lineno + sym.lexpos = t1.lexpos + t1 = targ[-1] + sym.endlineno = getattr(t1, 'endlineno', t1.lineno) + sym.endlexpos = getattr(t1, 'endlexpos', t1.lexpos) + #--! TRACKING + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + #--! TRACKING + if tracking: + sym.lineno = lexer.lineno + sym.lexpos = lexer.lexpos + #--! TRACKING + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + #--! TRACKING + if tracking: + sym.endlineno = getattr(lookahead, 'lineno', sym.lineno) + sym.endlexpos = getattr(lookahead, 'lexpos', sym.lexpos) + #--! TRACKING + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + #--! TRACKING + if tracking: + lookahead.lineno = sym.lineno + lookahead.lexpos = sym.lexpos + #--! TRACKING + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-end + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # parseopt_notrack(). + # + # Optimized version of parseopt() with line number tracking removed. + # DO NOT EDIT THIS CODE DIRECTLY. This code is automatically generated + # by the ply/ygen.py script. Make changes to the parsedebug() method instead. + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + def parseopt_notrack(self, input=None, lexer=None, debug=False, tracking=False, tokenfunc=None): + #--! parseopt-notrack-start + lookahead = None # Current lookahead symbol + lookaheadstack = [] # Stack of lookahead symbols + actions = self.action # Local reference to action table (to avoid lookup on self.) + goto = self.goto # Local reference to goto table (to avoid lookup on self.) + prod = self.productions # Local reference to production list (to avoid lookup on self.) + defaulted_states = self.defaulted_states # Local reference to defaulted states + pslice = YaccProduction(None) # Production object passed to grammar rules + errorcount = 0 # Used during error recovery + + + # If no lexer was given, we will try to use the lex module + if not lexer: + from . import lex + lexer = lex.lexer + + # Set up the lexer and parser objects on pslice + pslice.lexer = lexer + pslice.parser = self + + # If input was supplied, pass to lexer + if input is not None: + lexer.input(input) + + if tokenfunc is None: + # Tokenize function + get_token = lexer.token + else: + get_token = tokenfunc + + # Set the parser() token method (sometimes used in error recovery) + self.token = get_token + + # Set up the state and symbol stacks + + statestack = [] # Stack of parsing states + self.statestack = statestack + symstack = [] # Stack of grammar symbols + self.symstack = symstack + + pslice.stack = symstack # Put in the production + errtoken = None # Err token + + # The start state is assumed to be (0,$end) + + statestack.append(0) + sym = YaccSymbol() + sym.type = '$end' + symstack.append(sym) + state = 0 + while True: + # Get the next symbol on the input. If a lookahead symbol + # is already set, we just use that. Otherwise, we'll pull + # the next token off of the lookaheadstack or from the lexer + + + if state not in defaulted_states: + if not lookahead: + if not lookaheadstack: + lookahead = get_token() # Get the next token + else: + lookahead = lookaheadstack.pop() + if not lookahead: + lookahead = YaccSymbol() + lookahead.type = '$end' + + # Check the action table + ltype = lookahead.type + t = actions[state].get(ltype) + else: + t = defaulted_states[state] + + + if t is not None: + if t > 0: + # shift a symbol on the stack + statestack.append(t) + state = t + + + symstack.append(lookahead) + lookahead = None + + # Decrease error count on successful shift + if errorcount: + errorcount -= 1 + continue + + if t < 0: + # reduce a symbol on the stack, emit a production + p = prod[-t] + pname = p.name + plen = p.len + + # Get production function + sym = YaccSymbol() + sym.type = pname # Production name + sym.value = None + + + if plen: + targ = symstack[-plen-1:] + targ[0] = sym + + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # below as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + del symstack[-plen:] + self.state = state + p.callable(pslice) + del statestack[-plen:] + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + symstack.extend(targ[1:-1]) # Put the production slice back on the stack + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + else: + + + targ = [sym] + + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + # The code enclosed in this section is duplicated + # above as a performance optimization. Make sure + # changes get made in both locations. + + pslice.slice = targ + + try: + # Call the grammar rule with our special slice object + self.state = state + p.callable(pslice) + symstack.append(sym) + state = goto[statestack[-1]][pname] + statestack.append(state) + except SyntaxError: + # If an error was set. Enter error recovery state + lookaheadstack.append(lookahead) # Save the current lookahead token + statestack.pop() # Pop back one state (before the reduce) + state = statestack[-1] + sym.type = 'error' + sym.value = 'error' + lookahead = sym + errorcount = error_count + self.errorok = False + + continue + # !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + + if t == 0: + n = symstack[-1] + result = getattr(n, 'value', None) + return result + + if t is None: + + + # We have some kind of parsing error here. To handle + # this, we are going to push the current token onto + # the tokenstack and replace it with an 'error' token. + # If there are any synchronization rules, they may + # catch it. + # + # In addition to pushing the error token, we call call + # the user defined p_error() function if this is the + # first syntax error. This function is only called if + # errorcount == 0. + if errorcount == 0 or self.errorok: + errorcount = error_count + self.errorok = False + errtoken = lookahead + if errtoken.type == '$end': + errtoken = None # End of file! + if self.errorfunc: + if errtoken and not hasattr(errtoken, 'lexer'): + errtoken.lexer = lexer + self.state = state + tok = call_errorfunc(self.errorfunc, errtoken, self) + if self.errorok: + # User must have done some kind of panic + # mode recovery on their own. The + # returned token is the next lookahead + lookahead = tok + errtoken = None + continue + else: + if errtoken: + if hasattr(errtoken, 'lineno'): + lineno = lookahead.lineno + else: + lineno = 0 + if lineno: + sys.stderr.write('yacc: Syntax error at line %d, token=%s\n' % (lineno, errtoken.type)) + else: + sys.stderr.write('yacc: Syntax error, token=%s' % errtoken.type) + else: + sys.stderr.write('yacc: Parse error in input. EOF\n') + return + + else: + errorcount = error_count + + # case 1: the statestack only has 1 entry on it. If we're in this state, the + # entire parse has been rolled back and we're completely hosed. The token is + # discarded and we just keep going. + + if len(statestack) <= 1 and lookahead.type != '$end': + lookahead = None + errtoken = None + state = 0 + # Nuke the pushback stack + del lookaheadstack[:] + continue + + # case 2: the statestack has a couple of entries on it, but we're + # at the end of the file. nuke the top entry and generate an error token + + # Start nuking entries on the stack + if lookahead.type == '$end': + # Whoa. We're really hosed here. Bail out + return + + if lookahead.type != 'error': + sym = symstack[-1] + if sym.type == 'error': + # Hmmm. Error is on top of stack, we'll just nuke input + # symbol and continue + lookahead = None + continue + + # Create the error symbol for the first time and make it the new lookahead symbol + t = YaccSymbol() + t.type = 'error' + + if hasattr(lookahead, 'lineno'): + t.lineno = t.endlineno = lookahead.lineno + if hasattr(lookahead, 'lexpos'): + t.lexpos = t.endlexpos = lookahead.lexpos + t.value = lookahead + lookaheadstack.append(lookahead) + lookahead = t + else: + sym = symstack.pop() + statestack.pop() + state = statestack[-1] + + continue + + # Call an error function here + raise RuntimeError('yacc: internal parser error!!!\n') + + #--! parseopt-notrack-end + +# ----------------------------------------------------------------------------- +# === Grammar Representation === +# +# The following functions, classes, and variables are used to represent and +# manipulate the rules that make up a grammar. +# ----------------------------------------------------------------------------- + +# regex matching identifiers +_is_identifier = re.compile(r'^[a-zA-Z0-9_-]+$') + +# ----------------------------------------------------------------------------- +# class Production: +# +# This class stores the raw information about a single production or grammar rule. +# A grammar rule refers to a specification such as this: +# +# expr : expr PLUS term +# +# Here are the basic attributes defined on all productions +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','PLUS','term'] +# prec - Production precedence level +# number - Production number. +# func - Function that executes on reduce +# file - File where production function is defined +# lineno - Line number where production function is defined +# +# The following attributes are defined or optional. +# +# len - Length of the production (number of symbols on right hand side) +# usyms - Set of unique symbols found in the production +# ----------------------------------------------------------------------------- + +class Production(object): + reduced = 0 + def __init__(self, number, name, prod, precedence=('right', 0), func=None, file='', line=0): + self.name = name + self.prod = tuple(prod) + self.number = number + self.func = func + self.callable = None + self.file = file + self.line = line + self.prec = precedence + + # Internal settings used during table construction + + self.len = len(self.prod) # Length of the production + + # Create a list of unique production symbols used in the production + self.usyms = [] + for s in self.prod: + if s not in self.usyms: + self.usyms.append(s) + + # List of all LR items for the production + self.lr_items = [] + self.lr_next = None + + # Create a string representation + if self.prod: + self.str = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + self.str = '%s -> ' % self.name + + def __str__(self): + return self.str + + def __repr__(self): + return 'Production(' + str(self) + ')' + + def __len__(self): + return len(self.prod) + + def __nonzero__(self): + return 1 + + def __getitem__(self, index): + return self.prod[index] + + # Return the nth lr_item from the production (or None if at the end) + def lr_item(self, n): + if n > len(self.prod): + return None + p = LRItem(self, n) + # Precompute the list of productions immediately following. + try: + p.lr_after = Prodnames[p.prod[n+1]] + except (IndexError, KeyError): + p.lr_after = [] + try: + p.lr_before = p.prod[n-1] + except IndexError: + p.lr_before = None + return p + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + +# This class serves as a minimal standin for Production objects when +# reading table data from files. It only contains information +# actually used by the LR parsing engine, plus some additional +# debugging information. +class MiniProduction(object): + def __init__(self, str, name, len, func, file, line): + self.name = name + self.len = len + self.func = func + self.callable = None + self.file = file + self.line = line + self.str = str + + def __str__(self): + return self.str + + def __repr__(self): + return 'MiniProduction(%s)' % self.str + + # Bind the production function name to a callable + def bind(self, pdict): + if self.func: + self.callable = pdict[self.func] + + +# ----------------------------------------------------------------------------- +# class LRItem +# +# This class represents a specific stage of parsing a production rule. For +# example: +# +# expr : expr . PLUS term +# +# In the above, the "." represents the current location of the parse. Here +# basic attributes: +# +# name - Name of the production. For example 'expr' +# prod - A list of symbols on the right side ['expr','.', 'PLUS','term'] +# number - Production number. +# +# lr_next Next LR item. Example, if we are ' expr -> expr . PLUS term' +# then lr_next refers to 'expr -> expr PLUS . term' +# lr_index - LR item index (location of the ".") in the prod list. +# lookaheads - LALR lookahead symbols for this item +# len - Length of the production (number of symbols on right hand side) +# lr_after - List of all productions that immediately follow +# lr_before - Grammar symbol immediately before +# ----------------------------------------------------------------------------- + +class LRItem(object): + def __init__(self, p, n): + self.name = p.name + self.prod = list(p.prod) + self.number = p.number + self.lr_index = n + self.lookaheads = {} + self.prod.insert(n, '.') + self.prod = tuple(self.prod) + self.len = len(self.prod) + self.usyms = p.usyms + + def __str__(self): + if self.prod: + s = '%s -> %s' % (self.name, ' '.join(self.prod)) + else: + s = '%s -> ' % self.name + return s + + def __repr__(self): + return 'LRItem(' + str(self) + ')' + +# ----------------------------------------------------------------------------- +# rightmost_terminal() +# +# Return the rightmost terminal from a list of symbols. Used in add_production() +# ----------------------------------------------------------------------------- +def rightmost_terminal(symbols, terminals): + i = len(symbols) - 1 + while i >= 0: + if symbols[i] in terminals: + return symbols[i] + i -= 1 + return None + +# ----------------------------------------------------------------------------- +# === GRAMMAR CLASS === +# +# The following class represents the contents of the specified grammar along +# with various computed properties such as first sets, follow sets, LR items, etc. +# This data is used for critical parts of the table generation process later. +# ----------------------------------------------------------------------------- + +class GrammarError(YaccError): + pass + +class Grammar(object): + def __init__(self, terminals): + self.Productions = [None] # A list of all of the productions. The first + # entry is always reserved for the purpose of + # building an augmented grammar + + self.Prodnames = {} # A dictionary mapping the names of nonterminals to a list of all + # productions of that nonterminal. + + self.Prodmap = {} # A dictionary that is only used to detect duplicate + # productions. + + self.Terminals = {} # A dictionary mapping the names of terminal symbols to a + # list of the rules where they are used. + + for term in terminals: + self.Terminals[term] = [] + + self.Terminals['error'] = [] + + self.Nonterminals = {} # A dictionary mapping names of nonterminals to a list + # of rule numbers where they are used. + + self.First = {} # A dictionary of precomputed FIRST(x) symbols + + self.Follow = {} # A dictionary of precomputed FOLLOW(x) symbols + + self.Precedence = {} # Precedence rules for each terminal. Contains tuples of the + # form ('right',level) or ('nonassoc', level) or ('left',level) + + self.UsedPrecedence = set() # Precedence rules that were actually used by the grammer. + # This is only used to provide error checking and to generate + # a warning about unused precedence rules. + + self.Start = None # Starting symbol for the grammar + + + def __len__(self): + return len(self.Productions) + + def __getitem__(self, index): + return self.Productions[index] + + # ----------------------------------------------------------------------------- + # set_precedence() + # + # Sets the precedence for a given terminal. assoc is the associativity such as + # 'left','right', or 'nonassoc'. level is a numeric level. + # + # ----------------------------------------------------------------------------- + + def set_precedence(self, term, assoc, level): + assert self.Productions == [None], 'Must call set_precedence() before add_production()' + if term in self.Precedence: + raise GrammarError('Precedence already specified for terminal %r' % term) + if assoc not in ['left', 'right', 'nonassoc']: + raise GrammarError("Associativity must be one of 'left','right', or 'nonassoc'") + self.Precedence[term] = (assoc, level) + + # ----------------------------------------------------------------------------- + # add_production() + # + # Given an action function, this function assembles a production rule and + # computes its precedence level. + # + # The production rule is supplied as a list of symbols. For example, + # a rule such as 'expr : expr PLUS term' has a production name of 'expr' and + # symbols ['expr','PLUS','term']. + # + # Precedence is determined by the precedence of the right-most non-terminal + # or the precedence of a terminal specified by %prec. + # + # A variety of error checks are performed to make sure production symbols + # are valid and that %prec is used correctly. + # ----------------------------------------------------------------------------- + + def add_production(self, prodname, syms, func=None, file='', line=0): + + if prodname in self.Terminals: + raise GrammarError('%s:%d: Illegal rule name %r. Already defined as a token' % (file, line, prodname)) + if prodname == 'error': + raise GrammarError('%s:%d: Illegal rule name %r. error is a reserved word' % (file, line, prodname)) + if not _is_identifier.match(prodname): + raise GrammarError('%s:%d: Illegal rule name %r' % (file, line, prodname)) + + # Look for literal tokens + for n, s in enumerate(syms): + if s[0] in "'\"": + try: + c = eval(s) + if (len(c) > 1): + raise GrammarError('%s:%d: Literal token %s in rule %r may only be a single character' % + (file, line, s, prodname)) + if c not in self.Terminals: + self.Terminals[c] = [] + syms[n] = c + continue + except SyntaxError: + pass + if not _is_identifier.match(s) and s != '%prec': + raise GrammarError('%s:%d: Illegal name %r in rule %r' % (file, line, s, prodname)) + + # Determine the precedence level + if '%prec' in syms: + if syms[-1] == '%prec': + raise GrammarError('%s:%d: Syntax error. Nothing follows %%prec' % (file, line)) + if syms[-2] != '%prec': + raise GrammarError('%s:%d: Syntax error. %%prec can only appear at the end of a grammar rule' % + (file, line)) + precname = syms[-1] + prodprec = self.Precedence.get(precname) + if not prodprec: + raise GrammarError('%s:%d: Nothing known about the precedence of %r' % (file, line, precname)) + else: + self.UsedPrecedence.add(precname) + del syms[-2:] # Drop %prec from the rule + else: + # If no %prec, precedence is determined by the rightmost terminal symbol + precname = rightmost_terminal(syms, self.Terminals) + prodprec = self.Precedence.get(precname, ('right', 0)) + + # See if the rule is already in the rulemap + map = '%s -> %s' % (prodname, syms) + if map in self.Prodmap: + m = self.Prodmap[map] + raise GrammarError('%s:%d: Duplicate rule %s. ' % (file, line, m) + + 'Previous definition at %s:%d' % (m.file, m.line)) + + # From this point on, everything is valid. Create a new Production instance + pnumber = len(self.Productions) + if prodname not in self.Nonterminals: + self.Nonterminals[prodname] = [] + + # Add the production number to Terminals and Nonterminals + for t in syms: + if t in self.Terminals: + self.Terminals[t].append(pnumber) + else: + if t not in self.Nonterminals: + self.Nonterminals[t] = [] + self.Nonterminals[t].append(pnumber) + + # Create a production and add it to the list of productions + p = Production(pnumber, prodname, syms, prodprec, func, file, line) + self.Productions.append(p) + self.Prodmap[map] = p + + # Add to the global productions list + try: + self.Prodnames[prodname].append(p) + except KeyError: + self.Prodnames[prodname] = [p] + + # ----------------------------------------------------------------------------- + # set_start() + # + # Sets the starting symbol and creates the augmented grammar. Production + # rule 0 is S' -> start where start is the start symbol. + # ----------------------------------------------------------------------------- + + def set_start(self, start=None): + if not start: + start = self.Productions[1].name + if start not in self.Nonterminals: + raise GrammarError('start symbol %s undefined' % start) + self.Productions[0] = Production(0, "S'", [start]) + self.Nonterminals[start].append(0) + self.Start = start + + # ----------------------------------------------------------------------------- + # find_unreachable() + # + # Find all of the nonterminal symbols that can't be reached from the starting + # symbol. Returns a list of nonterminals that can't be reached. + # ----------------------------------------------------------------------------- + + def find_unreachable(self): + + # Mark all symbols that are reachable from a symbol s + def mark_reachable_from(s): + if s in reachable: + return + reachable.add(s) + for p in self.Prodnames.get(s, []): + for r in p.prod: + mark_reachable_from(r) + + reachable = set() + mark_reachable_from(self.Productions[0].prod[0]) + return [s for s in self.Nonterminals if s not in reachable] + + # ----------------------------------------------------------------------------- + # infinite_cycles() + # + # This function looks at the various parsing rules and tries to detect + # infinite recursion cycles (grammar rules where there is no possible way + # to derive a string of only terminals). + # ----------------------------------------------------------------------------- + + def infinite_cycles(self): + terminates = {} + + # Terminals: + for t in self.Terminals: + terminates[t] = True + + terminates['$end'] = True + + # Nonterminals: + + # Initialize to false: + for n in self.Nonterminals: + terminates[n] = False + + # Then propagate termination until no change: + while True: + some_change = False + for (n, pl) in self.Prodnames.items(): + # Nonterminal n terminates iff any of its productions terminates. + for p in pl: + # Production p terminates iff all of its rhs symbols terminate. + for s in p.prod: + if not terminates[s]: + # The symbol s does not terminate, + # so production p does not terminate. + p_terminates = False + break + else: + # didn't break from the loop, + # so every symbol s terminates + # so production p terminates. + p_terminates = True + + if p_terminates: + # symbol n terminates! + if not terminates[n]: + terminates[n] = True + some_change = True + # Don't need to consider any more productions for this n. + break + + if not some_change: + break + + infinite = [] + for (s, term) in terminates.items(): + if not term: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + # s is used-but-not-defined, and we've already warned of that, + # so it would be overkill to say that it's also non-terminating. + pass + else: + infinite.append(s) + + return infinite + + # ----------------------------------------------------------------------------- + # undefined_symbols() + # + # Find all symbols that were used the grammar, but not defined as tokens or + # grammar rules. Returns a list of tuples (sym, prod) where sym in the symbol + # and prod is the production where the symbol was used. + # ----------------------------------------------------------------------------- + def undefined_symbols(self): + result = [] + for p in self.Productions: + if not p: + continue + + for s in p.prod: + if s not in self.Prodnames and s not in self.Terminals and s != 'error': + result.append((s, p)) + return result + + # ----------------------------------------------------------------------------- + # unused_terminals() + # + # Find all terminals that were defined, but not used by the grammar. Returns + # a list of all symbols. + # ----------------------------------------------------------------------------- + def unused_terminals(self): + unused_tok = [] + for s, v in self.Terminals.items(): + if s != 'error' and not v: + unused_tok.append(s) + + return unused_tok + + # ------------------------------------------------------------------------------ + # unused_rules() + # + # Find all grammar rules that were defined, but not used (maybe not reachable) + # Returns a list of productions. + # ------------------------------------------------------------------------------ + + def unused_rules(self): + unused_prod = [] + for s, v in self.Nonterminals.items(): + if not v: + p = self.Prodnames[s][0] + unused_prod.append(p) + return unused_prod + + # ----------------------------------------------------------------------------- + # unused_precedence() + # + # Returns a list of tuples (term,precedence) corresponding to precedence + # rules that were never used by the grammar. term is the name of the terminal + # on which precedence was applied and precedence is a string such as 'left' or + # 'right' corresponding to the type of precedence. + # ----------------------------------------------------------------------------- + + def unused_precedence(self): + unused = [] + for termname in self.Precedence: + if not (termname in self.Terminals or termname in self.UsedPrecedence): + unused.append((termname, self.Precedence[termname][0])) + + return unused + + # ------------------------------------------------------------------------- + # _first() + # + # Compute the value of FIRST1(beta) where beta is a tuple of symbols. + # + # During execution of compute_first1, the result may be incomplete. + # Afterward (e.g., when called from compute_follow()), it will be complete. + # ------------------------------------------------------------------------- + def _first(self, beta): + + # We are computing First(x1,x2,x3,...,xn) + result = [] + for x in beta: + x_produces_empty = False + + # Add all the non- symbols of First[x] to the result. + for f in self.First[x]: + if f == '': + x_produces_empty = True + else: + if f not in result: + result.append(f) + + if x_produces_empty: + # We have to consider the next x in beta, + # i.e. stay in the loop. + pass + else: + # We don't have to consider any further symbols in beta. + break + else: + # There was no 'break' from the loop, + # so x_produces_empty was true for all x in beta, + # so beta produces empty as well. + result.append('') + + return result + + # ------------------------------------------------------------------------- + # compute_first() + # + # Compute the value of FIRST1(X) for all symbols + # ------------------------------------------------------------------------- + def compute_first(self): + if self.First: + return self.First + + # Terminals: + for t in self.Terminals: + self.First[t] = [t] + + self.First['$end'] = ['$end'] + + # Nonterminals: + + # Initialize to the empty set: + for n in self.Nonterminals: + self.First[n] = [] + + # Then propagate symbols until no change: + while True: + some_change = False + for n in self.Nonterminals: + for p in self.Prodnames[n]: + for f in self._first(p.prod): + if f not in self.First[n]: + self.First[n].append(f) + some_change = True + if not some_change: + break + + return self.First + + # --------------------------------------------------------------------- + # compute_follow() + # + # Computes all of the follow sets for every non-terminal symbol. The + # follow set is the set of all symbols that might follow a given + # non-terminal. See the Dragon book, 2nd Ed. p. 189. + # --------------------------------------------------------------------- + def compute_follow(self, start=None): + # If already computed, return the result + if self.Follow: + return self.Follow + + # If first sets not computed yet, do that first. + if not self.First: + self.compute_first() + + # Add '$end' to the follow list of the start symbol + for k in self.Nonterminals: + self.Follow[k] = [] + + if not start: + start = self.Productions[1].name + + self.Follow[start] = ['$end'] + + while True: + didadd = False + for p in self.Productions[1:]: + # Here is the production set + for i, B in enumerate(p.prod): + if B in self.Nonterminals: + # Okay. We got a non-terminal in a production + fst = self._first(p.prod[i+1:]) + hasempty = False + for f in fst: + if f != '' and f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if f == '': + hasempty = True + if hasempty or i == (len(p.prod)-1): + # Add elements of follow(a) to follow(b) + for f in self.Follow[p.name]: + if f not in self.Follow[B]: + self.Follow[B].append(f) + didadd = True + if not didadd: + break + return self.Follow + + + # ----------------------------------------------------------------------------- + # build_lritems() + # + # This function walks the list of productions and builds a complete set of the + # LR items. The LR items are stored in two ways: First, they are uniquely + # numbered and placed in the list _lritems. Second, a linked list of LR items + # is built for each production. For example: + # + # E -> E PLUS E + # + # Creates the list + # + # [E -> . E PLUS E, E -> E . PLUS E, E -> E PLUS . E, E -> E PLUS E . ] + # ----------------------------------------------------------------------------- + + def build_lritems(self): + for p in self.Productions: + lastlri = p + i = 0 + lr_items = [] + while True: + if i > len(p): + lri = None + else: + lri = LRItem(p, i) + # Precompute the list of productions immediately following + try: + lri.lr_after = self.Prodnames[lri.prod[i+1]] + except (IndexError, KeyError): + lri.lr_after = [] + try: + lri.lr_before = lri.prod[i-1] + except IndexError: + lri.lr_before = None + + lastlri.lr_next = lri + if not lri: + break + lr_items.append(lri) + lastlri = lri + i += 1 + p.lr_items = lr_items + +# ----------------------------------------------------------------------------- +# == Class LRTable == +# +# This basic class represents a basic table of LR parsing information. +# Methods for generating the tables are not defined here. They are defined +# in the derived class LRGeneratedTable. +# ----------------------------------------------------------------------------- + +class VersionError(YaccError): + pass + +class LRTable(object): + def __init__(self): + self.lr_action = None + self.lr_goto = None + self.lr_productions = None + self.lr_method = None + + def read_table(self, module): + if isinstance(module, types.ModuleType): + parsetab = module + else: + exec('import %s' % module) + parsetab = sys.modules[module] + + if parsetab._tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + + self.lr_action = parsetab._lr_action + self.lr_goto = parsetab._lr_goto + + self.lr_productions = [] + for p in parsetab._lr_productions: + self.lr_productions.append(MiniProduction(*p)) + + self.lr_method = parsetab._lr_method + return parsetab._lr_signature + + def read_pickle(self, filename): + try: + import cPickle as pickle + except ImportError: + import pickle + + if not os.path.exists(filename): + raise ImportError + + in_f = open(filename, 'rb') + + tabversion = pickle.load(in_f) + if tabversion != __tabversion__: + raise VersionError('yacc table file version is out of date') + self.lr_method = pickle.load(in_f) + signature = pickle.load(in_f) + self.lr_action = pickle.load(in_f) + self.lr_goto = pickle.load(in_f) + productions = pickle.load(in_f) + + self.lr_productions = [] + for p in productions: + self.lr_productions.append(MiniProduction(*p)) + + in_f.close() + return signature + + # Bind all production function names to callable objects in pdict + def bind_callables(self, pdict): + for p in self.lr_productions: + p.bind(pdict) + + +# ----------------------------------------------------------------------------- +# === LR Generator === +# +# The following classes and functions are used to generate LR parsing tables on +# a grammar. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# digraph() +# traverse() +# +# The following two functions are used to compute set valued functions +# of the form: +# +# F(x) = F'(x) U U{F(y) | x R y} +# +# This is used to compute the values of Read() sets as well as FOLLOW sets +# in LALR(1) generation. +# +# Inputs: X - An input set +# R - A relation +# FP - Set-valued function +# ------------------------------------------------------------------------------ + +def digraph(X, R, FP): + N = {} + for x in X: + N[x] = 0 + stack = [] + F = {} + for x in X: + if N[x] == 0: + traverse(x, N, stack, F, X, R, FP) + return F + +def traverse(x, N, stack, F, X, R, FP): + stack.append(x) + d = len(stack) + N[x] = d + F[x] = FP(x) # F(X) <- F'(x) + + rel = R(x) # Get y's related to x + for y in rel: + if N[y] == 0: + traverse(y, N, stack, F, X, R, FP) + N[x] = min(N[x], N[y]) + for a in F.get(y, []): + if a not in F[x]: + F[x].append(a) + if N[x] == d: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + while element != x: + N[stack[-1]] = MAXINT + F[stack[-1]] = F[x] + element = stack.pop() + +class LALRError(YaccError): + pass + +# ----------------------------------------------------------------------------- +# == LRGeneratedTable == +# +# This class implements the LR table generation algorithm. There are no +# public methods except for write() +# ----------------------------------------------------------------------------- + +class LRGeneratedTable(LRTable): + def __init__(self, grammar, method='LALR', log=None): + if method not in ['SLR', 'LALR']: + raise LALRError('Unsupported method %s' % method) + + self.grammar = grammar + self.lr_method = method + + # Set up the logger + if not log: + log = NullLogger() + self.log = log + + # Internal attributes + self.lr_action = {} # Action table + self.lr_goto = {} # Goto table + self.lr_productions = grammar.Productions # Copy of grammar Production array + self.lr_goto_cache = {} # Cache of computed gotos + self.lr0_cidhash = {} # Cache of closures + + self._add_count = 0 # Internal counter used to detect cycles + + # Diagonistic information filled in by the table generator + self.sr_conflict = 0 + self.rr_conflict = 0 + self.conflicts = [] # List of conflicts + + self.sr_conflicts = [] + self.rr_conflicts = [] + + # Build the tables + self.grammar.build_lritems() + self.grammar.compute_first() + self.grammar.compute_follow() + self.lr_parse_table() + + # Compute the LR(0) closure operation on I, where I is a set of LR(0) items. + + def lr0_closure(self, I): + self._add_count += 1 + + # Add everything in I to J + J = I[:] + didadd = True + while didadd: + didadd = False + for j in J: + for x in j.lr_after: + if getattr(x, 'lr0_added', 0) == self._add_count: + continue + # Add B --> .G to J + J.append(x.lr_next) + x.lr0_added = self._add_count + didadd = True + + return J + + # Compute the LR(0) goto function goto(I,X) where I is a set + # of LR(0) items and X is a grammar symbol. This function is written + # in a way that guarantees uniqueness of the generated goto sets + # (i.e. the same goto set will never be returned as two different Python + # objects). With uniqueness, we can later do fast set comparisons using + # id(obj) instead of element-wise comparison. + + def lr0_goto(self, I, x): + # First we look for a previously cached entry + g = self.lr_goto_cache.get((id(I), x)) + if g: + return g + + # Now we generate the goto set in a way that guarantees uniqueness + # of the result + + s = self.lr_goto_cache.get(x) + if not s: + s = {} + self.lr_goto_cache[x] = s + + gs = [] + for p in I: + n = p.lr_next + if n and n.lr_before == x: + s1 = s.get(id(n)) + if not s1: + s1 = {} + s[id(n)] = s1 + gs.append(n) + s = s1 + g = s.get('$end') + if not g: + if gs: + g = self.lr0_closure(gs) + s['$end'] = g + else: + s['$end'] = gs + self.lr_goto_cache[(id(I), x)] = g + return g + + # Compute the LR(0) sets of item function + def lr0_items(self): + C = [self.lr0_closure([self.grammar.Productions[0].lr_next])] + i = 0 + for I in C: + self.lr0_cidhash[id(I)] = i + i += 1 + + # Loop over the items in C and each grammar symbols + i = 0 + while i < len(C): + I = C[i] + i += 1 + + # Collect all of the symbols that could possibly be in the goto(I,X) sets + asyms = {} + for ii in I: + for s in ii.usyms: + asyms[s] = None + + for x in asyms: + g = self.lr0_goto(I, x) + if not g or id(g) in self.lr0_cidhash: + continue + self.lr0_cidhash[id(g)] = len(C) + C.append(g) + + return C + + # ----------------------------------------------------------------------------- + # ==== LALR(1) Parsing ==== + # + # LALR(1) parsing is almost exactly the same as SLR except that instead of + # relying upon Follow() sets when performing reductions, a more selective + # lookahead set that incorporates the state of the LR(0) machine is utilized. + # Thus, we mainly just have to focus on calculating the lookahead sets. + # + # The method used here is due to DeRemer and Pennelo (1982). + # + # DeRemer, F. L., and T. J. Pennelo: "Efficient Computation of LALR(1) + # Lookahead Sets", ACM Transactions on Programming Languages and Systems, + # Vol. 4, No. 4, Oct. 1982, pp. 615-649 + # + # Further details can also be found in: + # + # J. Tremblay and P. Sorenson, "The Theory and Practice of Compiler Writing", + # McGraw-Hill Book Company, (1985). + # + # ----------------------------------------------------------------------------- + + # ----------------------------------------------------------------------------- + # compute_nullable_nonterminals() + # + # Creates a dictionary containing all of the non-terminals that might produce + # an empty production. + # ----------------------------------------------------------------------------- + + def compute_nullable_nonterminals(self): + nullable = set() + num_nullable = 0 + while True: + for p in self.grammar.Productions[1:]: + if p.len == 0: + nullable.add(p.name) + continue + for t in p.prod: + if t not in nullable: + break + else: + nullable.add(p.name) + if len(nullable) == num_nullable: + break + num_nullable = len(nullable) + return nullable + + # ----------------------------------------------------------------------------- + # find_nonterminal_trans(C) + # + # Given a set of LR(0) items, this functions finds all of the non-terminal + # transitions. These are transitions in which a dot appears immediately before + # a non-terminal. Returns a list of tuples of the form (state,N) where state + # is the state number and N is the nonterminal symbol. + # + # The input C is the set of LR(0) items. + # ----------------------------------------------------------------------------- + + def find_nonterminal_transitions(self, C): + trans = [] + for stateno, state in enumerate(C): + for p in state: + if p.lr_index < p.len - 1: + t = (stateno, p.prod[p.lr_index+1]) + if t[1] in self.grammar.Nonterminals: + if t not in trans: + trans.append(t) + return trans + + # ----------------------------------------------------------------------------- + # dr_relation() + # + # Computes the DR(p,A) relationships for non-terminal transitions. The input + # is a tuple (state,N) where state is a number and N is a nonterminal symbol. + # + # Returns a list of terminals. + # ----------------------------------------------------------------------------- + + def dr_relation(self, C, trans, nullable): + dr_set = {} + state, N = trans + terms = [] + + g = self.lr0_goto(C[state], N) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index+1] + if a in self.grammar.Terminals: + if a not in terms: + terms.append(a) + + # This extra bit is to handle the start state + if state == 0 and N == self.grammar.Productions[0].prod[0]: + terms.append('$end') + + return terms + + # ----------------------------------------------------------------------------- + # reads_relation() + # + # Computes the READS() relation (p,A) READS (t,C). + # ----------------------------------------------------------------------------- + + def reads_relation(self, C, trans, empty): + # Look for empty transitions + rel = [] + state, N = trans + + g = self.lr0_goto(C[state], N) + j = self.lr0_cidhash.get(id(g), -1) + for p in g: + if p.lr_index < p.len - 1: + a = p.prod[p.lr_index + 1] + if a in empty: + rel.append((j, a)) + + return rel + + # ----------------------------------------------------------------------------- + # compute_lookback_includes() + # + # Determines the lookback and includes relations + # + # LOOKBACK: + # + # This relation is determined by running the LR(0) state machine forward. + # For example, starting with a production "N : . A B C", we run it forward + # to obtain "N : A B C ." We then build a relationship between this final + # state and the starting state. These relationships are stored in a dictionary + # lookdict. + # + # INCLUDES: + # + # Computes the INCLUDE() relation (p,A) INCLUDES (p',B). + # + # This relation is used to determine non-terminal transitions that occur + # inside of other non-terminal transition states. (p,A) INCLUDES (p', B) + # if the following holds: + # + # B -> LAT, where T -> epsilon and p' -L-> p + # + # L is essentially a prefix (which may be empty), T is a suffix that must be + # able to derive an empty string. State p' must lead to state p with the string L. + # + # ----------------------------------------------------------------------------- + + def compute_lookback_includes(self, C, trans, nullable): + lookdict = {} # Dictionary of lookback relations + includedict = {} # Dictionary of include relations + + # Make a dictionary of non-terminal transitions + dtrans = {} + for t in trans: + dtrans[t] = 1 + + # Loop over all transitions and compute lookbacks and includes + for state, N in trans: + lookb = [] + includes = [] + for p in C[state]: + if p.name != N: + continue + + # Okay, we have a name match. We now follow the production all the way + # through the state machine until we get the . on the right hand side + + lr_index = p.lr_index + j = state + while lr_index < p.len - 1: + lr_index = lr_index + 1 + t = p.prod[lr_index] + + # Check to see if this symbol and state are a non-terminal transition + if (j, t) in dtrans: + # Yes. Okay, there is some chance that this is an includes relation + # the only way to know for certain is whether the rest of the + # production derives empty + + li = lr_index + 1 + while li < p.len: + if p.prod[li] in self.grammar.Terminals: + break # No forget it + if p.prod[li] not in nullable: + break + li = li + 1 + else: + # Appears to be a relation between (j,t) and (state,N) + includes.append((j, t)) + + g = self.lr0_goto(C[j], t) # Go to next set + j = self.lr0_cidhash.get(id(g), -1) # Go to next state + + # When we get here, j is the final state, now we have to locate the production + for r in C[j]: + if r.name != p.name: + continue + if r.len != p.len: + continue + i = 0 + # This look is comparing a production ". A B C" with "A B C ." + while i < r.lr_index: + if r.prod[i] != p.prod[i+1]: + break + i = i + 1 + else: + lookb.append((j, r)) + for i in includes: + if i not in includedict: + includedict[i] = [] + includedict[i].append((state, N)) + lookdict[(state, N)] = lookb + + return lookdict, includedict + + # ----------------------------------------------------------------------------- + # compute_read_sets() + # + # Given a set of LR(0) items, this function computes the read sets. + # + # Inputs: C = Set of LR(0) items + # ntrans = Set of nonterminal transitions + # nullable = Set of empty transitions + # + # Returns a set containing the read sets + # ----------------------------------------------------------------------------- + + def compute_read_sets(self, C, ntrans, nullable): + FP = lambda x: self.dr_relation(C, x, nullable) + R = lambda x: self.reads_relation(C, x, nullable) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # compute_follow_sets() + # + # Given a set of LR(0) items, a set of non-terminal transitions, a readset, + # and an include set, this function computes the follow sets + # + # Follow(p,A) = Read(p,A) U U {Follow(p',B) | (p,A) INCLUDES (p',B)} + # + # Inputs: + # ntrans = Set of nonterminal transitions + # readsets = Readset (previously computed) + # inclsets = Include sets (previously computed) + # + # Returns a set containing the follow sets + # ----------------------------------------------------------------------------- + + def compute_follow_sets(self, ntrans, readsets, inclsets): + FP = lambda x: readsets[x] + R = lambda x: inclsets.get(x, []) + F = digraph(ntrans, R, FP) + return F + + # ----------------------------------------------------------------------------- + # add_lookaheads() + # + # Attaches the lookahead symbols to grammar rules. + # + # Inputs: lookbacks - Set of lookback relations + # followset - Computed follow set + # + # This function directly attaches the lookaheads to productions contained + # in the lookbacks set + # ----------------------------------------------------------------------------- + + def add_lookaheads(self, lookbacks, followset): + for trans, lb in lookbacks.items(): + # Loop over productions in lookback + for state, p in lb: + if state not in p.lookaheads: + p.lookaheads[state] = [] + f = followset.get(trans, []) + for a in f: + if a not in p.lookaheads[state]: + p.lookaheads[state].append(a) + + # ----------------------------------------------------------------------------- + # add_lalr_lookaheads() + # + # This function does all of the work of adding lookahead information for use + # with LALR parsing + # ----------------------------------------------------------------------------- + + def add_lalr_lookaheads(self, C): + # Determine all of the nullable nonterminals + nullable = self.compute_nullable_nonterminals() + + # Find all non-terminal transitions + trans = self.find_nonterminal_transitions(C) + + # Compute read sets + readsets = self.compute_read_sets(C, trans, nullable) + + # Compute lookback/includes relations + lookd, included = self.compute_lookback_includes(C, trans, nullable) + + # Compute LALR FOLLOW sets + followsets = self.compute_follow_sets(trans, readsets, included) + + # Add all of the lookaheads + self.add_lookaheads(lookd, followsets) + + # ----------------------------------------------------------------------------- + # lr_parse_table() + # + # This function constructs the parse tables for SLR or LALR + # ----------------------------------------------------------------------------- + def lr_parse_table(self): + Productions = self.grammar.Productions + Precedence = self.grammar.Precedence + goto = self.lr_goto # Goto array + action = self.lr_action # Action array + log = self.log # Logger for output + + actionp = {} # Action production array (temporary) + + log.info('Parsing method: %s', self.lr_method) + + # Step 1: Construct C = { I0, I1, ... IN}, collection of LR(0) items + # This determines the number of states + + C = self.lr0_items() + + if self.lr_method == 'LALR': + self.add_lalr_lookaheads(C) + + # Build the parser table, state by state + st = 0 + for I in C: + # Loop over each production in I + actlist = [] # List of actions + st_action = {} + st_actionp = {} + st_goto = {} + log.info('') + log.info('state %d', st) + log.info('') + for p in I: + log.info(' (%d) %s', p.number, p) + log.info('') + + for p in I: + if p.len == p.lr_index + 1: + if p.name == "S'": + # Start symbol. Accept! + st_action['$end'] = 0 + st_actionp['$end'] = p + else: + # We are at the end of a production. Reduce! + if self.lr_method == 'LALR': + laheads = p.lookaheads[st] + else: + laheads = self.grammar.Follow[p.name] + for a in laheads: + actlist.append((a, p, 'reduce using rule %d (%s)' % (p.number, p))) + r = st_action.get(a) + if r is not None: + # Whoa. Have a shift/reduce or reduce/reduce conflict + if r > 0: + # Need to decide on shift or reduce here + # By default we favor shifting. Need to add + # some precedence rules here. + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from rule being reduced (p) + rprec, rlevel = Productions[p.number].prec + + if (slevel < rlevel) or ((slevel == rlevel) and (rprec == 'left')): + # We really need to reduce here. + st_action[a] = -p.number + st_actionp[a] = p + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + Productions[p.number].reduced += 1 + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the shift + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif r < 0: + # Reduce/reduce conflict. In this case, we favor the rule + # that was defined first in the grammar file + oldp = Productions[-r] + pp = Productions[p.number] + if oldp.line > pp.line: + st_action[a] = -p.number + st_actionp[a] = p + chosenp, rejectp = pp, oldp + Productions[p.number].reduced += 1 + Productions[oldp.number].reduced -= 1 + else: + chosenp, rejectp = oldp, pp + self.rr_conflicts.append((st, chosenp, rejectp)) + log.info(' ! reduce/reduce conflict for %s resolved using rule %d (%s)', + a, st_actionp[a].number, st_actionp[a]) + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = -p.number + st_actionp[a] = p + Productions[p.number].reduced += 1 + else: + i = p.lr_index + a = p.prod[i+1] # Get symbol right after the "." + if a in self.grammar.Terminals: + g = self.lr0_goto(I, a) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + # We are in a shift state + actlist.append((a, p, 'shift and go to state %d' % j)) + r = st_action.get(a) + if r is not None: + # Whoa have a shift/reduce or shift/shift conflict + if r > 0: + if r != j: + raise LALRError('Shift/shift conflict in state %d' % st) + elif r < 0: + # Do a precedence check. + # - if precedence of reduce rule is higher, we reduce. + # - if precedence of reduce is same and left assoc, we reduce. + # - otherwise we shift + + # Shift precedence comes from the token + sprec, slevel = Precedence.get(a, ('right', 0)) + + # Reduce precedence comes from the rule that could have been reduced + rprec, rlevel = Productions[st_actionp[a].number].prec + + if (slevel > rlevel) or ((slevel == rlevel) and (rprec == 'right')): + # We decide to shift here... highest precedence to shift + Productions[st_actionp[a].number].reduced -= 1 + st_action[a] = j + st_actionp[a] = p + if not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as shift', a) + self.sr_conflicts.append((st, a, 'shift')) + elif (slevel == rlevel) and (rprec == 'nonassoc'): + st_action[a] = None + else: + # Hmmm. Guess we'll keep the reduce + if not slevel and not rlevel: + log.info(' ! shift/reduce conflict for %s resolved as reduce', a) + self.sr_conflicts.append((st, a, 'reduce')) + + else: + raise LALRError('Unknown conflict in state %d' % st) + else: + st_action[a] = j + st_actionp[a] = p + + # Print the actions associated with each terminal + _actprint = {} + for a, p, m in actlist: + if a in st_action: + if p is st_actionp[a]: + log.info(' %-15s %s', a, m) + _actprint[(a, m)] = 1 + log.info('') + # Print the actions that were not used. (debugging) + not_used = 0 + for a, p, m in actlist: + if a in st_action: + if p is not st_actionp[a]: + if not (a, m) in _actprint: + log.debug(' ! %-15s [ %s ]', a, m) + not_used = 1 + _actprint[(a, m)] = 1 + if not_used: + log.debug('') + + # Construct the goto table for this state + + nkeys = {} + for ii in I: + for s in ii.usyms: + if s in self.grammar.Nonterminals: + nkeys[s] = None + for n in nkeys: + g = self.lr0_goto(I, n) + j = self.lr0_cidhash.get(id(g), -1) + if j >= 0: + st_goto[n] = j + log.info(' %-30s shift and go to state %d', n, j) + + action[st] = st_action + actionp[st] = st_actionp + goto[st] = st_goto + st += 1 + + # ----------------------------------------------------------------------------- + # write() + # + # This function writes the LR parsing tables to a file + # ----------------------------------------------------------------------------- + + def write_table(self, tabmodule, outputdir='', signature=''): + if isinstance(tabmodule, types.ModuleType): + raise IOError("Won't overwrite existing tabmodule") + + basemodulename = tabmodule.split('.')[-1] + filename = os.path.join(outputdir, basemodulename) + '.py' + try: + f = open(filename, 'w') + + f.write(''' +# %s +# This file is automatically generated. Do not edit. +_tabversion = %r + +_lr_method = %r + +_lr_signature = %r + ''' % (os.path.basename(filename), __tabversion__, self.lr_method, signature)) + + # Change smaller to 0 to go back to original tables + smaller = 1 + + # Factor out names to try and make smaller + if smaller: + items = {} + + for s, nd in self.lr_action.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_action_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items +''') + + else: + f.write('\n_lr_action = { ') + for k, v in self.lr_action.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + if smaller: + # Factor out names to try and make smaller + items = {} + + for s, nd in self.lr_goto.items(): + for name, v in nd.items(): + i = items.get(name) + if not i: + i = ([], []) + items[name] = i + i[0].append(s) + i[1].append(v) + + f.write('\n_lr_goto_items = {') + for k, v in items.items(): + f.write('%r:([' % k) + for i in v[0]: + f.write('%r,' % i) + f.write('],[') + for i in v[1]: + f.write('%r,' % i) + + f.write(']),') + f.write('}\n') + + f.write(''' +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +''') + else: + f.write('\n_lr_goto = { ') + for k, v in self.lr_goto.items(): + f.write('(%r,%r):%r,' % (k[0], k[1], v)) + f.write('}\n') + + # Write production table + f.write('_lr_productions = [\n') + for p in self.lr_productions: + if p.func: + f.write(' (%r,%r,%d,%r,%r,%d),\n' % (p.str, p.name, p.len, + p.func, os.path.basename(p.file), p.line)) + else: + f.write(' (%r,%r,%d,None,None,None),\n' % (str(p), p.name, p.len)) + f.write(']\n') + f.close() + + except IOError as e: + raise + + + # ----------------------------------------------------------------------------- + # pickle_table() + # + # This function pickles the LR parsing tables to a supplied file object + # ----------------------------------------------------------------------------- + + def pickle_table(self, filename, signature=''): + try: + import cPickle as pickle + except ImportError: + import pickle + with open(filename, 'wb') as outf: + pickle.dump(__tabversion__, outf, pickle_protocol) + pickle.dump(self.lr_method, outf, pickle_protocol) + pickle.dump(signature, outf, pickle_protocol) + pickle.dump(self.lr_action, outf, pickle_protocol) + pickle.dump(self.lr_goto, outf, pickle_protocol) + + outp = [] + for p in self.lr_productions: + if p.func: + outp.append((p.str, p.name, p.len, p.func, os.path.basename(p.file), p.line)) + else: + outp.append((str(p), p.name, p.len, None, None, None)) + pickle.dump(outp, outf, pickle_protocol) + +# ----------------------------------------------------------------------------- +# === INTROSPECTION === +# +# The following functions and classes are used to implement the PLY +# introspection features followed by the yacc() function itself. +# ----------------------------------------------------------------------------- + +# ----------------------------------------------------------------------------- +# get_caller_module_dict() +# +# This function returns a dictionary containing all of the symbols defined within +# a caller further down the call stack. This is used to get the environment +# associated with the yacc() call if none was provided. +# ----------------------------------------------------------------------------- + +def get_caller_module_dict(levels): + f = sys._getframe(levels) + ldict = f.f_globals.copy() + if f.f_globals != f.f_locals: + ldict.update(f.f_locals) + return ldict + +# ----------------------------------------------------------------------------- +# parse_grammar() +# +# This takes a raw grammar rule string and parses it into production data +# ----------------------------------------------------------------------------- +def parse_grammar(doc, file, line): + grammar = [] + # Split the doc string into lines + pstrings = doc.splitlines() + lastp = None + dline = line + for ps in pstrings: + dline += 1 + p = ps.split() + if not p: + continue + try: + if p[0] == '|': + # This is a continuation of a previous rule + if not lastp: + raise SyntaxError("%s:%d: Misplaced '|'" % (file, dline)) + prodname = lastp + syms = p[1:] + else: + prodname = p[0] + lastp = prodname + syms = p[2:] + assign = p[1] + if assign != ':' and assign != '::=': + raise SyntaxError("%s:%d: Syntax error. Expected ':'" % (file, dline)) + + grammar.append((file, dline, prodname, syms)) + except SyntaxError: + raise + except Exception: + raise SyntaxError('%s:%d: Syntax error in rule %r' % (file, dline, ps.strip())) + + return grammar + +# ----------------------------------------------------------------------------- +# ParserReflect() +# +# This class represents information extracted for building a parser including +# start symbol, error function, tokens, precedence list, action functions, +# etc. +# ----------------------------------------------------------------------------- +class ParserReflect(object): + def __init__(self, pdict, log=None): + self.pdict = pdict + self.start = None + self.error_func = None + self.tokens = None + self.modules = set() + self.grammar = [] + self.error = False + + if log is None: + self.log = PlyLogger(sys.stderr) + else: + self.log = log + + # Get all of the basic information + def get_all(self): + self.get_start() + self.get_error_func() + self.get_tokens() + self.get_precedence() + self.get_pfunctions() + + # Validate all of the information + def validate_all(self): + self.validate_start() + self.validate_error_func() + self.validate_tokens() + self.validate_precedence() + self.validate_pfunctions() + self.validate_modules() + return self.error + + # Compute a signature over the grammar + def signature(self): + parts = [] + try: + if self.start: + parts.append(self.start) + if self.prec: + parts.append(''.join([''.join(p) for p in self.prec])) + if self.tokens: + parts.append(' '.join(self.tokens)) + for f in self.pfuncs: + if f[3]: + parts.append(f[3]) + except (TypeError, ValueError): + pass + return ''.join(parts) + + # ----------------------------------------------------------------------------- + # validate_modules() + # + # This method checks to see if there are duplicated p_rulename() functions + # in the parser module file. Without this function, it is really easy for + # users to make mistakes by cutting and pasting code fragments (and it's a real + # bugger to try and figure out why the resulting parser doesn't work). Therefore, + # we just do a little regular expression pattern matching of def statements + # to try and detect duplicates. + # ----------------------------------------------------------------------------- + + def validate_modules(self): + # Match def p_funcname( + fre = re.compile(r'\s*def\s+(p_[a-zA-Z_0-9]*)\(') + + for module in self.modules: + try: + lines, linen = inspect.getsourcelines(module) + except IOError: + continue + + counthash = {} + for linen, line in enumerate(lines): + linen += 1 + m = fre.match(line) + if m: + name = m.group(1) + prev = counthash.get(name) + if not prev: + counthash[name] = linen + else: + filename = inspect.getsourcefile(module) + self.log.warning('%s:%d: Function %s redefined. Previously defined on line %d', + filename, linen, name, prev) + + # Get the start symbol + def get_start(self): + self.start = self.pdict.get('start') + + # Validate the start symbol + def validate_start(self): + if self.start is not None: + if not isinstance(self.start, string_types): + self.log.error("'start' must be a string") + + # Look for error handler + def get_error_func(self): + self.error_func = self.pdict.get('p_error') + + # Validate the error function + def validate_error_func(self): + if self.error_func: + if isinstance(self.error_func, types.FunctionType): + ismethod = 0 + elif isinstance(self.error_func, types.MethodType): + ismethod = 1 + else: + self.log.error("'p_error' defined, but is not a function or method") + self.error = True + return + + eline = self.error_func.__code__.co_firstlineno + efile = self.error_func.__code__.co_filename + module = inspect.getmodule(self.error_func) + self.modules.add(module) + + argcount = self.error_func.__code__.co_argcount - ismethod + if argcount != 1: + self.log.error('%s:%d: p_error() requires 1 argument', efile, eline) + self.error = True + + # Get the tokens map + def get_tokens(self): + tokens = self.pdict.get('tokens') + if not tokens: + self.log.error('No token list is defined') + self.error = True + return + + if not isinstance(tokens, (list, tuple)): + self.log.error('tokens must be a list or tuple') + self.error = True + return + + if not tokens: + self.log.error('tokens is empty') + self.error = True + return + + self.tokens = tokens + + # Validate the tokens + def validate_tokens(self): + # Validate the tokens. + if 'error' in self.tokens: + self.log.error("Illegal token name 'error'. Is a reserved word") + self.error = True + return + + terminals = set() + for n in self.tokens: + if n in terminals: + self.log.warning('Token %r multiply defined', n) + terminals.add(n) + + # Get the precedence map (if any) + def get_precedence(self): + self.prec = self.pdict.get('precedence') + + # Validate and parse the precedence map + def validate_precedence(self): + preclist = [] + if self.prec: + if not isinstance(self.prec, (list, tuple)): + self.log.error('precedence must be a list or tuple') + self.error = True + return + for level, p in enumerate(self.prec): + if not isinstance(p, (list, tuple)): + self.log.error('Bad precedence table') + self.error = True + return + + if len(p) < 2: + self.log.error('Malformed precedence entry %s. Must be (assoc, term, ..., term)', p) + self.error = True + return + assoc = p[0] + if not isinstance(assoc, string_types): + self.log.error('precedence associativity must be a string') + self.error = True + return + for term in p[1:]: + if not isinstance(term, string_types): + self.log.error('precedence items must be strings') + self.error = True + return + preclist.append((term, assoc, level+1)) + self.preclist = preclist + + # Get all p_functions from the grammar + def get_pfunctions(self): + p_functions = [] + for name, item in self.pdict.items(): + if not name.startswith('p_') or name == 'p_error': + continue + if isinstance(item, (types.FunctionType, types.MethodType)): + line = getattr(item, 'co_firstlineno', item.__code__.co_firstlineno) + module = inspect.getmodule(item) + p_functions.append((line, module, name, item.__doc__)) + + # Sort all of the actions by line number; make sure to stringify + # modules to make them sortable, since `line` may not uniquely sort all + # p functions + p_functions.sort(key=lambda p_function: ( + p_function[0], + str(p_function[1]), + p_function[2], + p_function[3])) + self.pfuncs = p_functions + + # Validate all of the p_functions + def validate_pfunctions(self): + grammar = [] + # Check for non-empty symbols + if len(self.pfuncs) == 0: + self.log.error('no rules of the form p_rulename are defined') + self.error = True + return + + for line, module, name, doc in self.pfuncs: + file = inspect.getsourcefile(module) + func = self.pdict[name] + if isinstance(func, types.MethodType): + reqargs = 2 + else: + reqargs = 1 + if func.__code__.co_argcount > reqargs: + self.log.error('%s:%d: Rule %r has too many arguments', file, line, func.__name__) + self.error = True + elif func.__code__.co_argcount < reqargs: + self.log.error('%s:%d: Rule %r requires an argument', file, line, func.__name__) + self.error = True + elif not func.__doc__: + self.log.warning('%s:%d: No documentation string specified in function %r (ignored)', + file, line, func.__name__) + else: + try: + parsed_g = parse_grammar(doc, file, line) + for g in parsed_g: + grammar.append((name, g)) + except SyntaxError as e: + self.log.error(str(e)) + self.error = True + + # Looks like a valid grammar rule + # Mark the file in which defined. + self.modules.add(module) + + # Secondary validation step that looks for p_ definitions that are not functions + # or functions that look like they might be grammar rules. + + for n, v in self.pdict.items(): + if n.startswith('p_') and isinstance(v, (types.FunctionType, types.MethodType)): + continue + if n.startswith('t_'): + continue + if n.startswith('p_') and n != 'p_error': + self.log.warning('%r not defined as a function', n) + if ((isinstance(v, types.FunctionType) and v.__code__.co_argcount == 1) or + (isinstance(v, types.MethodType) and v.__func__.__code__.co_argcount == 2)): + if v.__doc__: + try: + doc = v.__doc__.split(' ') + if doc[1] == ':': + self.log.warning('%s:%d: Possible grammar rule %r defined without p_ prefix', + v.__code__.co_filename, v.__code__.co_firstlineno, n) + except IndexError: + pass + + self.grammar = grammar + +# ----------------------------------------------------------------------------- +# yacc(module) +# +# Build a parser +# ----------------------------------------------------------------------------- + +def yacc(method='LALR', debug=yaccdebug, module=None, tabmodule=tab_module, start=None, + check_recursion=True, optimize=False, write_tables=True, debugfile=debug_file, + outputdir=None, debuglog=None, errorlog=None, picklefile=None): + + if tabmodule is None: + tabmodule = tab_module + + # Reference to the parsing method of the last built parser + global parse + + # If pickling is enabled, table files are not created + if picklefile: + write_tables = 0 + + if errorlog is None: + errorlog = PlyLogger(sys.stderr) + + # Get the module dictionary used for the parser + if module: + _items = [(k, getattr(module, k)) for k in dir(module)] + pdict = dict(_items) + # If no __file__ attribute is available, try to obtain it from the __module__ instead + if '__file__' not in pdict: + pdict['__file__'] = sys.modules[pdict['__module__']].__file__ + else: + pdict = get_caller_module_dict(2) + + if outputdir is None: + # If no output directory is set, the location of the output files + # is determined according to the following rules: + # - If tabmodule specifies a package, files go into that package directory + # - Otherwise, files go in the same directory as the specifying module + if isinstance(tabmodule, types.ModuleType): + srcfile = tabmodule.__file__ + else: + if '.' not in tabmodule: + srcfile = pdict['__file__'] + else: + parts = tabmodule.split('.') + pkgname = '.'.join(parts[:-1]) + exec('import %s' % pkgname) + srcfile = getattr(sys.modules[pkgname], '__file__', '') + outputdir = os.path.dirname(srcfile) + + # Determine if the module is package of a package or not. + # If so, fix the tabmodule setting so that tables load correctly + pkg = pdict.get('__package__') + if pkg and isinstance(tabmodule, str): + if '.' not in tabmodule: + tabmodule = pkg + '.' + tabmodule + + + + # Set start symbol if it's specified directly using an argument + if start is not None: + pdict['start'] = start + + # Collect parser information from the dictionary + pinfo = ParserReflect(pdict, log=errorlog) + pinfo.get_all() + + if pinfo.error: + raise YaccError('Unable to build parser') + + # Check signature against table files (if any) + signature = pinfo.signature() + + # Read the tables + try: + lr = LRTable() + if picklefile: + read_signature = lr.read_pickle(picklefile) + else: + read_signature = lr.read_table(tabmodule) + if optimize or (read_signature == signature): + try: + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + parse = parser.parse + return parser + except Exception as e: + errorlog.warning('There was a problem loading the table file: %r', e) + except VersionError as e: + errorlog.warning(str(e)) + except ImportError: + pass + + if debuglog is None: + if debug: + try: + debuglog = PlyLogger(open(os.path.join(outputdir, debugfile), 'w')) + except IOError as e: + errorlog.warning("Couldn't open %r. %s" % (debugfile, e)) + debuglog = NullLogger() + else: + debuglog = NullLogger() + + debuglog.info('Created by PLY version %s (http://www.dabeaz.com/ply)', __version__) + + errors = False + + # Validate the parser information + if pinfo.validate_all(): + raise YaccError('Unable to build parser') + + if not pinfo.error_func: + errorlog.warning('no p_error() function is defined') + + # Create a grammar object + grammar = Grammar(pinfo.tokens) + + # Set precedence level for terminals + for term, assoc, level in pinfo.preclist: + try: + grammar.set_precedence(term, assoc, level) + except GrammarError as e: + errorlog.warning('%s', e) + + # Add productions to the grammar + for funcname, gram in pinfo.grammar: + file, line, prodname, syms = gram + try: + grammar.add_production(prodname, syms, funcname, file, line) + except GrammarError as e: + errorlog.error('%s', e) + errors = True + + # Set the grammar start symbols + try: + if start is None: + grammar.set_start(pinfo.start) + else: + grammar.set_start(start) + except GrammarError as e: + errorlog.error(str(e)) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Verify the grammar structure + undefined_symbols = grammar.undefined_symbols() + for sym, prod in undefined_symbols: + errorlog.error('%s:%d: Symbol %r used, but not defined as a token or a rule', prod.file, prod.line, sym) + errors = True + + unused_terminals = grammar.unused_terminals() + if unused_terminals: + debuglog.info('') + debuglog.info('Unused terminals:') + debuglog.info('') + for term in unused_terminals: + errorlog.warning('Token %r defined, but not used', term) + debuglog.info(' %s', term) + + # Print out all productions to the debug log + if debug: + debuglog.info('') + debuglog.info('Grammar') + debuglog.info('') + for n, p in enumerate(grammar.Productions): + debuglog.info('Rule %-5d %s', n, p) + + # Find unused non-terminals + unused_rules = grammar.unused_rules() + for prod in unused_rules: + errorlog.warning('%s:%d: Rule %r defined, but not used', prod.file, prod.line, prod.name) + + if len(unused_terminals) == 1: + errorlog.warning('There is 1 unused token') + if len(unused_terminals) > 1: + errorlog.warning('There are %d unused tokens', len(unused_terminals)) + + if len(unused_rules) == 1: + errorlog.warning('There is 1 unused rule') + if len(unused_rules) > 1: + errorlog.warning('There are %d unused rules', len(unused_rules)) + + if debug: + debuglog.info('') + debuglog.info('Terminals, with rules where they appear') + debuglog.info('') + terms = list(grammar.Terminals) + terms.sort() + for term in terms: + debuglog.info('%-20s : %s', term, ' '.join([str(s) for s in grammar.Terminals[term]])) + + debuglog.info('') + debuglog.info('Nonterminals, with rules where they appear') + debuglog.info('') + nonterms = list(grammar.Nonterminals) + nonterms.sort() + for nonterm in nonterms: + debuglog.info('%-20s : %s', nonterm, ' '.join([str(s) for s in grammar.Nonterminals[nonterm]])) + debuglog.info('') + + if check_recursion: + unreachable = grammar.find_unreachable() + for u in unreachable: + errorlog.warning('Symbol %r is unreachable', u) + + infinite = grammar.infinite_cycles() + for inf in infinite: + errorlog.error('Infinite recursion detected for symbol %r', inf) + errors = True + + unused_prec = grammar.unused_precedence() + for term, assoc in unused_prec: + errorlog.error('Precedence rule %r defined for unknown symbol %r', assoc, term) + errors = True + + if errors: + raise YaccError('Unable to build parser') + + # Run the LRGeneratedTable on the grammar + if debug: + errorlog.debug('Generating %s tables', method) + + lr = LRGeneratedTable(grammar, method, debuglog) + + if debug: + num_sr = len(lr.sr_conflicts) + + # Report shift/reduce and reduce/reduce conflicts + if num_sr == 1: + errorlog.warning('1 shift/reduce conflict') + elif num_sr > 1: + errorlog.warning('%d shift/reduce conflicts', num_sr) + + num_rr = len(lr.rr_conflicts) + if num_rr == 1: + errorlog.warning('1 reduce/reduce conflict') + elif num_rr > 1: + errorlog.warning('%d reduce/reduce conflicts', num_rr) + + # Write out conflicts to the output file + if debug and (lr.sr_conflicts or lr.rr_conflicts): + debuglog.warning('') + debuglog.warning('Conflicts:') + debuglog.warning('') + + for state, tok, resolution in lr.sr_conflicts: + debuglog.warning('shift/reduce conflict for %s in state %d resolved as %s', tok, state, resolution) + + already_reported = set() + for state, rule, rejected in lr.rr_conflicts: + if (state, id(rule), id(rejected)) in already_reported: + continue + debuglog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + debuglog.warning('rejected rule (%s) in state %d', rejected, state) + errorlog.warning('reduce/reduce conflict in state %d resolved using rule (%s)', state, rule) + errorlog.warning('rejected rule (%s) in state %d', rejected, state) + already_reported.add((state, id(rule), id(rejected))) + + warned_never = [] + for state, rule, rejected in lr.rr_conflicts: + if not rejected.reduced and (rejected not in warned_never): + debuglog.warning('Rule (%s) is never reduced', rejected) + errorlog.warning('Rule (%s) is never reduced', rejected) + warned_never.append(rejected) + + # Write the table file if requested + if write_tables: + try: + lr.write_table(tabmodule, outputdir, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (tabmodule, e)) + + # Write a pickled version of the tables + if picklefile: + try: + lr.pickle_table(picklefile, signature) + except IOError as e: + errorlog.warning("Couldn't create %r. %s" % (picklefile, e)) + + # Build the parser + lr.bind_callables(pinfo.pdict) + parser = LRParser(lr, pinfo.error_func) + + parse = parser.parse + return parser diff --git a/utils/cseq-1.9/pycparser/ply/ygen.py b/utils/cseq-1.9/pycparser/ply/ygen.py new file mode 100644 index 000000000..acf5ca1a3 --- /dev/null +++ b/utils/cseq-1.9/pycparser/ply/ygen.py @@ -0,0 +1,74 @@ +# ply: ygen.py +# +# This is a support program that auto-generates different versions of the YACC parsing +# function with different features removed for the purposes of performance. +# +# Users should edit the method LParser.parsedebug() in yacc.py. The source code +# for that method is then used to create the other methods. See the comments in +# yacc.py for further details. + +import os.path +import shutil + +def get_source_range(lines, tag): + srclines = enumerate(lines) + start_tag = '#--! %s-start' % tag + end_tag = '#--! %s-end' % tag + + for start_index, line in srclines: + if line.strip().startswith(start_tag): + break + + for end_index, line in srclines: + if line.strip().endswith(end_tag): + break + + return (start_index + 1, end_index) + +def filter_section(lines, tag): + filtered_lines = [] + include = True + tag_text = '#--! %s' % tag + for line in lines: + if line.strip().startswith(tag_text): + include = not include + elif include: + filtered_lines.append(line) + return filtered_lines + +def main(): + dirname = os.path.dirname(__file__) + shutil.copy2(os.path.join(dirname, 'yacc.py'), os.path.join(dirname, 'yacc.py.bak')) + with open(os.path.join(dirname, 'yacc.py'), 'r') as f: + lines = f.readlines() + + parse_start, parse_end = get_source_range(lines, 'parsedebug') + parseopt_start, parseopt_end = get_source_range(lines, 'parseopt') + parseopt_notrack_start, parseopt_notrack_end = get_source_range(lines, 'parseopt-notrack') + + # Get the original source + orig_lines = lines[parse_start:parse_end] + + # Filter the DEBUG sections out + parseopt_lines = filter_section(orig_lines, 'DEBUG') + + # Filter the TRACKING sections out + parseopt_notrack_lines = filter_section(parseopt_lines, 'TRACKING') + + # Replace the parser source sections with updated versions + lines[parseopt_notrack_start:parseopt_notrack_end] = parseopt_notrack_lines + lines[parseopt_start:parseopt_end] = parseopt_lines + + lines = [line.rstrip()+'\n' for line in lines] + with open(os.path.join(dirname, 'yacc.py'), 'w') as f: + f.writelines(lines) + + print('Updated yacc.py') + +if __name__ == '__main__': + main() + + + + + diff --git a/utils/cseq-1.9/pycparser/plyparser.py b/utils/cseq-1.9/pycparser/plyparser.py new file mode 100644 index 000000000..af91922fd --- /dev/null +++ b/utils/cseq-1.9/pycparser/plyparser.py @@ -0,0 +1,116 @@ +#----------------------------------------------------------------- +# plyparser.py +# +# PLYParser class and other utilites for simplifying programming +# parsers with PLY +# +# Eli Bendersky [http://eli.thegreenplace.net] +# License: BSD +#----------------------------------------------------------------- + + +class Coord(object): + """ Coordinates of a syntactic element. Consists of: + - File name + - Line number + - (optional) column number, for the Lexer + """ + __slots__ = ('file', 'line', 'column', '__weakref__') + def __init__(self, file, line, column=None): + self.file = file + self.line = line + self.column = column + + def __str__(self): + str = "%s:%s" % (self.file, self.line) + if self.column: str += ":%s" % self.column + return str + + +class ParseError(Exception): pass + + +class PLYParser(object): + def _create_opt_rule(self, rulename): + """ Given a rule name, creates an optional ply.yacc rule + for it. The name of the optional rule is + _opt + """ + optname = rulename + '_opt' + + def optrule(self, p): + p[0] = p[1] + + optrule.__doc__ = '%s : empty\n| %s' % (optname, rulename) + optrule.__name__ = 'p_%s' % optname + setattr(self.__class__, optrule.__name__, optrule) + + def _coord(self, lineno, column=None): + return Coord( + file=self.clex.filename, + line=lineno, + column=column) + + def _token_coord(self, p, token_idx): + """ Returns the coordinates for the YaccProduction objet 'p' indexed + with 'token_idx'. The coordinate includes the 'lineno' and + 'column'. Both follow the lex semantic, starting from 1. + """ + last_cr = p.lexer.lexer.lexdata.rfind('\n', 0, p.lexpos(token_idx)) + if last_cr < 0: + last_cr = -1 + column = (p.lexpos(token_idx) - (last_cr)) + return self._coord(p.lineno(token_idx), column) + + def _parse_error(self, msg, coord): + raise ParseError("%s: %s" % (coord, msg)) + + +def parameterized(*params): + """ Decorator to create parameterized rules. + + Parameterized rule methods must be named starting with 'p_' and contain + 'xxx', and their docstrings may contain 'xxx' and 'yyy'. These will be + replaced by the given parameter tuples. For example, ``p_xxx_rule()`` with + docstring 'xxx_rule : yyy' when decorated with + ``@parameterized(('id', 'ID'))`` produces ``p_id_rule()`` with the docstring + 'id_rule : ID'. Using multiple tuples produces multiple rules. + """ + def decorate(rule_func): + rule_func._params = params + return rule_func + return decorate + + +def template(cls): + """ Class decorator to generate rules from parameterized rule templates. + + See `parameterized` for more information on parameterized rules. + """ + for attr_name in dir(cls): + if attr_name.startswith('p_'): + method = getattr(cls, attr_name) + if hasattr(method, '_params'): + delattr(cls, attr_name) # Remove template method + _create_param_rules(cls, method) + return cls + + +def _create_param_rules(cls, func): + """ Create ply.yacc rules based on a parameterized rule function + + Generates new methods (one per each pair of parameters) based on the + template rule function `func`, and attaches them to `cls`. The rule + function's parameters must be accessible via its `_params` attribute. + """ + for xxx, yyy in func._params: + # Use the template method's body for each new method + def param_rule(self, p): + func(self, p) + + # Substitute in the params for the grammar rule and function name + param_rule.__doc__ = func.__doc__.replace('xxx', xxx).replace('yyy', yyy) + param_rule.__name__ = func.__name__.replace('xxx', xxx) + + # Attach the new method to the class + setattr(cls, param_rule.__name__, param_rule) diff --git a/utils/cseq-1.9/pycparser/yacctab.py b/utils/cseq-1.9/pycparser/yacctab.py new file mode 100644 index 000000000..a244322eb --- /dev/null +++ b/utils/cseq-1.9/pycparser/yacctab.py @@ -0,0 +1,332 @@ + +# yacctab.py +# This file is automatically generated. Do not edit. +_tabversion = '3.10' + +_lr_method = 'LALR' + +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMOD_BOOL _COMPLEX AUTO BREAK CASE CHAR CONST CONTINUE DEFAULT DO DOUBLE ELSE ENUM EXTERN FLOAT FOR GOTO IF INLINE INT LONG REGISTER OFFSETOF RESTRICT RETURN SHORT SIGNED SIZEOF STATIC STRUCT SWITCH TYPEDEF UNION UNSIGNED VOID VOLATILE WHILE __INT128 ID TYPEID INT_CONST_DEC INT_CONST_OCT INT_CONST_HEX INT_CONST_BIN FLOAT_CONST HEX_FLOAT_CONST CHAR_CONST WCHAR_CONST STRING_LITERAL WSTRING_LITERAL PLUS MINUS TIMES DIVIDE MOD OR AND NOT XOR LSHIFT RSHIFT LOR LAND LNOT LT LE GT GE EQ NE EQUALS TIMESEQUAL DIVEQUAL MODEQUAL PLUSEQUAL MINUSEQUAL LSHIFTEQUAL RSHIFTEQUAL ANDEQUAL XOREQUAL OREQUAL PLUSPLUS MINUSMINUS ARROW CONDOP LPAREN RPAREN LBRACKET RBRACKET LBRACE RBRACE COMMA PERIOD SEMI COLON ELLIPSIS PPHASH PPPRAGMA PPPRAGMASTRabstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN\n | direct_id_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN\n id_declarator : direct_id_declarator\n id_declarator : pointer direct_id_declarator\n typeid_declarator : direct_typeid_declarator\n typeid_declarator : pointer direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator\n translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON statement labeled_statement : CASE constant_expression COLON statement labeled_statement : DEFAULT COLON statement selection_statement : IF LPAREN expression RPAREN statement selection_statement : IF LPAREN expression RPAREN statement ELSE statement selection_statement : SWITCH LPAREN expression RPAREN statement iteration_statement : WHILE LPAREN expression RPAREN statement iteration_statement : DO statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' + +_lr_action_items = {'VOID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[6,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,6,-94,-109,-104,-65,-93,-110,6,-215,-107,-111,6,-63,-116,6,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,6,-53,6,-82,6,6,-61,-131,-301,-130,6,-147,-146,-160,-88,-90,6,-87,-89,-92,-81,-84,-86,-69,-30,6,6,-70,6,-83,6,6,-128,-140,-137,6,6,6,-161,6,6,-36,-35,6,6,-73,-76,-72,-74,6,-78,-193,-192,-77,-194,-75,6,6,-129,-132,-138,-302,-126,-127,-148,-71,6,-31,6,6,6,-34,6,6,6,-212,-211,6,-209,-195,-208,-196,-134,-133,-139,-150,-149,6,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'LBRACKET':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,70,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,113,115,125,136,137,140,147,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,184,185,186,189,190,193,196,226,230,231,233,234,240,245,247,256,272,275,276,278,282,289,292,315,320,321,350,351,356,357,364,365,368,373,377,378,379,380,383,388,391,392,412,413,414,415,421,422,440,441,445,447,449,452,453,459,465,466,467,468,469,477,478,479,484,485,488,489,499,502,503,504,505,510,512,517,],[-102,-115,-113,-99,-97,59,-95,-114,-96,-100,-91,-94,-109,-104,-93,-110,-215,-107,-303,-111,-116,-29,-105,-101,-112,-106,-108,-103,-117,-98,59,-131,-301,-130,-147,-146,-28,-158,-160,-27,-88,-90,141,-37,-87,-89,-92,-30,195,-288,-128,-161,-159,141,-292,-280,-295,-299,-296,-293,-278,-279,280,-291,-265,-297,-289,-277,-294,-290,-36,-35,195,195,322,-45,326,-288,-129,-132,-302,-126,-127,-148,-38,370,-300,-298,-274,-273,-31,-34,195,195,322,326,-134,-133,-150,-149,-44,-43,-177,370,-272,-271,-270,-269,-268,-281,195,195,-33,-32,-191,-185,-187,-189,-39,-42,-180,370,-178,-266,-267,370,-51,-50,-186,-188,-190,-41,-40,-179,501,-283,-46,-49,-282,370,-275,-48,-47,-284,-276,-285,]),'WCHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,153,-28,-303,153,-161,-303,153,153,-264,153,-262,153,-261,153,-260,153,153,-259,-263,153,153,153,-73,-76,-72,153,-74,153,153,-78,-193,-192,-77,-194,153,-75,-260,-302,153,153,153,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,153,-227,-228,-220,-226,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,-303,-260,153,-212,-211,153,-209,153,153,153,-195,153,-208,-196,153,153,153,-260,153,153,-12,153,153,-11,153,153,-28,-303,-260,-207,-210,153,-199,153,-197,-303,-176,153,153,-303,153,-260,153,153,153,153,-198,153,153,153,153,-11,153,-203,-202,-200,153,-303,153,153,153,-204,-201,153,-206,-205,]),'FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,154,-28,-303,154,-161,-303,154,154,-264,154,-262,154,-261,154,-260,154,154,-259,-263,154,154,154,-73,-76,-72,154,-74,154,154,-78,-193,-192,-77,-194,154,-75,-260,-302,154,154,154,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,154,-227,-228,-220,-226,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,-303,-260,154,-212,-211,154,-209,154,154,154,-195,154,-208,-196,154,154,154,-260,154,154,-12,154,154,-11,154,154,-28,-303,-260,-207,-210,154,-199,154,-197,-303,-176,154,154,-303,154,-260,154,154,154,154,-198,154,154,154,154,-11,154,-203,-202,-200,154,-303,154,154,154,-204,-201,154,-206,-205,]),'MINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,136,141,144,145,147,148,149,150,151,152,153,154,155,156,157,158,159,161,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,280,281,284,285,286,287,288,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,377,378,379,380,383,388,389,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,416,417,418,424,426,427,429,431,433,436,447,450,451,452,453,454,456,458,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,157,-28,-303,-288,157,-161,-303,157,157,-292,-264,-251,-280,-295,-299,-296,-293,-278,157,-262,-279,-253,-232,157,-261,157,-291,-260,-265,157,157,-297,-259,-289,-277,297,-294,-290,-263,157,157,157,-73,-76,-72,157,-74,157,157,-78,-193,-192,-77,-194,157,-75,-260,-288,-302,157,157,157,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,157,-227,-228,-220,-226,-300,157,-257,-298,-274,-273,157,157,157,-251,-256,157,-254,-255,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-303,-260,157,-212,-211,157,-209,157,157,157,-195,157,-208,-196,157,157,157,-260,157,157,-12,157,157,-11,-272,-271,-270,-269,-268,-281,157,297,297,297,-237,297,297,297,-236,297,297,-234,-233,297,297,297,297,297,-235,157,-28,-303,-260,-207,-210,157,-199,157,-197,-303,-176,-258,-266,-267,157,157,-252,-303,157,-260,157,157,157,157,-198,157,157,157,157,-11,157,-203,-202,-200,-282,157,-303,-275,157,157,-276,157,-204,-201,157,-206,-205,]),'RPAREN':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,58,60,61,69,71,73,74,76,77,78,79,80,83,85,88,91,92,96,105,109,110,111,112,113,114,115,116,118,125,136,137,138,140,142,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,180,184,185,186,187,188,189,190,191,192,193,194,196,208,224,230,231,233,234,240,245,247,252,253,272,274,275,276,278,281,282,285,286,288,289,290,291,292,293,315,316,317,318,319,320,321,323,327,328,329,330,343,350,351,356,357,364,365,375,376,377,378,379,380,382,383,384,386,387,388,390,391,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,412,413,414,415,419,420,421,422,425,430,432,434,437,440,441,451,452,453,458,465,466,467,468,469,477,478,483,484,485,487,488,489,493,496,499,503,504,505,506,507,510,512,513,517,],[-102,-115,-113,-99,-97,-52,-95,-114,-96,-100,-91,-94,-109,-104,-93,-110,-215,-107,-303,-111,-116,-29,-105,-101,-112,-106,-108,-103,-117,-98,105,-303,-53,-131,-130,-147,-146,-28,-158,-160,-27,-88,-90,-54,-37,-87,-89,-92,-30,184,-17,185,-164,-303,-18,-288,-162,-169,-128,-161,-159,247,-55,-303,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,-230,-294,-290,-216,-36,-35,-303,-168,-2,-182,-56,-166,-1,-45,-167,-184,-14,-213,-129,-132,-302,-126,-127,-148,-38,364,365,-300,-257,-298,-274,-273,383,-31,-251,-256,-254,-34,388,389,-303,-255,-182,-23,-24,414,415,-57,-183,-303,-303,-170,-163,-165,-13,-134,-133,-150,-149,-44,-43,-217,451,-272,-271,-270,-269,-286,-268,453,456,457,-281,-181,-182,-303,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-33,-32,-191,-185,465,466,-187,-189,469,-214,472,474,476,-39,-42,-258,-266,-267,-252,-51,-50,-186,-188,-190,-41,-40,-287,499,-283,-231,-46,-49,-303,508,-282,-275,-48,-47,-303,514,-284,-276,518,-285,]),'LONG':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[21,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,21,-94,-109,-104,-65,-93,-110,21,-215,-107,-111,21,-63,-116,21,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,21,-53,21,-82,21,21,-61,-131,-301,-130,21,-147,-146,-160,-88,-90,21,-87,-89,-92,-81,-84,-86,-69,-30,21,21,-70,21,-83,21,21,-128,-140,-137,21,21,21,-161,21,21,-36,-35,21,21,-73,-76,-72,-74,21,-78,-193,-192,-77,-194,-75,21,21,-129,-132,-138,-302,-126,-127,-148,-71,21,-31,21,21,21,-34,21,21,21,-212,-211,21,-209,-195,-208,-196,-134,-133,-139,-150,-149,21,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'PLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,136,141,144,145,147,148,149,150,151,152,153,154,155,156,157,158,159,161,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,280,281,284,285,286,287,288,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,377,378,379,380,383,388,389,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,416,417,418,424,426,427,429,431,433,436,447,450,451,452,453,454,456,458,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,164,-28,-303,-288,164,-161,-303,164,164,-292,-264,-251,-280,-295,-299,-296,-293,-278,164,-262,-279,-253,-232,164,-261,164,-291,-260,-265,164,164,-297,-259,-289,-277,301,-294,-290,-263,164,164,164,-73,-76,-72,164,-74,164,164,-78,-193,-192,-77,-194,164,-75,-260,-288,-302,164,164,164,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,164,-227,-228,-220,-226,-300,164,-257,-298,-274,-273,164,164,164,-251,-256,164,-254,-255,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,-303,-260,164,-212,-211,164,-209,164,164,164,-195,164,-208,-196,164,164,164,-260,164,164,-12,164,164,-11,-272,-271,-270,-269,-268,-281,164,301,301,301,-237,301,301,301,-236,301,301,-234,-233,301,301,301,301,301,-235,164,-28,-303,-260,-207,-210,164,-199,164,-197,-303,-176,-258,-266,-267,164,164,-252,-303,164,-260,164,164,164,164,-198,164,164,164,164,-11,164,-203,-202,-200,-282,164,-303,-275,164,164,-276,164,-204,-201,164,-206,-205,]),'ELLIPSIS':([198,],[329,]),'GT':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,302,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,302,-239,-237,-241,302,-240,-236,-243,302,-234,-233,-242,302,302,302,302,-235,-258,-266,-267,-252,-282,-275,-276,]),'GOTO':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,201,-73,-76,-72,-74,201,-78,-193,-192,-77,-194,201,-75,-302,-212,-211,-209,201,-195,-208,-196,201,-207,-210,-199,201,-197,201,-198,201,201,-203,-202,-200,201,201,-204,-201,201,-206,-205,]),'ENUM':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,126,127,128,129,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,232,233,254,273,282,283,284,287,289,323,327,332,333,335,336,342,345,347,354,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[28,-303,-115,-97,-52,-95,-96,-64,-60,-66,28,-94,-65,-93,28,-63,-116,28,-29,-62,-67,-303,-303,-117,-68,-98,-85,-10,-9,28,-53,-82,28,28,-61,-301,28,-160,28,-81,-84,-86,-69,-30,28,-70,28,-83,28,28,-140,-137,28,28,-161,28,28,-36,-35,28,28,-73,-76,-72,-74,28,-78,-193,-192,-77,-194,-75,28,28,-138,-302,-71,28,-31,28,28,28,-34,28,28,-212,-211,28,-209,-195,-208,-196,-139,28,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'PERIOD':([70,115,147,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,256,272,275,276,278,368,373,377,378,379,380,383,388,445,447,449,452,453,459,479,484,485,499,502,503,510,512,517,],[-301,-288,-292,-280,-295,-299,-296,-293,-278,-279,279,-291,-265,-297,-289,-277,-294,-290,-288,-302,369,-300,-298,-274,-273,-177,369,-272,-271,-270,-269,-268,-281,-180,369,-178,-266,-267,369,-179,500,-283,-282,369,-275,-284,-276,-285,]),'GE':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,306,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,306,-239,-237,-241,306,-240,-236,-243,306,-234,-233,-242,306,306,306,306,-235,-258,-266,-267,-252,-282,-275,-276,]),'INT_CONST_DEC':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,174,-28,-303,174,-161,-303,174,174,-264,174,-262,174,-261,174,-260,174,174,-259,-263,174,174,174,-73,-76,-72,174,-74,174,174,-78,-193,-192,-77,-194,174,-75,-260,-302,174,174,174,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,174,-227,-228,-220,-226,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,174,-303,-260,174,-212,-211,174,-209,174,174,174,-195,174,-208,-196,174,174,174,-260,174,174,-12,174,174,-11,174,174,-28,-303,-260,-207,-210,174,-199,174,-197,-303,-176,174,174,-303,174,-260,174,174,174,174,-198,174,174,174,174,-11,174,-203,-202,-200,174,-303,174,174,174,-204,-201,174,-206,-205,]),'ARROW':([115,147,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,275,276,278,377,378,379,380,383,388,452,453,499,503,512,],[-288,-292,-280,-295,-299,-296,-293,-278,-279,277,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-298,-274,-273,-272,-271,-270,-269,-268,-281,-266,-267,-282,-275,-276,]),'CHAR':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[41,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,41,-94,-109,-104,-65,-93,-110,41,-215,-107,-111,41,-63,-116,41,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,41,-53,41,-82,41,41,-61,-131,-301,-130,41,-147,-146,-160,-88,-90,41,-87,-89,-92,-81,-84,-86,-69,-30,41,41,-70,41,-83,41,41,-128,-140,-137,41,41,41,-161,41,41,-36,-35,41,41,-73,-76,-72,-74,41,-78,-193,-192,-77,-194,-75,41,41,-129,-132,-138,-302,-126,-127,-148,-71,41,-31,41,41,41,-34,41,41,41,-212,-211,41,-209,-195,-208,-196,-134,-133,-139,-150,-149,41,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'HEX_FLOAT_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,177,-28,-303,177,-161,-303,177,177,-264,177,-262,177,-261,177,-260,177,177,-259,-263,177,177,177,-73,-76,-72,177,-74,177,177,-78,-193,-192,-77,-194,177,-75,-260,-302,177,177,177,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,177,-227,-228,-220,-226,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,-303,-260,177,-212,-211,177,-209,177,177,177,-195,177,-208,-196,177,177,177,-260,177,177,-12,177,177,-11,177,177,-28,-303,-260,-207,-210,177,-199,177,-197,-303,-176,177,177,-303,177,-260,177,177,177,177,-198,177,177,177,177,-11,177,-203,-202,-200,177,-303,177,177,177,-204,-201,177,-206,-205,]),'DOUBLE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[45,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,45,-94,-109,-104,-65,-93,-110,45,-215,-107,-111,45,-63,-116,45,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,45,-53,45,-82,45,45,-61,-131,-301,-130,45,-147,-146,-160,-88,-90,45,-87,-89,-92,-81,-84,-86,-69,-30,45,45,-70,45,-83,45,45,-128,-140,-137,45,45,45,-161,45,45,-36,-35,45,45,-73,-76,-72,-74,45,-78,-193,-192,-77,-194,-75,45,45,-129,-132,-138,-302,-126,-127,-148,-71,45,-31,45,45,45,-34,45,45,45,-212,-211,45,-209,-195,-208,-196,-134,-133,-139,-150,-149,45,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'MINUSEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,261,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'INT_CONST_OCT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,178,-28,-303,178,-161,-303,178,178,-264,178,-262,178,-261,178,-260,178,178,-259,-263,178,178,178,-73,-76,-72,178,-74,178,178,-78,-193,-192,-77,-194,178,-75,-260,-302,178,178,178,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,178,-227,-228,-220,-226,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,178,-303,-260,178,-212,-211,178,-209,178,178,178,-195,178,-208,-196,178,178,178,-260,178,178,-12,178,178,-11,178,178,-28,-303,-260,-207,-210,178,-199,178,-197,-303,-176,178,178,-303,178,-260,178,178,178,178,-198,178,178,178,178,-11,178,-203,-202,-200,178,-303,178,178,178,-204,-201,178,-206,-205,]),'TIMESEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,270,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'OR':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,311,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,311,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,311,-244,-246,-247,-235,-258,-266,-267,-252,-282,-275,-276,]),'SHORT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[2,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,2,-94,-109,-104,-65,-93,-110,2,-215,-107,-111,2,-63,-116,2,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,2,-53,2,-82,2,2,-61,-131,-301,-130,2,-147,-146,-160,-88,-90,2,-87,-89,-92,-81,-84,-86,-69,-30,2,2,-70,2,-83,2,2,-128,-140,-137,2,2,2,-161,2,2,-36,-35,2,2,-73,-76,-72,-74,2,-78,-193,-192,-77,-194,-75,2,2,-129,-132,-138,-302,-126,-127,-148,-71,2,-31,2,2,2,-34,2,2,2,-212,-211,2,-209,-195,-208,-196,-134,-133,-139,-150,-149,2,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'RETURN':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,204,-73,-76,-72,-74,204,-78,-193,-192,-77,-194,204,-75,-302,-212,-211,-209,204,-195,-208,-196,204,-207,-210,-199,204,-197,204,-198,204,204,-203,-202,-200,204,204,-204,-201,204,-206,-205,]),'RSHIFTEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,271,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'RESTRICT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,136,141,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,250,251,254,273,282,283,284,287,289,292,322,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,417,418,426,427,431,436,473,494,495,497,515,516,519,520,],[35,35,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,35,-94,-109,-104,-65,-93,-110,35,-215,-107,35,-111,35,-63,-116,-29,-105,-62,-101,-67,-112,-106,35,-108,35,-103,-117,-68,-98,35,35,-53,35,-82,35,-61,-131,-301,-130,35,-147,-146,35,-160,-88,-90,35,-87,-89,-92,-81,-69,-30,35,35,35,-70,35,-83,35,35,-128,-140,-137,35,35,35,-161,35,35,35,-36,-35,35,35,-73,-76,-72,-74,35,-78,-193,-192,-77,-194,-75,35,35,-129,-132,-138,-302,-126,-127,-148,35,35,-71,35,-31,35,35,35,-34,35,35,35,35,-212,-211,35,-209,-195,-208,-196,-134,-133,-139,-150,-149,35,-33,-32,35,35,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'STATIC':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,73,74,78,80,83,87,91,92,96,101,104,105,107,113,120,121,122,136,141,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,250,254,282,289,322,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,417,426,427,431,436,473,494,495,497,515,516,519,520,],[9,9,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,9,-94,-109,-104,-65,-93,-110,9,-215,-107,-111,9,-63,-116,-29,-105,-62,-101,-67,-112,-106,9,-108,9,-103,-117,-68,-98,108,9,-53,9,-82,9,-61,-131,-301,-130,-147,-146,-160,-88,-90,9,-87,-89,-92,-81,-69,-30,182,9,-70,9,-83,-161,251,9,-36,-35,9,9,-73,-76,-72,-74,9,-78,-193,-192,-77,-194,-75,-132,-302,-148,362,-71,-31,-34,418,9,9,-212,-211,9,-209,-195,-208,-196,-134,-133,-150,-149,9,-33,-32,463,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'SIZEOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,156,-28,-303,156,-161,-303,156,156,-264,156,-262,156,-261,156,-260,156,156,-259,-263,156,156,156,-73,-76,-72,156,-74,156,156,-78,-193,-192,-77,-194,156,-75,-260,-302,156,156,156,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,156,-227,-228,-220,-226,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,-303,-260,156,-212,-211,156,-209,156,156,156,-195,156,-208,-196,156,156,156,-260,156,156,-12,156,156,-11,156,156,-28,-303,-260,-207,-210,156,-199,156,-197,-303,-176,156,156,-303,156,-260,156,156,156,156,-198,156,156,156,156,-11,156,-203,-202,-200,156,-303,156,156,156,-204,-201,156,-206,-205,]),'UNSIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[20,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,20,-94,-109,-104,-65,-93,-110,20,-215,-107,-111,20,-63,-116,20,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,20,-53,20,-82,20,20,-61,-131,-301,-130,20,-147,-146,-160,-88,-90,20,-87,-89,-92,-81,-84,-86,-69,-30,20,20,-70,20,-83,20,20,-128,-140,-137,20,20,20,-161,20,20,-36,-35,20,20,-73,-76,-72,-74,20,-78,-193,-192,-77,-194,-75,20,20,-129,-132,-138,-302,-126,-127,-148,-71,20,-31,20,20,20,-34,20,20,20,-212,-211,20,-209,-195,-208,-196,-134,-133,-139,-150,-149,20,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'UNION':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,126,127,128,129,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,232,233,254,273,282,283,284,287,289,323,327,332,333,335,336,342,345,347,354,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[22,-303,-115,-97,-52,-95,-96,-64,-60,-66,22,-94,-65,-93,22,-63,-116,22,-29,-62,-67,-303,-303,-117,-68,-98,-85,-10,-9,22,-53,-82,22,22,-61,-301,22,-160,22,-81,-84,-86,-69,-30,22,-70,22,-83,22,22,-140,-137,22,22,-161,22,22,-36,-35,22,22,-73,-76,-72,-74,22,-78,-193,-192,-77,-194,-75,22,22,-138,-302,-71,22,-31,22,22,22,-34,22,22,-212,-211,22,-209,-195,-208,-196,-139,22,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'COLON':([2,3,5,6,8,10,15,20,21,25,29,30,32,35,37,39,41,44,45,48,50,51,61,69,71,73,74,85,86,88,105,115,119,125,130,140,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,180,184,185,209,224,226,230,231,233,234,240,241,245,247,272,274,275,276,278,282,285,286,288,289,293,340,341,350,351,353,356,357,364,365,375,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,430,440,441,451,452,453,458,477,478,487,499,503,512,],[-102,-115,-113,-99,-52,-114,-100,-109,-104,-110,-215,-107,-111,-116,-29,-105,-101,-112,-106,-108,-103,-117,-53,-131,-130,-147,-146,-54,-157,-37,-30,-288,-156,-128,235,-55,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,-230,-294,-290,-216,-36,-35,338,-213,348,-129,-132,-302,-126,-127,355,-148,-38,-300,-257,-298,-274,-273,-31,-251,-256,-254,-34,-255,433,-229,-134,-133,235,-150,-149,-44,-43,-217,-272,-271,-270,-269,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,460,-247,-235,-33,-32,-214,-39,-42,-258,-266,-267,-252,-41,-40,-231,-282,-275,-276,]),'$end':([0,12,14,17,23,26,34,40,42,43,52,53,68,101,104,120,233,254,347,],[-303,-64,-60,-66,-65,-58,-63,-62,-67,0,-59,-68,-61,-81,-69,-70,-302,-71,-196,]),'WSTRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,150,152,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,152,-28,-303,152,-161,-303,152,152,-264,272,-299,152,-262,152,-261,152,-260,152,152,-259,-263,152,152,152,-73,-76,-72,152,-74,152,152,-78,-193,-192,-77,-194,152,-75,-260,-302,152,152,152,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,152,-227,-228,-220,-226,-300,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,-303,-260,152,-212,-211,152,-209,152,152,152,-195,152,-208,-196,152,152,152,-260,152,152,-12,152,152,-11,152,152,-28,-303,-260,-207,-210,152,-199,152,-197,-303,-176,152,152,-303,152,-260,152,152,152,152,-198,152,152,152,152,-11,152,-203,-202,-200,152,-303,152,152,152,-204,-201,152,-206,-205,]),'DIVIDE':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,304,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,304,304,304,304,304,304,304,304,304,304,-234,-233,304,304,304,304,304,-235,-258,-266,-267,-252,-282,-275,-276,]),'FOR':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,206,-73,-76,-72,-74,206,-78,-193,-192,-77,-194,206,-75,-302,-212,-211,-209,206,-195,-208,-196,206,-207,-210,-199,206,-197,206,-198,206,206,-203,-202,-200,206,206,-204,-201,206,-206,-205,]),'PLUSPLUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,136,141,144,145,147,148,150,151,152,153,154,155,156,157,158,159,163,164,166,167,168,169,170,171,172,173,174,175,177,178,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,275,276,278,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,377,378,379,380,383,388,389,416,417,418,424,426,427,429,431,433,436,447,450,452,453,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,166,-28,-303,-288,166,-161,-303,166,166,-292,-264,-280,-295,-299,-296,-293,-278,166,-262,-279,278,166,-261,166,-291,-260,-265,166,166,-297,-259,-289,-277,-294,-290,-263,166,166,166,-73,-76,-72,166,-74,166,166,-78,-193,-192,-77,-194,166,-75,-260,-288,-302,166,166,166,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,166,-227,-228,-220,-226,-300,166,-298,-274,-273,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,-303,-260,166,-212,-211,166,-209,166,166,166,-195,166,-208,-196,166,166,166,-260,166,166,-12,166,166,-11,-272,-271,-270,-269,-268,-281,166,166,-28,-303,-260,-207,-210,166,-199,166,-197,-303,-176,-266,-267,166,166,-303,166,-260,166,166,166,166,-198,166,166,166,166,-11,166,-203,-202,-200,-282,166,-303,-275,166,166,-276,166,-204,-201,166,-206,-205,]),'EQUALS':([8,37,61,85,86,87,88,89,97,105,115,119,135,140,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,184,185,226,233,247,272,274,275,276,278,282,285,286,288,289,293,364,365,368,373,377,378,379,380,383,388,412,413,440,441,445,449,451,452,453,458,477,478,479,499,503,512,],[-52,-29,-53,-54,-157,-156,-37,144,145,-30,-288,-156,246,-55,-292,263,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-36,-35,-288,-302,-38,-300,-257,-298,-274,-273,-31,-251,-256,-254,-34,-255,-44,-43,-177,450,-272,-271,-270,-269,-268,-281,-33,-32,-39,-42,-180,-178,-258,-266,-267,-252,-41,-40,-179,-282,-275,-276,]),'ELSE':([53,104,199,200,203,205,214,217,222,233,332,333,336,345,347,426,427,431,436,473,494,495,497,515,516,519,520,],[-68,-69,-73,-76,-72,-74,-78,-77,-75,-302,-212,-211,-209,-208,-196,-207,-210,-199,-197,-198,-203,-202,509,-204,-201,-206,-205,]),'ANDEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,268,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'EQ':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,308,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,308,-239,-237,-241,-245,-240,-236,-243,308,-234,-233,-242,308,-244,308,308,-235,-258,-266,-267,-252,-282,-275,-276,]),'AND':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,136,141,144,145,147,148,149,150,151,152,153,154,155,156,157,158,159,161,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,280,281,284,285,286,287,288,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,377,378,379,380,383,388,389,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,416,417,418,424,426,427,429,431,433,436,447,450,451,452,453,454,456,458,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,173,-28,-303,-288,173,-161,-303,173,173,-292,-264,-251,-280,-295,-299,-296,-293,-278,173,-262,-279,-253,-232,173,-261,173,-291,-260,-265,173,173,-297,-259,-289,-277,309,-294,-290,-263,173,173,173,-73,-76,-72,173,-74,173,173,-78,-193,-192,-77,-194,173,-75,-260,-288,-302,173,173,173,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,173,-227,-228,-220,-226,-300,173,-257,-298,-274,-273,173,173,173,-251,-256,173,-254,-255,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,173,-303,-260,173,-212,-211,173,-209,173,173,173,-195,173,-208,-196,173,173,173,-260,173,173,-12,173,173,-11,-272,-271,-270,-269,-268,-281,173,-238,309,-239,-237,-241,-245,-240,-236,-243,309,-234,-233,-242,309,-244,-246,309,-235,173,-28,-303,-260,-207,-210,173,-199,173,-197,-303,-176,-258,-266,-267,173,173,-252,-303,173,-260,173,173,173,173,-198,173,173,173,173,-11,173,-203,-202,-200,-282,173,-303,-275,173,173,-276,173,-204,-201,173,-206,-205,]),'TYPEID':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,76,77,78,79,80,81,83,84,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,137,139,142,146,170,184,185,186,189,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,277,279,282,283,284,287,289,323,327,332,333,335,336,342,345,347,350,351,353,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[29,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,29,-94,-109,-104,-136,-65,-93,-110,29,69,73,-215,-107,-303,-111,88,-63,-116,29,-29,-135,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,29,-53,88,-82,29,29,-61,-131,-301,-130,29,-147,-146,-28,-158,-160,-27,-88,88,-90,88,29,-87,-89,-92,-81,-84,-86,-69,-30,193,29,-70,29,-83,29,29,-128,-140,-137,29,29,88,-161,-159,88,29,88,29,-36,-35,29,193,29,-73,-76,-72,-74,29,-78,-193,-192,-77,-194,-75,29,29,-129,-132,-138,-302,-126,-127,-148,-71,29,377,379,-31,29,29,29,-34,29,29,-212,-211,29,-209,-195,-208,-196,-134,-133,88,-139,-150,-149,29,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'LBRACE':([8,18,22,27,28,37,38,53,61,62,64,66,67,69,70,71,73,74,87,101,104,105,121,122,143,144,145,184,185,199,200,203,205,212,214,215,216,217,219,221,222,233,256,282,289,332,333,336,338,342,345,347,348,366,372,374,389,412,413,426,427,431,433,436,447,450,451,456,457,459,472,473,474,476,480,481,494,495,497,502,509,514,515,516,518,519,520,],[-52,-303,-136,70,70,-29,-135,-68,-53,-7,-82,70,-8,70,-301,70,70,70,-303,-81,-69,-30,70,-83,70,70,70,-36,-35,-73,-76,-72,-74,70,-78,-193,-192,-77,-194,70,-75,-302,-303,-31,-34,-212,-211,-209,70,-195,-208,-196,70,-12,70,-11,70,-33,-32,-207,-210,-199,70,-197,-303,-176,70,70,70,-303,70,-198,70,70,70,-11,-203,-202,-200,-303,70,70,-204,-201,70,-206,-205,]),'PPHASH':([0,12,14,17,23,26,34,40,42,53,68,101,104,120,233,254,347,],[42,-64,-60,-66,-65,42,-63,-62,-67,-68,-61,-81,-69,-70,-302,-71,-196,]),'INT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[50,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,50,-94,-109,-104,-65,-93,-110,50,-215,-107,-111,50,-63,-116,50,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,50,-53,50,-82,50,50,-61,-131,-301,-130,50,-147,-146,-160,-88,-90,50,-87,-89,-92,-81,-84,-86,-69,-30,50,50,-70,50,-83,50,50,-128,-140,-137,50,50,50,-161,50,50,-36,-35,50,50,-73,-76,-72,-74,50,-78,-193,-192,-77,-194,-75,50,50,-129,-132,-138,-302,-126,-127,-148,-71,50,-31,50,50,50,-34,50,50,50,-212,-211,50,-209,-195,-208,-196,-134,-133,-139,-150,-149,50,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'SIGNED':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[48,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,48,-94,-109,-104,-65,-93,-110,48,-215,-107,-111,48,-63,-116,48,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,48,-53,48,-82,48,48,-61,-131,-301,-130,48,-147,-146,-160,-88,-90,48,-87,-89,-92,-81,-84,-86,-69,-30,48,48,-70,48,-83,48,48,-128,-140,-137,48,48,48,-161,48,48,-36,-35,48,48,-73,-76,-72,-74,48,-78,-193,-192,-77,-194,-75,48,48,-129,-132,-138,-302,-126,-127,-148,-71,48,-31,48,48,48,-34,48,48,48,-212,-211,48,-209,-195,-208,-196,-134,-133,-139,-150,-149,48,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'CONTINUE':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,207,-73,-76,-72,-74,207,-78,-193,-192,-77,-194,207,-75,-302,-212,-211,-209,207,-195,-208,-196,207,-207,-210,-199,207,-197,207,-198,207,207,-203,-202,-200,207,207,-204,-201,207,-206,-205,]),'NOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,181,-28,-303,181,-161,-303,181,181,-264,181,-262,181,-261,181,-260,181,181,-259,-263,181,181,181,-73,-76,-72,181,-74,181,181,-78,-193,-192,-77,-194,181,-75,-260,-302,181,181,181,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,181,-227,-228,-220,-226,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,181,-303,-260,181,-212,-211,181,-209,181,181,181,-195,181,-208,-196,181,181,181,-260,181,181,-12,181,181,-11,181,181,-28,-303,-260,-207,-210,181,-199,181,-197,-303,-176,181,181,-303,181,-260,181,181,181,181,-198,181,181,181,181,-11,181,-203,-202,-200,181,-303,181,181,181,-204,-201,181,-206,-205,]),'OREQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,269,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'MOD':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,312,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,312,312,312,312,312,312,312,312,312,312,-234,-233,312,312,312,312,312,-235,-258,-266,-267,-252,-282,-275,-276,]),'RSHIFT':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,294,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,294,-239,-237,294,294,294,-236,294,294,-234,-233,294,294,294,294,294,-235,-258,-266,-267,-252,-282,-275,-276,]),'DEFAULT':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,209,-73,-76,-72,-74,209,-78,-193,-192,-77,-194,209,-75,-302,-212,-211,-209,209,-195,-208,-196,209,-207,-210,-199,209,-197,209,-198,209,209,-203,-202,-200,209,209,-204,-201,209,-206,-205,]),'__INT128':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[25,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,25,-94,-109,-104,-65,-93,-110,25,-215,-107,-111,25,-63,-116,25,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,25,-53,25,-82,25,25,-61,-131,-301,-130,25,-147,-146,-160,-88,-90,25,-87,-89,-92,-81,-84,-86,-69,-30,25,25,-70,25,-83,25,25,-128,-140,-137,25,25,25,-161,25,25,-36,-35,25,25,-73,-76,-72,-74,25,-78,-193,-192,-77,-194,-75,25,25,-129,-132,-138,-302,-126,-127,-148,-71,25,-31,25,25,25,-34,25,25,25,-212,-211,25,-209,-195,-208,-196,-134,-133,-139,-150,-149,25,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'WHILE':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,346,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,210,-73,-76,-72,-74,210,-78,-193,-192,-77,-194,210,-75,-302,-212,-211,-209,210,-195,-208,435,-196,210,-207,-210,-199,210,-197,210,-198,210,210,-203,-202,-200,210,210,-204,-201,210,-206,-205,]),'DIVEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,260,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'EXTERN':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,254,282,289,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[11,11,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,11,-94,-109,-104,-65,-93,-110,11,-215,-107,-111,11,-63,-116,-29,-105,-62,-101,-67,-112,-106,11,-108,11,-103,-117,-68,-98,11,-53,11,-82,11,-61,-131,-301,-130,-147,-146,-88,-90,11,-87,-89,-92,-81,-69,-30,11,-70,11,-83,11,-36,-35,11,11,-73,-76,-72,-74,11,-78,-193,-192,-77,-194,-75,-132,-302,-148,-71,-31,-34,11,11,-212,-211,11,-209,-195,-208,-196,-134,-133,-150,-149,11,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'CASE':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,211,-73,-76,-72,-74,211,-78,-193,-192,-77,-194,211,-75,-302,-212,-211,-209,211,-195,-208,-196,211,-207,-210,-199,211,-197,211,-198,211,211,-203,-202,-200,211,211,-204,-201,211,-206,-205,]),'LAND':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,307,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,307,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-258,-266,-267,-252,-282,-275,-276,]),'REGISTER':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,254,282,289,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[19,19,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,19,-94,-109,-104,-65,-93,-110,19,-215,-107,-111,19,-63,-116,-29,-105,-62,-101,-67,-112,-106,19,-108,19,-103,-117,-68,-98,19,-53,19,-82,19,-61,-131,-301,-130,-147,-146,-88,-90,19,-87,-89,-92,-81,-69,-30,19,-70,19,-83,19,-36,-35,19,19,-73,-76,-72,-74,19,-78,-193,-192,-77,-194,-75,-132,-302,-148,-71,-31,-34,19,19,-212,-211,19,-209,-195,-208,-196,-134,-133,-150,-149,19,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'MODEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,262,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'NE':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,299,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,299,-239,-237,-241,-245,-240,-236,-243,299,-234,-233,-242,299,-244,299,299,-235,-258,-266,-267,-252,-282,-275,-276,]),'SWITCH':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,213,-73,-76,-72,-74,213,-78,-193,-192,-77,-194,213,-75,-302,-212,-211,-209,213,-195,-208,-196,213,-207,-210,-199,213,-197,213,-198,213,213,-203,-202,-200,213,213,-204,-201,213,-206,-205,]),'INT_CONST_HEX':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,167,-28,-303,167,-161,-303,167,167,-264,167,-262,167,-261,167,-260,167,167,-259,-263,167,167,167,-73,-76,-72,167,-74,167,167,-78,-193,-192,-77,-194,167,-75,-260,-302,167,167,167,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,167,-227,-228,-220,-226,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,167,-303,-260,167,-212,-211,167,-209,167,167,167,-195,167,-208,-196,167,167,167,-260,167,167,-12,167,167,-11,167,167,-28,-303,-260,-207,-210,167,-199,167,-197,-303,-176,167,167,-303,167,-260,167,167,167,167,-198,167,167,167,167,-11,167,-203,-202,-200,167,-303,167,167,167,-204,-201,167,-206,-205,]),'_COMPLEX':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[30,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,30,-94,-109,-104,-65,-93,-110,30,-215,-107,-111,30,-63,-116,30,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,30,-53,30,-82,30,30,-61,-131,-301,-130,30,-147,-146,-160,-88,-90,30,-87,-89,-92,-81,-84,-86,-69,-30,30,30,-70,30,-83,30,30,-128,-140,-137,30,30,30,-161,30,30,-36,-35,30,30,-73,-76,-72,-74,30,-78,-193,-192,-77,-194,-75,30,30,-129,-132,-138,-302,-126,-127,-148,-71,30,-31,30,30,30,-34,30,30,30,-212,-211,30,-209,-195,-208,-196,-134,-133,-139,-150,-149,30,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'PPPRAGMASTR':([53,],[104,]),'PLUSEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,265,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'STRUCT':([0,1,3,7,8,9,11,12,14,17,18,19,23,24,26,34,35,36,37,40,42,47,49,51,53,54,55,56,57,60,61,64,65,67,68,70,72,78,87,101,102,103,104,105,117,120,121,122,123,124,126,127,128,129,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,232,233,254,273,282,283,284,287,289,323,327,332,333,335,336,342,345,347,354,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[38,-303,-115,-97,-52,-95,-96,-64,-60,-66,38,-94,-65,-93,38,-63,-116,38,-29,-62,-67,-303,-303,-117,-68,-98,-85,-10,-9,38,-53,-82,38,38,-61,-301,38,-160,38,-81,-84,-86,-69,-30,38,-70,38,-83,38,38,-140,-137,38,38,-161,38,38,-36,-35,38,38,-73,-76,-72,-74,38,-78,-193,-192,-77,-194,-75,38,38,-138,-302,-71,38,-31,38,38,38,-34,38,38,-212,-211,38,-209,-195,-208,-196,-139,38,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'CONDOP':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,310,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-258,-266,-267,-252,-282,-275,-276,]),'BREAK':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,218,-73,-76,-72,-74,218,-78,-193,-192,-77,-194,218,-75,-302,-212,-211,-209,218,-195,-208,-196,218,-207,-210,-199,218,-197,218,-198,218,218,-203,-202,-200,218,218,-204,-201,218,-206,-205,]),'VOLATILE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,136,141,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,250,251,254,273,282,283,284,287,289,292,322,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,417,418,426,427,431,436,473,494,495,497,515,516,519,520,],[51,51,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,51,-94,-109,-104,-65,-93,-110,51,-215,-107,51,-111,51,-63,-116,-29,-105,-62,-101,-67,-112,-106,51,-108,51,-103,-117,-68,-98,51,51,-53,51,-82,51,-61,-131,-301,-130,51,-147,-146,51,-160,-88,-90,51,-87,-89,-92,-81,-69,-30,51,51,51,-70,51,-83,51,51,-128,-140,-137,51,51,51,-161,51,51,51,-36,-35,51,51,-73,-76,-72,-74,51,-78,-193,-192,-77,-194,-75,51,51,-129,-132,-138,-302,-126,-127,-148,51,51,-71,51,-31,51,51,51,-34,51,51,51,51,-212,-211,51,-209,-195,-208,-196,-134,-133,-139,-150,-149,51,-33,-32,51,51,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'PPPRAGMA':([0,12,14,17,23,26,34,40,42,53,68,70,101,104,120,121,199,200,203,205,212,214,215,216,217,219,221,222,233,254,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[53,-64,-60,-66,-65,53,-63,-62,-67,-68,-61,-301,-81,-69,-70,53,-73,-76,-72,-74,53,-78,-193,-192,-77,-194,53,-75,-302,-71,-212,-211,-209,53,-195,-208,-196,53,-207,-210,-199,53,-197,53,-198,53,53,-203,-202,-200,53,53,-204,-201,53,-206,-205,]),'INLINE':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,254,282,289,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[54,54,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,54,-94,-109,-104,-65,-93,-110,54,-215,-107,-111,54,-63,-116,-29,-105,-62,-101,-67,-112,-106,54,-108,54,-103,-117,-68,-98,54,-53,54,-82,54,-61,-131,-301,-130,-147,-146,-88,-90,54,-87,-89,-92,-81,-69,-30,54,-70,54,-83,54,-36,-35,54,54,-73,-76,-72,-74,54,-78,-193,-192,-77,-194,-75,-132,-302,-148,-71,-31,-34,54,54,-212,-211,54,-209,-195,-208,-196,-134,-133,-150,-149,54,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'INT_CONST_BIN':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,147,-28,-303,147,-161,-303,147,147,-264,147,-262,147,-261,147,-260,147,147,-259,-263,147,147,147,-73,-76,-72,147,-74,147,147,-78,-193,-192,-77,-194,147,-75,-260,-302,147,147,147,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,147,-227,-228,-220,-226,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,-303,-260,147,-212,-211,147,-209,147,147,147,-195,147,-208,-196,147,147,147,-260,147,147,-12,147,147,-11,147,147,-28,-303,-260,-207,-210,147,-199,147,-197,-303,-176,147,147,-303,147,-260,147,147,147,147,-198,147,147,147,147,-11,147,-203,-202,-200,147,-303,147,147,147,-204,-201,147,-206,-205,]),'DO':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,221,-73,-76,-72,-74,221,-78,-193,-192,-77,-194,221,-75,-302,-212,-211,-209,221,-195,-208,-196,221,-207,-210,-199,221,-197,221,-198,221,221,-203,-202,-200,221,221,-204,-201,221,-206,-205,]),'LNOT':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,148,-28,-303,148,-161,-303,148,148,-264,148,-262,148,-261,148,-260,148,148,-259,-263,148,148,148,-73,-76,-72,148,-74,148,148,-78,-193,-192,-77,-194,148,-75,-260,-302,148,148,148,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,148,-227,-228,-220,-226,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,148,-303,-260,148,-212,-211,148,-209,148,148,148,-195,148,-208,-196,148,148,148,-260,148,148,-12,148,148,-11,148,148,-28,-303,-260,-207,-210,148,-199,148,-197,-303,-176,148,148,-303,148,-260,148,148,148,148,-198,148,148,148,148,-11,148,-203,-202,-200,148,-303,148,148,148,-204,-201,148,-206,-205,]),'CONST':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,31,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,59,60,61,63,64,67,68,69,70,71,72,73,74,76,78,80,83,87,91,92,96,101,104,105,107,108,113,120,121,122,123,124,125,126,127,128,129,130,136,141,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,250,251,254,273,282,283,284,287,289,292,322,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,417,418,426,427,431,436,473,494,495,497,515,516,519,520,],[3,3,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,3,-94,-109,-104,-65,-93,-110,3,-215,-107,3,-111,3,-63,-116,-29,-105,-62,-101,-67,-112,-106,3,-108,3,-103,-117,-68,-98,3,3,-53,3,-82,3,-61,-131,-301,-130,3,-147,-146,3,-160,-88,-90,3,-87,-89,-92,-81,-69,-30,3,3,3,-70,3,-83,3,3,-128,-140,-137,3,3,3,-161,3,3,3,-36,-35,3,3,-73,-76,-72,-74,3,-78,-193,-192,-77,-194,-75,3,3,-129,-132,-138,-302,-126,-127,-148,3,3,-71,3,-31,3,3,3,-34,3,3,3,3,-212,-211,3,-209,-195,-208,-196,-134,-133,-139,-150,-149,3,-33,-32,3,3,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'LOR':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,295,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-258,-266,-267,-252,-282,-275,-276,]),'CHAR_CONST':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,151,-28,-303,151,-161,-303,151,151,-264,151,-262,151,-261,151,-260,151,151,-259,-263,151,151,151,-73,-76,-72,151,-74,151,151,-78,-193,-192,-77,-194,151,-75,-260,-302,151,151,151,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,151,-227,-228,-220,-226,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,151,-303,-260,151,-212,-211,151,-209,151,151,151,-195,151,-208,-196,151,151,151,-260,151,151,-12,151,151,-11,151,151,-28,-303,-260,-207,-210,151,-199,151,-197,-303,-176,151,151,-303,151,-260,151,151,151,151,-198,151,151,151,151,-11,151,-203,-202,-200,151,-303,151,151,151,-204,-201,151,-206,-205,]),'LSHIFT':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,296,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,296,-239,-237,296,296,296,-236,296,296,-234,-233,296,296,296,296,296,-235,-258,-266,-267,-252,-282,-275,-276,]),'RBRACE':([53,70,101,104,115,121,126,127,129,133,134,135,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,180,199,200,203,205,212,214,215,216,217,219,220,222,223,228,229,232,233,242,243,244,256,257,272,274,275,276,278,285,286,288,293,332,333,336,341,342,345,347,354,358,359,367,371,374,375,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,426,427,431,436,444,447,448,451,452,453,458,473,482,486,487,494,495,497,498,499,502,503,512,515,516,519,520,],[-68,-301,-81,-69,-288,-303,-140,-137,233,-151,233,-154,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,-230,-294,-290,-216,-73,-76,-72,-74,-6,-78,-193,-192,-77,-194,-5,-75,233,233,233,-138,-302,233,233,-152,-303,-171,-300,-257,-298,-274,-273,-251,-256,-254,-255,-212,-211,-209,-229,-195,-208,-196,-139,-153,-155,233,-22,-21,-217,-272,-271,-270,-269,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-207,-210,-199,-197,-172,233,-174,-258,-266,-267,-252,-198,-173,233,-231,-203,-202,-200,-175,-282,233,-275,-276,-204,-201,-206,-205,]),'_BOOL':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[15,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,15,-94,-109,-104,-65,-93,-110,15,-215,-107,-111,15,-63,-116,15,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,15,-53,15,-82,15,15,-61,-131,-301,-130,15,-147,-146,-160,-88,-90,15,-87,-89,-92,-81,-84,-86,-69,-30,15,15,-70,15,-83,15,15,-128,-140,-137,15,15,15,-161,15,15,-36,-35,15,15,-73,-76,-72,-74,15,-78,-193,-192,-77,-194,-75,15,15,-129,-132,-138,-302,-126,-127,-148,-71,15,-31,15,15,15,-34,15,15,15,-212,-211,15,-209,-195,-208,-196,-134,-133,-139,-150,-149,15,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'LE':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,298,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,298,-239,-237,-241,298,-240,-236,-243,298,-234,-233,-242,298,298,298,298,-235,-258,-266,-267,-252,-282,-275,-276,]),'SEMI':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,46,47,48,49,50,51,53,54,55,56,57,61,63,65,68,69,70,71,72,73,74,80,82,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,115,119,120,121,123,124,125,126,127,129,130,140,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,180,184,185,199,200,202,203,204,205,207,208,212,214,215,216,217,218,219,220,221,222,224,226,228,229,230,231,232,233,234,236,237,238,239,240,241,245,247,248,254,255,257,258,259,272,274,275,276,278,282,285,286,288,289,293,331,332,333,334,335,336,338,341,342,343,345,347,348,350,351,352,354,356,357,364,365,375,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,412,413,426,427,428,429,430,431,433,436,438,439,440,441,444,451,452,453,458,470,471,472,473,474,476,477,478,482,487,492,494,495,497,499,503,508,509,512,514,515,516,518,519,520,],[17,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,-94,-109,-104,-65,-93,-110,17,-215,-107,-111,-303,-63,-116,-303,-29,-105,-62,-101,-67,-112,-106,101,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,-53,-303,-303,-61,-131,-301,-130,126,-147,-146,-88,-20,-90,-54,-157,-156,-37,-120,-79,-87,-89,-19,-118,-122,-92,-124,-16,-80,-15,-81,-84,-86,-69,-30,-288,-156,-70,-303,126,126,-128,-140,-137,126,-303,-55,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,-230,-294,-290,-216,-36,-35,-73,-76,332,-72,333,-74,336,-14,-303,-78,-193,-192,-77,345,-194,-13,-303,-75,-213,-288,126,126,-129,-132,-138,-302,-126,-26,-25,354,-141,-127,-143,-148,-38,-119,-71,-121,-171,-125,-123,-300,-257,-298,-274,-273,-31,-251,-256,-254,-34,-255,426,-212,-211,427,-303,-209,-303,-229,-195,-13,-208,-196,-303,-134,-133,-145,-139,-150,-149,-44,-43,-217,-272,-271,-270,-269,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-33,-32,-207,-210,470,-303,-214,-199,-303,-197,-142,-144,-39,-42,-172,-258,-266,-267,-252,-303,493,-303,-198,-303,-303,-41,-40,-173,-231,506,-203,-202,-200,-282,-275,515,-303,-276,-303,-204,-201,-303,-206,-205,]),'LT':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,300,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,300,-239,-237,-241,300,-240,-236,-243,300,-234,-233,-242,300,300,300,300,-235,-258,-266,-267,-252,-282,-275,-276,]),'COMMA':([2,3,5,6,7,8,9,10,11,15,16,19,20,21,24,25,29,30,31,32,35,37,39,41,44,45,48,50,51,54,61,69,71,73,74,76,77,78,79,80,82,83,85,86,87,88,89,91,92,94,95,96,97,98,105,112,113,114,115,116,118,119,125,133,134,135,136,137,140,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,180,184,185,187,188,189,190,191,192,193,194,196,208,224,226,230,231,233,234,236,239,240,241,242,243,244,245,247,248,255,257,258,259,272,274,275,276,278,282,285,286,288,289,290,292,293,320,321,328,330,334,341,350,351,352,356,357,358,359,364,365,371,375,377,378,379,380,381,382,383,384,385,388,390,391,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,421,422,430,432,434,437,438,439,440,441,444,448,451,452,453,458,465,466,467,468,469,477,478,482,483,486,487,488,489,496,498,499,503,504,505,511,512,],[-102,-115,-113,-99,-97,-52,-95,-114,-96,-100,-91,-94,-109,-104,-93,-110,-215,-107,-303,-111,-116,-29,-105,-101,-112,-106,-108,-103,-117,-98,-53,-131,-130,-147,-146,-28,-158,-160,-27,-88,139,-90,-54,-157,-156,-37,-120,-87,-89,-118,-122,-92,-124,146,-30,-164,-303,197,-288,198,-169,-156,-128,-151,244,-154,-161,-159,-55,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,-230,-294,-290,-216,-36,-35,-168,-2,-182,-56,-166,-1,-45,-167,-184,337,-213,-288,-129,-132,-302,-126,353,-141,-127,-143,244,244,-152,-148,-38,-119,-121,-171,-125,-123,-300,-257,-298,-274,-273,-31,-251,-256,-254,-34,337,-303,-255,-57,-183,-170,-165,337,-229,-134,-133,-145,-150,-149,-153,-155,-44,-43,447,-217,-272,-271,-270,-269,337,-286,-268,454,455,-281,-181,-182,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,337,-247,-235,-33,-32,-191,-185,-187,-189,-214,337,337,337,-142,-144,-39,-42,-172,-174,-258,-266,-267,-252,-51,-50,-186,-188,-190,-41,-40,-173,-287,502,-231,-46,-49,337,-175,-282,-275,-48,-47,337,-276,]),'OFFSETOF':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,163,164,166,168,170,171,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,162,-28,-303,162,-161,-303,162,162,-264,162,-262,162,-261,162,-260,162,162,-259,-263,162,162,162,-73,-76,-72,162,-74,162,162,-78,-193,-192,-77,-194,162,-75,-260,-302,162,162,162,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,162,-227,-228,-220,-226,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,162,-303,-260,162,-212,-211,162,-209,162,162,162,-195,162,-208,-196,162,162,162,-260,162,162,-12,162,162,-11,162,162,-28,-303,-260,-207,-210,162,-199,162,-197,-303,-176,162,162,-303,162,-260,162,162,162,162,-198,162,162,162,162,-11,162,-203,-202,-200,162,-303,162,162,162,-204,-201,162,-206,-205,]),'TYPEDEF':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,254,282,289,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[7,7,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,7,-94,-109,-104,-65,-93,-110,7,-215,-107,-111,7,-63,-116,-29,-105,-62,-101,-67,-112,-106,7,-108,7,-103,-117,-68,-98,7,-53,7,-82,7,-61,-131,-301,-130,-147,-146,-88,-90,7,-87,-89,-92,-81,-69,-30,7,-70,7,-83,7,-36,-35,7,7,-73,-76,-72,-74,7,-78,-193,-192,-77,-194,-75,-132,-302,-148,-71,-31,-34,7,7,-212,-211,7,-209,-195,-208,-196,-134,-133,-150,-149,7,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'XOR':([115,147,149,150,151,152,153,154,155,158,159,161,167,169,172,174,175,176,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,451,452,453,458,499,503,512,],[-288,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,-232,-291,-265,-297,-289,-277,303,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-238,303,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,303,-244,-246,303,-235,-258,-266,-267,-252,-282,-275,-276,]),'AUTO':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,37,39,40,41,42,44,45,47,48,49,50,51,53,54,60,61,63,64,67,68,69,70,71,73,74,80,83,87,91,92,96,101,104,105,113,120,121,122,142,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,231,233,245,254,282,289,323,327,332,333,335,336,342,345,347,350,351,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[24,24,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,24,-94,-109,-104,-65,-93,-110,24,-215,-107,-111,24,-63,-116,-29,-105,-62,-101,-67,-112,-106,24,-108,24,-103,-117,-68,-98,24,-53,24,-82,24,-61,-131,-301,-130,-147,-146,-88,-90,24,-87,-89,-92,-81,-69,-30,24,-70,24,-83,24,-36,-35,24,24,-73,-76,-72,-74,24,-78,-193,-192,-77,-194,-75,-132,-302,-148,-71,-31,-34,24,24,-212,-211,24,-209,-195,-208,-196,-134,-133,-150,-149,24,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'TIMES':([0,1,2,3,4,5,6,7,9,10,11,12,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,91,92,96,101,102,103,104,106,107,108,113,115,120,121,125,130,136,139,141,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,161,163,164,166,167,168,169,170,171,172,173,174,175,176,177,178,181,182,183,186,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,230,231,233,234,235,240,245,246,249,250,251,254,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,278,280,281,284,285,286,287,288,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,350,351,353,355,356,357,361,362,363,366,370,372,374,377,378,379,380,383,388,389,392,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,416,417,418,424,426,427,429,431,433,436,447,450,451,452,453,454,456,458,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[31,-303,-102,-115,31,-113,-99,-97,-95,-114,-96,-64,-60,-100,-91,-66,-94,-109,-104,-65,-93,-110,31,-215,-107,-303,-111,31,-63,-116,31,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,-303,31,31,-61,-131,-301,-130,-147,-146,-28,31,-160,-27,-88,31,-90,-87,-89,-92,-81,-84,-86,-69,168,-28,-303,31,-288,-70,225,-128,31,-161,31,-303,225,225,31,-292,-264,-251,-280,-295,-299,-296,-293,-278,225,-262,-279,-253,-232,225,-261,225,-291,-260,-265,225,225,-297,-259,-289,-277,305,-294,-290,-263,225,225,31,325,-73,-76,-72,225,-74,225,225,-78,-193,-192,-77,-194,225,-75,-260,-288,-129,-132,-302,-126,225,-127,-148,225,361,-28,-303,-71,-303,-221,-224,-222,-218,-219,-223,-225,225,-227,-228,-220,-226,-300,225,-257,-298,-274,-273,225,225,225,-251,-256,225,-254,31,-255,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,225,-303,-260,424,-212,-211,225,-209,225,225,225,-195,225,-208,-196,225,225,-134,-133,31,225,-150,-149,-260,225,225,-12,225,225,-11,-272,-271,-270,-269,-268,-281,225,31,305,305,305,305,305,305,305,305,305,305,-234,-233,305,305,305,305,305,-235,462,-28,-303,-260,-207,-210,225,-199,225,-197,-303,-176,-258,-266,-267,225,225,-252,-303,225,-260,225,225,225,225,-198,225,225,225,225,-11,225,-203,-202,-200,-282,225,-303,-275,225,225,-276,225,-204,-201,225,-206,-205,]),'LPAREN':([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,19,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,61,63,65,68,69,70,71,73,74,76,77,78,79,80,81,83,84,85,88,91,92,96,101,102,103,104,105,106,107,108,113,115,120,121,125,130,136,137,139,140,141,144,145,146,147,148,150,151,152,153,154,155,156,157,158,159,162,163,164,166,167,168,169,170,171,172,173,174,175,177,178,181,182,183,184,185,186,189,190,193,195,196,199,200,203,204,205,206,210,211,212,213,214,215,216,217,219,221,222,225,226,227,230,231,233,234,235,240,245,246,247,249,250,251,254,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,275,276,278,280,281,282,284,287,289,292,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,315,320,321,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,350,351,353,355,356,357,361,362,363,364,365,366,370,372,374,377,378,379,380,383,388,389,391,392,412,413,414,415,416,417,418,421,422,424,426,427,429,431,433,435,436,440,441,447,450,452,453,454,456,459,460,462,463,464,465,466,467,468,469,470,472,473,474,475,476,477,478,480,481,488,489,493,494,495,497,499,501,502,503,504,505,506,509,512,514,515,516,518,519,520,],[4,-303,-102,-115,4,-113,-99,-97,60,-95,-114,-96,-64,4,-60,-100,-91,-66,-94,-109,-104,-65,-93,-110,4,-215,-107,-303,-111,81,-63,-116,4,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,-303,60,81,4,-61,-131,-301,-130,-147,-146,-28,-158,-160,-27,-88,81,-90,81,142,-37,-87,-89,-92,-81,-84,-86,-69,-30,170,-28,-303,186,-288,-70,170,-128,81,-161,-159,81,142,-303,170,170,81,-292,-264,-280,-295,-299,-296,-293,-278,273,-262,-279,281,283,284,-261,287,-291,-260,-265,170,287,-297,-259,-289,-277,-294,-290,-263,170,170,-36,-35,186,186,323,-45,170,327,-73,-76,-72,170,-74,335,339,284,170,344,-78,-193,-192,-77,-194,170,-75,-260,-288,349,-129,-132,-302,-126,284,-127,-148,284,-38,170,-28,-303,-71,-303,-221,-224,-222,-218,-219,-223,-225,170,-227,-228,-220,-226,-300,170,-298,-274,-273,170,170,-31,170,170,-34,392,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,170,284,284,186,323,327,-303,-260,170,-212,-211,170,-209,170,170,170,-195,170,-208,-196,170,170,-134,-133,81,284,-150,-149,-260,170,170,-44,-43,-12,284,170,-11,-272,-271,-270,-269,-268,-281,284,392,392,-33,-32,-191,-185,170,-28,-303,-187,-189,-260,-207,-210,170,-199,170,475,-197,-39,-42,-303,-176,-266,-267,170,284,-303,284,-260,170,170,-51,-50,-186,-188,-190,170,170,-198,170,170,170,-41,-40,170,-11,-46,-49,170,-203,-202,-200,-282,170,-303,-275,-48,-47,170,170,-276,170,-204,-201,170,-206,-205,]),'MINUSMINUS':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,115,121,136,141,144,145,147,148,150,151,152,153,154,155,156,157,158,159,163,164,166,167,168,169,170,171,172,173,174,175,177,178,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,226,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,272,273,275,276,278,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,377,378,379,380,383,388,389,416,417,418,424,426,427,429,431,433,436,447,450,452,453,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,499,501,502,503,506,509,512,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,171,-28,-303,-288,171,-161,-303,171,171,-292,-264,-280,-295,-299,-296,-293,-278,171,-262,-279,276,171,-261,171,-291,-260,-265,171,171,-297,-259,-289,-277,-294,-290,-263,171,171,171,-73,-76,-72,171,-74,171,171,-78,-193,-192,-77,-194,171,-75,-260,-288,-302,171,171,171,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,171,-227,-228,-220,-226,-300,171,-298,-274,-273,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,171,-303,-260,171,-212,-211,171,-209,171,171,171,-195,171,-208,-196,171,171,171,-260,171,171,-12,171,171,-11,-272,-271,-270,-269,-268,-281,171,171,-28,-303,-260,-207,-210,171,-199,171,-197,-303,-176,-266,-267,171,171,-303,171,-260,171,171,171,171,-198,171,171,171,171,-11,171,-203,-202,-200,-282,171,-303,-275,171,171,-276,171,-204,-201,171,-206,-205,]),'ID':([0,1,2,3,4,5,6,7,9,10,11,12,13,14,15,16,17,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,38,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,59,60,63,65,68,69,70,71,73,74,75,76,77,78,79,80,81,83,84,91,92,96,101,102,103,104,106,107,108,113,120,121,125,130,131,132,136,137,139,141,142,144,145,146,148,156,157,163,164,166,168,170,171,173,181,182,183,186,189,195,197,199,200,201,203,204,205,211,212,214,215,216,217,219,221,222,225,230,231,233,234,235,240,244,245,246,249,250,251,254,256,260,261,262,263,264,265,266,267,268,269,270,271,273,277,279,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,315,322,323,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,350,351,353,355,356,357,361,362,363,366,369,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,455,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,500,501,502,506,509,514,515,516,518,519,520,],[37,-303,-102,-115,37,-113,-99,-97,-95,-114,-96,-64,37,-60,-100,-91,-66,-94,-109,-104,-136,-65,-93,-110,37,71,74,-215,-107,-303,-111,37,-63,-116,37,-135,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,-303,115,37,37,-61,-131,-301,-130,-147,-146,135,-28,-158,-160,-27,-88,37,-90,37,-87,-89,-92,-81,-84,-86,-69,115,-28,-303,37,-70,226,-128,37,135,135,-161,-159,37,-303,115,115,115,37,-264,115,-262,115,-261,115,-260,115,115,-259,-263,115,115,37,37,115,115,-73,-76,331,-72,115,-74,115,226,-78,-193,-192,-77,-194,226,-75,-260,-129,-132,-302,-126,115,-127,135,-148,115,115,-28,-303,-71,-303,-221,-224,-222,-218,-219,-223,-225,115,-227,-228,-220,-226,115,378,380,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,115,37,-303,115,-260,115,-212,-211,115,-209,115,226,115,-195,115,-208,-196,226,115,-134,-133,37,115,-150,-149,-260,115,115,-12,115,115,115,-11,115,115,-28,-303,-260,-207,-210,115,-199,226,-197,-303,-176,115,115,115,-303,115,-260,115,115,115,226,-198,226,115,226,115,-11,115,-203,-202,-200,115,115,-303,115,226,226,-204,-201,226,-206,-205,]),'IF':([53,70,101,104,121,199,200,203,205,212,214,215,216,217,219,221,222,233,332,333,336,338,342,345,347,348,426,427,431,433,436,472,473,474,476,494,495,497,509,514,515,516,518,519,520,],[-68,-301,-81,-69,227,-73,-76,-72,-74,227,-78,-193,-192,-77,-194,227,-75,-302,-212,-211,-209,227,-195,-208,-196,227,-207,-210,-199,227,-197,227,-198,227,227,-203,-202,-200,227,227,-204,-201,227,-206,-205,]),'STRING_LITERAL':([3,35,51,53,59,70,76,78,79,101,104,106,107,108,121,136,141,144,145,148,156,157,158,163,164,166,168,170,171,172,173,181,182,183,195,199,200,203,204,205,211,212,214,215,216,217,219,221,222,225,233,235,246,249,250,251,256,260,261,262,263,264,265,266,267,268,269,270,271,273,275,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,322,325,326,332,333,335,336,337,338,339,342,344,345,347,348,349,355,361,362,363,366,370,372,374,389,416,417,418,424,426,427,429,431,433,436,447,450,454,456,459,460,462,463,464,470,472,473,474,475,476,480,481,493,494,495,497,501,502,506,509,514,515,516,518,519,520,],[-115,-116,-117,-68,-303,-301,-28,-160,-27,-81,-69,172,-28,-303,172,-161,-303,172,172,-264,172,-262,275,172,-261,172,-260,172,172,-297,-259,-263,172,172,172,-73,-76,-72,172,-74,172,172,-78,-193,-192,-77,-194,172,-75,-260,-302,172,172,172,-28,-303,-303,-221,-224,-222,-218,-219,-223,-225,172,-227,-228,-220,-226,172,-298,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,-303,-260,172,-212,-211,172,-209,172,172,172,-195,172,-208,-196,172,172,172,-260,172,172,-12,172,172,-11,172,172,-28,-303,-260,-207,-210,172,-199,172,-197,-303,-176,172,172,-303,172,-260,172,172,172,172,-198,172,172,172,172,-11,172,-203,-202,-200,172,-303,172,172,172,-204,-201,172,-206,-205,]),'FLOAT':([0,1,2,3,5,6,7,8,9,10,11,12,14,15,16,17,18,19,20,21,23,24,25,26,29,30,32,33,34,35,36,37,39,40,41,42,44,45,47,48,49,50,51,53,54,55,56,57,60,61,63,64,65,67,68,69,70,71,72,73,74,78,80,83,87,91,92,96,101,102,103,104,105,113,117,120,121,122,123,124,125,126,127,128,129,130,136,142,170,184,185,186,198,199,200,203,205,212,214,215,216,217,219,222,228,229,230,231,232,233,234,240,245,254,273,282,283,284,287,289,292,323,327,332,333,335,336,342,345,347,350,351,354,356,357,392,412,413,426,427,431,436,473,494,495,497,515,516,519,520,],[39,-303,-102,-115,-113,-99,-97,-52,-95,-114,-96,-64,-60,-100,-91,-66,39,-94,-109,-104,-65,-93,-110,39,-215,-107,-111,39,-63,-116,39,-29,-105,-62,-101,-67,-112,-106,-303,-108,-303,-103,-117,-68,-98,-85,-10,-9,39,-53,39,-82,39,39,-61,-131,-301,-130,39,-147,-146,-160,-88,-90,39,-87,-89,-92,-81,-84,-86,-69,-30,39,39,-70,39,-83,39,39,-128,-140,-137,39,39,39,-161,39,39,-36,-35,39,39,-73,-76,-72,-74,39,-78,-193,-192,-77,-194,-75,39,39,-129,-132,-138,-302,-126,-127,-148,-71,39,-31,39,39,39,-34,39,39,39,-212,-211,39,-209,-195,-208,-196,-134,-133,-139,-150,-149,39,-33,-32,-207,-210,-199,-197,-198,-203,-202,-200,-204,-201,-206,-205,]),'XOREQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,264,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'LSHIFTEQUAL':([115,147,149,150,151,152,153,154,155,158,159,167,169,172,174,175,177,178,226,233,272,274,275,276,278,285,286,288,293,377,378,379,380,383,388,451,452,453,458,499,503,512,],[-288,-292,266,-280,-295,-299,-296,-293,-278,-279,-253,-291,-265,-297,-289,-277,-294,-290,-288,-302,-300,-257,-298,-274,-273,-251,-256,-254,-255,-272,-271,-270,-269,-268,-281,-258,-266,-267,-252,-282,-275,-276,]),'RBRACKET':([3,35,51,59,78,79,106,107,115,136,141,147,149,150,151,152,153,154,155,158,159,160,161,165,167,168,169,172,174,175,176,177,178,179,180,195,224,233,249,250,272,274,275,276,278,285,286,288,293,313,314,322,324,325,326,341,360,361,375,377,378,379,380,381,383,388,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,410,411,416,417,423,424,430,442,443,446,451,452,453,458,461,462,487,490,491,499,503,511,512,],[-115,-116,-117,-303,-160,-27,-303,-28,-288,-161,-303,-292,-251,-280,-295,-299,-296,-293,-278,-279,-253,282,-232,-4,-291,289,-265,-297,-289,-277,-230,-294,-290,-3,-216,-303,-213,-302,-303,-28,-300,-257,-298,-274,-273,-251,-256,-254,-255,412,413,-303,421,422,-303,-229,440,441,-217,-272,-271,-270,-269,452,-268,-281,-238,-250,-239,-237,-241,-245,-240,-236,-243,-248,-234,-233,-242,-249,-244,-246,-247,-235,-303,-28,467,468,-214,477,478,479,-258,-266,-267,-252,488,489,-231,504,505,-282,-275,517,-276,]),} + +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items + +_lr_goto_items = {'expression_statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[199,199,199,199,199,199,199,199,199,199,199,199,]),'struct_or_union_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,128,129,142,170,186,198,212,228,229,273,283,284,287,323,327,335,392,],[5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,]),'init_declarator_list':([33,63,],[82,82,]),'init_declarator_list_opt':([33,63,],[90,90,]),'iteration_statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[200,200,200,200,200,200,200,200,200,200,200,200,]),'unified_string_literal':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'assignment_expression_opt':([106,195,249,326,416,],[160,324,360,423,461,]),'brace_open':([27,28,66,69,71,73,74,121,143,144,145,212,221,338,348,372,389,433,451,456,457,472,474,476,480,509,514,518,],[72,75,121,123,124,131,132,121,121,256,256,121,121,121,121,256,459,121,459,459,459,121,121,121,256,121,121,121,]),'enumerator':([75,131,132,244,],[133,133,133,358,]),'typeid_noparen_declarator':([113,],[194,]),'type_qualifier_list_opt':([31,59,108,141,251,322,418,],[77,106,183,249,363,416,464,]),'declaration_specifiers_no_type_opt':([1,47,49,],[55,102,103,]),'expression_opt':([121,212,221,335,338,348,429,433,470,472,474,476,493,506,509,514,518,],[202,202,202,428,202,202,471,202,492,202,202,202,507,513,202,202,202,]),'designation':([256,447,459,502,],[366,366,366,366,]),'parameter_list':([60,142,186,323,327,392,],[116,116,116,116,116,116,]),'labeled_statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[203,203,203,203,203,203,203,203,203,203,203,203,]),'abstract_declarator':([113,186,292,392,],[188,319,188,319,]),'translation_unit':([0,],[26,]),'init_declarator':([33,63,139,146,],[94,94,248,259,]),'direct_abstract_declarator':([113,186,189,292,315,391,392,],[196,196,321,196,321,321,196,]),'designator_list':([256,447,459,502,],[373,373,373,373,]),'identifier':([60,106,121,142,144,145,156,163,166,170,171,182,183,195,197,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,323,326,335,337,338,339,344,348,349,355,362,363,369,370,372,389,416,429,433,454,455,456,460,463,464,470,472,474,475,476,480,493,500,501,506,509,514,518,],[118,175,175,118,175,175,175,175,175,175,175,175,175,175,328,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,175,118,175,175,175,175,175,175,175,175,175,175,175,445,175,175,175,175,175,175,175,485,175,175,175,175,175,175,175,175,175,175,175,510,175,175,175,175,175,]),'offsetof_member_designator':([455,],[484,]),'unary_expression':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[149,149,149,149,274,285,288,149,293,149,149,149,149,285,149,149,285,285,149,149,149,149,149,149,149,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,285,149,285,285,149,149,149,149,149,149,149,149,285,149,149,285,149,285,149,149,149,149,285,285,149,149,149,149,149,149,149,149,149,149,149,149,149,149,]),'abstract_declarator_opt':([113,292,],[187,390,]),'initializer':([144,145,372,480,],[255,258,448,498,]),'direct_id_declarator':([0,4,13,26,33,36,63,65,81,84,113,130,139,146,186,189,315,353,],[8,8,61,8,8,8,8,8,8,61,8,8,8,8,8,61,61,8,]),'struct_declaration_list':([72,123,124,],[129,228,229,]),'pp_directive':([0,26,],[12,12,]),'declaration_list':([18,87,],[67,67,]),'id_init_declarator':([36,65,],[95,95,]),'type_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,128,129,142,170,186,198,212,228,229,273,283,284,287,323,327,335,392,],[16,16,16,96,16,96,16,125,16,96,16,125,125,230,125,16,125,16,16,16,125,125,125,125,125,125,16,16,16,16,]),'compound_statement':([66,121,143,212,221,338,348,433,472,474,476,509,514,518,],[120,205,254,205,205,205,205,205,205,205,205,205,205,205,]),'pointer':([0,4,26,33,36,63,65,77,81,113,130,139,146,186,292,353,392,],[13,13,13,84,13,84,13,137,84,189,84,84,84,315,391,84,391,]),'typeid_declarator':([33,63,81,130,139,146,353,],[86,86,138,86,86,86,86,]),'id_init_declarator_list':([36,65,],[98,98,]),'declarator':([33,63,130,139,146,353,],[89,89,241,89,89,241,]),'argument_expression_list':([281,],[384,]),'struct_declarator_list_opt':([130,],[238,]),'typedef_name':([0,18,26,36,60,65,67,72,87,117,121,123,124,128,129,142,170,186,198,212,228,229,273,283,284,287,323,327,335,392,],[32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,]),'parameter_type_list_opt':([186,327,392,],[318,425,318,]),'struct_declarator':([130,353,],[239,438,]),'type_qualifier':([0,1,18,26,31,33,47,49,59,60,63,67,72,76,87,107,108,113,121,123,124,128,129,130,141,142,170,186,198,212,228,229,250,251,273,283,284,287,292,322,323,327,335,392,417,418,],[47,47,47,47,78,91,47,47,78,47,91,47,78,136,47,136,78,91,47,78,78,136,78,240,78,47,78,47,47,47,78,78,136,78,78,78,78,78,240,78,47,47,47,47,136,78,]),'assignment_operator':([149,],[267,]),'expression':([121,170,204,212,221,273,280,284,287,310,335,338,339,344,348,349,429,433,470,472,474,475,476,493,501,506,509,514,518,],[208,290,334,208,208,290,381,290,290,409,208,208,432,434,208,437,208,208,208,208,208,496,208,208,511,208,208,208,208,]),'storage_class_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,142,186,198,212,323,327,335,392,],[1,1,1,1,80,1,1,1,80,1,1,80,1,1,1,1,1,1,1,1,1,]),'unified_wstring_literal':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,]),'translation_unit_or_empty':([0,],[43,]),'initializer_list_opt':([256,],[367,]),'brace_close':([129,134,223,228,229,242,243,367,447,486,502,],[231,245,347,350,351,356,357,444,482,503,512,]),'direct_typeid_declarator':([33,63,81,84,130,139,146,353,],[85,85,85,140,85,85,85,85,]),'external_declaration':([0,26,],[14,68,]),'type_name':([170,273,283,284,287,],[291,376,385,386,387,]),'block_item_list':([121,],[212,]),'pppragma_directive':([0,26,121,212,221,338,348,433,472,474,476,509,514,518,],[23,23,214,214,214,214,214,214,214,214,214,214,214,214,]),'statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[215,215,346,431,436,473,494,495,497,516,519,520,]),'cast_expression':([106,121,144,145,163,170,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[161,161,161,161,286,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,458,161,161,161,161,458,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,]),'struct_declarator_list':([130,],[236,]),'empty':([0,1,18,31,33,36,47,49,59,60,63,65,87,106,108,113,121,130,141,142,186,195,212,221,249,251,256,292,322,323,326,327,335,338,348,392,416,418,429,433,447,459,470,472,474,476,493,502,506,509,514,518,],[52,57,62,79,93,100,57,57,79,110,93,100,62,179,79,192,220,237,79,110,316,179,343,343,179,79,374,192,79,110,179,316,343,343,343,316,179,79,343,343,481,481,343,343,343,343,343,481,343,343,343,343,]),'parameter_declaration':([60,142,186,198,323,327,392,],[112,112,112,330,112,112,112,]),'primary_expression':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,169,]),'declaration':([0,18,26,67,87,121,212,335,],[34,64,34,122,64,216,216,429,]),'declaration_specifiers_no_type':([0,1,18,26,47,49,60,67,87,121,142,186,198,212,323,327,335,392,],[36,56,65,36,56,56,117,65,65,65,117,117,117,65,117,117,65,117,]),'jump_statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[217,217,217,217,217,217,217,217,217,217,217,217,]),'enumerator_list':([75,131,132,],[134,242,243,]),'block_item':([121,212,],[219,342,]),'constant_expression':([211,235,246,355,370,],[340,352,359,439,446,]),'identifier_list_opt':([60,142,323,],[109,252,419,]),'constant':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,]),'type_specifier_no_typeid':([0,18,26,33,36,60,63,65,67,72,87,113,117,121,123,124,128,129,130,142,170,186,198,212,228,229,273,283,284,287,292,323,327,335,392,],[10,10,10,83,10,10,83,10,10,10,10,83,10,10,10,10,10,10,234,10,10,10,10,10,10,10,10,10,10,10,234,10,10,10,10,]),'struct_declaration':([72,123,124,129,228,229,],[127,127,127,232,232,232,]),'direct_typeid_noparen_declarator':([113,189,],[190,320,]),'id_declarator':([0,4,26,33,36,63,65,81,113,130,139,146,186,353,],[18,58,18,87,97,119,97,58,191,119,119,119,58,119,]),'selection_statement':([121,212,221,338,348,433,472,474,476,509,514,518,],[222,222,222,222,222,222,222,222,222,222,222,222,]),'postfix_expression':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,]),'initializer_list':([256,459,],[371,486,]),'unary_operator':([106,121,144,145,156,163,166,170,171,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,389,416,429,433,454,456,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,]),'struct_or_union':([0,18,26,36,60,65,67,72,87,117,121,123,124,128,129,142,170,186,198,212,228,229,273,283,284,287,323,327,335,392,],[27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,]),'block_item_list_opt':([121,],[223,]),'assignment_expression':([106,121,144,145,170,182,183,195,204,212,221,249,267,273,280,281,284,287,310,326,335,337,338,339,344,348,349,362,363,372,416,429,433,454,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[165,224,257,257,224,313,314,165,224,224,224,165,375,224,224,382,224,224,224,165,224,430,224,224,224,224,224,442,443,257,165,224,224,483,490,491,224,224,224,224,224,257,224,224,224,224,224,224,]),'designation_opt':([256,447,459,502,],[372,480,372,480,]),'parameter_type_list':([60,142,186,323,327,392,],[111,253,317,420,317,317,]),'type_qualifier_list':([31,59,72,108,123,124,129,141,170,228,229,251,273,283,284,287,322,418,],[76,107,128,76,128,128,128,250,128,128,128,76,128,128,128,128,417,76,]),'designator':([256,373,447,459,502,],[368,449,368,368,368,]),'id_init_declarator_list_opt':([36,65,],[99,99,]),'declaration_specifiers':([0,18,26,60,67,87,121,142,186,198,212,323,327,335,392,],[33,63,33,113,63,63,63,113,113,113,63,113,113,63,113,]),'identifier_list':([60,142,323,],[114,114,114,]),'declaration_list_opt':([18,87,],[66,143,]),'function_definition':([0,26,],[40,40,]),'binary_expression':([106,121,144,145,170,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,326,335,337,338,339,344,348,349,355,362,363,370,372,416,429,433,454,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,393,394,395,396,397,398,399,400,401,402,403,404,405,406,407,408,176,410,411,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,176,]),'enum_specifier':([0,18,26,36,60,65,67,72,87,117,121,123,124,128,129,142,170,186,198,212,228,229,273,283,284,287,323,327,335,392,],[44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,44,]),'decl_body':([0,18,26,67,87,121,212,335,],[46,46,46,46,46,46,46,46,]),'function_specifier':([0,1,18,26,33,47,49,60,63,67,87,113,121,142,186,198,212,323,327,335,392,],[49,49,49,49,92,49,49,49,92,49,49,92,49,49,49,49,49,49,49,49,49,]),'specifier_qualifier_list':([72,123,124,129,170,228,229,273,283,284,287,],[130,130,130,130,292,130,130,292,292,292,292,]),'conditional_expression':([106,121,144,145,170,182,183,195,204,211,212,221,235,246,249,267,273,280,281,284,287,310,326,335,337,338,339,344,348,349,355,362,363,370,372,416,429,433,454,460,463,464,470,472,474,475,476,480,493,501,506,509,514,518,],[180,180,180,180,180,180,180,180,180,341,180,180,341,341,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,180,341,180,180,341,180,180,180,180,180,487,180,180,180,180,180,180,180,180,180,180,180,180,180,180,]),} + +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +_lr_productions = [ + ("S' -> translation_unit_or_empty","S'",1,None,None,None), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',42), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',42), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',42), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',42), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',42), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',42), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',42), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',42), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',42), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',42), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',42), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',42), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',42), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',42), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',109), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',110), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN','direct_id_declarator',4,'p_direct_id_declarator_6','plyparser.py',110), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',109), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',110), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_declarator',4,'p_direct_typeid_declarator_6','plyparser.py',110), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',110), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN','direct_typeid_noparen_declarator',4,'p_direct_typeid_noparen_declarator_6','plyparser.py',110), + ('id_declarator -> direct_id_declarator','id_declarator',1,'p_id_declarator_1','plyparser.py',109), + ('id_declarator -> pointer direct_id_declarator','id_declarator',2,'p_id_declarator_2','plyparser.py',109), + ('typeid_declarator -> direct_typeid_declarator','typeid_declarator',1,'p_typeid_declarator_1','plyparser.py',109), + ('typeid_declarator -> pointer direct_typeid_declarator','typeid_declarator',2,'p_typeid_declarator_2','plyparser.py',109), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator','typeid_noparen_declarator',1,'p_typeid_noparen_declarator_1','plyparser.py',109), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_2','plyparser.py',109), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',542), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',547), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',553), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',558), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',563), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',569), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',570), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',581), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',598), + ('statement -> labeled_statement','statement',1,'p_statement','c_parser.py',609), + ('statement -> expression_statement','statement',1,'p_statement','c_parser.py',610), + ('statement -> compound_statement','statement',1,'p_statement','c_parser.py',611), + ('statement -> selection_statement','statement',1,'p_statement','c_parser.py',612), + ('statement -> iteration_statement','statement',1,'p_statement','c_parser.py',613), + ('statement -> jump_statement','statement',1,'p_statement','c_parser.py',614), + ('statement -> pppragma_directive','statement',1,'p_statement','c_parser.py',615), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',629), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',630), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',689), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',698), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',699), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',709), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',714), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',719), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',725), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',730), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',735), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',740), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',745), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',750), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',756), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',757), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',758), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',759), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',760), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',765), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',770), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',771), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',772), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',773), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',774), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',775), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',776), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',777), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',778), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',779), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',780), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',781), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',786), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',787), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',788), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',789), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',794), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',795), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',796), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',801), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',802), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',810), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',811), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',816), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',817), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',822), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',823), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',830), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',835), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',840), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',845), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',854), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',855), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',864), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',873), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',874), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',883), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',884), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',891), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',892), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',900), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',938), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',943), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',944), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',952), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',957), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',958), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',966), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',967), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',972), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',977), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',978), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',983), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',984), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',985), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',996), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',997), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1012), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1013), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1124), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1125), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1154), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1155), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1160), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1161), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1169), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1170), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1189), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1190), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1201), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1232), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1233), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1242), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1247), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1248), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1256), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1257), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1268), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1276), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1277), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1282), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1283), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1288), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1299), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1307), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1312), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1322), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1326), + ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','c_parser.py',1337), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1346), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1357), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',4,'p_direct_abstract_declarator_6','c_parser.py',1366), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1376), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1387), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1388), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1395), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1396), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1402), + ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1408), + ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1412), + ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1416), + ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1420), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1424), + ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1428), + ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1433), + ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1437), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1441), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1445), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1450), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1454), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1458), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1462), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1463), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1468), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1475), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1476), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1488), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1492), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1493), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1506), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1507), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1508), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1509), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1510), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1511), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1512), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1513), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1514), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1515), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1516), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1521), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1525), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1526), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1534), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1535), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1536), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1537), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1538), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1539), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1540), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1541), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1542), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1543), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1544), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1545), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1546), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1547), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1548), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1549), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1550), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1551), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1552), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1560), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1564), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1568), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1572), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1573), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1574), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1579), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1580), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1588), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1589), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1590), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1591), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1592), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1593), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1598), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1602), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1606), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1607), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1612), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1613), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1614), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1615), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1621), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1622), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1627), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1628), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1633), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1637), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1641), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1642), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1647), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1651), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1659), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1660), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1661), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1674), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1675), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1684), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1688), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1689), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1690), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1691), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1697), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1698), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1704), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1705), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1716), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1717), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1727), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1728), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1738), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1744), + ('empty -> ','empty',0,'p_empty','c_parser.py',1750), +] diff --git a/utils/cseq-1.9/pycparserext/__init__.py b/utils/cseq-1.9/pycparserext/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/utils/cseq-1.9/pycparserext/c_generator.py b/utils/cseq-1.9/pycparserext/c_generator.py new file mode 100644 index 000000000..4a94c09e1 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/c_generator.py @@ -0,0 +1,5 @@ +from warnings import warn +warn("pycparserext.c_generator is deprecated. Please use pycparser.c_generator " + "directly.", DeprecationWarning) + +from pycparser.c_generator import * # noqa diff --git a/utils/cseq-1.9/pycparserext/ext_c_generator.py b/utils/cseq-1.9/pycparserext/ext_c_generator.py new file mode 100644 index 000000000..751905ab6 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/ext_c_generator.py @@ -0,0 +1,163 @@ +from pycparser.c_generator import CGenerator as CGeneratorBaseBuggy +from pycparserext.ext_c_parser import FuncDeclExt, TypeDeclExt +import pycparser.c_ast as c_ast + + +class CGeneratorBase(CGeneratorBaseBuggy): + # bug fix + def visit_UnaryOp(self, n): + operand = self._parenthesize_unless_simple(n.expr) + if n.op == 'p++': + return '%s++' % operand + elif n.op == 'p--': + return '%s--' % operand + elif n.op == 'sizeof': + # Always parenthesize the argument of sizeof since it can be + # a name. + return 'sizeof(%s)' % self.visit(n.expr) + else: + # avoid merging of "- - x" or "__real__varname" + return '%s %s' % (n.op, operand) + + +class AsmAndAttributesMixin(object): + def visit_Asm(self, n): + components = [ + n.template, + ] + if (n.output_operands is not None + or n.input_operands is not None + or n.clobbered_regs is not None): + components.extend([ + n.output_operands, + n.input_operands, + n.clobbered_regs, + ]) + + return " %s(%s)" % ( + n.asm_keyword, + " : ".join( + self.visit(c) for c in components)) + + def _generate_type(self, n, modifiers=[]): + """ Recursive generation from a type node. n is the type node. + modifiers collects the PtrDecl, ArrayDecl and FuncDecl modifiers + encountered on the way down to a TypeDecl, to allow proper + generation from it. + """ + typ = type(n) + #~ print(n, modifiers) + + if typ in (c_ast.TypeDecl, TypeDeclExt): + s = '' + if n.quals: + s += ' '.join(n.quals) + ' ' + s += self.visit(n.type) + + nstr = n.declname if n.declname else '' + # Resolve modifiers. + # Wrap in parens to distinguish pointer to array and pointer to + # function syntax. + # + for i, modifier in enumerate(modifiers): + if isinstance(modifier, c_ast.ArrayDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '[' + self.visit(modifier.dim) + ']' + elif isinstance(modifier, c_ast.FuncDecl): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '(' + self.visit(modifier.args) + ')' + elif isinstance(modifier, FuncDeclExt): + if (i != 0 and isinstance(modifiers[i - 1], c_ast.PtrDecl)): + nstr = '(' + nstr + ')' + nstr += '(' + self.visit(modifier.args) + ')' + + if modifier.asm is not None: + nstr += " " + self.visit(modifier.asm) + + if modifier.attributes.exprs: + nstr += ( + ' __attribute__((' + + self.visit(modifier.attributes) + + '))') + + elif isinstance(modifier, c_ast.PtrDecl): + # BUG FIX: pycparser ignores quals + quals = ' '.join(modifier.quals) + if quals: + quals = quals + ' ' + nstr = '*' + quals + nstr + + if hasattr(n, "attributes") and n.attributes.exprs: + nstr += ' __attribute__((' + self.visit(n.attributes) + '))' + + if nstr: + s += ' ' + nstr + return s + elif typ == c_ast.Decl: + return self._generate_decl(n.type) + elif typ == c_ast.Typename: + return self._generate_type(n.type) + elif typ == c_ast.IdentifierType: + return ' '.join(n.names) + ' ' + elif typ in (c_ast.ArrayDecl, c_ast.PtrDecl, c_ast.FuncDecl, FuncDeclExt): + return self._generate_type(n.type, modifiers + [n]) + else: + return self.visit(n) + + def _generate_decl(self, n): + """ Generation from a Decl node. + """ + s = '' + + def funcspec_to_str(i): + if isinstance(i, c_ast.Node): + return self.visit(i) + else: + return i + + if n.funcspec: + s = ' '.join(funcspec_to_str(i) for i in n.funcspec) + ' ' + if n.storage: + s += ' '.join(n.storage) + ' ' + s += self._generate_type(n.type) + return s + + def visit_AttributeSpecifier(self, n): + return ' __attribute__((' + self.visit(n.exprlist) + '))' + + +class GnuCGenerator(AsmAndAttributesMixin, CGeneratorBase): + def visit_TypeOfDeclaration(self, n): + return "__typeof__(%s)" % self.visit(n.declaration) + + def visit_TypeOfExpression(self, n): + return "__typeof__(%s)" % self.visit(n.expr) + + def visit_TypeList(self, n): + return ', '.join(self.visit(ch) for ch in n.types) + + +class GNUCGenerator(GnuCGenerator): + def __init__(self): + from warnings import warn + warn("GNUCGenerator is now called GnuCGenerator", + DeprecationWarning, stacklevel=2) + + +class OpenCLCGenerator(AsmAndAttributesMixin, CGeneratorBase): + def visit_FileAST(self, n): + s = '' + from pycparserext.ext_c_parser import PreprocessorLine + for ext in n.ext: + if isinstance(ext, (c_ast.FuncDef, PreprocessorLine)): + s += self.visit(ext) + else: + s += self.visit(ext) + ';\n' + return s + + def visit_PreprocessorLine(self, n): + return n.contents + +# vim: fdm=marker diff --git a/utils/cseq-1.9/pycparserext/ext_c_lexer.py b/utils/cseq-1.9/pycparserext/ext_c_lexer.py new file mode 100644 index 000000000..1f8126c72 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/ext_c_lexer.py @@ -0,0 +1,76 @@ +from pycparser.c_lexer import CLexer as CLexerBase +try: + from pycparser.ply.lex import TOKEN +except ImportError: + from ply.lex import TOKEN + + +class GnuCLexer(CLexerBase): + # support '3i' for imaginary literal + floating_constant = ( + '((((' + + CLexerBase.fractional_constant+')' + + CLexerBase.exponent_part+'?)|([0-9]+' + + CLexerBase.exponent_part+'))i?[FfLl]?)') + + @TOKEN(floating_constant) + def t_FLOAT_CONST(self, t): + return t + + t_pppragma_ignore = ' \t<>.-{}();+-*/$%@&^~!?:,0123456789=' + + +class GNUCLexer(GnuCLexer): + def __init__(self, *args, **kwargs): + from warnings import warn + warn("GNUCLexer is now called GnuCLexer", + DeprecationWarning, stacklevel=2) + + GnuCLexer.__init__(self, *args, **kwargs) + + +class OpenCLCLexer(CLexerBase): + tokens = CLexerBase.tokens + ('LINECOMMENT',) + states = ( + # ('comment', 'exclusive'), + # ('preproc', 'exclusive'), + ('ppline', 'exclusive'), # unused + ('pppragma', 'exclusive'), # unused + ) + + def t_LINECOMMENT(self, t): + r'\/\/([^\n]+)\n' + t.lexer.lineno += t.value.count("\n") + + # overrides pycparser, must have same name + def t_PPHASH(self, t): + r'[ \t]*\#([^\n]|\\\n)+[^\n\\]\n' + t.lexer.lineno += t.value.count("\n") + return t + + +def add_lexer_keywords(cls, keywords): + cls.keywords = cls.keywords + tuple( + kw.upper() for kw in keywords) + + cls.keyword_map = cls.keyword_map.copy() + cls.keyword_map.update(dict( + (kw, kw.upper()) for kw in keywords)) + + cls.tokens = cls.tokens + tuple( + kw.upper() for kw in keywords) + + +add_lexer_keywords(GnuCLexer, [ + '__attribute__', '__asm__', '__asm', '__typeof__', + '__real__', '__imag__', '__builtin_types_compatible_p', + '__const', '__restrict', '__inline', '__inline__', + '__extension__', 'asm', '__attribute']) + +_CL_KEYWORDS = ['kernel', 'constant', 'global', 'local', 'private', + "read_only", "write_only", "read_write"] +add_lexer_keywords(OpenCLCLexer, [ + '__attribute__', '__attribute', '__asm__', '__asm', 'asm'] + + _CL_KEYWORDS + ["__"+kw for kw in _CL_KEYWORDS]) + +# vim: fdm=marker diff --git a/utils/cseq-1.9/pycparserext/ext_c_parser.py b/utils/cseq-1.9/pycparserext/ext_c_parser.py new file mode 100644 index 000000000..ff4d49b08 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/ext_c_parser.py @@ -0,0 +1,591 @@ +from __future__ import division + +import pycparser.c_parser +import pycparser.c_ast as c_ast +try: + import pycparser.ply.yacc as yacc +except ImportError: + import ply.yacc as yacc # noqa: F401 +from pycparser.plyparser import parameterized, template + + +class CParserBase(pycparser.c_parser.CParser): + def __init__(self, **kwds): + kwds['lexer'] = self.lexer_class + kwds['lextab'] = 'pycparserext.lextab' + kwds['yacctab'] = 'pycparserext.yacctab' + kwds['taboutputdir'] = 'pycparserext' + pycparser.c_parser.CParser.__init__(self, **kwds) + + def parse(self, text, filename='', debuglevel=0, + initial_type_symbols=set()): + self.clex.filename = filename + self.clex.reset_lineno() + + # _scope_stack[-1] is the current (topmost) scope. + + initial_scope = dict((tpsym, 1) for tpsym in initial_type_symbols) + initial_scope.update( + dict((tpsym, 1) for tpsym in self.initial_type_symbols)) + self._scope_stack = [initial_scope] + + if not text or text.isspace(): + return c_ast.FileAST([]) + else: + return self.cparser.parse(text, lexer=self.clex, debug=debuglevel) + + +# {{{ ast extensions + +class TypeList(c_ast.Node): + def __init__(self, types, coord=None): + self.types = types + self.coord = coord + + def children(self): + nodelist = [] + for i, child in enumerate(self.types or []): + nodelist.append(("types[%d]" % i, child)) + return tuple(nodelist) + + def __iter__(self): + for child in (self.types or []): + yield child + + attr_names = () + + +class AttributeSpecifier(c_ast.Node): + def __init__(self, exprlist): + self.exprlist = exprlist + + def children(self): + return [("exprlist", self.exprlist)] + + def __iter__(self): + # Do not return anything, but yield is necessary to keep this function + # a generator + return + yield + + attr_names = () + + +class Asm(c_ast.Node): + def __init__(self, asm_keyword, template, output_operands, + input_operands, clobbered_regs, coord=None): + self.asm_keyword = asm_keyword + self.template = template + self.output_operands = output_operands + self.input_operands = input_operands + self.clobbered_regs = clobbered_regs + self.coord = coord + + def children(self): + nodelist = [] + if self.template is not None: + nodelist.append(("template", self.template)) + if self.output_operands is not None: + nodelist.append(("output_operands", self.output_operands)) + if self.input_operands is not None: + nodelist.append(("input_operands", self.input_operands)) + if self.clobbered_regs is not None: + nodelist.append(("clobbered_regs", self.clobbered_regs)) + return tuple(nodelist) + + def __iter__(self): + if self.template is not None: + yield self.template + if self.output_operands is not None: + yield self.output_operands + if self.input_operands is not None: + yield self.input_operands + if self.clobbered_regs is not None: + yield self.clobbered_regs + + attr_names = ('asm_keyword',) + + +class PreprocessorLine(c_ast.Node): + def __init__(self, contents, coord=None): + self.contents = contents + self.coord = coord + + def children(self): + return () + + def __iter__(self): + # Do not return anything, but yield is necessary to keep this function + # a generator + return + yield + + attr_names = ("contents",) + + +class TypeOfDeclaration(c_ast.Node): + def __init__(self, declaration, coord=None): + self.declaration = declaration + self.coord = coord + + def children(self): + nodelist = [] + if self.declaration is not None: + nodelist.append(("declaration", self.declaration)) + return tuple(nodelist) + + def __iter__(self): + if self.declaration is not None: + yield self.declaration + + attr_names = () + + +class TypeOfExpression(c_ast.Node): + def __init__(self, expr, coord=None): + self.expr = expr + self.coord = coord + + def children(self): + nodelist = [] + if self.expr is not None: + nodelist.append(("expr", self.expr)) + return tuple(nodelist) + + def __iter__(self): + if self.expr is not None: + yield self.expr + + attr_names = () + + +# These are the same as pycparser's, but it does *not* declare __slots__-- +# so we can poke in attributes at our leisure. +class TypeDeclExt(c_ast.TypeDecl): + @staticmethod + def from_pycparser(td): + assert isinstance(td, c_ast.TypeDecl) + return TypeDeclExt(td.declname, td.quals, td.type, td.coord) + + +class ArrayDeclExt(c_ast.TypeDecl): + @staticmethod + def from_pycparser(ad): + assert isinstance(ad, c_ast.ArrayDecl) + return ArrayDeclExt(ad.type, ad.dim, ad.dim_quals, ad.coord) + + +def to_decl_ext(d): + if isinstance(d, c_ast.TypeDecl): + return TypeDeclExt.from_pycparser(d) + elif isinstance(d, c_ast.ArrayDecl): + return ArrayDeclExt.from_pycparser(d) + else: + raise TypeError("unexpected decl type: %s" % type(d).__name__) + + +class FuncDeclExt(c_ast.Node): + def __init__(self, args, type, attributes, asm, coord=None): + self.args = args + self.type = type + self.attributes = attributes + self.asm = asm + self.coord = coord + + def children(self): + nodelist = [] + if self.args is not None: + nodelist.append(("args", self.args)) + if self.type is not None: + nodelist.append(("type", self.type)) + if self.attributes is not None: + nodelist.append(("attributes", self.attributes)) + if self.asm is not None: + nodelist.append(("asm", self.asm)) + return tuple(nodelist) + + def __iter__(self): + if self.args is not None: + yield self.args + if self.type is not None: + yield self.type + if self.attributes is not None: + yield self.attributes + if self.asm is not None: + yield self.asm + + attr_names = () + +# }}} + + +# {{{ attributes + +@template +class _AttributesMixin(object): + def p_attributes_opt_1(self, p): + """ attributes_opt : attribute_decl attributes_opt + """ + p[1].exprs.extend(p[2].exprs) + p[0] = p[1] + + def p_attributes_opt_2(self, p): + """ attributes_opt : empty + """ + p[0] = c_ast.ExprList([], self._coord(p.lineno(1))) + + def p_attribute_decl(self, p): + """ attribute_decl : __ATTRIBUTE__ LPAREN LPAREN attribute_list RPAREN RPAREN + | __ATTRIBUTE LPAREN LPAREN attribute_list RPAREN RPAREN + """ + p[0] = p[4] + + def p_attribute_list_1(self, p): + """ attribute_list : attribute + """ + p[0] = c_ast.ExprList([p[1]], self._coord(p.lineno(1))) + + def p_attribute_list_2(self, p): + """ attribute_list : attribute_list COMMA attribute + """ + p[1].exprs.append(p[3]) + p[0] = p[1] + + def p_attribute_1(self, p): + """ attribute : CONST + """ + p[0] = c_ast.ID(name="const", coord=self._coord(p.lineno(1))) + + def p_attribute_3(self, p): + """ attribute : assignment_expression + """ + p[0] = p[1] + + # {{{ /!\ names must match C parser to override + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_1(self, p): + """ xxx_declarator : direct_xxx_declarator attributes_opt + """ + if p[2].exprs: + if isinstance(p[1], c_ast.ArrayDecl): + p[1].type = to_decl_ext(p[1].type) + p[1].type.attributes = p[2] + elif isinstance(p[1], c_ast.FuncDecl): + p[1].type = to_decl_ext(p[1].type) + p[1].type.attributes = p[2] + elif not isinstance(p[1], c_ast.TypeDecl): + raise NotImplementedError( + "cannot attach attributes to nodes of type '%s'" + % type(p[1])) + else: + p[1] = to_decl_ext(p[1]) + p[1].attributes = p[2] + + p[0] = p[1] + + # }}} + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_xxx_declarator_2(self, p): + """ xxx_declarator : pointer direct_xxx_declarator attributes_opt + | pointer attributes_opt direct_xxx_declarator + """ + if hasattr(p[3], "exprs"): + attr_decl = p[3] + decl = p[2] + else: + attr_decl = p[2] + decl = p[3] + + if not attr_decl.exprs: + attr_decl = None + + if attr_decl: + if isinstance(decl, c_ast.ArrayDecl): + decl.type = to_decl_ext(decl.type) + decl.type.attributes = attr_decl + elif isinstance(decl, c_ast.FuncDecl): + decl.type = to_decl_ext(decl.type) + decl.type.attributes = attr_decl + elif not isinstance(p[2], c_ast.TypeDecl): + raise NotImplementedError( + "cannot attach attributes to nodes of type '%s'" + % type(p[1])) + else: + decl = to_decl_ext(decl) + decl.attributes = attr_decl + + p[0] = self._type_modify_decl(decl, p[1]) + + def p_function_specifier_attr(self, p): + """ function_specifier : attribute_decl + """ + p[0] = AttributeSpecifier(p[1]) + +# }}} + + +# {{{ asm + +class _AsmMixin(object): + def p_asm_opt_1(self, p): + """ asm_opt : empty + """ + p[0] = None + + def p_asm_opt_2(self, p): + """ asm_opt : asm_no_semi + """ + p[0] = p[1] + + def p_asm_1(self, p): + """ asm_no_semi : asm_keyword LPAREN asm_argument_expression_list RPAREN + """ + p[0] = Asm(p[1], p[3], None, None, None, coord=self._coord(p.lineno(2))) + + def p_asm_2(self, p): + """ asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON \ + asm_argument_expression_list RPAREN + """ + p[0] = Asm(p[1], p[3], p[5], None, None, coord=self._coord(p.lineno(2))) + + def p_asm_3(self, p): + """ asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON \ + asm_argument_expression_list COLON asm_argument_expression_list \ + RPAREN + """ + p[0] = Asm(p[1], p[3], p[5], p[7], None, coord=self._coord(p.lineno(2))) + + def p_asm_4(self, p): + """ asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON \ + asm_argument_expression_list COLON asm_argument_expression_list \ + COLON asm_argument_expression_list RPAREN + """ + p[0] = Asm(p[1], p[3], p[5], p[7], p[9], coord=self._coord(p.lineno(2))) + + def p_asm_keyword(self, p): + """ asm_keyword : __ASM__ asm_volatile + | __ASM asm_volatile + | ASM asm_volatile + """ + p[0] = p[1] + if p[2]: + p[0] += ' ' + p[2] + + def p_asm_volatile(self, p): + """ asm_volatile : VOLATILE + | empty + """ + p[0] = p[1] + + def p_asm_argument_expression_list(self, p): + """asm_argument_expression_list : argument_expression_list + | empty + """ + p[0] = p[1] + + def p_statement_gnu(self, p): + """ statement : asm_no_semi + | asm_no_semi SEMI + """ + p[0] = p[1] + +# def p_asm_with_semi(self, p): +# """ asm : asm SEMI +# """ +# p[0] = p[1] + + +@template +class _AsmAndAttributesMixin(_AsmMixin, _AttributesMixin): + # {{{ /!\ names must match C parser to override + + @parameterized(('id', 'ID'), ('typeid', 'TYPEID'), ('typeid_noparen', 'TYPEID')) + def p_direct_xxx_declarator_6(self, p): + """ direct_xxx_declarator : direct_xxx_declarator LPAREN parameter_type_list \ + RPAREN asm_opt attributes_opt + | direct_xxx_declarator \ + LPAREN identifier_list_opt RPAREN \ + asm_opt attributes_opt + """ + func = FuncDeclExt( + args=p[3], + type=None, + attributes=p[6], + asm=p[5], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + def p_direct_abstract_declarator_6(self, p): + """ direct_abstract_declarator : direct_abstract_declarator \ + LPAREN parameter_type_list_opt RPAREN asm_opt attributes_opt + """ + func = FuncDeclExt( + args=p[3], + type=None, + attributes=p[6], + asm=p[5], + coord=p[1].coord) + + p[0] = self._type_modify_decl(decl=p[1], modifier=func) + + # }}} +# }}} + + +# {{{ gnu parser + +class GnuCParser(_AsmAndAttributesMixin, CParserBase): + # TODO: __extension__ + + from pycparserext.ext_c_lexer import GnuCLexer as lexer_class # noqa + + initial_type_symbols = set(["__builtin_va_list"]) + + def p_function_specifier_gnu(self, p): + """ function_specifier : __INLINE + | __INLINE__ + """ + p[0] = p[1] + + def p_type_qualifier_gnu(self, p): + """ type_qualifier : __CONST + | __RESTRICT + | __EXTENSION__ + """ + p[0] = p[1] + + def p_type_specifier_gnu_typeof_expr(self, p): + """ type_specifier : __TYPEOF__ LPAREN expression RPAREN + """ + if isinstance(p[3], c_ast.TypeDecl): + pass + + p[0] = TypeOfExpression(p[3]) + + def p_type_specifier_gnu_typeof_decl(self, p): + """ type_specifier : __TYPEOF__ LPAREN parameter_declaration RPAREN + """ + p[0] = TypeOfDeclaration(p[3]) + + def p_unary_operator_gnu(self, p): + """ unary_operator : __REAL__ + | __IMAG__ + """ + p[0] = p[1] + + def p_postfix_expression_gnu_tcp(self, p): + """ postfix_expression : __BUILTIN_TYPES_COMPATIBLE_P \ + LPAREN parameter_declaration COMMA parameter_declaration RPAREN + """ + p[0] = c_ast.FuncCall(c_ast.ID(p[1], self._coord(p.lineno(1))), + TypeList([p[3], p[5]], self._coord(p.lineno(2)))) + + def p_gnu_statement_expression(self, p): + """ gnu_statement_expression : LPAREN compound_statement RPAREN + """ + p[0] = p[2] + + def p_gnu_primary_expression_6(self, p): + """ primary_expression : gnu_statement_expression """ + p[0] = p[1] + + def p_statement(self, p): + """ statement : labeled_statement + | expression_statement + | compound_statement + | selection_statement + | iteration_statement + | jump_statement + | pppragma_directive + | gnu_statement_expression + """ + p[0] = p[1] + + def p_attribute_const(self, p): + """ attribute : __CONST + """ + p[0] = c_ast.ID(name="__const", coord=self._coord(p.lineno(1))) + + def p_struct_declaration_list_1(self, p): + """ struct_declaration_list : empty """ + p[0] = None + +# }}} + + +class OpenCLCParser(_AsmAndAttributesMixin, CParserBase): + from pycparserext.ext_c_lexer import OpenCLCLexer as lexer_class # noqa + + INT_BIT_COUNTS = [8, 16, 32, 64] + initial_type_symbols = ( + set([ + "%s%d" % (base_name, count) + for base_name in [ + 'char', 'uchar', 'short', 'ushort', 'int', 'uint', + 'long', 'ulong', 'float', 'double', 'half'] + for count in [2, 3, 4, 8, 16] + ]) + | set([ + "intptr_t", "uintptr_t", + "intmax_t", "uintmax_t", + "size_t", "ptrdiff_t", + "uint", "ulong", "ushort", "uchar", + "half", "bool"]) + | set(["int%d_t" % bc for bc in INT_BIT_COUNTS]) + | set(["uint%d_t" % bc for bc in INT_BIT_COUNTS]) + | set(["int_least%d_t" % bc for bc in INT_BIT_COUNTS]) + | set(["uint_least%d_t" % bc for bc in INT_BIT_COUNTS]) + | set(["int_fast%d_t" % bc for bc in INT_BIT_COUNTS]) + | set(["uint_fast%d_t" % bc for bc in INT_BIT_COUNTS]) + | set([ + "image1d_t", "image1d_array_t", "image1d_buffer_t", + "image2d_t", "image2d_array_t", + "image3d_t", + "sampler_t", "event_t" + ]) + | set(["cfloat_t", "cdouble_t"]) # PyOpenCL extension + ) + + def p_pp_directive(self, p): + """ pp_directive : PPHASH + """ + p[0] = [PreprocessorLine(p[1], coord=self._coord(p.lineno(1)))] + + def p_external_declaration_comment(self, p): + """ external_declaration : LINECOMMENT + """ + p[0] = None + + def p_statement_comment(self, p): + """ statement : LINECOMMENT + """ + p[0] = None + + def p_type_qualifier_cl(self, p): + """ type_qualifier : __GLOBAL + | GLOBAL + | __LOCAL + | LOCAL + | __CONSTANT + | CONSTANT + | __PRIVATE + | PRIVATE + | __READ_ONLY + | READ_ONLY + | __WRITE_ONLY + | WRITE_ONLY + | __READ_WRITE + | READ_WRITE + """ + p[0] = p[1] + + def p_function_specifier_cl(self, p): + """ function_specifier : __KERNEL + | KERNEL + """ + p[0] = p[1] + +# vim: fdm=marker diff --git a/utils/cseq-1.9/pycparserext/lextab.py b/utils/cseq-1.9/pycparserext/lextab.py new file mode 100644 index 000000000..15b808040 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/lextab.py @@ -0,0 +1,10 @@ +# lextab.py. This file automatically created by PLY (version 3.11). Don't edit! +_tabversion = '3.10' +_lextokens = set(('AND', 'ANDEQUAL', 'ARROW', 'ASM', 'AUTO', 'BREAK', 'CASE', 'CHAR', 'CHAR_CONST', 'COLON', 'COMMA', 'CONDOP', 'CONST', 'CONTINUE', 'DEFAULT', 'DIVEQUAL', 'DIVIDE', 'DO', 'DOUBLE', 'ELLIPSIS', 'ELSE', 'ENUM', 'EQ', 'EQUALS', 'EXTERN', 'FLOAT', 'FLOAT_CONST', 'FOR', 'GE', 'GOTO', 'GT', 'HEX_FLOAT_CONST', 'ID', 'IF', 'INLINE', 'INT', 'INT_CONST_BIN', 'INT_CONST_DEC', 'INT_CONST_HEX', 'INT_CONST_OCT', 'LAND', 'LBRACE', 'LBRACKET', 'LE', 'LNOT', 'LONG', 'LOR', 'LPAREN', 'LSHIFT', 'LSHIFTEQUAL', 'LT', 'MINUS', 'MINUSEQUAL', 'MINUSMINUS', 'MOD', 'MODEQUAL', 'NE', 'NOT', 'OFFSETOF', 'OR', 'OREQUAL', 'PERIOD', 'PLUS', 'PLUSEQUAL', 'PLUSPLUS', 'PPHASH', 'PPPRAGMA', 'PPPRAGMASTR', 'RBRACE', 'RBRACKET', 'REGISTER', 'RESTRICT', 'RETURN', 'RPAREN', 'RSHIFT', 'RSHIFTEQUAL', 'SEMI', 'SHORT', 'SIGNED', 'SIZEOF', 'STATIC', 'STRING_LITERAL', 'STRUCT', 'SWITCH', 'TIMES', 'TIMESEQUAL', 'TYPEDEF', 'TYPEID', 'UNION', 'UNSIGNED', 'VOID', 'VOLATILE', 'WCHAR_CONST', 'WHILE', 'WSTRING_LITERAL', 'XOR', 'XOREQUAL', '_BOOL', '_COMPLEX', '__ASM', '__ASM__', '__ATTRIBUTE', '__ATTRIBUTE__', '__BUILTIN_TYPES_COMPATIBLE_P', '__CONST', '__EXTENSION__', '__IMAG__', '__INLINE', '__INLINE__', '__INT128', '__REAL__', '__RESTRICT', '__TYPEOF__')) +_lexreflags = 64 +_lexliterals = '' +_lexstateinfo = {'ppline': 'exclusive', 'pppragma': 'exclusive', 'INITIAL': 'inclusive'} +_lexstatere = {'ppline': [('(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\\n)|(?Pline)', [None, ('t_ppline_FILENAME', 'FILENAME'), None, None, None, None, None, None, ('t_ppline_LINE_NUMBER', 'LINE_NUMBER'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ppline_NEWLINE', 'NEWLINE'), ('t_ppline_PPLINE', 'PPLINE')])], 'pppragma': [('(?P\\n)|(?Ppragma)|(?P.+)', [None, ('t_pppragma_NEWLINE', 'NEWLINE'), ('t_pppragma_PPPRAGMA', 'PPPRAGMA'), ('t_pppragma_STR', 'STR')])], 'INITIAL': [('(?P((((([0-9]*\\.[0-9]+)|([0-9]+\\.))([eE][-+]?[0-9]+)?)|([0-9]+([eE][-+]?[0-9]+)))i?[FfLl]?))|(?P[ \\t]*\\#)|(?P\\n+)|(?P\\{)|(?P\\})|(?P(0[xX]([0-9a-fA-F]+|((([0-9a-fA-F]+)?\\.[0-9a-fA-F]+)|([0-9a-fA-F]+\\.)))([pP][+-]?[0-9]+)[FfLl]?))|(?P0[xX][0-9a-fA-F]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)', [None, ('t_FLOAT_CONST', 'FLOAT_CONST'), None, None, None, None, None, None, None, None, None, ('t_PPHASH', 'PPHASH'), ('t_NEWLINE', 'NEWLINE'), ('t_LBRACE', 'LBRACE'), ('t_RBRACE', 'RBRACE'), ('t_HEX_FLOAT_CONST', 'HEX_FLOAT_CONST'), None, None, None, None, None, None, None, ('t_INT_CONST_HEX', 'INT_CONST_HEX')]), ('(?P0[bB][01]+(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P0[0-7]*[89])|(?P0[0-7]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|(?P(0(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?)|([1-9][0-9]*(([uU]ll)|([uU]LL)|(ll[uU]?)|(LL[uU]?)|([uU][lL])|([lL][uU]?)|[uU])?))|(?P\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?PL\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))\')|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*\\n)|(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*$))|(?P(\'([^\'\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))[^\'\n]+\')|(\'\')|(\'([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])[^\'\\n]*\'))', [None, ('t_INT_CONST_BIN', 'INT_CONST_BIN'), None, None, None, None, None, None, None, ('t_BAD_CONST_OCT', 'BAD_CONST_OCT'), ('t_INT_CONST_OCT', 'INT_CONST_OCT'), None, None, None, None, None, None, None, ('t_INT_CONST_DEC', 'INT_CONST_DEC'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_CHAR_CONST', 'CHAR_CONST'), None, None, None, None, None, None, ('t_WCHAR_CONST', 'WCHAR_CONST'), None, None, None, None, None, None, ('t_UNMATCHED_QUOTE', 'UNMATCHED_QUOTE'), None, None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_BAD_CHAR_CONST', 'BAD_CHAR_CONST')]), ('(?PL"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*?([\\\\][^a-zA-Z._~^!=&\\^\\-\\\\?\'"x0-7])([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P[a-zA-Z_$][0-9a-zA-Z_$]*)|(?P"([^"\\\\\\n]|(\\\\(([a-zA-Z._~!=&\\^\\-\\\\?\'"])|(\\d+)|(x[0-9a-fA-F]+))))*")|(?P\\.\\.\\.)|(?P\\+\\+)|(?P\\|\\|)|(?P\\^=)|(?P\\|=)|(?P<<=)|(?P>>=)|(?P\\+=)|(?P\\*=)|(?P\\+)|(?P%=)|(?P/=)', [None, ('t_WSTRING_LITERAL', 'WSTRING_LITERAL'), None, None, None, None, None, None, ('t_BAD_STRING_LITERAL', 'BAD_STRING_LITERAL'), None, None, None, None, None, None, None, None, None, None, None, None, None, ('t_ID', 'ID'), (None, 'STRING_LITERAL'), None, None, None, None, None, None, (None, 'ELLIPSIS'), (None, 'PLUSPLUS'), (None, 'LOR'), (None, 'XOREQUAL'), (None, 'OREQUAL'), (None, 'LSHIFTEQUAL'), (None, 'RSHIFTEQUAL'), (None, 'PLUSEQUAL'), (None, 'TIMESEQUAL'), (None, 'PLUS'), (None, 'MODEQUAL'), (None, 'DIVEQUAL')]), ('(?P\\])|(?P\\?)|(?P\\^)|(?P<<)|(?P<=)|(?P\\()|(?P->)|(?P==)|(?P!=)|(?P--)|(?P\\|)|(?P\\*)|(?P\\[)|(?P>=)|(?P\\))|(?P&&)|(?P>>)|(?P-=)|(?P\\.)|(?P&=)|(?P=)|(?P<)|(?P,)|(?P/)|(?P&)|(?P%)|(?P;)|(?P-)|(?P>)|(?P:)|(?P~)|(?P!)', [None, (None, 'RBRACKET'), (None, 'CONDOP'), (None, 'XOR'), (None, 'LSHIFT'), (None, 'LE'), (None, 'LPAREN'), (None, 'ARROW'), (None, 'EQ'), (None, 'NE'), (None, 'MINUSMINUS'), (None, 'OR'), (None, 'TIMES'), (None, 'LBRACKET'), (None, 'GE'), (None, 'RPAREN'), (None, 'LAND'), (None, 'RSHIFT'), (None, 'MINUSEQUAL'), (None, 'PERIOD'), (None, 'ANDEQUAL'), (None, 'EQUALS'), (None, 'LT'), (None, 'COMMA'), (None, 'DIVIDE'), (None, 'AND'), (None, 'MOD'), (None, 'SEMI'), (None, 'MINUS'), (None, 'GT'), (None, 'COLON'), (None, 'NOT'), (None, 'LNOT')])]} +_lexstateignore = {'ppline': ' \t', 'pppragma': ' \t<>.-{}();+-*/$%@&^~!?:,0123456789=', 'INITIAL': ' \t'} +_lexstateerrorf = {'ppline': 't_ppline_error', 'pppragma': 't_pppragma_error', 'INITIAL': 't_error'} +_lexstateeoff = {} diff --git a/utils/cseq-1.9/pycparserext/yacctab.py b/utils/cseq-1.9/pycparserext/yacctab.py new file mode 100644 index 000000000..df4fc4712 --- /dev/null +++ b/utils/cseq-1.9/pycparserext/yacctab.py @@ -0,0 +1,375 @@ + +# yacctab.py +# This file is automatically generated. Do not edit. +# pylint: disable=W,C,R +_tabversion = '3.10' + +_lr_method = 'LALR' + +_lr_signature = 'translation_unit_or_emptyleftLORleftLANDleftORleftXORleftANDleftEQNEleftGTGELTLEleftRSHIFTLSHIFTleftPLUSMINUSleftTIMESDIVIDEMODAND ANDEQUAL ARROW ASM AUTO BREAK CASE CHAR CHAR_CONST COLON COMMA CONDOP CONST CONTINUE DEFAULT DIVEQUAL DIVIDE DO DOUBLE ELLIPSIS ELSE ENUM EQ EQUALS EXTERN FLOAT FLOAT_CONST FOR GE GOTO GT HEX_FLOAT_CONST ID IF INLINE INT INT_CONST_BIN INT_CONST_DEC INT_CONST_HEX INT_CONST_OCT LAND LBRACE LBRACKET LE LNOT LONG LOR LPAREN LSHIFT LSHIFTEQUAL LT MINUS MINUSEQUAL MINUSMINUS MOD MODEQUAL NE NOT OFFSETOF OR OREQUAL PERIOD PLUS PLUSEQUAL PLUSPLUS PPHASH PPPRAGMA PPPRAGMASTR RBRACE RBRACKET REGISTER RESTRICT RETURN RPAREN RSHIFT RSHIFTEQUAL SEMI SHORT SIGNED SIZEOF STATIC STRING_LITERAL STRUCT SWITCH TIMES TIMESEQUAL TYPEDEF TYPEID UNION UNSIGNED VOID VOLATILE WCHAR_CONST WHILE WSTRING_LITERAL XOR XOREQUAL _BOOL _COMPLEX __ASM __ASM__ __ATTRIBUTE __ATTRIBUTE__ __BUILTIN_TYPES_COMPATIBLE_P __CONST __EXTENSION__ __IMAG__ __INLINE __INLINE__ __INT128 __REAL__ __RESTRICT __TYPEOF__abstract_declarator_opt : empty\n| abstract_declaratorassignment_expression_opt : empty\n| assignment_expressionblock_item_list_opt : empty\n| block_item_listdeclaration_list_opt : empty\n| declaration_listdeclaration_specifiers_no_type_opt : empty\n| declaration_specifiers_no_typedesignation_opt : empty\n| designationexpression_opt : empty\n| expressionid_init_declarator_list_opt : empty\n| id_init_declarator_listidentifier_list_opt : empty\n| identifier_listinit_declarator_list_opt : empty\n| init_declarator_listinitializer_list_opt : empty\n| initializer_listparameter_type_list_opt : empty\n| parameter_type_liststruct_declarator_list_opt : empty\n| struct_declarator_listtype_qualifier_list_opt : empty\n| type_qualifier_list direct_id_declarator : ID\n direct_id_declarator : LPAREN id_declarator RPAREN\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_id_declarator : direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_id_declarator : direct_id_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt\n | direct_id_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt\n direct_typeid_declarator : TYPEID\n direct_typeid_declarator : LPAREN typeid_declarator RPAREN\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_declarator : direct_typeid_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt\n | direct_typeid_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt\n direct_typeid_noparen_declarator : TYPEID\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET\n | direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET\n direct_typeid_noparen_declarator : direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt\n | direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt\n id_declarator : direct_id_declarator attributes_opt\n id_declarator : pointer direct_id_declarator attributes_opt\n | pointer attributes_opt direct_id_declarator\n typeid_declarator : direct_typeid_declarator attributes_opt\n typeid_declarator : pointer direct_typeid_declarator attributes_opt\n | pointer attributes_opt direct_typeid_declarator\n typeid_noparen_declarator : direct_typeid_noparen_declarator attributes_opt\n typeid_noparen_declarator : pointer direct_typeid_noparen_declarator attributes_opt\n | pointer attributes_opt direct_typeid_noparen_declarator\n attributes_opt : attribute_decl attributes_opt\n attributes_opt : empty\n attribute_decl : __ATTRIBUTE__ LPAREN LPAREN attribute_list RPAREN RPAREN\n | __ATTRIBUTE LPAREN LPAREN attribute_list RPAREN RPAREN\n attribute_list : attribute\n attribute_list : attribute_list COMMA attribute\n attribute : CONST\n attribute : assignment_expression\n function_specifier : attribute_decl\n asm_opt : empty\n asm_opt : asm_no_semi\n asm_no_semi : asm_keyword LPAREN asm_argument_expression_list RPAREN\n asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list RPAREN\n asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list RPAREN\n asm_no_semi : asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list RPAREN\n asm_keyword : __ASM__ asm_volatile\n | __ASM asm_volatile\n | ASM asm_volatile\n asm_volatile : VOLATILE\n | empty\n asm_argument_expression_list : argument_expression_list\n | empty\n statement : asm_no_semi\n | asm_no_semi SEMI\n direct_abstract_declarator : direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN asm_opt attributes_opt\n function_specifier : __INLINE\n | __INLINE__\n type_qualifier : __CONST\n | __RESTRICT\n | __EXTENSION__\n type_specifier : __TYPEOF__ LPAREN expression RPAREN\n type_specifier : __TYPEOF__ LPAREN parameter_declaration RPAREN\n unary_operator : __REAL__\n | __IMAG__\n postfix_expression : __BUILTIN_TYPES_COMPATIBLE_P LPAREN parameter_declaration COMMA parameter_declaration RPAREN\n gnu_statement_expression : LPAREN compound_statement RPAREN\n primary_expression : gnu_statement_expression statement : labeled_statement\n | expression_statement\n | compound_statement\n | selection_statement\n | iteration_statement\n | jump_statement\n | pppragma_directive\n | gnu_statement_expression\n attribute : __CONST\n struct_declaration_list : empty translation_unit_or_empty : translation_unit\n | empty\n translation_unit : external_declaration\n translation_unit : translation_unit external_declaration\n external_declaration : function_definition\n external_declaration : declaration\n external_declaration : pp_directive\n | pppragma_directive\n external_declaration : SEMI\n pp_directive : PPHASH\n pppragma_directive : PPPRAGMA\n | PPPRAGMA PPPRAGMASTR\n function_definition : id_declarator declaration_list_opt compound_statement\n function_definition : declaration_specifiers id_declarator declaration_list_opt compound_statement\n decl_body : declaration_specifiers init_declarator_list_opt\n | declaration_specifiers_no_type id_init_declarator_list_opt\n declaration : decl_body SEMI\n declaration_list : declaration\n | declaration_list declaration\n declaration_specifiers_no_type : type_qualifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : storage_class_specifier declaration_specifiers_no_type_opt\n declaration_specifiers_no_type : function_specifier declaration_specifiers_no_type_opt\n declaration_specifiers : declaration_specifiers type_qualifier\n declaration_specifiers : declaration_specifiers storage_class_specifier\n declaration_specifiers : declaration_specifiers function_specifier\n declaration_specifiers : declaration_specifiers type_specifier_no_typeid\n declaration_specifiers : type_specifier\n declaration_specifiers : declaration_specifiers_no_type type_specifier\n storage_class_specifier : AUTO\n | REGISTER\n | STATIC\n | EXTERN\n | TYPEDEF\n function_specifier : INLINE\n type_specifier_no_typeid : VOID\n | _BOOL\n | CHAR\n | SHORT\n | INT\n | LONG\n | FLOAT\n | DOUBLE\n | _COMPLEX\n | SIGNED\n | UNSIGNED\n | __INT128\n type_specifier : typedef_name\n | enum_specifier\n | struct_or_union_specifier\n | type_specifier_no_typeid\n type_qualifier : CONST\n | RESTRICT\n | VOLATILE\n init_declarator_list : init_declarator\n | init_declarator_list COMMA init_declarator\n init_declarator : declarator\n | declarator EQUALS initializer\n id_init_declarator_list : id_init_declarator\n | id_init_declarator_list COMMA init_declarator\n id_init_declarator : id_declarator\n | id_declarator EQUALS initializer\n specifier_qualifier_list : specifier_qualifier_list type_specifier_no_typeid\n specifier_qualifier_list : specifier_qualifier_list type_qualifier\n specifier_qualifier_list : type_specifier\n specifier_qualifier_list : type_qualifier_list type_specifier\n struct_or_union_specifier : struct_or_union ID\n | struct_or_union TYPEID\n struct_or_union_specifier : struct_or_union brace_open struct_declaration_list brace_close\n struct_or_union_specifier : struct_or_union ID brace_open struct_declaration_list brace_close\n | struct_or_union TYPEID brace_open struct_declaration_list brace_close\n struct_or_union : STRUCT\n | UNION\n struct_declaration_list : struct_declaration\n | struct_declaration_list struct_declaration\n struct_declaration : specifier_qualifier_list struct_declarator_list_opt SEMI\n struct_declaration : SEMI\n struct_declarator_list : struct_declarator\n | struct_declarator_list COMMA struct_declarator\n struct_declarator : declarator\n struct_declarator : declarator COLON constant_expression\n | COLON constant_expression\n enum_specifier : ENUM ID\n | ENUM TYPEID\n enum_specifier : ENUM brace_open enumerator_list brace_close\n enum_specifier : ENUM ID brace_open enumerator_list brace_close\n | ENUM TYPEID brace_open enumerator_list brace_close\n enumerator_list : enumerator\n | enumerator_list COMMA\n | enumerator_list COMMA enumerator\n enumerator : ID\n | ID EQUALS constant_expression\n declarator : id_declarator\n | typeid_declarator\n pointer : TIMES type_qualifier_list_opt\n | TIMES type_qualifier_list_opt pointer\n type_qualifier_list : type_qualifier\n | type_qualifier_list type_qualifier\n parameter_type_list : parameter_list\n | parameter_list COMMA ELLIPSIS\n parameter_list : parameter_declaration\n | parameter_list COMMA parameter_declaration\n parameter_declaration : declaration_specifiers id_declarator\n | declaration_specifiers typeid_noparen_declarator\n parameter_declaration : declaration_specifiers abstract_declarator_opt\n identifier_list : identifier\n | identifier_list COMMA identifier\n initializer : assignment_expression\n initializer : brace_open initializer_list_opt brace_close\n | brace_open initializer_list COMMA brace_close\n initializer_list : designation_opt initializer\n | initializer_list COMMA designation_opt initializer\n designation : designator_list EQUALS\n designator_list : designator\n | designator_list designator\n designator : LBRACKET constant_expression RBRACKET\n | PERIOD identifier\n type_name : specifier_qualifier_list abstract_declarator_opt\n abstract_declarator : pointer\n abstract_declarator : pointer direct_abstract_declarator\n abstract_declarator : direct_abstract_declarator\n direct_abstract_declarator : LPAREN abstract_declarator RPAREN direct_abstract_declarator : direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : LBRACKET assignment_expression_opt RBRACKET\n direct_abstract_declarator : direct_abstract_declarator LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LBRACKET TIMES RBRACKET\n direct_abstract_declarator : LPAREN parameter_type_list_opt RPAREN\n block_item : declaration\n | statement\n block_item_list : block_item\n | block_item_list block_item\n compound_statement : brace_open block_item_list_opt brace_close labeled_statement : ID COLON statement labeled_statement : CASE constant_expression COLON statement labeled_statement : DEFAULT COLON statement selection_statement : IF LPAREN expression RPAREN statement selection_statement : IF LPAREN expression RPAREN statement ELSE statement selection_statement : SWITCH LPAREN expression RPAREN statement iteration_statement : WHILE LPAREN expression RPAREN statement iteration_statement : DO statement WHILE LPAREN expression RPAREN SEMI iteration_statement : FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement iteration_statement : FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement jump_statement : GOTO ID SEMI jump_statement : BREAK SEMI jump_statement : CONTINUE SEMI jump_statement : RETURN expression SEMI\n | RETURN SEMI\n expression_statement : expression_opt SEMI expression : assignment_expression\n | expression COMMA assignment_expression\n typedef_name : TYPEID assignment_expression : conditional_expression\n | unary_expression assignment_operator assignment_expression\n assignment_operator : EQUALS\n | XOREQUAL\n | TIMESEQUAL\n | DIVEQUAL\n | MODEQUAL\n | PLUSEQUAL\n | MINUSEQUAL\n | LSHIFTEQUAL\n | RSHIFTEQUAL\n | ANDEQUAL\n | OREQUAL\n constant_expression : conditional_expression conditional_expression : binary_expression\n | binary_expression CONDOP expression COLON conditional_expression\n binary_expression : cast_expression\n | binary_expression TIMES binary_expression\n | binary_expression DIVIDE binary_expression\n | binary_expression MOD binary_expression\n | binary_expression PLUS binary_expression\n | binary_expression MINUS binary_expression\n | binary_expression RSHIFT binary_expression\n | binary_expression LSHIFT binary_expression\n | binary_expression LT binary_expression\n | binary_expression LE binary_expression\n | binary_expression GE binary_expression\n | binary_expression GT binary_expression\n | binary_expression EQ binary_expression\n | binary_expression NE binary_expression\n | binary_expression AND binary_expression\n | binary_expression OR binary_expression\n | binary_expression XOR binary_expression\n | binary_expression LAND binary_expression\n | binary_expression LOR binary_expression\n cast_expression : unary_expression cast_expression : LPAREN type_name RPAREN cast_expression unary_expression : postfix_expression unary_expression : PLUSPLUS unary_expression\n | MINUSMINUS unary_expression\n | unary_operator cast_expression\n unary_expression : SIZEOF unary_expression\n | SIZEOF LPAREN type_name RPAREN\n unary_operator : AND\n | TIMES\n | PLUS\n | MINUS\n | NOT\n | LNOT\n postfix_expression : primary_expression postfix_expression : postfix_expression LBRACKET expression RBRACKET postfix_expression : postfix_expression LPAREN argument_expression_list RPAREN\n | postfix_expression LPAREN RPAREN\n postfix_expression : postfix_expression PERIOD ID\n | postfix_expression PERIOD TYPEID\n | postfix_expression ARROW ID\n | postfix_expression ARROW TYPEID\n postfix_expression : postfix_expression PLUSPLUS\n | postfix_expression MINUSMINUS\n postfix_expression : LPAREN type_name RPAREN brace_open initializer_list brace_close\n | LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close\n primary_expression : identifier primary_expression : constant primary_expression : unified_string_literal\n | unified_wstring_literal\n primary_expression : LPAREN expression RPAREN primary_expression : OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN\n offsetof_member_designator : identifier\n | offsetof_member_designator PERIOD identifier\n | offsetof_member_designator LBRACKET expression RBRACKET\n argument_expression_list : assignment_expression\n | argument_expression_list COMMA assignment_expression\n identifier : ID constant : INT_CONST_DEC\n | INT_CONST_OCT\n | INT_CONST_HEX\n | INT_CONST_BIN\n constant : FLOAT_CONST\n | HEX_FLOAT_CONST\n constant : CHAR_CONST\n | WCHAR_CONST\n unified_string_literal : STRING_LITERAL\n | unified_string_literal STRING_LITERAL\n unified_wstring_literal : WSTRING_LITERAL\n | unified_wstring_literal WSTRING_LITERAL\n brace_open : LBRACE\n brace_close : RBRACE\n empty : ' + +_lr_action_items = {'VOID':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[2,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,2,-89,-118,-154,-257,-117,-146,-345,-151,-345,2,-153,-139,-110,-137,-115,-150,-113,2,-160,-88,-141,-90,-158,-157,-143,-116,2,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,2,-190,-343,-189,2,-52,-111,-119,-9,-127,-10,-128,-131,-133,2,-130,-132,-135,2,-125,2,2,-174,-173,2,-203,-124,-129,-53,-54,-61,2,2,2,2,-120,2,-126,2,2,2,-171,-183,-180,2,2,-107,-204,-30,2,2,-91,2,-92,2,2,2,2,-344,-191,-345,-345,2,-121,-99,-102,-98,-100,2,-104,-235,-83,-234,-103,-105,-236,-101,2,2,2,-175,-181,-172,-169,-170,-96,2,2,2,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,2,-251,-237,-84,-250,-238,-177,-176,-182,-64,2,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'__IMAG__':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,125,-343,-345,-119,-28,-203,-27,-124,125,-94,-304,-303,125,125,-301,-305,125,-93,-306,125,-302,125,125,-28,-345,-345,125,125,125,125,-204,-263,-266,-264,-260,-261,-265,-267,125,-269,-270,-262,-268,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,125,-344,125,-302,125,125,125,-28,-345,-345,-99,-102,-98,125,-100,125,125,-104,-235,-83,-234,-103,-105,-236,125,-101,125,125,125,-96,125,-345,125,-302,-302,125,125,-12,125,125,-11,-254,-253,125,-251,125,125,125,-237,125,-84,-250,-238,125,125,125,-345,125,125,125,-28,-345,-302,125,-345,-219,-249,-252,125,-241,125,-239,-11,-302,125,125,125,125,125,-240,125,-72,125,125,125,-345,125,125,-245,-244,-242,125,125,-73,125,125,-246,-243,125,-248,125,-74,-247,-75,]),'LBRACKET':([1,2,6,8,9,10,11,12,13,14,15,16,18,19,22,24,25,27,29,32,34,36,39,42,43,44,45,46,48,49,52,54,55,57,60,62,65,67,68,70,71,72,83,86,88,91,94,95,99,111,112,114,115,116,117,123,124,126,127,129,131,132,133,134,137,139,144,145,146,150,152,153,155,156,162,164,185,201,207,208,209,215,232,237,238,239,240,242,251,253,254,257,259,284,286,294,295,298,300,309,338,346,350,352,353,359,367,368,371,372,373,374,375,376,379,384,389,391,418,419,423,424,427,428,429,430,438,439,442,447,474,475,480,485,486,487,492,493,495,504,505,507,508,509,510,511,512,515,516,518,520,522,524,544,545,551,552,553,554,555,557,558,559,560,561,569,573,574,575,578,579,580,583,584,585,594,595,597,598,599,600,601,605,608,617,620,],[-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,74,-138,-134,-152,-89,-154,-257,-146,-151,-153,-139,-137,-150,-160,-88,-141,-90,-158,-157,-143,-86,-136,-345,-29,-155,-148,74,-62,-345,-190,-343,-189,-131,-133,186,-37,-130,-132,-135,-174,-173,-28,-201,-203,-27,74,-61,-338,-335,-321,-331,-336,-332,-319,-341,-333,-339,-322,-320,-307,-97,-334,-337,244,261,-330,186,-171,-204,-202,-30,-340,-91,261,-342,-92,-316,-315,261,261,392,-45,395,-344,-191,-345,-345,-38,186,444,-97,-330,-175,-172,-169,-170,-96,-323,261,261,-314,-313,-312,-311,-310,261,392,395,-193,-192,-31,-34,-71,-345,-70,-345,-345,-345,-220,444,-177,-176,-64,444,-308,-309,-233,-228,392,-230,-232,-33,-32,-36,-35,-39,-42,-345,-345,-223,444,-221,-63,577,-325,-345,-345,-229,-231,-345,-41,-40,-44,-43,-222,-72,444,-317,-324,-95,-46,-49,-345,-345,-345,-318,-326,-48,-47,-51,-50,-85,-73,-327,-74,-75,]),'WCHAR_CONST':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,126,-343,-345,-119,-28,-203,-27,-124,126,-94,-304,-303,126,126,-301,-305,126,-93,-306,126,-302,126,126,-28,-345,-345,126,126,126,126,-204,-263,-266,-264,-260,-261,-265,-267,126,-269,-270,-262,-268,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,126,-344,126,-302,126,126,126,-28,-345,-345,-99,-102,-98,126,-100,126,126,-104,-235,-83,-234,-103,-105,-236,126,-101,126,126,126,-96,126,-345,126,-302,-302,126,126,-12,126,126,-11,-254,-253,126,-251,126,126,126,-237,126,-84,-250,-238,126,126,126,-345,126,126,126,-28,-345,-302,126,-345,-219,-249,-252,126,-241,126,-239,-11,-302,126,126,126,126,126,-240,126,-72,126,126,126,-345,126,126,-245,-244,-242,126,126,-73,126,126,-246,-243,126,-248,126,-74,-247,-75,]),'FLOAT_CONST':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,127,-343,-345,-119,-28,-203,-27,-124,127,-94,-304,-303,127,127,-301,-305,127,-93,-306,127,-302,127,127,-28,-345,-345,127,127,127,127,-204,-263,-266,-264,-260,-261,-265,-267,127,-269,-270,-262,-268,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,127,-344,127,-302,127,127,127,-28,-345,-345,-99,-102,-98,127,-100,127,127,-104,-235,-83,-234,-103,-105,-236,127,-101,127,127,127,-96,127,-345,127,-302,-302,127,127,-12,127,127,-11,-254,-253,127,-251,127,127,127,-237,127,-84,-250,-238,127,127,127,-345,127,127,127,-28,-345,-302,127,-345,-219,-249,-252,127,-241,127,-239,-11,-302,127,127,127,127,127,-240,127,-72,127,127,127,-345,127,127,-245,-244,-242,127,127,-73,127,127,-246,-243,127,-248,127,-74,-247,-75,]),'__ASM':([23,71,78,119,196,284,294,295,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,438,439,454,455,458,459,464,467,468,471,472,525,526,529,531,537,551,552,555,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,315,-344,315,315,-99,-102,-98,-100,315,-104,-235,-83,-234,-103,-105,-236,315,-101,-96,315,315,-254,-253,-251,315,-237,-84,-250,-238,315,-249,-252,-241,315,-239,315,315,315,315,-240,-72,315,315,-245,-244,-242,-73,315,315,-246,-243,315,-248,-74,-247,-75,]),'__TYPEOF__':([0,10,11,13,14,15,16,17,21,22,23,26,28,30,34,35,36,37,40,41,42,43,44,45,46,50,51,52,54,57,58,63,65,67,68,69,71,75,76,77,78,79,80,81,82,90,107,108,110,113,116,119,120,122,123,124,143,151,187,195,196,197,198,199,200,202,203,204,206,207,209,228,230,246,247,250,251,284,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,351,367,372,393,396,423,424,427,428,429,430,454,455,457,458,464,467,468,471,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[5,-87,-69,-140,-159,-345,-138,-114,5,-89,-118,-117,-345,-345,-139,-110,-137,-115,-113,5,-160,-88,-141,-90,-158,-116,5,-86,-136,-29,-112,-345,-345,-62,-345,5,-343,5,-52,-111,-119,-9,-127,-10,-128,5,-125,5,5,5,-203,-124,-129,-53,-54,-61,5,5,5,-120,5,-126,5,5,5,-183,-180,5,-107,-204,-30,5,5,5,5,5,5,-344,-345,-345,5,-121,-99,-102,-98,-100,5,-104,-235,-83,-234,-103,-105,-236,-101,5,5,5,-181,-96,5,5,5,-31,-34,-71,-345,-70,-345,-254,-253,5,-251,-237,-84,-250,-238,-182,-64,5,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'RPAREN':([1,2,6,8,9,10,11,12,13,14,15,16,18,19,22,24,25,27,29,32,34,36,39,42,43,44,45,46,48,49,52,54,55,57,60,62,65,67,68,70,72,75,76,83,86,88,91,94,95,99,111,112,114,115,116,117,118,122,123,124,126,127,129,131,132,133,134,135,137,139,142,144,145,146,147,148,150,152,153,155,156,159,162,164,165,166,175,176,177,178,179,180,181,182,185,187,188,201,207,208,209,210,211,212,213,214,215,229,231,232,234,235,236,237,238,239,240,242,245,248,249,251,252,253,254,255,256,257,258,259,260,262,284,286,294,295,298,300,301,305,306,313,325,350,352,353,359,361,363,364,365,366,367,368,370,371,372,373,374,375,376,378,379,380,382,384,385,386,387,388,389,391,393,394,396,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,423,424,427,428,429,430,431,432,433,438,439,449,463,465,471,474,475,480,481,482,484,486,487,492,493,494,495,499,500,503,504,505,507,508,509,510,511,512,515,516,524,530,532,533,534,535,538,543,544,545,546,551,552,553,554,555,556,557,558,559,560,568,569,574,575,578,579,580,583,584,585,588,590,592,594,595,597,598,599,600,601,602,603,604,605,608,609,611,616,617,619,620,],[-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-134,-152,-89,-154,-257,-146,-151,-153,-139,-137,-150,-160,-88,-141,-90,-158,-157,-143,-86,-136,-345,-29,-155,-148,-345,-62,-345,-190,-189,-345,-52,-131,-133,-345,-37,-130,-132,-135,-174,-173,-28,-201,-203,-27,209,-53,-54,-61,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,232,-339,-322,-320,-274,239,-307,-97,-334,-337,-295,-255,-345,-330,-272,-258,294,-17,295,-207,-18,-205,-212,298,-345,-345,-55,-171,-204,-202,-30,-67,-65,361,-68,-106,-340,-299,-296,-91,367,368,369,-345,-342,-92,-316,-315,379,-293,-298,-345,-211,-225,-345,-209,-1,-45,-210,-227,-2,-297,-344,-191,-345,-345,-38,-57,-56,438,439,449,-14,-175,-172,-169,-170,480,-259,482,483,-256,-96,-323,-224,-225,-345,-314,-313,-312,-311,-328,-310,487,490,-225,-23,-24,492,493,-345,-226,-345,-58,-345,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-193,-192,-31,-34,-71,-345,-70,-345,-213,-206,-208,-345,-345,524,-345,-13,-238,-177,-176,-64,-66,-300,-294,-308,-309,-233,-228,-59,-60,551,552,555,-230,-232,-33,-32,-36,-35,-39,-42,-345,-345,-63,566,569,-81,-82,570,572,-329,575,-325,578,-345,-345,-229,-231,-345,-273,-41,-40,-44,-43,-345,-72,-317,-324,-95,-46,-49,-345,-345,-345,-345,605,606,-318,-326,-48,-47,-51,-50,-85,-345,610,-345,-73,-327,614,617,-345,-74,620,-75,]),'LONG':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[6,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,6,-89,-118,-154,-257,-117,-146,-345,-151,-345,6,-153,-139,-110,-137,-115,-150,-113,6,-160,-88,-141,-90,-158,-157,-143,-116,6,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,6,-190,-343,-189,6,-52,-111,-119,-9,-127,-10,-128,-131,-133,6,-130,-132,-135,6,-125,6,6,-174,-173,6,-203,-124,-129,-53,-54,-61,6,6,6,6,-120,6,-126,6,6,6,-171,-183,-180,6,6,-107,-204,-30,6,6,-91,6,-92,6,6,6,6,-344,-191,-345,-345,6,-121,-99,-102,-98,-100,6,-104,-235,-83,-234,-103,-105,-236,-101,6,6,6,-175,-181,-172,-169,-170,-96,6,6,6,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,6,-251,-237,-84,-250,-238,-177,-176,-182,-64,6,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'PLUS':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,149,150,152,153,154,155,156,158,161,163,164,165,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,233,238,240,242,244,245,247,248,249,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,354,362,367,368,369,373,374,375,376,379,392,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,482,484,485,486,487,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,130,-343,-345,-119,-28,-203,-27,-124,130,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,-293,130,-341,130,-333,-301,-305,130,-339,-322,-320,-274,-93,-307,-97,-334,-306,-337,-295,130,-302,130,-330,270,130,-28,-345,-345,130,130,130,130,-204,-340,-263,-266,-264,-260,-261,-265,-267,130,-269,-270,-262,-268,130,-299,130,-296,130,-342,-316,-315,130,130,130,-293,-298,130,-297,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,130,-344,130,-302,130,130,130,-28,-345,-345,-99,-102,-98,130,-100,130,130,-104,-235,-83,-234,-103,-97,-236,130,-101,130,-330,130,130,-96,-323,130,-314,-313,-312,-311,-310,-345,130,-302,270,270,270,-279,270,270,270,-278,270,270,-276,-275,270,270,270,270,270,-277,-302,130,130,-12,130,130,-11,-254,-253,130,-251,130,130,130,-237,130,-84,-250,-238,130,130,130,-300,-294,-345,-308,-309,130,130,130,-28,-345,-302,130,-345,-219,-249,-252,130,-241,130,-239,-11,-302,130,130,130,130,130,-240,130,-72,130,130,130,-345,-317,-324,130,-95,130,-245,-244,-242,-318,130,130,-73,130,130,-246,-243,130,-248,130,-74,-247,-75,]),'ELLIPSIS':([297,],[432,]),'GT':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,271,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,271,-281,-279,-283,271,-282,-278,-285,271,-276,-275,-284,271,271,271,271,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'GOTO':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,317,-344,-99,-102,-98,-100,317,-104,-235,-83,-234,-103,-105,-236,317,-101,-96,-254,-253,-251,317,-237,-84,-250,-238,317,-249,-252,-241,317,-239,317,-240,-72,317,317,-245,-244,-242,-73,317,317,-246,-243,317,-248,-74,-247,-75,]),'ENUM':([0,10,11,13,14,15,16,17,21,22,23,26,28,30,34,35,36,37,40,41,42,43,44,45,46,50,51,52,54,57,58,63,65,67,68,69,71,75,76,77,78,79,80,81,82,90,107,108,110,113,116,119,120,122,123,124,143,151,187,195,196,197,198,199,200,202,203,204,206,207,209,228,230,246,247,250,251,284,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,351,367,372,393,396,423,424,427,428,429,430,454,455,457,458,464,467,468,471,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[7,-87,-69,-140,-159,-345,-138,-114,7,-89,-118,-117,-345,-345,-139,-110,-137,-115,-113,7,-160,-88,-141,-90,-158,-116,7,-86,-136,-29,-112,-345,-345,-62,-345,7,-343,7,-52,-111,-119,-9,-127,-10,-128,7,-125,7,7,7,-203,-124,-129,-53,-54,-61,7,7,7,-120,7,-126,7,7,7,-183,-180,7,-107,-204,-30,7,7,7,7,7,7,-344,-345,-345,7,-121,-99,-102,-98,-100,7,-104,-235,-83,-234,-103,-105,-236,-101,7,7,7,-181,-96,7,7,7,-31,-34,-71,-345,-70,-345,-254,-253,7,-251,-237,-84,-250,-238,-182,-64,7,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'PERIOD':([71,126,127,129,131,132,133,134,137,139,144,145,146,150,152,153,155,156,164,215,238,240,242,284,309,338,346,367,368,373,374,375,376,379,442,447,485,486,487,518,520,522,544,545,561,573,574,575,578,594,595,608,],[-343,-338,-335,-321,-331,-336,-332,-319,-341,-333,-339,-322,-320,-307,-97,-334,-337,243,-330,-340,-342,-316,-315,-344,443,-97,-330,-96,-323,-314,-313,-312,-311,-310,-220,443,443,-308,-309,-223,443,-221,576,-325,-222,443,-317,-324,-95,-318,-326,-327,]),'GE':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,275,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,275,-281,-279,-283,275,-282,-278,-285,275,-276,-275,-284,275,275,275,275,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'INT_CONST_DEC':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,131,-343,-345,-119,-28,-203,-27,-124,131,-94,-304,-303,131,131,-301,-305,131,-93,-306,131,-302,131,131,-28,-345,-345,131,131,131,131,-204,-263,-266,-264,-260,-261,-265,-267,131,-269,-270,-262,-268,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,131,-344,131,-302,131,131,131,-28,-345,-345,-99,-102,-98,131,-100,131,131,-104,-235,-83,-234,-103,-105,-236,131,-101,131,131,131,-96,131,-345,131,-302,-302,131,131,-12,131,131,-11,-254,-253,131,-251,131,131,131,-237,131,-84,-250,-238,131,131,131,-345,131,131,131,-28,-345,-302,131,-345,-219,-249,-252,131,-241,131,-239,-11,-302,131,131,131,131,131,-240,131,-72,131,131,131,-345,131,131,-245,-244,-242,131,131,-73,131,131,-246,-243,131,-248,131,-74,-247,-75,]),'ARROW':([126,127,129,131,132,133,134,137,139,144,145,146,150,152,153,155,156,164,215,238,240,242,284,338,346,367,368,373,374,375,376,379,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-341,-333,-339,-322,-320,-307,-97,-334,-337,241,-330,-340,-342,-316,-315,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-308,-309,-317,-324,-95,-318,]),'__INT128':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[32,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,32,-89,-118,-154,-257,-117,-146,-345,-151,-345,32,-153,-139,-110,-137,-115,-150,-113,32,-160,-88,-141,-90,-158,-157,-143,-116,32,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,32,-190,-343,-189,32,-52,-111,-119,-9,-127,-10,-128,-131,-133,32,-130,-132,-135,32,-125,32,32,-174,-173,32,-203,-124,-129,-53,-54,-61,32,32,32,32,-120,32,-126,32,32,32,-171,-183,-180,32,32,-107,-204,-30,32,32,-91,32,-92,32,32,32,32,-344,-191,-345,-345,32,-121,-99,-102,-98,-100,32,-104,-235,-83,-234,-103,-105,-236,-101,32,32,32,-175,-181,-172,-169,-170,-96,32,32,32,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,32,-251,-237,-84,-250,-238,-177,-176,-182,-64,32,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'HEX_FLOAT_CONST':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,132,-343,-345,-119,-28,-203,-27,-124,132,-94,-304,-303,132,132,-301,-305,132,-93,-306,132,-302,132,132,-28,-345,-345,132,132,132,132,-204,-263,-266,-264,-260,-261,-265,-267,132,-269,-270,-262,-268,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,132,-344,132,-302,132,132,132,-28,-345,-345,-99,-102,-98,132,-100,132,132,-104,-235,-83,-234,-103,-105,-236,132,-101,132,132,132,-96,132,-345,132,-302,-302,132,132,-12,132,132,-11,-254,-253,132,-251,132,132,132,-237,132,-84,-250,-238,132,132,132,-345,132,132,132,-28,-345,-302,132,-345,-219,-249,-252,132,-241,132,-239,-11,-302,132,132,132,132,132,-240,132,-72,132,132,132,-345,132,132,-245,-244,-242,132,132,-73,132,132,-246,-243,132,-248,132,-74,-247,-75,]),'DOUBLE':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[9,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,9,-89,-118,-154,-257,-117,-146,-345,-151,-345,9,-153,-139,-110,-137,-115,-150,-113,9,-160,-88,-141,-90,-158,-157,-143,-116,9,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,9,-190,-343,-189,9,-52,-111,-119,-9,-127,-10,-128,-131,-133,9,-130,-132,-135,9,-125,9,9,-174,-173,9,-203,-124,-129,-53,-54,-61,9,9,9,9,-120,9,-126,9,9,9,-171,-183,-180,9,9,-107,-204,-30,9,9,-91,9,-92,9,9,9,9,-344,-191,-345,-345,9,-121,-99,-102,-98,-100,9,-104,-235,-83,-234,-103,-105,-236,-101,9,9,9,-175,-181,-172,-169,-170,-96,9,9,9,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,9,-251,-237,-84,-250,-238,-177,-176,-182,-64,9,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'MINUSEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,217,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'INT_CONST_OCT':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,133,-343,-345,-119,-28,-203,-27,-124,133,-94,-304,-303,133,133,-301,-305,133,-93,-306,133,-302,133,133,-28,-345,-345,133,133,133,133,-204,-263,-266,-264,-260,-261,-265,-267,133,-269,-270,-262,-268,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,133,-344,133,-302,133,133,133,-28,-345,-345,-99,-102,-98,133,-100,133,133,-104,-235,-83,-234,-103,-105,-236,133,-101,133,133,133,-96,133,-345,133,-302,-302,133,133,-12,133,133,-11,-254,-253,133,-251,133,133,133,-237,133,-84,-250,-238,133,133,133,-345,133,133,133,-28,-345,-302,133,-345,-219,-249,-252,133,-241,133,-239,-11,-302,133,133,133,133,133,-240,133,-72,133,133,133,-345,133,133,-245,-244,-242,133,133,-73,133,133,-246,-243,133,-248,133,-74,-247,-75,]),'__INLINE__':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[10,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,10,-89,-118,-154,-257,-117,-146,10,-151,10,10,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,10,-86,-136,-29,-112,-155,-148,10,-345,-62,-345,10,-190,-343,-189,10,-52,-111,-119,-131,-133,10,-130,-132,-135,10,-125,10,-174,-173,-124,-53,-54,-61,10,10,-120,10,-126,-30,-91,-92,10,10,-344,-191,-345,-345,10,-121,-99,-102,-98,-100,10,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,10,10,10,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,10,-251,-237,-84,-250,-238,-177,-176,-64,10,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'TIMESEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,226,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'OR':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,280,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,280,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,280,-286,-288,-289,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'SHORT':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[12,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,12,-89,-118,-154,-257,-117,-146,-345,-151,-345,12,-153,-139,-110,-137,-115,-150,-113,12,-160,-88,-141,-90,-158,-157,-143,-116,12,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,12,-190,-343,-189,12,-52,-111,-119,-9,-127,-10,-128,-131,-133,12,-130,-132,-135,12,-125,12,12,-174,-173,12,-203,-124,-129,-53,-54,-61,12,12,12,12,-120,12,-126,12,12,12,-171,-183,-180,12,12,-107,-204,-30,12,12,-91,12,-92,12,12,12,12,-344,-191,-345,-345,12,-121,-99,-102,-98,-100,12,-104,-235,-83,-234,-103,-105,-236,-101,12,12,12,-175,-181,-172,-169,-170,-96,12,12,12,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,12,-251,-237,-84,-250,-238,-177,-176,-182,-64,12,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'RETURN':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,320,-344,-99,-102,-98,-100,320,-104,-235,-83,-234,-103,-105,-236,320,-101,-96,-254,-253,-251,320,-237,-84,-250,-238,320,-249,-252,-241,320,-239,320,-240,-72,320,320,-245,-244,-242,-73,320,320,-246,-243,320,-248,-74,-247,-75,]),'RSHIFTEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,227,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'RESTRICT':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,122,123,124,143,162,173,174,186,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[14,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,14,-89,-118,-154,-257,-117,-146,14,-151,14,14,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,14,-86,-136,14,-29,-112,-155,-148,14,-345,-62,-345,14,-190,-343,-189,14,14,-52,-111,-119,-131,-133,14,-130,-132,-135,14,-125,14,-174,-173,14,14,-203,-124,-53,-54,-61,14,14,14,14,14,14,-120,14,-126,14,14,14,-171,-183,-180,14,14,-107,-204,-30,14,14,-91,14,-92,14,14,14,14,-344,-191,-345,-345,14,14,14,-121,-99,-102,-98,-100,14,-104,-235,-83,-234,-103,-105,-236,-101,14,14,14,-175,-181,-172,-169,-170,-96,14,14,14,14,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,14,-251,-237,-84,-250,-238,-177,-176,-182,-64,14,14,14,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'STATIC':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,116,119,122,123,124,162,173,186,187,195,196,197,207,209,232,239,250,251,284,286,294,295,297,303,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,497,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[16,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,16,-89,-118,-154,-257,-117,-146,16,-151,16,16,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,16,-86,-136,-29,-112,-155,-148,16,-345,-62,-345,16,-190,-343,-189,174,16,-52,-111,-119,-131,-133,16,-130,-132,-135,16,-125,16,-174,-173,-203,-124,-53,-54,-61,16,292,304,16,-120,16,-126,-204,-30,-91,-92,16,16,-344,-191,-345,-345,16,436,-121,-99,-102,-98,-100,16,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,16,498,16,16,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,16,-251,-237,-84,-250,-238,-177,-176,-64,16,549,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'SIZEOF':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,136,-343,-345,-119,-28,-203,-27,-124,136,-94,-304,-303,136,136,-301,-305,136,-93,-306,136,-302,136,136,-28,-345,-345,136,136,136,136,-204,-263,-266,-264,-260,-261,-265,-267,136,-269,-270,-262,-268,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,-344,136,-302,136,136,136,-28,-345,-345,-99,-102,-98,136,-100,136,136,-104,-235,-83,-234,-103,-105,-236,136,-101,136,136,136,-96,136,-345,136,-302,-302,136,136,-12,136,136,-11,-254,-253,136,-251,136,136,136,-237,136,-84,-250,-238,136,136,136,-345,136,136,136,-28,-345,-302,136,-345,-219,-249,-252,136,-241,136,-239,-11,-302,136,136,136,136,136,-240,136,-72,136,136,136,-345,136,136,-245,-244,-242,136,136,-73,136,136,-246,-243,136,-248,136,-74,-247,-75,]),'UNSIGNED':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[19,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,19,-89,-118,-154,-257,-117,-146,-345,-151,-345,19,-153,-139,-110,-137,-115,-150,-113,19,-160,-88,-141,-90,-158,-157,-143,-116,19,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,19,-190,-343,-189,19,-52,-111,-119,-9,-127,-10,-128,-131,-133,19,-130,-132,-135,19,-125,19,19,-174,-173,19,-203,-124,-129,-53,-54,-61,19,19,19,19,-120,19,-126,19,19,19,-171,-183,-180,19,19,-107,-204,-30,19,19,-91,19,-92,19,19,19,19,-344,-191,-345,-345,19,-121,-99,-102,-98,-100,19,-104,-235,-83,-234,-103,-105,-236,-101,19,19,19,-175,-181,-172,-169,-170,-96,19,19,19,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,19,-251,-237,-84,-250,-238,-177,-176,-182,-64,19,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'MINUS':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,149,150,152,153,154,155,156,158,161,163,164,165,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,233,238,240,242,244,245,247,248,249,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,354,362,367,368,369,373,374,375,376,379,392,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,482,484,485,486,487,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,128,-343,-345,-119,-28,-203,-27,-124,128,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,-293,128,-341,128,-333,-301,-305,128,-339,-322,-320,-274,-93,-307,-97,-334,-306,-337,-295,128,-302,128,-330,266,128,-28,-345,-345,128,128,128,128,-204,-340,-263,-266,-264,-260,-261,-265,-267,128,-269,-270,-262,-268,128,-299,128,-296,128,-342,-316,-315,128,128,128,-293,-298,128,-297,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,-344,128,-302,128,128,128,-28,-345,-345,-99,-102,-98,128,-100,128,128,-104,-235,-83,-234,-103,-97,-236,128,-101,128,-330,128,128,-96,-323,128,-314,-313,-312,-311,-310,-345,128,-302,266,266,266,-279,266,266,266,-278,266,266,-276,-275,266,266,266,266,266,-277,-302,128,128,-12,128,128,-11,-254,-253,128,-251,128,128,128,-237,128,-84,-250,-238,128,128,128,-300,-294,-345,-308,-309,128,128,128,-28,-345,-302,128,-345,-219,-249,-252,128,-241,128,-239,-11,-302,128,128,128,128,128,-240,128,-72,128,128,128,-345,-317,-324,128,-95,128,-245,-244,-242,-318,128,128,-73,128,128,-246,-243,128,-248,128,-74,-247,-75,]),'PLUSPLUS':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,126,127,128,129,130,131,132,133,134,136,137,138,139,140,141,143,144,145,146,149,150,152,153,154,155,156,158,161,163,164,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,238,240,242,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,354,362,367,368,369,373,374,375,376,379,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,486,487,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,138,-343,-345,-119,-28,-203,-27,-124,138,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,138,-341,138,-333,-301,-305,138,-339,-322,-320,-93,-307,-97,-334,-306,-337,242,138,-302,138,-330,138,-28,-345,-345,138,138,138,138,-204,-340,-263,-266,-264,-260,-261,-265,-267,138,-269,-270,-262,-268,138,138,138,-342,-316,-315,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,138,-344,138,-302,138,138,138,-28,-345,-345,-99,-102,-98,138,-100,138,138,-104,-235,-83,-234,-103,-97,-236,138,-101,138,-330,138,138,-96,-323,138,-314,-313,-312,-311,-310,-345,138,-302,-302,138,138,-12,138,138,-11,-254,-253,138,-251,138,138,138,-237,138,-84,-250,-238,138,138,138,-345,-308,-309,138,138,138,-28,-345,-302,138,-345,-219,-249,-252,138,-241,138,-239,-11,-302,138,138,138,138,138,-240,138,-72,138,138,138,-345,-317,-324,138,-95,138,-245,-244,-242,-318,138,138,-73,138,138,-246,-243,138,-248,138,-74,-247,-75,]),'COLON':([1,2,6,8,9,12,14,15,19,22,24,25,27,29,32,39,42,43,45,46,48,49,57,60,62,65,67,68,70,72,76,88,89,91,111,112,122,123,124,126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,159,164,165,166,185,188,194,201,205,209,215,229,231,232,238,239,240,242,248,249,262,284,286,294,295,298,300,301,326,346,350,352,353,359,360,363,366,367,368,373,374,375,376,378,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,422,423,424,427,428,429,430,438,439,462,463,474,475,477,480,482,484,486,487,507,508,509,510,511,512,515,516,524,532,533,534,543,556,557,558,559,560,568,569,574,575,578,590,594,604,605,611,617,620,],[-156,-142,-147,-144,-149,-145,-159,-345,-152,-89,-154,-257,-146,-151,-153,-150,-160,-88,-90,-158,-157,-143,-29,-155,-148,-345,-62,-345,-190,-189,-52,-345,-200,-37,-174,-173,-53,-54,-61,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-255,-330,-272,-258,-345,-55,-199,-171,354,-30,-340,-299,-296,-91,-342,-92,-316,-315,-293,-298,-297,-344,-191,-345,-345,-38,-57,-56,459,472,-175,-172,-169,-170,479,-259,-256,-96,-323,-314,-313,-312,-311,-328,-310,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,506,-289,-277,-193,-192,-271,-31,-34,-71,-345,-70,-345,-345,-345,531,-345,-177,-176,354,-64,-300,-294,-308,-309,-33,-32,-36,-35,-39,-42,-345,-345,-63,568,-81,-82,-329,-273,-41,-40,-44,-43,-345,-72,-317,-324,-95,604,-318,-345,-73,616,-74,-75,]),'$end':([0,17,21,23,26,33,35,37,38,40,50,58,77,78,119,195,284,307,471,],[-345,-114,-108,-118,-117,0,-110,-115,-109,-113,-116,-112,-111,-119,-124,-120,-344,-121,-238,]),'WSTRING_LITERAL':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,137,138,140,141,143,145,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,238,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,137,-343,-345,-119,-28,-203,-27,-124,137,-94,-304,-303,137,-341,137,-301,-305,137,238,-93,-306,137,-302,137,137,-28,-345,-345,137,137,137,137,-204,-263,-266,-264,-260,-261,-265,-267,137,-269,-270,-262,-268,137,137,137,-342,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,137,-344,137,-302,137,137,137,-28,-345,-345,-99,-102,-98,137,-100,137,137,-104,-235,-83,-234,-103,-105,-236,137,-101,137,137,137,-96,137,-345,137,-302,-302,137,137,-12,137,137,-11,-254,-253,137,-251,137,137,137,-237,137,-84,-250,-238,137,137,137,-345,137,137,137,-28,-345,-302,137,-345,-219,-249,-252,137,-241,137,-239,-11,-302,137,137,137,137,137,-240,137,-72,137,137,137,-345,137,137,-245,-244,-242,137,137,-73,137,137,-246,-243,137,-248,137,-74,-247,-75,]),'DIVIDE':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,273,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,273,273,273,273,273,273,273,273,273,273,-276,-275,273,273,273,273,273,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'FOR':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,322,-344,-99,-102,-98,-100,322,-104,-235,-83,-234,-103,-105,-236,322,-101,-96,-254,-253,-251,322,-237,-84,-250,-238,322,-249,-252,-241,322,-239,322,-240,-72,322,322,-245,-244,-242,-73,322,322,-246,-243,322,-248,-74,-247,-75,]),'__RESTRICT':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,122,123,124,143,162,173,174,186,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[22,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,22,-89,-118,-154,-257,-117,-146,22,-151,22,22,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,22,-86,-136,22,-29,-112,-155,-148,22,-345,-62,-345,22,-190,-343,-189,22,22,-52,-111,-119,-131,-133,22,-130,-132,-135,22,-125,22,-174,-173,22,22,-203,-124,-53,-54,-61,22,22,22,22,22,22,-120,22,-126,22,22,22,-171,-183,-180,22,22,-107,-204,-30,22,22,-91,22,-92,22,22,22,22,-344,-191,-345,-345,22,22,22,-121,-99,-102,-98,-100,22,-104,-235,-83,-234,-103,-105,-236,-101,22,22,22,-175,-181,-172,-169,-170,-96,22,22,22,22,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,22,-251,-237,-84,-250,-238,-177,-176,-182,-64,22,22,22,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'INT_CONST_HEX':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,139,-343,-345,-119,-28,-203,-27,-124,139,-94,-304,-303,139,139,-301,-305,139,-93,-306,139,-302,139,139,-28,-345,-345,139,139,139,139,-204,-263,-266,-264,-260,-261,-265,-267,139,-269,-270,-262,-268,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,-344,139,-302,139,139,139,-28,-345,-345,-99,-102,-98,139,-100,139,139,-104,-235,-83,-234,-103,-105,-236,139,-101,139,139,139,-96,139,-345,139,-302,-302,139,139,-12,139,139,-11,-254,-253,139,-251,139,139,139,-237,139,-84,-250,-238,139,139,139,-345,139,139,139,-28,-345,-302,139,-345,-219,-249,-252,139,-241,139,-239,-11,-302,139,139,139,139,139,-240,139,-72,139,139,139,-345,139,139,-245,-244,-242,139,139,-73,139,139,-246,-243,139,-248,139,-74,-247,-75,]),'EQUALS':([15,57,65,67,68,76,88,89,90,91,92,100,122,123,124,126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,171,185,188,194,209,215,229,231,238,240,242,248,249,262,284,294,295,298,300,301,338,346,367,368,373,374,375,376,379,423,424,427,428,429,430,438,439,442,447,480,482,484,486,487,507,508,509,510,511,512,515,516,518,522,524,557,558,559,560,561,569,574,575,578,594,605,617,620,],[-345,-29,-345,-62,-345,-52,-345,-200,-199,-37,190,191,-53,-54,-61,-338,-335,-321,-331,-336,-332,-319,219,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,287,-345,-55,-199,-30,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-345,-345,-38,-57,-56,-97,-330,-96,-323,-314,-313,-312,-311,-310,-31,-34,-71,-345,-70,-345,-345,-345,-220,523,-64,-300,-294,-308,-309,-33,-32,-36,-35,-39,-42,-345,-345,-223,-221,-63,-41,-40,-44,-43,-222,-72,-317,-324,-95,-318,-73,-74,-75,]),'ELSE':([23,78,284,314,316,319,321,333,335,337,338,343,367,454,455,458,467,468,471,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[-118,-119,-344,-99,-102,-98,-100,-104,-83,-103,-105,-101,-96,-254,-253,-251,-84,-250,-238,-249,-252,-241,-239,-240,-72,-245,-244,607,-73,-246,-243,-248,-74,-247,-75,]),'__CONST':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,121,122,123,124,143,162,173,174,186,187,193,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,362,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[43,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,43,-89,-118,-154,-257,-117,-146,43,-151,43,43,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,43,-86,-136,43,-29,-112,-155,-148,43,-345,-62,-345,43,-190,-343,-189,43,43,-52,-111,-119,-131,-133,43,-130,-132,-135,43,-125,43,-174,-173,43,43,-203,-124,214,-53,-54,-61,43,43,43,43,43,43,214,-120,43,-126,43,43,43,-171,-183,-180,43,43,-107,-204,-30,43,43,-91,43,-92,43,43,43,43,-344,-191,-345,-345,43,43,43,-121,-99,-102,-98,-100,43,-104,-235,-83,-234,-103,-105,-236,-101,43,43,43,-175,-181,-172,-169,-170,214,-96,43,43,43,43,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,43,-251,-237,-84,-250,-238,-177,-176,-182,-64,43,43,43,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'ANDEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,224,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'EQ':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,277,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,277,-281,-279,-283,-287,-282,-278,-285,277,-276,-275,-284,277,-286,277,277,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'AND':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,149,150,152,153,154,155,156,158,161,163,164,165,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,233,238,240,242,244,245,247,248,249,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,354,362,367,368,369,373,374,375,376,379,392,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,482,484,485,486,487,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,140,-343,-345,-119,-28,-203,-27,-124,140,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,-293,140,-341,140,-333,-301,-305,140,-339,-322,-320,-274,-93,-307,-97,-334,-306,-337,-295,140,-302,140,-330,278,140,-28,-345,-345,140,140,140,140,-204,-340,-263,-266,-264,-260,-261,-265,-267,140,-269,-270,-262,-268,140,-299,140,-296,140,-342,-316,-315,140,140,140,-293,-298,140,-297,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,140,-344,140,-302,140,140,140,-28,-345,-345,-99,-102,-98,140,-100,140,140,-104,-235,-83,-234,-103,-97,-236,140,-101,140,-330,140,140,-96,-323,140,-314,-313,-312,-311,-310,-345,140,-302,-280,278,-281,-279,-283,-287,-282,-278,-285,278,-276,-275,-284,278,-286,-288,278,-277,-302,140,140,-12,140,140,-11,-254,-253,140,-251,140,140,140,-237,140,-84,-250,-238,140,140,140,-300,-294,-345,-308,-309,140,140,140,-28,-345,-302,140,-345,-219,-249,-252,140,-241,140,-239,-11,-302,140,140,140,140,140,-240,140,-72,140,140,140,-345,-317,-324,140,-95,140,-245,-244,-242,-318,140,140,-73,140,140,-246,-243,140,-248,140,-74,-247,-75,]),'TYPEID':([0,1,2,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,53,54,55,57,58,59,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,84,86,87,90,94,95,99,105,107,108,110,111,112,113,114,115,116,117,119,120,122,123,124,143,151,162,183,184,187,192,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,228,230,232,239,241,243,246,247,250,251,253,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,390,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,477,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[25,-156,-142,-147,70,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,-179,25,-89,-118,-154,-257,-117,-146,-345,-151,-345,91,-153,-139,-110,-137,-115,-150,-113,25,-160,-88,-141,-90,-158,-157,-143,-116,25,-86,111,-136,-345,-29,-112,-178,-155,-148,-345,-345,-62,-345,25,-190,-343,-189,25,-52,-111,-119,-9,-127,-10,-128,-131,91,-133,91,25,-130,-132,-135,91,-125,25,25,-174,-173,25,-28,-201,-203,-27,-124,-129,-53,-54,-61,25,25,257,91,91,25,91,-120,25,-126,25,25,25,-171,-183,-180,25,91,-107,-204,-202,-30,25,25,-91,-92,373,375,25,25,25,25,257,-344,-191,-345,-345,25,-121,-99,-102,-98,-100,25,-104,-235,-83,-234,-103,-105,-236,-101,25,25,25,-175,-181,-172,-169,-170,-96,25,257,25,25,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,25,-251,-237,-84,-250,-238,-177,-176,91,-182,-64,25,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'LBRACE':([7,15,20,23,51,53,57,59,65,67,68,70,71,72,76,78,90,106,107,109,110,111,112,119,122,123,124,143,189,190,191,196,197,209,228,230,247,284,294,295,309,314,316,319,321,331,333,334,335,336,337,338,340,342,343,345,367,369,423,424,427,428,429,430,440,446,448,454,455,458,459,464,467,468,471,472,480,482,483,485,490,507,508,509,510,520,523,524,525,526,529,531,537,541,562,566,567,569,570,572,573,589,591,593,605,607,610,612,613,614,615,617,618,620,],[71,-345,-179,-118,-345,71,-29,-178,-345,-62,-345,71,-343,71,-52,-119,-345,-7,-125,71,-8,71,71,-124,-53,-54,-61,71,71,71,71,71,-126,-30,71,71,71,-344,-345,-345,-345,-99,-102,-98,-100,71,-104,-235,-83,-234,-103,-105,-236,71,-101,71,-96,71,-31,-34,-71,-345,-70,-345,-12,71,-11,-254,-253,-251,71,-237,-84,-250,-238,71,-64,71,71,-345,71,-33,-32,-36,-35,-345,-219,-63,-249,-252,-241,71,-239,-11,71,71,-240,-72,71,71,-345,-245,-244,-242,-73,71,71,-246,-243,71,-248,-74,-247,-75,]),'PPHASH':([0,17,21,23,26,35,37,40,50,58,77,78,119,195,284,307,471,],[26,-114,26,-118,-117,-110,-115,-113,-116,-112,-111,-119,-124,-120,-344,-121,-238,]),'INT':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[27,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,27,-89,-118,-154,-257,-117,-146,-345,-151,-345,27,-153,-139,-110,-137,-115,-150,-113,27,-160,-88,-141,-90,-158,-157,-143,-116,27,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,27,-190,-343,-189,27,-52,-111,-119,-9,-127,-10,-128,-131,-133,27,-130,-132,-135,27,-125,27,27,-174,-173,27,-203,-124,-129,-53,-54,-61,27,27,27,27,-120,27,-126,27,27,27,-171,-183,-180,27,27,-107,-204,-30,27,27,-91,27,-92,27,27,27,27,-344,-191,-345,-345,27,-121,-99,-102,-98,-100,27,-104,-235,-83,-234,-103,-105,-236,-101,27,27,27,-175,-181,-172,-169,-170,-96,27,27,27,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,27,-251,-237,-84,-250,-238,-177,-176,-182,-64,27,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'SIGNED':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[29,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,29,-89,-118,-154,-257,-117,-146,-345,-151,-345,29,-153,-139,-110,-137,-115,-150,-113,29,-160,-88,-141,-90,-158,-157,-143,-116,29,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,29,-190,-343,-189,29,-52,-111,-119,-9,-127,-10,-128,-131,-133,29,-130,-132,-135,29,-125,29,29,-174,-173,29,-203,-124,-129,-53,-54,-61,29,29,29,29,-120,29,-126,29,29,29,-171,-183,-180,29,29,-107,-204,-30,29,29,-91,29,-92,29,29,29,29,-344,-191,-345,-345,29,-121,-99,-102,-98,-100,29,-104,-235,-83,-234,-103,-105,-236,-101,29,29,29,-175,-181,-172,-169,-170,-96,29,29,29,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,29,-251,-237,-84,-250,-238,-177,-176,-182,-64,29,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'CONTINUE':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,324,-344,-99,-102,-98,-100,324,-104,-235,-83,-234,-103,-105,-236,324,-101,-96,-254,-253,-251,324,-237,-84,-250,-238,324,-249,-252,-241,324,-239,324,-240,-72,324,324,-245,-244,-242,-73,324,324,-246,-243,324,-248,-74,-247,-75,]),'NOT':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,141,-343,-345,-119,-28,-203,-27,-124,141,-94,-304,-303,141,141,-301,-305,141,-93,-306,141,-302,141,141,-28,-345,-345,141,141,141,141,-204,-263,-266,-264,-260,-261,-265,-267,141,-269,-270,-262,-268,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,141,-344,141,-302,141,141,141,-28,-345,-345,-99,-102,-98,141,-100,141,141,-104,-235,-83,-234,-103,-105,-236,141,-101,141,141,141,-96,141,-345,141,-302,-302,141,141,-12,141,141,-11,-254,-253,141,-251,141,141,141,-237,141,-84,-250,-238,141,141,141,-345,141,141,141,-28,-345,-302,141,-345,-219,-249,-252,141,-241,141,-239,-11,-302,141,141,141,141,141,-240,141,-72,141,141,141,-345,141,141,-245,-244,-242,141,141,-73,141,141,-246,-243,141,-248,141,-74,-247,-75,]),'OREQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,225,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'MOD':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,281,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,281,281,281,281,281,281,281,281,281,281,-276,-275,281,281,281,281,281,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'RSHIFT':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,263,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,263,-281,-279,263,263,263,-278,263,263,-276,-275,263,263,263,263,263,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'DEFAULT':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,326,-344,-99,-102,-98,-100,326,-104,-235,-83,-234,-103,-105,-236,326,-101,-96,-254,-253,-251,326,-237,-84,-250,-238,326,-249,-252,-241,326,-239,326,-240,-72,326,326,-245,-244,-242,-73,326,326,-246,-243,326,-248,-74,-247,-75,]),'CHAR':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[8,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,8,-89,-118,-154,-257,-117,-146,-345,-151,-345,8,-153,-139,-110,-137,-115,-150,-113,8,-160,-88,-141,-90,-158,-157,-143,-116,8,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,8,-190,-343,-189,8,-52,-111,-119,-9,-127,-10,-128,-131,-133,8,-130,-132,-135,8,-125,8,8,-174,-173,8,-203,-124,-129,-53,-54,-61,8,8,8,8,-120,8,-126,8,8,8,-171,-183,-180,8,8,-107,-204,-30,8,8,-91,8,-92,8,8,8,8,-344,-191,-345,-345,8,-121,-99,-102,-98,-100,8,-104,-235,-83,-234,-103,-105,-236,-101,8,8,8,-175,-181,-172,-169,-170,-96,8,8,8,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,8,-251,-237,-84,-250,-238,-177,-176,-182,-64,8,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'WHILE':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,470,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,327,-344,-99,-102,-98,-100,327,-104,-235,-83,-234,-103,-105,-236,327,-101,-96,-254,-253,-251,327,-237,-84,-250,536,-238,327,-249,-252,-241,327,-239,327,-240,-72,327,327,-245,-244,-242,-73,327,327,-246,-243,327,-248,-74,-247,-75,]),'DIVEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,216,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'EXTERN':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[34,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,34,-89,-118,-154,-257,-117,-146,34,-151,34,34,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,34,-86,-136,-29,-112,-155,-148,34,-345,-62,-345,34,-190,-343,-189,34,-52,-111,-119,-131,-133,34,-130,-132,-135,34,-125,34,-174,-173,-124,-53,-54,-61,34,34,-120,34,-126,-30,-91,-92,34,34,-344,-191,-345,-345,34,-121,-99,-102,-98,-100,34,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,34,34,34,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,34,-251,-237,-84,-250,-238,-177,-176,-64,34,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'__ASM__':([23,71,78,119,196,284,294,295,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,438,439,454,455,458,459,464,467,468,471,472,525,526,529,531,537,551,552,555,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,328,-344,328,328,-99,-102,-98,-100,328,-104,-235,-83,-234,-103,-105,-236,328,-101,-96,328,328,-254,-253,-251,328,-237,-84,-250,-238,328,-249,-252,-241,328,-239,328,328,328,328,-240,-72,328,328,-245,-244,-242,-73,328,328,-246,-243,328,-248,-74,-247,-75,]),'CASE':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,329,-344,-99,-102,-98,-100,329,-104,-235,-83,-234,-103,-105,-236,329,-101,-96,-254,-253,-251,329,-237,-84,-250,-238,329,-249,-252,-241,329,-239,329,-240,-72,329,329,-245,-244,-242,-73,329,329,-246,-243,329,-248,-74,-247,-75,]),'LAND':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,276,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,276,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'REGISTER':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[36,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,36,-89,-118,-154,-257,-117,-146,36,-151,36,36,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,36,-86,-136,-29,-112,-155,-148,36,-345,-62,-345,36,-190,-343,-189,36,-52,-111,-119,-131,-133,36,-130,-132,-135,36,-125,36,-174,-173,-124,-53,-54,-61,36,36,-120,36,-126,-30,-91,-92,36,36,-344,-191,-345,-345,36,-121,-99,-102,-98,-100,36,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,36,36,36,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,36,-251,-237,-84,-250,-238,-177,-176,-64,36,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'MODEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,218,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'NE':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,268,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,268,-281,-279,-283,-287,-282,-278,-285,268,-276,-275,-284,268,-286,268,268,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'SWITCH':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,332,-344,-99,-102,-98,-100,332,-104,-235,-83,-234,-103,-105,-236,332,-101,-96,-254,-253,-251,332,-237,-84,-250,-238,332,-249,-252,-241,332,-239,332,-240,-72,332,332,-245,-244,-242,-73,332,332,-246,-243,332,-248,-74,-247,-75,]),'ASM':([23,71,78,119,196,284,294,295,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,438,439,454,455,458,459,464,467,468,471,472,525,526,529,531,537,551,552,555,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,341,-344,341,341,-99,-102,-98,-100,341,-104,-235,-83,-234,-103,-105,-236,341,-101,-96,341,341,-254,-253,-251,341,-237,-84,-250,-238,341,-249,-252,-241,341,-239,341,341,341,341,-240,-72,341,341,-245,-244,-242,-73,341,341,-246,-243,341,-248,-74,-247,-75,]),'__REAL__':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,149,-343,-345,-119,-28,-203,-27,-124,149,-94,-304,-303,149,149,-301,-305,149,-93,-306,149,-302,149,149,-28,-345,-345,149,149,149,149,-204,-263,-266,-264,-260,-261,-265,-267,149,-269,-270,-262,-268,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,149,-344,149,-302,149,149,149,-28,-345,-345,-99,-102,-98,149,-100,149,149,-104,-235,-83,-234,-103,-105,-236,149,-101,149,149,149,-96,149,-345,149,-302,-302,149,149,-12,149,149,-11,-254,-253,149,-251,149,149,149,-237,149,-84,-250,-238,149,149,149,-345,149,149,149,-28,-345,-302,149,-345,-219,-249,-252,149,-241,149,-239,-11,-302,149,149,149,149,149,-240,149,-72,149,149,149,-345,149,149,-245,-244,-242,149,149,-73,149,149,-246,-243,149,-248,149,-74,-247,-75,]),'_COMPLEX':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[39,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,39,-89,-118,-154,-257,-117,-146,-345,-151,-345,39,-153,-139,-110,-137,-115,-150,-113,39,-160,-88,-141,-90,-158,-157,-143,-116,39,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,39,-190,-343,-189,39,-52,-111,-119,-9,-127,-10,-128,-131,-133,39,-130,-132,-135,39,-125,39,39,-174,-173,39,-203,-124,-129,-53,-54,-61,39,39,39,39,-120,39,-126,39,39,39,-171,-183,-180,39,39,-107,-204,-30,39,39,-91,39,-92,39,39,39,39,-344,-191,-345,-345,39,-121,-99,-102,-98,-100,39,-104,-235,-83,-234,-103,-105,-236,-101,39,39,39,-175,-181,-172,-169,-170,-96,39,39,39,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,39,-251,-237,-84,-250,-238,-177,-176,-182,-64,39,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'PPPRAGMASTR':([23,],[78,]),'PLUSEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,221,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'STRUCT':([0,10,11,13,14,15,16,17,21,22,23,26,28,30,34,35,36,37,40,41,42,43,44,45,46,50,51,52,54,57,58,63,65,67,68,69,71,75,76,77,78,79,80,81,82,90,107,108,110,113,116,119,120,122,123,124,143,151,187,195,196,197,198,199,200,202,203,204,206,207,209,228,230,246,247,250,251,284,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,351,367,372,393,396,423,424,427,428,429,430,454,455,457,458,464,467,468,471,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[59,-87,-69,-140,-159,-345,-138,-114,59,-89,-118,-117,-345,-345,-139,-110,-137,-115,-113,59,-160,-88,-141,-90,-158,-116,59,-86,-136,-29,-112,-345,-345,-62,-345,59,-343,59,-52,-111,-119,-9,-127,-10,-128,59,-125,59,59,59,-203,-124,-129,-53,-54,-61,59,59,59,-120,59,-126,59,59,59,-183,-180,59,-107,-204,-30,59,59,59,59,59,59,-344,-345,-345,59,-121,-99,-102,-98,-100,59,-104,-235,-83,-234,-103,-105,-236,-101,59,59,59,-181,-96,59,59,59,-31,-34,-71,-345,-70,-345,-254,-253,59,-251,-237,-84,-250,-238,-182,-64,59,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'CONDOP':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,279,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'BREAK':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,339,-344,-99,-102,-98,-100,339,-104,-235,-83,-234,-103,-105,-236,339,-101,-96,-254,-253,-251,339,-237,-84,-250,-238,339,-249,-252,-241,339,-239,339,-240,-72,339,339,-245,-244,-242,-73,339,339,-246,-243,339,-248,-74,-247,-75,]),'VOLATILE':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,122,123,124,143,162,173,174,186,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,315,316,319,321,328,331,333,334,335,336,337,338,340,341,343,345,348,349,350,351,352,353,359,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[42,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,42,-89,-118,-154,-257,-117,-146,42,-151,42,42,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,42,-86,-136,42,-29,-112,-155,-148,42,-345,-62,-345,42,-190,-343,-189,42,42,-52,-111,-119,-131,-133,42,-130,-132,-135,42,-125,42,-174,-173,42,42,-203,-124,-53,-54,-61,42,42,42,42,42,42,-120,42,-126,42,42,42,-171,-183,-180,42,42,-107,-204,-30,42,42,-91,42,-92,42,42,42,42,-344,-191,-345,-345,42,42,42,-121,-99,451,-102,-98,-100,451,42,-104,-235,-83,-234,-103,-105,-236,451,-101,42,42,42,-175,-181,-172,-169,-170,-96,42,42,42,42,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,42,-251,-237,-84,-250,-238,-177,-176,-182,-64,42,42,42,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'PPPRAGMA':([0,17,21,23,26,35,37,40,50,58,71,77,78,119,195,196,284,307,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[23,-114,23,-118,-117,-110,-115,-113,-116,-112,-343,-111,-119,-124,-120,23,-344,-121,-99,-102,-98,-100,23,-104,-235,-83,-234,-103,-105,-236,23,-101,-96,-254,-253,-251,23,-237,-84,-250,-238,23,-249,-252,-241,23,-239,23,-240,-72,23,23,-245,-244,-242,-73,23,23,-246,-243,23,-248,-74,-247,-75,]),'INLINE':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[44,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,44,-89,-118,-154,-257,-117,-146,44,-151,44,44,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,44,-86,-136,-29,-112,-155,-148,44,-345,-62,-345,44,-190,-343,-189,44,-52,-111,-119,-131,-133,44,-130,-132,-135,44,-125,44,-174,-173,-124,-53,-54,-61,44,44,-120,44,-126,-30,-91,-92,44,44,-344,-191,-345,-345,44,-121,-99,-102,-98,-100,44,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,44,44,44,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,44,-251,-237,-84,-250,-238,-177,-176,-64,44,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'INT_CONST_BIN':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,153,-343,-345,-119,-28,-203,-27,-124,153,-94,-304,-303,153,153,-301,-305,153,-93,-306,153,-302,153,153,-28,-345,-345,153,153,153,153,-204,-263,-266,-264,-260,-261,-265,-267,153,-269,-270,-262,-268,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,-344,153,-302,153,153,153,-28,-345,-345,-99,-102,-98,153,-100,153,153,-104,-235,-83,-234,-103,-105,-236,153,-101,153,153,153,-96,153,-345,153,-302,-302,153,153,-12,153,153,-11,-254,-253,153,-251,153,153,153,-237,153,-84,-250,-238,153,153,153,-345,153,153,153,-28,-345,-302,153,-345,-219,-249,-252,153,-241,153,-239,-11,-302,153,153,153,153,153,-240,153,-72,153,153,153,-345,153,153,-245,-244,-242,153,153,-73,153,153,-246,-243,153,-248,153,-74,-247,-75,]),'DO':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,342,-344,-99,-102,-98,-100,342,-104,-235,-83,-234,-103,-105,-236,342,-101,-96,-254,-253,-251,342,-237,-84,-250,-238,342,-249,-252,-241,342,-239,342,-240,-72,342,342,-245,-244,-242,-73,342,342,-246,-243,342,-248,-74,-247,-75,]),'__EXTENSION__':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,122,123,124,143,162,173,174,186,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[45,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,45,-89,-118,-154,-257,-117,-146,45,-151,45,45,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,45,-86,-136,45,-29,-112,-155,-148,45,-345,-62,-345,45,-190,-343,-189,45,45,-52,-111,-119,-131,-133,45,-130,-132,-135,45,-125,45,-174,-173,45,45,-203,-124,-53,-54,-61,45,45,45,45,45,45,-120,45,-126,45,45,45,-171,-183,-180,45,45,-107,-204,-30,45,45,-91,45,-92,45,45,45,45,-344,-191,-345,-345,45,45,45,-121,-99,-102,-98,-100,45,-104,-235,-83,-234,-103,-105,-236,-101,45,45,45,-175,-181,-172,-169,-170,-96,45,45,45,45,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,45,-251,-237,-84,-250,-238,-177,-176,-182,-64,45,45,45,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'LNOT':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,154,-343,-345,-119,-28,-203,-27,-124,154,-94,-304,-303,154,154,-301,-305,154,-93,-306,154,-302,154,154,-28,-345,-345,154,154,154,154,-204,-263,-266,-264,-260,-261,-265,-267,154,-269,-270,-262,-268,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,154,-344,154,-302,154,154,154,-28,-345,-345,-99,-102,-98,154,-100,154,154,-104,-235,-83,-234,-103,-105,-236,154,-101,154,154,154,-96,154,-345,154,-302,-302,154,154,-12,154,154,-11,-254,-253,154,-251,154,154,154,-237,154,-84,-250,-238,154,154,154,-345,154,154,154,-28,-345,-302,154,-345,-219,-249,-252,154,-241,154,-239,-11,-302,154,154,154,154,154,-240,154,-72,154,154,154,-345,154,154,-245,-244,-242,154,154,-73,154,154,-246,-243,154,-248,154,-74,-247,-75,]),'CONST':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,74,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,113,114,116,119,121,122,123,124,143,162,173,174,186,187,193,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,303,304,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,362,367,372,392,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,497,498,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[46,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,46,-89,-118,-154,-257,-117,-146,46,-151,46,46,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,46,-86,-136,46,-29,-112,-155,-148,46,-345,-62,-345,46,-190,-343,-189,46,46,-52,-111,-119,-131,-133,46,-130,-132,-135,46,-125,46,-174,-173,46,46,-203,-124,210,-53,-54,-61,46,46,46,46,46,46,210,-120,46,-126,46,46,46,-171,-183,-180,46,46,-107,-204,-30,46,46,-91,46,-92,46,46,46,46,-344,-191,-345,-345,46,46,46,-121,-99,-102,-98,-100,46,-104,-235,-83,-234,-103,-105,-236,-101,46,46,46,-175,-181,-172,-169,-170,210,-96,46,46,46,46,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,46,-251,-237,-84,-250,-238,-177,-176,-182,-64,46,46,46,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'LOR':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,264,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'CHAR_CONST':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,155,-343,-345,-119,-28,-203,-27,-124,155,-94,-304,-303,155,155,-301,-305,155,-93,-306,155,-302,155,155,-28,-345,-345,155,155,155,155,-204,-263,-266,-264,-260,-261,-265,-267,155,-269,-270,-262,-268,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,155,-344,155,-302,155,155,155,-28,-345,-345,-99,-102,-98,155,-100,155,155,-104,-235,-83,-234,-103,-105,-236,155,-101,155,155,155,-96,155,-345,155,-302,-302,155,155,-12,155,155,-11,-254,-253,155,-251,155,155,155,-237,155,-84,-250,-238,155,155,155,-345,155,155,155,-28,-345,-302,155,-345,-219,-249,-252,155,-241,155,-239,-11,-302,155,155,155,155,155,-240,155,-72,155,155,155,-345,155,155,-245,-244,-242,155,155,-73,155,155,-246,-243,155,-248,155,-74,-247,-75,]),'__ATTRIBUTE__':([0,1,2,4,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,87,88,90,91,94,95,99,105,107,110,111,112,114,115,116,117,119,122,123,124,162,185,187,195,196,197,207,208,209,232,239,250,251,253,254,257,284,286,294,295,297,298,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,384,389,393,396,418,419,423,424,427,428,429,430,438,439,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,511,512,515,516,524,525,526,529,537,551,552,555,557,558,559,560,567,569,579,580,583,584,585,589,591,593,597,598,599,600,605,612,613,615,617,618,620,],[47,-156,-142,47,-147,-144,-149,-87,-69,-145,-140,-159,47,-138,-114,-134,-152,47,-89,-118,-154,-257,-117,-146,47,-151,47,47,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,47,-86,-136,-345,-29,-112,-155,-148,47,47,-62,47,47,-190,-343,-189,47,-52,-111,-119,-131,-133,47,47,47,-37,-130,-132,-135,47,-125,47,-174,-173,-28,-201,-203,-27,-124,-53,-54,-61,47,47,47,-120,47,-126,-204,-202,-30,-91,-92,47,47,47,47,-45,-344,-191,-345,-345,47,-38,-121,-99,-102,-98,-100,47,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,47,47,47,47,47,-193,-192,-31,-34,-71,47,-70,47,-345,-345,-254,-253,47,-251,-237,-84,-250,-238,-177,-176,-64,47,-33,-32,-36,-35,-39,-42,47,47,-63,-249,-252,-241,-239,-345,-345,-345,-41,-40,-44,-43,-240,-72,-46,-49,47,47,47,-245,-244,-242,-48,-47,-51,-50,-73,-246,-243,-248,-74,-247,-75,]),'LSHIFT':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,265,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,265,-281,-279,265,265,265,-278,265,265,-276,-275,265,265,265,265,265,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'RBRACE':([23,71,78,113,119,126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,166,169,170,171,196,198,199,200,202,203,206,215,229,231,238,240,242,248,249,262,282,283,284,285,309,310,314,316,319,321,323,331,333,334,335,336,337,338,340,343,344,348,349,351,363,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,420,421,422,441,445,448,454,455,458,464,467,468,471,478,482,484,486,487,517,520,521,525,526,529,537,542,556,563,567,569,573,574,575,578,586,589,591,593,594,605,612,613,615,617,618,620,],[-118,-343,-119,-345,-124,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,-272,-258,-194,284,-197,-345,-345,-345,284,-183,-180,-107,-340,-299,-296,-342,-316,-315,-293,-298,-297,284,284,-344,-195,-345,-214,-99,-102,-98,-100,-5,-6,-104,-235,-83,-234,-103,-105,-236,-101,284,284,284,-181,-259,-96,-323,-314,-313,-312,-311,-310,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-196,-198,-271,284,-22,-21,-254,-253,-251,-237,-84,-250,-238,-182,-300,-294,-308,-309,-215,284,-217,-249,-252,-241,-239,284,-273,-216,-240,-72,284,-317,-324,-95,-218,-245,-244,-242,-318,-73,-246,-243,-248,-74,-247,-75,]),'_BOOL':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[49,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,49,-89,-118,-154,-257,-117,-146,-345,-151,-345,49,-153,-139,-110,-137,-115,-150,-113,49,-160,-88,-141,-90,-158,-157,-143,-116,49,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,49,-190,-343,-189,49,-52,-111,-119,-9,-127,-10,-128,-131,-133,49,-130,-132,-135,49,-125,49,49,-174,-173,49,-203,-124,-129,-53,-54,-61,49,49,49,49,-120,49,-126,49,49,49,-171,-183,-180,49,49,-107,-204,-30,49,49,-91,49,-92,49,49,49,49,-344,-191,-345,-345,49,-121,-99,-102,-98,-100,49,-104,-235,-83,-234,-103,-105,-236,-101,49,49,49,-175,-181,-172,-169,-170,-96,49,49,49,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,49,-251,-237,-84,-250,-238,-177,-176,-182,-64,49,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'LE':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,267,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,267,-281,-279,-283,267,-282,-278,-285,267,-276,-275,-284,267,267,267,267,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'SEMI':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,52,54,57,58,60,61,62,63,65,67,68,70,71,72,76,77,78,79,80,81,82,83,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,105,108,111,112,113,119,120,122,123,124,126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,159,164,165,166,185,188,194,195,196,198,199,200,201,202,203,205,206,209,215,229,231,232,238,239,240,242,248,249,262,284,286,294,295,298,299,300,301,307,308,310,311,312,314,316,318,319,320,321,323,324,325,331,333,334,335,336,337,338,339,340,342,343,346,348,349,350,351,352,353,355,356,357,358,359,360,363,366,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,422,423,424,427,428,429,430,438,439,453,454,455,456,457,458,459,464,465,467,468,471,472,474,475,476,478,480,482,484,486,487,507,508,509,510,511,512,515,516,517,524,525,526,527,528,529,531,537,539,540,556,557,558,559,560,563,564,565,566,567,569,570,572,574,575,578,587,589,591,593,594,605,606,607,610,612,613,614,615,617,618,620,],[50,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,50,-89,-118,-154,-257,-117,-146,-345,-151,-345,-345,-153,-139,-110,-137,-115,-150,-113,-345,-160,-88,-141,-90,-158,-157,-143,-116,-86,-136,-29,-112,-155,119,-148,-345,-345,-62,-345,-190,-343,-189,-52,-111,-119,-9,-127,-10,-128,-131,-20,-133,-345,-200,-199,-37,-163,-122,-130,-132,-19,-161,-165,-135,-167,-16,-123,-15,-345,-345,-174,-173,202,-124,-129,-53,-54,-61,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-255,-330,-272,-258,-345,-55,-199,-120,-345,202,202,202,-171,-183,-180,-345,-107,-30,-340,-299,-296,-91,-342,-92,-316,-315,-293,-298,-297,-344,-191,-345,-345,-38,-162,-57,-56,-121,-164,-214,-168,-166,-99,-102,454,-98,455,-100,-13,458,-14,-345,-104,-235,467,-234,-103,-97,468,-236,-345,-101,-330,202,202,-175,-181,-172,-169,-26,-25,478,-184,-170,-186,-259,-256,-96,-323,-314,-313,-312,-311,-310,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-193,-192,-271,-31,-34,-71,-345,-70,-345,-345,-345,525,-254,-253,526,-345,-251,-345,-237,-13,-84,-250,-238,-345,-177,-176,-188,-182,-64,-300,-294,-308,-309,-33,-32,-36,-35,-39,-42,-345,-345,-215,-63,-249,-252,564,-345,-241,-345,-239,-185,-187,-273,-41,-40,-44,-43,-216,-345,588,-345,-240,-72,-345,-345,-317,-324,-95,602,-245,-244,-242,-318,-73,612,-345,-345,-246,-243,-345,-248,-74,-247,-75,]),'__ATTRIBUTE':([0,1,2,4,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,55,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,87,88,90,91,94,95,99,105,107,110,111,112,114,115,116,117,119,122,123,124,162,185,187,195,196,197,207,208,209,232,239,250,251,253,254,257,284,286,294,295,297,298,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,384,389,393,396,418,419,423,424,427,428,429,430,438,439,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,511,512,515,516,524,525,526,529,537,551,552,555,557,558,559,560,567,569,579,580,583,584,585,589,591,593,597,598,599,600,605,612,613,615,617,618,620,],[3,-156,-142,3,-147,-144,-149,-87,-69,-145,-140,-159,3,-138,-114,-134,-152,3,-89,-118,-154,-257,-117,-146,3,-151,3,3,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,3,-86,-136,-345,-29,-112,-155,-148,3,3,-62,3,3,-190,-343,-189,3,-52,-111,-119,-131,-133,3,3,3,-37,-130,-132,-135,3,-125,3,-174,-173,-28,-201,-203,-27,-124,-53,-54,-61,3,3,3,-120,3,-126,-204,-202,-30,-91,-92,3,3,3,3,-45,-344,-191,-345,-345,3,-38,-121,-99,-102,-98,-100,3,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,3,3,3,3,3,-193,-192,-31,-34,-71,3,-70,3,-345,-345,-254,-253,3,-251,-237,-84,-250,-238,-177,-176,-64,3,-33,-32,-36,-35,-39,-42,3,3,-63,-249,-252,-241,-239,-345,-345,-345,-41,-40,-44,-43,-240,-72,-46,-49,3,3,3,-245,-244,-242,-48,-47,-51,-50,-73,-246,-243,-248,-74,-247,-75,]),'LT':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,269,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,269,-281,-279,-283,269,-282,-278,-285,269,-276,-275,-284,269,269,269,269,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'COMMA':([1,2,6,8,9,10,11,12,13,14,15,16,18,19,22,24,25,27,29,32,34,36,39,42,43,44,45,46,48,49,52,54,55,57,60,62,65,67,68,70,72,76,83,85,86,88,89,90,91,92,94,95,97,98,99,100,101,111,112,114,115,116,117,122,123,124,126,127,129,131,132,133,134,135,137,139,142,144,145,146,147,150,152,153,155,156,159,162,164,165,166,169,170,171,178,179,180,181,185,188,194,201,207,208,209,210,211,212,213,214,215,229,231,232,235,237,238,239,240,242,248,249,252,253,254,255,256,257,258,259,260,262,282,283,284,285,286,294,295,298,299,300,301,308,310,311,312,313,325,338,346,350,352,353,355,358,359,360,363,366,367,368,370,371,373,374,375,376,377,378,379,380,381,383,389,391,394,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,427,428,429,430,431,433,438,439,445,456,474,475,476,480,481,482,484,486,487,492,493,494,495,504,505,507,508,509,510,511,512,515,516,517,521,524,530,533,535,538,539,540,542,543,551,552,553,554,555,556,557,558,559,560,563,569,574,575,578,579,580,583,584,585,586,592,594,596,597,598,599,600,601,605,617,620,],[-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-134,-152,-89,-154,-257,-146,-151,-153,-139,-137,-150,-160,-88,-141,-90,-158,-157,-143,-86,-136,-345,-29,-155,-148,-345,-62,-345,-190,-189,-52,-131,183,-133,-345,-200,-199,-37,-163,-130,-132,-161,-165,-135,-167,192,-174,-173,-28,-201,-203,-27,-53,-54,-61,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,233,-339,-322,-320,-274,-307,-97,-334,-337,-295,-255,-345,-330,-272,-258,-194,285,-197,-207,296,297,-212,-345,-55,-199,-171,-204,-202,-30,-67,-65,362,-68,-106,-340,-299,-296,-91,233,-345,-342,-92,-316,-315,-293,-298,-211,-225,-345,-209,-1,-45,-210,-227,-2,-297,285,285,-344,-195,-191,-345,-345,-38,-162,-57,-56,-164,-214,-168,-166,362,233,-97,-330,-175,-172,-169,477,-184,-170,-186,-259,-256,-96,-323,-224,-225,-314,-313,-312,-311,233,-328,-310,488,489,491,-345,-226,-58,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,233,-289,-277,-193,-192,-196,-198,-271,-31,-34,-71,-345,-70,-345,-213,-208,-345,-345,520,233,-177,-176,-188,-64,-66,-300,-294,-308,-309,-233,-228,-59,-60,-230,-232,-33,-32,-36,-35,-39,-42,-345,-345,-215,-217,-63,233,488,233,233,-185,-187,573,-329,-345,-345,-229,-231,-345,-273,-41,-40,-44,-43,-216,-72,-317,-324,-95,-46,-49,-345,-345,-345,-218,233,-318,233,-48,-47,-51,-50,-85,-73,-74,-75,]),'__INLINE':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[52,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,52,-89,-118,-154,-257,-117,-146,52,-151,52,52,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,52,-86,-136,-29,-112,-155,-148,52,-345,-62,-345,52,-190,-343,-189,52,-52,-111,-119,-131,-133,52,-130,-132,-135,52,-125,52,-174,-173,-124,-53,-54,-61,52,52,-120,52,-126,-30,-91,-92,52,52,-344,-191,-345,-345,52,-121,-99,-102,-98,-100,52,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,52,52,52,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,52,-251,-237,-84,-250,-238,-177,-176,-64,52,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'OFFSETOF':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,157,-343,-345,-119,-28,-203,-27,-124,157,-94,-304,-303,157,157,-301,-305,157,-93,-306,157,-302,157,157,-28,-345,-345,157,157,157,157,-204,-263,-266,-264,-260,-261,-265,-267,157,-269,-270,-262,-268,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,157,-344,157,-302,157,157,157,-28,-345,-345,-99,-102,-98,157,-100,157,157,-104,-235,-83,-234,-103,-105,-236,157,-101,157,157,157,-96,157,-345,157,-302,-302,157,157,-12,157,157,-11,-254,-253,157,-251,157,157,157,-237,157,-84,-250,-238,157,157,157,-345,157,157,157,-28,-345,-302,157,-345,-219,-249,-252,157,-241,157,-239,-11,-302,157,157,157,157,157,-240,157,-72,157,157,157,-345,157,157,-245,-244,-242,157,157,-73,157,157,-246,-243,157,-248,157,-74,-247,-75,]),'UNION':([0,10,11,13,14,15,16,17,21,22,23,26,28,30,34,35,36,37,40,41,42,43,44,45,46,50,51,52,54,57,58,63,65,67,68,69,71,75,76,77,78,79,80,81,82,90,107,108,110,113,116,119,120,122,123,124,143,151,187,195,196,197,198,199,200,202,203,204,206,207,209,228,230,246,247,250,251,284,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,351,367,372,393,396,423,424,427,428,429,430,454,455,457,458,464,467,468,471,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[20,-87,-69,-140,-159,-345,-138,-114,20,-89,-118,-117,-345,-345,-139,-110,-137,-115,-113,20,-160,-88,-141,-90,-158,-116,20,-86,-136,-29,-112,-345,-345,-62,-345,20,-343,20,-52,-111,-119,-9,-127,-10,-128,20,-125,20,20,20,-203,-124,-129,-53,-54,-61,20,20,20,-120,20,-126,20,20,20,-183,-180,20,-107,-204,-30,20,20,20,20,20,20,-344,-345,-345,20,-121,-99,-102,-98,-100,20,-104,-235,-83,-234,-103,-105,-236,-101,20,20,20,-181,-96,20,20,20,-31,-34,-71,-345,-70,-345,-254,-253,20,-251,-237,-84,-250,-238,-182,-64,20,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'TYPEDEF':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[13,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,13,-89,-118,-154,-257,-117,-146,13,-151,13,13,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,13,-86,-136,-29,-112,-155,-148,13,-345,-62,-345,13,-190,-343,-189,13,-52,-111,-119,-131,-133,13,-130,-132,-135,13,-125,13,-174,-173,-124,-53,-54,-61,13,13,-120,13,-126,-30,-91,-92,13,13,-344,-191,-345,-345,13,-121,-99,-102,-98,-100,13,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,13,13,13,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,13,-251,-237,-84,-250,-238,-177,-176,-64,13,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'XOR':([126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,164,165,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-330,272,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-280,272,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,272,-286,-288,272,-277,-300,-294,-308,-309,-317,-324,-95,-318,]),'AUTO':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,83,86,90,94,95,99,105,107,110,111,112,119,122,123,124,162,187,195,196,197,209,232,239,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,350,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[54,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,54,-89,-118,-154,-257,-117,-146,54,-151,54,54,-153,-139,-110,-137,-115,-150,-113,-160,-88,-141,-90,-158,-157,-143,-116,54,-86,-136,-29,-112,-155,-148,54,-345,-62,-345,54,-190,-343,-189,54,-52,-111,-119,-131,-133,54,-130,-132,-135,54,-125,54,-174,-173,-124,-53,-54,-61,54,54,-120,54,-126,-30,-91,-92,54,54,-344,-191,-345,-345,54,-121,-99,-102,-98,-100,54,-104,-235,-83,-234,-103,-105,-236,-101,-175,-96,54,54,54,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,54,-251,-237,-84,-250,-238,-177,-176,-64,54,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'__BUILTIN_TYPES_COMPATIBLE_P':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,130,136,138,140,141,143,149,154,158,161,163,172,173,174,186,190,191,193,196,207,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,160,-343,-345,-119,-28,-203,-27,-124,160,-94,-304,-303,160,160,-301,-305,160,-93,-306,160,-302,160,160,-28,-345,-345,160,160,160,160,-204,-263,-266,-264,-260,-261,-265,-267,160,-269,-270,-262,-268,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,160,-344,160,-302,160,160,160,-28,-345,-345,-99,-102,-98,160,-100,160,160,-104,-235,-83,-234,-103,-105,-236,160,-101,160,160,160,-96,160,-345,160,-302,-302,160,160,-12,160,160,-11,-254,-253,160,-251,160,160,160,-237,160,-84,-250,-238,160,160,160,-345,160,160,160,-28,-345,-302,160,-345,-219,-249,-252,160,-241,160,-239,-11,-302,160,160,160,160,160,-240,160,-72,160,160,160,-345,160,160,-245,-244,-242,160,160,-73,160,160,-246,-243,160,-248,160,-74,-247,-75,]),'TIMES':([0,1,2,6,8,9,10,11,12,13,14,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,52,54,55,56,58,60,62,63,69,70,71,72,74,77,78,79,80,81,82,83,84,86,94,95,99,105,108,111,112,114,115,116,117,119,120,121,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,143,144,145,146,147,149,150,152,153,154,155,156,158,161,162,163,164,165,172,173,174,183,186,190,191,192,193,195,196,201,205,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,237,238,239,240,242,244,245,247,248,249,251,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,286,287,290,292,293,302,303,304,307,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,350,352,353,354,359,362,367,368,369,372,373,374,375,376,379,392,395,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,418,419,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,474,475,477,479,480,482,484,485,486,487,488,490,496,497,498,502,506,520,523,524,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[55,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-138,-114,-134,-152,55,-89,-118,-154,-257,-117,-146,-345,-151,-345,55,-153,-139,-110,-137,-115,-150,-113,55,-160,-88,-141,-90,-158,-157,-143,-116,-86,-136,-345,55,-112,-155,-148,-345,161,-190,-343,-189,-345,-111,-119,-9,-127,-10,-128,-131,55,-133,-130,-132,-135,55,55,-174,-173,-28,55,-203,-27,-124,-129,161,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,-293,161,-341,161,-333,-301,-305,161,-339,-322,-320,-274,-93,-307,-97,-334,-306,-337,-295,161,-302,55,161,-330,274,290,-28,-345,55,-345,161,161,55,161,-120,161,-171,55,-204,-340,-263,-266,-264,-260,-261,-265,-267,161,-269,-270,-262,-268,161,-299,161,-296,-91,161,55,-342,-92,-316,-315,161,161,161,-293,-298,55,398,-297,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,161,-344,-191,161,-302,161,161,435,-28,-345,-121,-345,-99,-102,-98,161,-100,161,161,-104,-235,-83,-234,-103,-97,-236,161,-101,161,-330,-175,-172,-169,161,-170,161,-96,-323,161,55,-314,-313,-312,-311,-310,-345,502,-302,274,274,274,274,274,274,274,274,274,274,-276,-275,274,274,274,274,274,-277,-193,-192,-302,161,161,-12,161,161,-11,-254,-253,161,-251,161,161,161,-237,161,-84,-250,-238,161,161,-177,-176,55,161,-64,-300,-294,-345,-308,-309,161,161,548,-28,-345,-302,161,-345,-219,-63,-249,-252,161,-241,161,-239,-11,-302,161,161,161,161,161,-240,161,-72,161,161,161,-345,-317,-324,161,-95,161,-245,-244,-242,-318,161,161,-73,161,161,-246,-243,161,-248,161,-74,-247,-75,]),'LPAREN':([0,1,2,3,4,5,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,47,48,49,50,52,54,55,56,57,58,60,62,63,64,65,66,67,68,69,70,71,72,74,77,78,79,80,81,82,83,84,86,87,88,91,94,95,99,104,105,108,111,112,114,115,116,117,119,120,121,123,124,125,126,127,128,129,130,131,132,133,134,136,137,138,139,140,141,143,144,145,146,149,150,152,153,154,155,156,157,158,160,161,162,163,164,172,173,174,183,184,185,186,190,191,192,193,195,196,201,205,207,208,209,215,216,217,218,219,220,221,222,223,224,225,226,227,228,230,232,233,237,238,239,240,242,244,245,247,251,253,254,257,259,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,286,287,290,292,293,294,295,298,300,302,303,304,307,309,314,315,316,319,320,321,322,327,328,329,330,331,332,333,334,335,336,337,338,340,341,342,343,345,346,347,350,352,353,354,359,362,367,368,369,371,372,373,374,375,376,379,384,389,390,391,392,395,398,418,419,423,424,427,428,429,430,435,436,437,438,439,440,444,446,448,450,451,452,454,455,457,458,459,460,461,463,464,466,467,468,469,471,472,473,474,475,477,479,480,485,486,487,488,490,492,493,495,496,497,498,502,504,505,506,507,508,509,510,511,512,515,516,520,523,524,525,526,528,529,531,536,537,541,548,549,550,551,552,553,554,555,557,558,559,560,562,564,566,567,568,569,570,571,572,573,574,575,577,578,579,580,583,584,585,588,589,591,593,594,597,598,599,600,601,602,604,605,607,610,612,613,614,615,616,617,618,620,],[56,-156,-142,64,56,69,-147,-144,-149,-87,-69,-145,-140,-159,75,-138,-114,-134,-152,56,-89,-118,-154,-257,-117,-146,-345,-151,-345,84,-153,-139,-110,-137,-115,-150,-113,56,-160,-88,-141,-90,-158,104,-157,-143,-116,-86,-136,-345,56,-29,-112,-155,-148,-345,121,75,56,-62,-345,143,-190,-343,-189,-345,-111,-119,-9,-127,-10,-128,-131,84,-133,84,187,-37,-130,-132,-135,193,84,56,-174,-173,-28,-201,-203,-27,-124,-129,143,75,-61,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,228,-341,230,-333,-301,-305,143,-339,-322,-320,-93,-307,-97,-334,-306,-337,245,246,247,250,-302,251,230,-330,143,-28,-345,84,84,187,-345,143,143,84,143,-120,345,-171,84,-204,-202,-30,-340,-263,-266,-264,-260,-261,-265,-267,143,-269,-270,-262,-268,143,143,-91,143,372,-342,-92,-316,-315,143,143,143,251,251,393,-45,396,143,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,143,247,247,-344,-191,247,-302,143,143,-345,-345,-38,187,143,-28,-345,-121,-345,-99,-345,-102,-98,143,-100,457,460,-345,247,463,345,466,-104,-235,-83,-234,-103,-97,-236,-345,345,-101,143,-330,473,-175,-172,-169,247,-170,143,-96,-323,247,372,372,-314,-313,-312,-311,-310,251,393,56,396,-345,143,-302,-193,-192,-31,-34,-71,-345,-70,-345,-302,143,143,-345,-345,-12,247,143,-11,-77,-79,-80,-254,-253,143,-251,345,143,-76,143,-237,143,-84,-250,-78,-238,345,143,-177,-176,84,247,-64,-345,-308,-309,143,247,-233,-228,393,143,-28,-345,-302,-230,-232,247,-33,-32,-36,-35,-39,-42,-345,-345,-345,-219,-63,-249,-252,143,-241,345,571,-239,-11,-302,143,143,-345,-345,-229,-231,-345,-41,-40,-44,-43,143,143,345,-240,143,-72,345,143,345,-345,-317,-324,143,-95,-46,-49,-345,-345,-345,143,-245,-244,-242,-318,-48,-47,-51,-50,-85,143,143,-73,345,345,-246,-243,345,-248,143,-74,-247,-75,]),'MINUSMINUS':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,126,127,128,129,130,131,132,133,134,136,137,138,139,140,141,143,144,145,146,149,150,152,153,154,155,156,158,161,163,164,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,238,240,242,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,346,354,362,367,368,369,373,374,375,376,379,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,486,487,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,574,575,577,578,588,589,591,593,594,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,163,-343,-345,-119,-28,-203,-27,-124,163,-94,-338,-335,-304,-321,-303,-331,-336,-332,-319,163,-341,163,-333,-301,-305,163,-339,-322,-320,-93,-307,-97,-334,-306,-337,240,163,-302,163,-330,163,-28,-345,-345,163,163,163,163,-204,-340,-263,-266,-264,-260,-261,-265,-267,163,-269,-270,-262,-268,163,163,163,-342,-316,-315,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,163,-344,163,-302,163,163,163,-28,-345,-345,-99,-102,-98,163,-100,163,163,-104,-235,-83,-234,-103,-97,-236,163,-101,163,-330,163,163,-96,-323,163,-314,-313,-312,-311,-310,-345,163,-302,-302,163,163,-12,163,163,-11,-254,-253,163,-251,163,163,163,-237,163,-84,-250,-238,163,163,163,-345,-308,-309,163,163,163,-28,-345,-302,163,-345,-219,-249,-252,163,-241,163,-239,-11,-302,163,163,163,163,163,-240,163,-72,163,163,163,-345,-317,-324,163,-95,163,-245,-244,-242,-318,163,163,-73,163,163,-246,-243,163,-248,163,-74,-247,-75,]),'ID':([0,1,2,4,6,7,8,9,10,11,12,13,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,52,53,54,55,56,58,59,60,62,63,66,67,68,69,70,71,72,73,74,75,77,78,79,80,81,82,83,84,86,87,94,95,99,105,108,111,112,114,115,116,117,119,120,121,124,125,128,130,136,138,140,141,143,149,154,158,161,162,163,167,168,172,173,174,183,184,186,187,190,191,192,193,195,196,201,205,207,208,216,217,218,219,220,221,222,223,224,225,226,227,228,230,232,233,239,241,243,244,245,247,251,253,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,285,286,287,290,292,293,296,302,303,304,307,309,314,316,317,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,350,352,353,354,359,362,367,369,384,390,392,393,395,398,418,419,435,436,437,440,443,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,474,475,477,479,480,485,488,489,490,496,497,498,502,506,520,523,524,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,576,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[57,-156,-142,57,-147,72,-144,-149,-87,-69,-145,-140,-159,-138,-114,-134,-152,-179,57,-89,-118,-154,-257,-117,-146,-345,-151,-345,57,-153,-139,-110,-137,-115,-150,-113,57,-160,-88,-141,-90,-158,-157,-143,-116,-86,112,-136,-345,57,-112,-178,-155,-148,-345,57,-62,-345,164,-190,-343,-189,171,-345,164,-111,-119,-9,-127,-10,-128,-131,57,-133,57,-130,-132,-135,57,57,-174,-173,-28,-201,-203,-27,-124,-129,164,-61,-94,-304,-303,164,164,-301,-305,164,-93,-306,164,-302,57,164,171,171,164,-28,-345,57,57,-345,164,164,164,57,164,-120,346,-171,57,-204,-202,-263,-266,-264,-260,-261,-265,-267,164,-269,-270,-262,-268,164,164,-91,164,-92,374,376,164,164,164,57,57,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,164,-344,171,-191,164,-302,164,164,164,164,-28,-345,-121,-345,-99,-102,453,-98,164,-100,164,346,-104,-235,-83,-234,-103,-105,-236,346,-101,164,-175,-172,-169,164,-170,164,-96,164,57,57,-345,164,164,-302,-193,-192,-302,164,164,-12,164,164,164,-11,-254,-253,164,-251,346,164,164,-237,164,-84,-250,-238,346,164,-177,-176,57,164,-64,-345,164,164,164,164,-28,-345,-302,164,-345,-219,-63,-249,-252,164,-241,346,-239,-11,-302,164,164,164,164,346,-240,164,-72,346,164,346,-345,164,164,164,-245,-244,-242,164,164,-73,346,346,-246,-243,346,-248,164,-74,-247,-75,]),'IF':([23,71,78,119,196,284,314,316,319,321,331,333,334,335,336,337,338,340,342,343,367,454,455,458,459,464,467,468,471,472,525,526,529,531,537,566,567,569,570,572,589,591,593,605,607,610,612,613,614,615,617,618,620,],[-118,-343,-119,-124,347,-344,-99,-102,-98,-100,347,-104,-235,-83,-234,-103,-105,-236,347,-101,-96,-254,-253,-251,347,-237,-84,-250,-238,347,-249,-252,-241,347,-239,347,-240,-72,347,347,-245,-244,-242,-73,347,347,-246,-243,347,-248,-74,-247,-75,]),'STRING_LITERAL':([14,22,23,42,43,45,46,69,71,74,78,114,116,117,119,121,125,128,129,130,136,138,140,141,143,144,149,154,158,161,163,172,173,174,186,190,191,193,196,207,215,216,217,218,219,220,221,222,223,224,225,226,227,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,284,287,290,292,293,302,303,304,309,314,316,319,320,321,329,331,333,334,335,336,337,338,340,342,343,345,354,362,367,369,392,395,398,435,436,437,440,444,446,448,454,455,457,458,459,460,463,464,466,467,468,471,472,473,479,485,488,490,496,497,498,502,506,520,523,525,526,528,529,531,537,541,548,549,550,562,564,566,567,568,569,570,571,572,573,577,588,589,591,593,602,604,605,607,610,612,613,614,615,616,617,618,620,],[-159,-89,-118,-160,-88,-90,-158,144,-343,-345,-119,-28,-203,-27,-124,144,-94,-304,215,-303,144,144,-301,-305,144,-339,-93,-306,144,-302,144,144,-28,-345,-345,144,144,144,144,-204,-340,-263,-266,-264,-260,-261,-265,-267,144,-269,-270,-262,-268,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,-344,144,-302,144,144,144,-28,-345,-345,-99,-102,-98,144,-100,144,144,-104,-235,-83,-234,-103,-105,-236,144,-101,144,144,144,-96,144,-345,144,-302,-302,144,144,-12,144,144,-11,-254,-253,144,-251,144,144,144,-237,144,-84,-250,-238,144,144,144,-345,144,144,144,-28,-345,-302,144,-345,-219,-249,-252,144,-241,144,-239,-11,-302,144,144,144,144,144,-240,144,-72,144,144,144,-345,144,144,-245,-244,-242,144,144,-73,144,144,-246,-243,144,-248,144,-74,-247,-75,]),'FLOAT':([0,1,2,6,8,9,10,11,12,13,14,15,16,17,18,19,21,22,23,24,25,26,27,28,29,30,31,32,34,35,36,37,39,40,41,42,43,44,45,46,48,49,50,51,52,54,57,58,60,62,63,65,67,68,69,70,71,72,75,76,77,78,79,80,81,82,83,86,90,94,95,99,105,107,108,110,111,112,113,116,119,120,122,123,124,143,151,162,187,195,196,197,198,199,200,201,202,203,204,205,206,207,209,228,230,232,237,239,246,247,250,251,284,286,294,295,297,307,314,316,319,321,331,333,334,335,336,337,338,340,343,345,348,349,350,351,352,353,359,367,372,393,396,418,419,423,424,427,428,429,430,454,455,457,458,464,467,468,471,474,475,478,480,491,507,508,509,510,524,525,526,529,537,567,569,589,591,593,605,612,613,615,617,618,620,],[62,-156,-142,-147,-144,-149,-87,-69,-145,-140,-159,-345,-138,-114,-134,-152,62,-89,-118,-154,-257,-117,-146,-345,-151,-345,62,-153,-139,-110,-137,-115,-150,-113,62,-160,-88,-141,-90,-158,-157,-143,-116,62,-86,-136,-29,-112,-155,-148,-345,-345,-62,-345,62,-190,-343,-189,62,-52,-111,-119,-9,-127,-10,-128,-131,-133,62,-130,-132,-135,62,-125,62,62,-174,-173,62,-203,-124,-129,-53,-54,-61,62,62,62,62,-120,62,-126,62,62,62,-171,-183,-180,62,62,-107,-204,-30,62,62,-91,62,-92,62,62,62,62,-344,-191,-345,-345,62,-121,-99,-102,-98,-100,62,-104,-235,-83,-234,-103,-105,-236,-101,62,62,62,-175,-181,-172,-169,-170,-96,62,62,62,-193,-192,-31,-34,-71,-345,-70,-345,-254,-253,62,-251,-237,-84,-250,-238,-177,-176,-182,-64,62,-33,-32,-36,-35,-63,-249,-252,-241,-239,-240,-72,-245,-244,-242,-73,-246,-243,-248,-74,-247,-75,]),'XOREQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,220,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'LSHIFTEQUAL':([126,127,129,131,132,133,134,135,137,139,144,145,146,150,152,153,155,156,164,215,229,231,238,240,242,248,249,262,284,338,346,367,368,373,374,375,376,379,482,484,486,487,574,575,578,594,],[-338,-335,-321,-331,-336,-332,-319,222,-341,-333,-339,-322,-320,-307,-97,-334,-337,-295,-330,-340,-299,-296,-342,-316,-315,-293,-298,-297,-344,-97,-330,-96,-323,-314,-313,-312,-311,-310,-300,-294,-308,-309,-317,-324,-95,-318,]),'RBRACKET':([14,22,42,43,45,46,74,116,117,126,127,129,131,132,133,134,135,137,139,144,145,146,147,150,152,153,155,156,159,164,165,166,172,173,186,207,215,229,231,238,240,242,248,249,261,262,284,288,289,290,291,302,303,363,366,367,368,373,374,375,376,377,379,392,395,397,398,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,416,417,422,425,426,434,435,482,484,486,487,496,497,501,502,513,514,519,547,548,556,574,575,578,581,582,594,596,],[-159,-89,-160,-88,-90,-158,-345,-203,-27,-338,-335,-321,-331,-336,-332,-319,-293,-341,-333,-339,-322,-320,-274,-307,-97,-334,-337,-295,-255,-330,-272,-258,-345,-28,-345,-204,-340,-299,-296,-342,-316,-315,-293,-298,-345,-297,-344,423,-4,424,-3,-345,-28,-259,-256,-96,-323,-314,-313,-312,-311,486,-310,-345,-345,504,505,-280,-292,-281,-279,-283,-287,-282,-278,-285,-290,-276,-275,-284,-291,-286,-288,-289,-277,-271,507,508,511,512,-300,-294,-308,-309,-345,-28,553,554,557,558,561,579,580,-273,-317,-324,-95,597,598,-318,608,]),} + +_lr_action = {} +for _k, _v in _lr_action_items.items(): + for _x,_y in zip(_v[0],_v[1]): + if not _x in _lr_action: _lr_action[_x] = {} + _lr_action[_x][_k] = _y +del _lr_action_items + +_lr_goto_items = {'expression_statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[314,314,314,314,314,314,314,314,314,314,314,314,]),'asm_volatile':([315,328,341,],[450,461,469,]),'struct_or_union_specifier':([0,21,41,51,69,75,90,108,110,113,143,151,187,196,198,199,200,204,228,230,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,]),'init_declarator_list':([31,105,],[85,85,]),'init_declarator_list_opt':([31,105,],[93,93,]),'iteration_statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[316,316,316,316,316,316,316,316,316,316,316,316,]),'unified_string_literal':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,129,]),'assignment_expression_opt':([172,261,302,395,496,],[288,397,434,501,547,]),'brace_open':([7,53,70,72,109,111,112,143,189,190,191,196,228,230,247,331,342,345,369,446,459,472,482,483,490,531,562,566,570,572,607,610,614,],[73,113,167,168,196,198,199,196,196,309,309,196,196,196,196,196,196,196,485,309,196,196,485,485,485,196,309,196,196,196,196,196,196,]),'struct_declaration':([113,198,199,200,348,349,],[203,203,203,351,351,351,]),'typeid_noparen_declarator':([162,],[258,]),'type_qualifier_list_opt':([55,74,174,186,304,392,498,],[115,172,293,302,437,496,550,]),'declaration_specifiers_no_type_opt':([28,30,63,],[80,82,120,]),'expression_opt':([196,331,342,457,459,472,528,531,564,566,570,572,588,602,607,610,614,],[318,318,318,527,318,318,565,318,587,318,318,318,603,609,318,318,318,]),'designation':([309,485,520,573,],[440,440,440,440,]),'parameter_list':([75,187,251,372,393,396,],[180,180,180,180,180,180,]),'labeled_statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[319,319,319,319,319,319,319,319,319,319,319,319,]),'abstract_declarator':([162,237,251,372,],[260,260,388,388,]),'asm_no_semi':([196,294,295,331,342,438,439,459,472,531,551,552,555,566,570,572,607,610,614,],[335,427,427,335,335,427,427,335,335,335,427,427,427,335,335,335,335,335,335,]),'translation_unit':([0,],[21,]),'init_declarator':([31,105,183,192,],[97,97,299,312,]),'direct_abstract_declarator':([162,237,251,253,371,372,384,],[259,259,259,391,391,259,391,]),'attribute_decl':([0,4,15,21,28,30,31,51,63,65,68,69,75,87,88,90,105,110,162,185,187,196,250,251,253,254,297,331,372,384,389,393,396,428,430,457,491,515,516,583,584,585,],[11,68,68,11,11,11,11,11,11,68,68,11,11,68,68,11,11,11,11,68,11,11,11,11,68,68,11,11,11,68,68,11,11,68,68,11,11,68,68,68,68,68,]),'designator_list':([309,485,520,573,],[447,447,447,447,]),'identifier':([69,75,121,136,138,143,158,163,172,187,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,296,302,320,329,331,342,345,354,362,369,393,395,436,437,443,444,446,457,459,460,463,466,472,473,479,488,489,490,496,506,528,531,549,550,562,564,566,568,570,571,572,576,577,588,602,604,607,610,614,616,],[134,181,134,134,134,134,134,134,134,181,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,134,431,134,134,134,134,134,134,134,134,134,181,134,134,134,518,134,134,134,134,134,134,134,134,134,134,134,545,134,134,134,134,134,134,134,134,134,134,134,134,134,134,595,134,134,134,134,134,134,134,134,]),'offsetof_member_designator':([489,],[544,]),'unary_expression':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[135,135,229,231,135,248,262,135,135,135,135,135,135,135,135,135,135,135,135,135,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,248,135,248,248,248,135,135,135,135,248,135,135,135,248,135,248,135,135,135,248,135,135,135,135,135,135,135,135,248,135,248,135,248,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,]),'abstract_declarator_opt':([162,237,],[252,370,]),'initializer':([190,191,446,562,],[308,311,521,586,]),'direct_id_declarator':([0,4,21,31,41,56,66,84,87,105,108,162,183,184,192,205,251,253,384,390,477,],[15,65,15,15,15,15,123,15,65,15,15,15,15,123,15,15,15,65,65,123,15,]),'enumerator_list':([73,167,168,],[170,282,283,]),'pp_directive':([0,21,],[17,17,]),'declaration_list':([51,90,],[110,110,]),'id_init_declarator':([41,108,],[98,98,]),'type_specifier':([0,21,41,51,69,75,90,108,110,113,143,151,187,196,198,199,200,204,228,230,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[18,18,99,18,18,18,18,99,18,201,201,99,18,18,201,201,201,352,201,201,201,201,18,18,18,18,201,201,201,18,18,18,18,18,]),'compound_statement':([109,143,189,196,228,230,247,331,342,345,459,472,531,566,570,572,607,610,614,],[195,234,307,321,234,234,234,321,321,234,321,321,321,321,321,321,321,321,321,]),'pointer':([0,21,31,41,56,84,105,108,115,162,183,192,205,237,251,372,477,],[4,4,87,4,4,87,87,4,208,253,87,87,87,371,384,371,87,]),'attributes_opt':([4,15,65,68,87,88,185,253,254,384,389,428,430,515,516,583,584,585,],[66,76,122,124,184,188,301,390,394,66,494,509,510,559,560,599,600,601,]),'typeid_declarator':([31,84,105,183,192,205,477,],[89,182,89,89,89,89,89,]),'designator':([309,447,485,520,573,],[442,522,442,442,442,]),'id_init_declarator_list':([41,108,],[101,101,]),'declarator':([31,105,183,192,205,477,],[92,92,92,92,360,360,]),'argument_expression_list':([245,463,568,604,616,],[380,533,533,533,533,]),'struct_declarator_list_opt':([205,],[357,]),'block_item_list':([196,],[331,]),'parameter_type_list_opt':([251,372,396,],[387,387,503,]),'struct_declarator':([205,477,],[358,539,]),'type_qualifier':([0,21,28,30,31,51,55,63,69,74,75,90,105,110,113,114,143,162,173,174,186,187,196,198,199,200,204,205,228,230,237,246,247,250,251,297,303,304,331,345,348,349,372,392,393,396,457,491,497,498,],[28,28,28,28,94,28,116,28,28,116,28,28,94,28,116,207,116,94,207,116,116,28,28,116,116,116,207,359,116,116,359,116,116,28,28,28,207,116,28,116,116,116,28,116,28,28,28,28,207,116,]),'assignment_operator':([135,],[223,]),'expression':([69,143,196,228,230,244,247,279,320,331,342,345,457,459,460,466,472,473,528,531,564,566,570,571,572,577,588,602,607,610,614,],[142,235,325,235,235,377,235,415,456,325,325,235,325,325,530,535,325,538,325,325,325,325,325,592,325,596,325,325,325,325,325,]),'storage_class_specifier':([0,21,28,30,31,51,63,69,75,90,105,110,162,187,196,250,251,297,331,372,393,396,457,491,],[30,30,30,30,83,30,30,30,30,30,83,30,83,30,30,30,30,30,30,30,30,30,30,30,]),'unified_wstring_literal':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,145,]),'translation_unit_or_empty':([0,],[33,]),'initializer_list_opt':([309,],[441,]),'brace_close':([170,200,282,283,344,348,349,441,520,542,573,],[286,350,418,419,471,474,475,517,563,574,594,]),'direct_typeid_declarator':([31,84,87,105,183,184,192,205,477,],[88,88,185,88,88,300,88,88,88,]),'external_declaration':([0,21,],[35,77,]),'asm_keyword':([196,294,295,331,342,438,439,459,472,531,551,552,555,566,570,572,607,610,614,],[330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,]),'type_name':([143,228,230,246,247,345,],[236,364,365,381,382,236,]),'typedef_name':([0,21,41,51,69,75,90,108,110,113,143,151,187,196,198,199,200,204,228,230,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,]),'pppragma_directive':([0,21,196,331,342,459,472,531,566,570,572,607,610,614,],[37,37,333,333,333,333,333,333,333,333,333,333,333,333,]),'statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[334,334,470,529,537,567,589,591,593,613,615,618,]),'cast_expression':([69,121,143,158,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[147,147,147,249,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,484,147,147,147,147,147,147,147,147,147,147,147,147,147,147,484,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,]),'struct_declarator_list':([205,],[355,]),'empty':([0,4,15,28,30,31,41,51,55,63,65,68,74,75,87,88,90,105,108,113,162,172,174,185,186,187,196,198,199,205,237,251,253,254,261,294,295,302,304,309,315,328,331,341,342,372,384,389,392,393,395,396,428,430,438,439,457,459,463,472,485,496,498,515,516,520,528,531,551,552,555,564,566,568,570,572,573,583,584,585,588,602,604,607,610,614,616,],[38,67,67,79,79,96,103,106,117,79,67,67,117,176,67,67,106,96,103,206,256,291,117,67,117,176,323,206,206,356,256,385,67,67,291,429,429,291,117,448,452,452,465,452,465,385,67,67,117,176,291,385,67,67,429,429,465,465,534,465,541,291,117,67,67,541,465,465,429,429,429,465,465,534,465,465,541,67,67,67,465,465,534,465,465,465,534,]),'parameter_declaration':([69,75,187,250,251,297,372,393,396,491,],[148,178,178,383,178,433,178,178,178,546,]),'primary_expression':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,150,]),'declaration':([0,21,51,90,110,196,331,457,],[40,40,107,107,197,336,336,528,]),'declaration_specifiers_no_type':([0,21,28,30,51,63,69,75,90,110,187,196,250,251,297,331,372,393,396,457,491,],[41,41,81,81,108,81,151,151,108,108,151,108,151,151,151,108,151,151,151,108,151,]),'jump_statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[337,337,337,337,337,337,337,337,337,337,337,337,]),'gnu_statement_expression':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[152,152,152,152,152,152,152,152,152,152,152,338,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,152,338,338,152,152,152,152,152,152,152,152,152,152,338,152,152,152,338,152,152,152,152,152,152,152,338,152,152,152,152,338,152,338,152,338,152,152,152,152,338,338,338,152,]),'struct_declaration_list':([113,198,199,],[200,348,349,]),'block_item':([196,331,],[340,464,]),'constant_expression':([287,329,354,444,479,],[421,462,476,519,540,]),'identifier_list_opt':([75,187,393,],[175,305,499,]),'constant':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,146,]),'attribute':([121,193,362,],[211,211,481,]),'type_specifier_no_typeid':([0,21,31,41,51,69,75,90,105,108,110,113,143,151,162,187,196,198,199,200,204,205,228,230,237,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[48,48,86,48,48,48,48,48,86,48,48,48,48,48,86,48,48,48,48,48,48,353,48,48,353,48,48,48,48,48,48,48,48,48,48,48,48,48,48,]),'enumerator':([73,167,168,285,],[169,169,169,420,]),'asm_argument_expression_list':([463,568,604,616,],[532,590,611,619,]),'direct_typeid_noparen_declarator':([162,253,390,],[254,389,495,]),'id_declarator':([0,21,31,41,56,84,105,108,162,183,192,205,251,477,],[51,51,90,100,118,118,194,100,255,194,194,194,118,194,]),'selection_statement':([196,331,342,459,472,531,566,570,572,607,610,614,],[343,343,343,343,343,343,343,343,343,343,343,343,]),'attribute_list':([121,193,],[212,313,]),'postfix_expression':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,]),'initializer_list':([309,485,],[445,542,]),'unary_operator':([69,121,136,138,143,158,163,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,369,395,436,437,444,446,457,459,460,463,466,472,473,479,488,490,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,158,]),'struct_or_union':([0,21,41,51,69,75,90,108,110,113,143,151,187,196,198,199,200,204,228,230,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,53,]),'block_item_list_opt':([196,],[344,]),'assignment_expression':([69,121,143,172,190,191,193,196,223,228,230,233,244,245,247,261,279,292,293,302,320,331,342,345,362,395,436,437,446,457,459,460,463,466,472,473,488,496,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[159,213,159,289,310,310,213,159,363,159,159,366,159,378,159,289,159,425,426,289,159,159,159,159,213,289,513,514,310,159,159,159,378,159,159,159,543,289,159,159,581,582,310,159,159,378,159,159,159,159,159,159,378,159,159,159,378,]),'designation_opt':([309,485,520,573,],[446,446,562,562,]),'parameter_type_list':([75,187,251,372,393,396,],[177,306,386,386,500,386,]),'type_qualifier_list':([55,74,113,143,174,186,198,199,200,228,230,246,247,304,345,348,349,392,498,],[114,173,204,204,114,303,204,204,204,204,204,204,204,114,204,204,204,497,114,]),'asm_opt':([294,295,438,439,551,552,555,],[428,430,515,516,583,584,585,]),'id_init_declarator_list_opt':([41,108,],[102,102,]),'declaration_specifiers':([0,21,51,69,75,90,110,187,196,250,251,297,331,372,393,396,457,491,],[31,31,105,162,162,105,105,162,105,162,162,162,105,162,162,162,105,162,]),'identifier_list':([75,187,393,],[179,179,179,]),'declaration_list_opt':([51,90,],[109,189,]),'function_definition':([0,21,],[58,58,]),'binary_expression':([69,121,143,172,190,191,193,196,223,228,230,233,244,245,247,261,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,292,293,302,320,329,331,342,345,354,362,395,436,437,444,446,457,459,460,463,466,472,473,479,488,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,399,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,165,416,417,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,165,]),'enum_specifier':([0,21,41,51,69,75,90,108,110,113,143,151,187,196,198,199,200,204,228,230,246,247,250,251,297,331,345,348,349,372,393,396,457,491,],[60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,]),'decl_body':([0,21,51,90,110,196,331,457,],[61,61,61,61,61,61,61,61,]),'function_specifier':([0,21,28,30,31,51,63,69,75,90,105,110,162,187,196,250,251,297,331,372,393,396,457,491,],[63,63,63,63,95,63,63,63,63,63,95,63,95,63,63,63,63,63,63,63,63,63,63,63,]),'specifier_qualifier_list':([113,143,198,199,200,228,230,246,247,345,348,349,],[205,237,205,205,205,237,237,237,237,237,205,205,]),'conditional_expression':([69,121,143,172,190,191,193,196,223,228,230,233,244,245,247,261,279,287,292,293,302,320,329,331,342,345,354,362,395,436,437,444,446,457,459,460,463,466,472,473,479,488,496,506,528,531,549,550,562,564,566,568,570,571,572,577,588,602,604,607,610,614,616,],[166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,422,166,166,166,166,422,166,166,166,422,166,166,166,166,422,166,166,166,166,166,166,166,166,422,166,166,556,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,166,]),} + +_lr_goto = {} +for _k, _v in _lr_goto_items.items(): + for _x, _y in zip(_v[0], _v[1]): + if not _x in _lr_goto: _lr_goto[_x] = {} + _lr_goto[_x][_k] = _y +del _lr_goto_items +_lr_productions = [ + ("S' -> translation_unit_or_empty","S'",1,None,None,None), + ('abstract_declarator_opt -> empty','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',42), + ('abstract_declarator_opt -> abstract_declarator','abstract_declarator_opt',1,'p_abstract_declarator_opt','plyparser.py',43), + ('assignment_expression_opt -> empty','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',42), + ('assignment_expression_opt -> assignment_expression','assignment_expression_opt',1,'p_assignment_expression_opt','plyparser.py',43), + ('block_item_list_opt -> empty','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',42), + ('block_item_list_opt -> block_item_list','block_item_list_opt',1,'p_block_item_list_opt','plyparser.py',43), + ('declaration_list_opt -> empty','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',42), + ('declaration_list_opt -> declaration_list','declaration_list_opt',1,'p_declaration_list_opt','plyparser.py',43), + ('declaration_specifiers_no_type_opt -> empty','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',42), + ('declaration_specifiers_no_type_opt -> declaration_specifiers_no_type','declaration_specifiers_no_type_opt',1,'p_declaration_specifiers_no_type_opt','plyparser.py',43), + ('designation_opt -> empty','designation_opt',1,'p_designation_opt','plyparser.py',42), + ('designation_opt -> designation','designation_opt',1,'p_designation_opt','plyparser.py',43), + ('expression_opt -> empty','expression_opt',1,'p_expression_opt','plyparser.py',42), + ('expression_opt -> expression','expression_opt',1,'p_expression_opt','plyparser.py',43), + ('id_init_declarator_list_opt -> empty','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',42), + ('id_init_declarator_list_opt -> id_init_declarator_list','id_init_declarator_list_opt',1,'p_id_init_declarator_list_opt','plyparser.py',43), + ('identifier_list_opt -> empty','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',42), + ('identifier_list_opt -> identifier_list','identifier_list_opt',1,'p_identifier_list_opt','plyparser.py',43), + ('init_declarator_list_opt -> empty','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',42), + ('init_declarator_list_opt -> init_declarator_list','init_declarator_list_opt',1,'p_init_declarator_list_opt','plyparser.py',43), + ('initializer_list_opt -> empty','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',42), + ('initializer_list_opt -> initializer_list','initializer_list_opt',1,'p_initializer_list_opt','plyparser.py',43), + ('parameter_type_list_opt -> empty','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',42), + ('parameter_type_list_opt -> parameter_type_list','parameter_type_list_opt',1,'p_parameter_type_list_opt','plyparser.py',43), + ('struct_declarator_list_opt -> empty','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',42), + ('struct_declarator_list_opt -> struct_declarator_list','struct_declarator_list_opt',1,'p_struct_declarator_list_opt','plyparser.py',43), + ('type_qualifier_list_opt -> empty','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',42), + ('type_qualifier_list_opt -> type_qualifier_list','type_qualifier_list_opt',1,'p_type_qualifier_list_opt','plyparser.py',43), + ('direct_id_declarator -> ID','direct_id_declarator',1,'p_direct_id_declarator_1','plyparser.py',109), + ('direct_id_declarator -> LPAREN id_declarator RPAREN','direct_id_declarator',3,'p_direct_id_declarator_2','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_3','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_id_declarator',6,'p_direct_id_declarator_4','plyparser.py',110), + ('direct_id_declarator -> direct_id_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_id_declarator',5,'p_direct_id_declarator_5','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt','direct_id_declarator',6,'p_direct_id_declarator_6','plyparser.py',109), + ('direct_id_declarator -> direct_id_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt','direct_id_declarator',6,'p_direct_id_declarator_6','plyparser.py',110), + ('direct_typeid_declarator -> TYPEID','direct_typeid_declarator',1,'p_direct_typeid_declarator_1','plyparser.py',109), + ('direct_typeid_declarator -> LPAREN typeid_declarator RPAREN','direct_typeid_declarator',3,'p_direct_typeid_declarator_2','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_3','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_declarator',6,'p_direct_typeid_declarator_4','plyparser.py',110), + ('direct_typeid_declarator -> direct_typeid_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_declarator',5,'p_direct_typeid_declarator_5','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt','direct_typeid_declarator',6,'p_direct_typeid_declarator_6','plyparser.py',109), + ('direct_typeid_declarator -> direct_typeid_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt','direct_typeid_declarator',6,'p_direct_typeid_declarator_6','plyparser.py',110), + ('direct_typeid_noparen_declarator -> TYPEID','direct_typeid_noparen_declarator',1,'p_direct_typeid_noparen_declarator_1','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt assignment_expression_opt RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_3','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET STATIC type_qualifier_list_opt assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list STATIC assignment_expression RBRACKET','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_4','plyparser.py',110), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LBRACKET type_qualifier_list_opt TIMES RBRACKET','direct_typeid_noparen_declarator',5,'p_direct_typeid_noparen_declarator_5','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN parameter_type_list RPAREN asm_opt attributes_opt','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_6','plyparser.py',109), + ('direct_typeid_noparen_declarator -> direct_typeid_noparen_declarator LPAREN identifier_list_opt RPAREN asm_opt attributes_opt','direct_typeid_noparen_declarator',6,'p_direct_typeid_noparen_declarator_6','plyparser.py',110), + ('id_declarator -> direct_id_declarator attributes_opt','id_declarator',2,'p_id_declarator_1','plyparser.py',109), + ('id_declarator -> pointer direct_id_declarator attributes_opt','id_declarator',3,'p_id_declarator_2','plyparser.py',109), + ('id_declarator -> pointer attributes_opt direct_id_declarator','id_declarator',3,'p_id_declarator_2','plyparser.py',110), + ('typeid_declarator -> direct_typeid_declarator attributes_opt','typeid_declarator',2,'p_typeid_declarator_1','plyparser.py',109), + ('typeid_declarator -> pointer direct_typeid_declarator attributes_opt','typeid_declarator',3,'p_typeid_declarator_2','plyparser.py',109), + ('typeid_declarator -> pointer attributes_opt direct_typeid_declarator','typeid_declarator',3,'p_typeid_declarator_2','plyparser.py',110), + ('typeid_noparen_declarator -> direct_typeid_noparen_declarator attributes_opt','typeid_noparen_declarator',2,'p_typeid_noparen_declarator_1','plyparser.py',109), + ('typeid_noparen_declarator -> pointer direct_typeid_noparen_declarator attributes_opt','typeid_noparen_declarator',3,'p_typeid_noparen_declarator_2','plyparser.py',109), + ('typeid_noparen_declarator -> pointer attributes_opt direct_typeid_noparen_declarator','typeid_noparen_declarator',3,'p_typeid_noparen_declarator_2','plyparser.py',110), + ('attributes_opt -> attribute_decl attributes_opt','attributes_opt',2,'p_attributes_opt_1','ext_c_parser.py',227), + ('attributes_opt -> empty','attributes_opt',1,'p_attributes_opt_2','ext_c_parser.py',233), + ('attribute_decl -> __ATTRIBUTE__ LPAREN LPAREN attribute_list RPAREN RPAREN','attribute_decl',6,'p_attribute_decl','ext_c_parser.py',238), + ('attribute_decl -> __ATTRIBUTE LPAREN LPAREN attribute_list RPAREN RPAREN','attribute_decl',6,'p_attribute_decl','ext_c_parser.py',239), + ('attribute_list -> attribute','attribute_list',1,'p_attribute_list_1','ext_c_parser.py',244), + ('attribute_list -> attribute_list COMMA attribute','attribute_list',3,'p_attribute_list_2','ext_c_parser.py',249), + ('attribute -> CONST','attribute',1,'p_attribute_1','ext_c_parser.py',255), + ('attribute -> assignment_expression','attribute',1,'p_attribute_3','ext_c_parser.py',260), + ('function_specifier -> attribute_decl','function_specifier',1,'p_function_specifier_attr','ext_c_parser.py',322), + ('asm_opt -> empty','asm_opt',1,'p_asm_opt_1','ext_c_parser.py',333), + ('asm_opt -> asm_no_semi','asm_opt',1,'p_asm_opt_2','ext_c_parser.py',338), + ('asm_no_semi -> asm_keyword LPAREN asm_argument_expression_list RPAREN','asm_no_semi',4,'p_asm_1','ext_c_parser.py',343), + ('asm_no_semi -> asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list RPAREN','asm_no_semi',6,'p_asm_2','ext_c_parser.py',348), + ('asm_no_semi -> asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list RPAREN','asm_no_semi',8,'p_asm_3','ext_c_parser.py',354), + ('asm_no_semi -> asm_keyword LPAREN asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list COLON asm_argument_expression_list RPAREN','asm_no_semi',10,'p_asm_4','ext_c_parser.py',361), + ('asm_keyword -> __ASM__ asm_volatile','asm_keyword',2,'p_asm_keyword','ext_c_parser.py',368), + ('asm_keyword -> __ASM asm_volatile','asm_keyword',2,'p_asm_keyword','ext_c_parser.py',369), + ('asm_keyword -> ASM asm_volatile','asm_keyword',2,'p_asm_keyword','ext_c_parser.py',370), + ('asm_volatile -> VOLATILE','asm_volatile',1,'p_asm_volatile','ext_c_parser.py',377), + ('asm_volatile -> empty','asm_volatile',1,'p_asm_volatile','ext_c_parser.py',378), + ('asm_argument_expression_list -> argument_expression_list','asm_argument_expression_list',1,'p_asm_argument_expression_list','ext_c_parser.py',383), + ('asm_argument_expression_list -> empty','asm_argument_expression_list',1,'p_asm_argument_expression_list','ext_c_parser.py',384), + ('statement -> asm_no_semi','statement',1,'p_statement_gnu','ext_c_parser.py',389), + ('statement -> asm_no_semi SEMI','statement',2,'p_statement_gnu','ext_c_parser.py',390), + ('direct_abstract_declarator -> direct_abstract_declarator LPAREN parameter_type_list_opt RPAREN asm_opt attributes_opt','direct_abstract_declarator',6,'p_direct_abstract_declarator_6','ext_c_parser.py',422), + ('function_specifier -> __INLINE','function_specifier',1,'p_function_specifier_gnu','ext_c_parser.py',448), + ('function_specifier -> __INLINE__','function_specifier',1,'p_function_specifier_gnu','ext_c_parser.py',449), + ('type_qualifier -> __CONST','type_qualifier',1,'p_type_qualifier_gnu','ext_c_parser.py',454), + ('type_qualifier -> __RESTRICT','type_qualifier',1,'p_type_qualifier_gnu','ext_c_parser.py',455), + ('type_qualifier -> __EXTENSION__','type_qualifier',1,'p_type_qualifier_gnu','ext_c_parser.py',456), + ('type_specifier -> __TYPEOF__ LPAREN expression RPAREN','type_specifier',4,'p_type_specifier_gnu_typeof_expr','ext_c_parser.py',461), + ('type_specifier -> __TYPEOF__ LPAREN parameter_declaration RPAREN','type_specifier',4,'p_type_specifier_gnu_typeof_decl','ext_c_parser.py',469), + ('unary_operator -> __REAL__','unary_operator',1,'p_unary_operator_gnu','ext_c_parser.py',474), + ('unary_operator -> __IMAG__','unary_operator',1,'p_unary_operator_gnu','ext_c_parser.py',475), + ('postfix_expression -> __BUILTIN_TYPES_COMPATIBLE_P LPAREN parameter_declaration COMMA parameter_declaration RPAREN','postfix_expression',6,'p_postfix_expression_gnu_tcp','ext_c_parser.py',480), + ('gnu_statement_expression -> LPAREN compound_statement RPAREN','gnu_statement_expression',3,'p_gnu_statement_expression','ext_c_parser.py',487), + ('primary_expression -> gnu_statement_expression','primary_expression',1,'p_gnu_primary_expression_6','ext_c_parser.py',492), + ('statement -> labeled_statement','statement',1,'p_statement','ext_c_parser.py',496), + ('statement -> expression_statement','statement',1,'p_statement','ext_c_parser.py',497), + ('statement -> compound_statement','statement',1,'p_statement','ext_c_parser.py',498), + ('statement -> selection_statement','statement',1,'p_statement','ext_c_parser.py',499), + ('statement -> iteration_statement','statement',1,'p_statement','ext_c_parser.py',500), + ('statement -> jump_statement','statement',1,'p_statement','ext_c_parser.py',501), + ('statement -> pppragma_directive','statement',1,'p_statement','ext_c_parser.py',502), + ('statement -> gnu_statement_expression','statement',1,'p_statement','ext_c_parser.py',503), + ('attribute -> __CONST','attribute',1,'p_attribute_const','ext_c_parser.py',508), + ('struct_declaration_list -> empty','struct_declaration_list',1,'p_struct_declaration_list_1','ext_c_parser.py',513), + ('translation_unit_or_empty -> translation_unit','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',514), + ('translation_unit_or_empty -> empty','translation_unit_or_empty',1,'p_translation_unit_or_empty','c_parser.py',515), + ('translation_unit -> external_declaration','translation_unit',1,'p_translation_unit_1','c_parser.py',523), + ('translation_unit -> translation_unit external_declaration','translation_unit',2,'p_translation_unit_2','c_parser.py',530), + ('external_declaration -> function_definition','external_declaration',1,'p_external_declaration_1','c_parser.py',542), + ('external_declaration -> declaration','external_declaration',1,'p_external_declaration_2','c_parser.py',547), + ('external_declaration -> pp_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',552), + ('external_declaration -> pppragma_directive','external_declaration',1,'p_external_declaration_3','c_parser.py',553), + ('external_declaration -> SEMI','external_declaration',1,'p_external_declaration_4','c_parser.py',558), + ('pp_directive -> PPHASH','pp_directive',1,'p_pp_directive','c_parser.py',563), + ('pppragma_directive -> PPPRAGMA','pppragma_directive',1,'p_pppragma_directive','c_parser.py',569), + ('pppragma_directive -> PPPRAGMA PPPRAGMASTR','pppragma_directive',2,'p_pppragma_directive','c_parser.py',570), + ('function_definition -> id_declarator declaration_list_opt compound_statement','function_definition',3,'p_function_definition_1','c_parser.py',581), + ('function_definition -> declaration_specifiers id_declarator declaration_list_opt compound_statement','function_definition',4,'p_function_definition_2','c_parser.py',598), + ('decl_body -> declaration_specifiers init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',629), + ('decl_body -> declaration_specifiers_no_type id_init_declarator_list_opt','decl_body',2,'p_decl_body','c_parser.py',630), + ('declaration -> decl_body SEMI','declaration',2,'p_declaration','c_parser.py',689), + ('declaration_list -> declaration','declaration_list',1,'p_declaration_list','c_parser.py',698), + ('declaration_list -> declaration_list declaration','declaration_list',2,'p_declaration_list','c_parser.py',699), + ('declaration_specifiers_no_type -> type_qualifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_1','c_parser.py',709), + ('declaration_specifiers_no_type -> storage_class_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_2','c_parser.py',714), + ('declaration_specifiers_no_type -> function_specifier declaration_specifiers_no_type_opt','declaration_specifiers_no_type',2,'p_declaration_specifiers_no_type_3','c_parser.py',719), + ('declaration_specifiers -> declaration_specifiers type_qualifier','declaration_specifiers',2,'p_declaration_specifiers_1','c_parser.py',725), + ('declaration_specifiers -> declaration_specifiers storage_class_specifier','declaration_specifiers',2,'p_declaration_specifiers_2','c_parser.py',730), + ('declaration_specifiers -> declaration_specifiers function_specifier','declaration_specifiers',2,'p_declaration_specifiers_3','c_parser.py',735), + ('declaration_specifiers -> declaration_specifiers type_specifier_no_typeid','declaration_specifiers',2,'p_declaration_specifiers_4','c_parser.py',740), + ('declaration_specifiers -> type_specifier','declaration_specifiers',1,'p_declaration_specifiers_5','c_parser.py',745), + ('declaration_specifiers -> declaration_specifiers_no_type type_specifier','declaration_specifiers',2,'p_declaration_specifiers_6','c_parser.py',750), + ('storage_class_specifier -> AUTO','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',756), + ('storage_class_specifier -> REGISTER','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',757), + ('storage_class_specifier -> STATIC','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',758), + ('storage_class_specifier -> EXTERN','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',759), + ('storage_class_specifier -> TYPEDEF','storage_class_specifier',1,'p_storage_class_specifier','c_parser.py',760), + ('function_specifier -> INLINE','function_specifier',1,'p_function_specifier','c_parser.py',765), + ('type_specifier_no_typeid -> VOID','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',770), + ('type_specifier_no_typeid -> _BOOL','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',771), + ('type_specifier_no_typeid -> CHAR','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',772), + ('type_specifier_no_typeid -> SHORT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',773), + ('type_specifier_no_typeid -> INT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',774), + ('type_specifier_no_typeid -> LONG','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',775), + ('type_specifier_no_typeid -> FLOAT','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',776), + ('type_specifier_no_typeid -> DOUBLE','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',777), + ('type_specifier_no_typeid -> _COMPLEX','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',778), + ('type_specifier_no_typeid -> SIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',779), + ('type_specifier_no_typeid -> UNSIGNED','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',780), + ('type_specifier_no_typeid -> __INT128','type_specifier_no_typeid',1,'p_type_specifier_no_typeid','c_parser.py',781), + ('type_specifier -> typedef_name','type_specifier',1,'p_type_specifier','c_parser.py',786), + ('type_specifier -> enum_specifier','type_specifier',1,'p_type_specifier','c_parser.py',787), + ('type_specifier -> struct_or_union_specifier','type_specifier',1,'p_type_specifier','c_parser.py',788), + ('type_specifier -> type_specifier_no_typeid','type_specifier',1,'p_type_specifier','c_parser.py',789), + ('type_qualifier -> CONST','type_qualifier',1,'p_type_qualifier','c_parser.py',794), + ('type_qualifier -> RESTRICT','type_qualifier',1,'p_type_qualifier','c_parser.py',795), + ('type_qualifier -> VOLATILE','type_qualifier',1,'p_type_qualifier','c_parser.py',796), + ('init_declarator_list -> init_declarator','init_declarator_list',1,'p_init_declarator_list','c_parser.py',801), + ('init_declarator_list -> init_declarator_list COMMA init_declarator','init_declarator_list',3,'p_init_declarator_list','c_parser.py',802), + ('init_declarator -> declarator','init_declarator',1,'p_init_declarator','c_parser.py',810), + ('init_declarator -> declarator EQUALS initializer','init_declarator',3,'p_init_declarator','c_parser.py',811), + ('id_init_declarator_list -> id_init_declarator','id_init_declarator_list',1,'p_id_init_declarator_list','c_parser.py',816), + ('id_init_declarator_list -> id_init_declarator_list COMMA init_declarator','id_init_declarator_list',3,'p_id_init_declarator_list','c_parser.py',817), + ('id_init_declarator -> id_declarator','id_init_declarator',1,'p_id_init_declarator','c_parser.py',822), + ('id_init_declarator -> id_declarator EQUALS initializer','id_init_declarator',3,'p_id_init_declarator','c_parser.py',823), + ('specifier_qualifier_list -> specifier_qualifier_list type_specifier_no_typeid','specifier_qualifier_list',2,'p_specifier_qualifier_list_1','c_parser.py',830), + ('specifier_qualifier_list -> specifier_qualifier_list type_qualifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_2','c_parser.py',835), + ('specifier_qualifier_list -> type_specifier','specifier_qualifier_list',1,'p_specifier_qualifier_list_3','c_parser.py',840), + ('specifier_qualifier_list -> type_qualifier_list type_specifier','specifier_qualifier_list',2,'p_specifier_qualifier_list_4','c_parser.py',845), + ('struct_or_union_specifier -> struct_or_union ID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',854), + ('struct_or_union_specifier -> struct_or_union TYPEID','struct_or_union_specifier',2,'p_struct_or_union_specifier_1','c_parser.py',855), + ('struct_or_union_specifier -> struct_or_union brace_open struct_declaration_list brace_close','struct_or_union_specifier',4,'p_struct_or_union_specifier_2','c_parser.py',864), + ('struct_or_union_specifier -> struct_or_union ID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',873), + ('struct_or_union_specifier -> struct_or_union TYPEID brace_open struct_declaration_list brace_close','struct_or_union_specifier',5,'p_struct_or_union_specifier_3','c_parser.py',874), + ('struct_or_union -> STRUCT','struct_or_union',1,'p_struct_or_union','c_parser.py',883), + ('struct_or_union -> UNION','struct_or_union',1,'p_struct_or_union','c_parser.py',884), + ('struct_declaration_list -> struct_declaration','struct_declaration_list',1,'p_struct_declaration_list','c_parser.py',891), + ('struct_declaration_list -> struct_declaration_list struct_declaration','struct_declaration_list',2,'p_struct_declaration_list','c_parser.py',892), + ('struct_declaration -> specifier_qualifier_list struct_declarator_list_opt SEMI','struct_declaration',3,'p_struct_declaration_1','c_parser.py',900), + ('struct_declaration -> SEMI','struct_declaration',1,'p_struct_declaration_2','c_parser.py',938), + ('struct_declarator_list -> struct_declarator','struct_declarator_list',1,'p_struct_declarator_list','c_parser.py',943), + ('struct_declarator_list -> struct_declarator_list COMMA struct_declarator','struct_declarator_list',3,'p_struct_declarator_list','c_parser.py',944), + ('struct_declarator -> declarator','struct_declarator',1,'p_struct_declarator_1','c_parser.py',952), + ('struct_declarator -> declarator COLON constant_expression','struct_declarator',3,'p_struct_declarator_2','c_parser.py',957), + ('struct_declarator -> COLON constant_expression','struct_declarator',2,'p_struct_declarator_2','c_parser.py',958), + ('enum_specifier -> ENUM ID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',966), + ('enum_specifier -> ENUM TYPEID','enum_specifier',2,'p_enum_specifier_1','c_parser.py',967), + ('enum_specifier -> ENUM brace_open enumerator_list brace_close','enum_specifier',4,'p_enum_specifier_2','c_parser.py',972), + ('enum_specifier -> ENUM ID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',977), + ('enum_specifier -> ENUM TYPEID brace_open enumerator_list brace_close','enum_specifier',5,'p_enum_specifier_3','c_parser.py',978), + ('enumerator_list -> enumerator','enumerator_list',1,'p_enumerator_list','c_parser.py',983), + ('enumerator_list -> enumerator_list COMMA','enumerator_list',2,'p_enumerator_list','c_parser.py',984), + ('enumerator_list -> enumerator_list COMMA enumerator','enumerator_list',3,'p_enumerator_list','c_parser.py',985), + ('enumerator -> ID','enumerator',1,'p_enumerator','c_parser.py',996), + ('enumerator -> ID EQUALS constant_expression','enumerator',3,'p_enumerator','c_parser.py',997), + ('declarator -> id_declarator','declarator',1,'p_declarator','c_parser.py',1012), + ('declarator -> typeid_declarator','declarator',1,'p_declarator','c_parser.py',1013), + ('pointer -> TIMES type_qualifier_list_opt','pointer',2,'p_pointer','c_parser.py',1124), + ('pointer -> TIMES type_qualifier_list_opt pointer','pointer',3,'p_pointer','c_parser.py',1125), + ('type_qualifier_list -> type_qualifier','type_qualifier_list',1,'p_type_qualifier_list','c_parser.py',1154), + ('type_qualifier_list -> type_qualifier_list type_qualifier','type_qualifier_list',2,'p_type_qualifier_list','c_parser.py',1155), + ('parameter_type_list -> parameter_list','parameter_type_list',1,'p_parameter_type_list','c_parser.py',1160), + ('parameter_type_list -> parameter_list COMMA ELLIPSIS','parameter_type_list',3,'p_parameter_type_list','c_parser.py',1161), + ('parameter_list -> parameter_declaration','parameter_list',1,'p_parameter_list','c_parser.py',1169), + ('parameter_list -> parameter_list COMMA parameter_declaration','parameter_list',3,'p_parameter_list','c_parser.py',1170), + ('parameter_declaration -> declaration_specifiers id_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1189), + ('parameter_declaration -> declaration_specifiers typeid_noparen_declarator','parameter_declaration',2,'p_parameter_declaration_1','c_parser.py',1190), + ('parameter_declaration -> declaration_specifiers abstract_declarator_opt','parameter_declaration',2,'p_parameter_declaration_2','c_parser.py',1201), + ('identifier_list -> identifier','identifier_list',1,'p_identifier_list','c_parser.py',1232), + ('identifier_list -> identifier_list COMMA identifier','identifier_list',3,'p_identifier_list','c_parser.py',1233), + ('initializer -> assignment_expression','initializer',1,'p_initializer_1','c_parser.py',1242), + ('initializer -> brace_open initializer_list_opt brace_close','initializer',3,'p_initializer_2','c_parser.py',1247), + ('initializer -> brace_open initializer_list COMMA brace_close','initializer',4,'p_initializer_2','c_parser.py',1248), + ('initializer_list -> designation_opt initializer','initializer_list',2,'p_initializer_list','c_parser.py',1256), + ('initializer_list -> initializer_list COMMA designation_opt initializer','initializer_list',4,'p_initializer_list','c_parser.py',1257), + ('designation -> designator_list EQUALS','designation',2,'p_designation','c_parser.py',1268), + ('designator_list -> designator','designator_list',1,'p_designator_list','c_parser.py',1276), + ('designator_list -> designator_list designator','designator_list',2,'p_designator_list','c_parser.py',1277), + ('designator -> LBRACKET constant_expression RBRACKET','designator',3,'p_designator','c_parser.py',1282), + ('designator -> PERIOD identifier','designator',2,'p_designator','c_parser.py',1283), + ('type_name -> specifier_qualifier_list abstract_declarator_opt','type_name',2,'p_type_name','c_parser.py',1288), + ('abstract_declarator -> pointer','abstract_declarator',1,'p_abstract_declarator_1','c_parser.py',1299), + ('abstract_declarator -> pointer direct_abstract_declarator','abstract_declarator',2,'p_abstract_declarator_2','c_parser.py',1307), + ('abstract_declarator -> direct_abstract_declarator','abstract_declarator',1,'p_abstract_declarator_3','c_parser.py',1312), + ('direct_abstract_declarator -> LPAREN abstract_declarator RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_1','c_parser.py',1322), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_2','c_parser.py',1326), + ('direct_abstract_declarator -> LBRACKET assignment_expression_opt RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_3','c_parser.py',1337), + ('direct_abstract_declarator -> direct_abstract_declarator LBRACKET TIMES RBRACKET','direct_abstract_declarator',4,'p_direct_abstract_declarator_4','c_parser.py',1346), + ('direct_abstract_declarator -> LBRACKET TIMES RBRACKET','direct_abstract_declarator',3,'p_direct_abstract_declarator_5','c_parser.py',1357), + ('direct_abstract_declarator -> LPAREN parameter_type_list_opt RPAREN','direct_abstract_declarator',3,'p_direct_abstract_declarator_7','c_parser.py',1376), + ('block_item -> declaration','block_item',1,'p_block_item','c_parser.py',1387), + ('block_item -> statement','block_item',1,'p_block_item','c_parser.py',1388), + ('block_item_list -> block_item','block_item_list',1,'p_block_item_list','c_parser.py',1395), + ('block_item_list -> block_item_list block_item','block_item_list',2,'p_block_item_list','c_parser.py',1396), + ('compound_statement -> brace_open block_item_list_opt brace_close','compound_statement',3,'p_compound_statement_1','c_parser.py',1402), + ('labeled_statement -> ID COLON statement','labeled_statement',3,'p_labeled_statement_1','c_parser.py',1408), + ('labeled_statement -> CASE constant_expression COLON statement','labeled_statement',4,'p_labeled_statement_2','c_parser.py',1412), + ('labeled_statement -> DEFAULT COLON statement','labeled_statement',3,'p_labeled_statement_3','c_parser.py',1416), + ('selection_statement -> IF LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_1','c_parser.py',1420), + ('selection_statement -> IF LPAREN expression RPAREN statement ELSE statement','selection_statement',7,'p_selection_statement_2','c_parser.py',1424), + ('selection_statement -> SWITCH LPAREN expression RPAREN statement','selection_statement',5,'p_selection_statement_3','c_parser.py',1428), + ('iteration_statement -> WHILE LPAREN expression RPAREN statement','iteration_statement',5,'p_iteration_statement_1','c_parser.py',1433), + ('iteration_statement -> DO statement WHILE LPAREN expression RPAREN SEMI','iteration_statement',7,'p_iteration_statement_2','c_parser.py',1437), + ('iteration_statement -> FOR LPAREN expression_opt SEMI expression_opt SEMI expression_opt RPAREN statement','iteration_statement',9,'p_iteration_statement_3','c_parser.py',1441), + ('iteration_statement -> FOR LPAREN declaration expression_opt SEMI expression_opt RPAREN statement','iteration_statement',8,'p_iteration_statement_4','c_parser.py',1445), + ('jump_statement -> GOTO ID SEMI','jump_statement',3,'p_jump_statement_1','c_parser.py',1450), + ('jump_statement -> BREAK SEMI','jump_statement',2,'p_jump_statement_2','c_parser.py',1454), + ('jump_statement -> CONTINUE SEMI','jump_statement',2,'p_jump_statement_3','c_parser.py',1458), + ('jump_statement -> RETURN expression SEMI','jump_statement',3,'p_jump_statement_4','c_parser.py',1462), + ('jump_statement -> RETURN SEMI','jump_statement',2,'p_jump_statement_4','c_parser.py',1463), + ('expression_statement -> expression_opt SEMI','expression_statement',2,'p_expression_statement','c_parser.py',1468), + ('expression -> assignment_expression','expression',1,'p_expression','c_parser.py',1475), + ('expression -> expression COMMA assignment_expression','expression',3,'p_expression','c_parser.py',1476), + ('typedef_name -> TYPEID','typedef_name',1,'p_typedef_name','c_parser.py',1488), + ('assignment_expression -> conditional_expression','assignment_expression',1,'p_assignment_expression','c_parser.py',1492), + ('assignment_expression -> unary_expression assignment_operator assignment_expression','assignment_expression',3,'p_assignment_expression','c_parser.py',1493), + ('assignment_operator -> EQUALS','assignment_operator',1,'p_assignment_operator','c_parser.py',1506), + ('assignment_operator -> XOREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1507), + ('assignment_operator -> TIMESEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1508), + ('assignment_operator -> DIVEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1509), + ('assignment_operator -> MODEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1510), + ('assignment_operator -> PLUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1511), + ('assignment_operator -> MINUSEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1512), + ('assignment_operator -> LSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1513), + ('assignment_operator -> RSHIFTEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1514), + ('assignment_operator -> ANDEQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1515), + ('assignment_operator -> OREQUAL','assignment_operator',1,'p_assignment_operator','c_parser.py',1516), + ('constant_expression -> conditional_expression','constant_expression',1,'p_constant_expression','c_parser.py',1521), + ('conditional_expression -> binary_expression','conditional_expression',1,'p_conditional_expression','c_parser.py',1525), + ('conditional_expression -> binary_expression CONDOP expression COLON conditional_expression','conditional_expression',5,'p_conditional_expression','c_parser.py',1526), + ('binary_expression -> cast_expression','binary_expression',1,'p_binary_expression','c_parser.py',1534), + ('binary_expression -> binary_expression TIMES binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1535), + ('binary_expression -> binary_expression DIVIDE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1536), + ('binary_expression -> binary_expression MOD binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1537), + ('binary_expression -> binary_expression PLUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1538), + ('binary_expression -> binary_expression MINUS binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1539), + ('binary_expression -> binary_expression RSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1540), + ('binary_expression -> binary_expression LSHIFT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1541), + ('binary_expression -> binary_expression LT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1542), + ('binary_expression -> binary_expression LE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1543), + ('binary_expression -> binary_expression GE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1544), + ('binary_expression -> binary_expression GT binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1545), + ('binary_expression -> binary_expression EQ binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1546), + ('binary_expression -> binary_expression NE binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1547), + ('binary_expression -> binary_expression AND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1548), + ('binary_expression -> binary_expression OR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1549), + ('binary_expression -> binary_expression XOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1550), + ('binary_expression -> binary_expression LAND binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1551), + ('binary_expression -> binary_expression LOR binary_expression','binary_expression',3,'p_binary_expression','c_parser.py',1552), + ('cast_expression -> unary_expression','cast_expression',1,'p_cast_expression_1','c_parser.py',1560), + ('cast_expression -> LPAREN type_name RPAREN cast_expression','cast_expression',4,'p_cast_expression_2','c_parser.py',1564), + ('unary_expression -> postfix_expression','unary_expression',1,'p_unary_expression_1','c_parser.py',1568), + ('unary_expression -> PLUSPLUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1572), + ('unary_expression -> MINUSMINUS unary_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1573), + ('unary_expression -> unary_operator cast_expression','unary_expression',2,'p_unary_expression_2','c_parser.py',1574), + ('unary_expression -> SIZEOF unary_expression','unary_expression',2,'p_unary_expression_3','c_parser.py',1579), + ('unary_expression -> SIZEOF LPAREN type_name RPAREN','unary_expression',4,'p_unary_expression_3','c_parser.py',1580), + ('unary_operator -> AND','unary_operator',1,'p_unary_operator','c_parser.py',1588), + ('unary_operator -> TIMES','unary_operator',1,'p_unary_operator','c_parser.py',1589), + ('unary_operator -> PLUS','unary_operator',1,'p_unary_operator','c_parser.py',1590), + ('unary_operator -> MINUS','unary_operator',1,'p_unary_operator','c_parser.py',1591), + ('unary_operator -> NOT','unary_operator',1,'p_unary_operator','c_parser.py',1592), + ('unary_operator -> LNOT','unary_operator',1,'p_unary_operator','c_parser.py',1593), + ('postfix_expression -> primary_expression','postfix_expression',1,'p_postfix_expression_1','c_parser.py',1598), + ('postfix_expression -> postfix_expression LBRACKET expression RBRACKET','postfix_expression',4,'p_postfix_expression_2','c_parser.py',1602), + ('postfix_expression -> postfix_expression LPAREN argument_expression_list RPAREN','postfix_expression',4,'p_postfix_expression_3','c_parser.py',1606), + ('postfix_expression -> postfix_expression LPAREN RPAREN','postfix_expression',3,'p_postfix_expression_3','c_parser.py',1607), + ('postfix_expression -> postfix_expression PERIOD ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1612), + ('postfix_expression -> postfix_expression PERIOD TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1613), + ('postfix_expression -> postfix_expression ARROW ID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1614), + ('postfix_expression -> postfix_expression ARROW TYPEID','postfix_expression',3,'p_postfix_expression_4','c_parser.py',1615), + ('postfix_expression -> postfix_expression PLUSPLUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1621), + ('postfix_expression -> postfix_expression MINUSMINUS','postfix_expression',2,'p_postfix_expression_5','c_parser.py',1622), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list brace_close','postfix_expression',6,'p_postfix_expression_6','c_parser.py',1627), + ('postfix_expression -> LPAREN type_name RPAREN brace_open initializer_list COMMA brace_close','postfix_expression',7,'p_postfix_expression_6','c_parser.py',1628), + ('primary_expression -> identifier','primary_expression',1,'p_primary_expression_1','c_parser.py',1633), + ('primary_expression -> constant','primary_expression',1,'p_primary_expression_2','c_parser.py',1637), + ('primary_expression -> unified_string_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1641), + ('primary_expression -> unified_wstring_literal','primary_expression',1,'p_primary_expression_3','c_parser.py',1642), + ('primary_expression -> LPAREN expression RPAREN','primary_expression',3,'p_primary_expression_4','c_parser.py',1647), + ('primary_expression -> OFFSETOF LPAREN type_name COMMA offsetof_member_designator RPAREN','primary_expression',6,'p_primary_expression_5','c_parser.py',1651), + ('offsetof_member_designator -> identifier','offsetof_member_designator',1,'p_offsetof_member_designator','c_parser.py',1659), + ('offsetof_member_designator -> offsetof_member_designator PERIOD identifier','offsetof_member_designator',3,'p_offsetof_member_designator','c_parser.py',1660), + ('offsetof_member_designator -> offsetof_member_designator LBRACKET expression RBRACKET','offsetof_member_designator',4,'p_offsetof_member_designator','c_parser.py',1661), + ('argument_expression_list -> assignment_expression','argument_expression_list',1,'p_argument_expression_list','c_parser.py',1674), + ('argument_expression_list -> argument_expression_list COMMA assignment_expression','argument_expression_list',3,'p_argument_expression_list','c_parser.py',1675), + ('identifier -> ID','identifier',1,'p_identifier','c_parser.py',1684), + ('constant -> INT_CONST_DEC','constant',1,'p_constant_1','c_parser.py',1688), + ('constant -> INT_CONST_OCT','constant',1,'p_constant_1','c_parser.py',1689), + ('constant -> INT_CONST_HEX','constant',1,'p_constant_1','c_parser.py',1690), + ('constant -> INT_CONST_BIN','constant',1,'p_constant_1','c_parser.py',1691), + ('constant -> FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1697), + ('constant -> HEX_FLOAT_CONST','constant',1,'p_constant_2','c_parser.py',1698), + ('constant -> CHAR_CONST','constant',1,'p_constant_3','c_parser.py',1704), + ('constant -> WCHAR_CONST','constant',1,'p_constant_3','c_parser.py',1705), + ('unified_string_literal -> STRING_LITERAL','unified_string_literal',1,'p_unified_string_literal','c_parser.py',1716), + ('unified_string_literal -> unified_string_literal STRING_LITERAL','unified_string_literal',2,'p_unified_string_literal','c_parser.py',1717), + ('unified_wstring_literal -> WSTRING_LITERAL','unified_wstring_literal',1,'p_unified_wstring_literal','c_parser.py',1727), + ('unified_wstring_literal -> unified_wstring_literal WSTRING_LITERAL','unified_wstring_literal',2,'p_unified_wstring_literal','c_parser.py',1728), + ('brace_open -> LBRACE','brace_open',1,'p_brace_open','c_parser.py',1738), + ('brace_close -> RBRACE','brace_close',1,'p_brace_close','c_parser.py',1744), + ('empty -> ','empty',0,'p_empty','c_parser.py',1750), +] diff --git a/utils/cseq-1.9/test.c b/utils/cseq-1.9/test.c new file mode 100644 index 000000000..4825ae8fa --- /dev/null +++ b/utils/cseq-1.9/test.c @@ -0,0 +1,637 @@ +/* + * generated by CSeq [ 0000 / 0000 ] 2020-07-13 15:11:30 + * + * [ 0000 merger-2019.11.15 + * 0000 parser-2019.11.27 + * 0000 module-0.0-2019.11.27 ] + * + * params: + * -i examples/lazy_unsafe.c, --output test.c + * + * modules: + * 0000 workarounds () + * 0000 functiontracker () + * 0000 preinstrumenter (error-label) + * 0000 constants (deep-propagation) + * 0000 spinlock () + * 0000 switchtransformer () + * 0000 dowhileconverter () + * 0000 conditionextractor () + * 0000 varnames () + * 0000 preinliner () + * 0000 inliner (atomic-parameters simplify-args) + * 0000 unroller (unwind unwind-while unwind-for unwind-for-max softunwindbound varnamesmap varscopesmap extra-tracking) + * 0000 duplicator () + * 0000 condwaitconverter () + * 0000 lazyseq (rounds threads schedule deadlock norobin preanalysis nondet-condvar-wakeups) + * 0000 instrumenter (backend bitwidth header well-nested-locks emptystructs) + * 0000 feeder (backend time llvm depth slevel output no-simplify) + * 0000 cex (backend cex exitcode threadnamesmap threadindexes threadindextoname varnamesmap coordstofunctions sv-comp witness entry threadsizes threadendlines loopheads) + * + */ +#define __cs_MUTEX_INITIALIZER -1 +#define __cs_COND_INITIALIZER -1 +#define __cs_RWLOCK_INITIALIZER -1 +#define __cs_BARRIER_SERIAL_THREAD 0 +#define __cs_CANCEL_ASYNCHRONOUS 0 +#define __cs_CANCEL_ENABLE 0 +#define __cs_CANCEL_DEFERRED 0 +#define __cs_CANCEL_DISABLE 0 +#define __cs_CANCELED 0 +#define __cs_CREATE_DETACHED 0 +#define __cs_CREATE_JOINABLE 0 +#define __cs_EXPLICIT_SCHED 0 +#define __cs_INHERIT_SCHED 0 +#define __cs_MUTEX_DEFAULT 0 +#define __cs_MUTEX_ERRORCHECK 0 +#define __cs_MUTEX_NORMAL 0 +#define __cs_MUTEX_RECURSIVE 0 +#define __cs_MUTEX_ROBUST 0 +#define __cs_MUTEX_STALLED 0 +#define __cs_ONCE_INIT 0 +#define __cs_PRIO_INHERIT 0 +#define __cs_PRIO_NONE 0 +#define __cs_PRIO_PROTECT 0 +#define __cs_PROCESS_SHARED 0 +#define __cs_PROCESS_PRIVATE 0 +#define __cs_SCOPE_PROCESS 0 +#define __cs_SCOPE_SYSTEM 0 +#include +int __VERIFIER_nondet_int(); +int nondet_int(); +unsigned int __VERIFIER_nondet_uint(); +unsigned int nondet_uint(); +_Bool __VERIFIER_nondet_bool(); +_Bool nondet_bool(); +char __VERIFIER_nondet_char(); +char nondet_char(); +unsigned char __VERIFIER_nondet_uchar(); +unsigned char nondet_uchar(); +//#include +//#include +#define THREADS 3 +#define ROUNDS 1 +#define STOP_VOID(A) return; +#define STOP_NONVOID(A) return 0; +#define IF(T,A,B) if ((__cs_pc[T] > A) | (A >= __cs_pc_cs[T])) goto B; +#ifndef NULL +#define NULL 0 +#endif + + unsigned __CPROVER_bitvector[1] __cs_active_thread[THREADS + 1] = {1}; + + unsigned __CPROVER_bitvector[3] __cs_pc[THREADS + 1]; + + unsigned __CPROVER_bitvector[4] __cs_pc_cs[THREADS + 1]; + + unsigned __CPROVER_bitvector[3] __cs_thread_index; + + unsigned __CPROVER_bitvector[3] __cs_last_thread; + + unsigned __CPROVER_bitvector[3] __cs_thread_lines[] = {6, 3, 3, 3}; + + void *__cs_safe_malloc(unsigned int __cs_size) + { + + void *__cs_ptr = (malloc(__cs_size)); + + __CPROVER_assume(__cs_ptr); + return (__cs_ptr); + } + + + void __cs_init_scalar(void *__cs_var, unsigned int __cs_size) + { + + if (__cs_size == (sizeof(int))) + + * ((int *) __cs_var) = (nondet_int()); + else + + { + + __cs_var = (malloc(__cs_size)); + } + + } + + + void __CSEQ_message(char *__cs_message) + { + ; + } + + + typedef int cspthread_t; + + void *__cs_threadargs[THREADS + 1]; + + typedef int cspthread_key_t; + + cspthread_key_t __cs_keys[1][THREADS + 2]; + + void (*__cs_key_destructor[1])(void *); + + int pthread_create(cspthread_t *__cs_new_thread_id, void *__cs_attr, void *(*__cs_func)(void *), void *__cs_arg, int __cs_threadID) + { + + if (__cs_threadID > THREADS) + return (0); + + + * __cs_new_thread_id = (__cs_threadID); + + __cs_active_thread[__cs_threadID] = (1); + + __cs_threadargs[__cs_threadID] = (__cs_arg); + + __CSEQ_message("thread spawned"); + + return (0); + } + + + int pthread_join(cspthread_t __cs_id, void **__cs_value_ptr) + { + + __CPROVER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]); + + return (0); + } + + + int pthread_exit(void *__cs_value_ptr) + { + + if ((__cs_key_destructor[0] != 0) && (__cs_keys[0][__cs_thread_index + 1] != 0)) + { + + __cs_key_destructor[0](__cs_keys[0][__cs_thread_index + 1]); + } + + } + + + int pthread_self(void) + { + return (__cs_thread_index + 1); + } + + + typedef int cspthread_mutex_t; + + int pthread_mutex_init(cspthread_mutex_t *__cs_m, int __cs_val) + { + + * __cs_m = (- 1); + + return (0); + } + + + int pthread_mutex_destroy(cspthread_mutex_t *__cs_mutex_to_destroy) + { + + * __cs_mutex_to_destroy = (- 2); + + __CSEQ_message("lock destroyed"); + + return (0); + } + + + int pthread_mutex_lock(cspthread_mutex_t *__cs_mutex_to_lock) + { + + __CPROVER_assume((* __cs_mutex_to_lock) == (- 1)); + + * __cs_mutex_to_lock = (__cs_thread_index + 1); + + __CSEQ_message("lock acquired"); + + return (0); + } + + + int pthread_mutex_unlock(cspthread_mutex_t *__cs_mutex_to_unlock) + { + + __CPROVER_assume((* __cs_mutex_to_unlock) == (__cs_thread_index + 1)); + + * __cs_mutex_to_unlock = (- 1); + + __CSEQ_message("lock released"); + + return (0); + } + + + typedef int cspthread_cond_t; + + int pthread_cond_init(cspthread_cond_t *__cs_cond_to_init, void *__cs_attr) + { + + * __cs_cond_to_init = (- 1); + + return (0); + } + + + int pthread_cond_destroy(cspthread_cond_t *__cs_cond_to_destroy) + { + + * __cs_cond_to_destroy = (- 2); + + return (0); + } + + + int pthread_cond_wait_1(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + pthread_mutex_unlock(__cs_m); + + return (0); + } + + + int pthread_cond_wait_2(cspthread_cond_t *__cs_cond_to_wait_for, cspthread_mutex_t *__cs_m) + { + + __CPROVER_assume((* __cs_cond_to_wait_for) == 1); + + pthread_mutex_lock(__cs_m); + + return (0); + } + + + int pthread_cond_signal(cspthread_cond_t *__cs_cond_to_signal) + { + + * __cs_cond_to_signal = (1); + + __CSEQ_message("conditional variable signal"); + + return (0); + } + + + int pthread_cond_broadcast(cspthread_cond_t *__cs_cond_to_broadcast) + { + + * __cs_cond_to_broadcast = (1); + + __CSEQ_message("conditional variable broadcast"); + + return (0); + } + + + typedef struct cspthread_barrier_t + { + + unsigned int init; + + unsigned int current; + } cspthread_barrier_t; + + int pthread_barrier_init(cspthread_barrier_t *__cs_barrier_to_init, void *__cs_attr, unsigned int count) + { + + __cs_barrier_to_init->current = (count); + + __cs_barrier_to_init->init = (count); + + return (0); + } + + + int pthread_barrier_destroy(cspthread_barrier_t *__cs_barrier_to_destroy) + { + + __cs_barrier_to_destroy->init = (- 1); + + __cs_barrier_to_destroy->current = (- 1); + + return (0); + } + + + int pthread_barrier_wait_1(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __cs_barrier_to_wait->current--; + + return (0); + } + + + int pthread_barrier_wait_2(cspthread_barrier_t *__cs_barrier_to_wait) + { + + __CPROVER_assume(__cs_barrier_to_wait->current == 0); + + __cs_barrier_to_wait->current = (__cs_barrier_to_wait->init); + + return (0); + } + + + int pthread_key_create(cspthread_key_t *key, void (*destructor)(void *)) + { + + static int currentkey = (0); + + __cs_key_destructor[0] = (destructor); + + * key = (currentkey++); + + return (0); + } + + + int pthread_setspecific(cspthread_key_t key, const void *value) + { + + __cs_keys[key][__cs_thread_index + 1] = (value); + + return (0); + } + + + void *pthread_getspecific(cspthread_key_t key) + { + + return (__cs_keys[key][__cs_thread_index + 1]); + } + + + void __CSEQ_noop(void) + { + } + + + void __VERIFIER_error(); + + + cspthread_mutex_t m; + + int data = (0); + + void *thread1_0(void *__cs_param_thread1_arg) + + { + +IF(1,0,tthread1_0_1) + + pthread_mutex_lock(& m); + +tthread1_0_1: IF(1,1,tthread1_0_2) + + data++; + +tthread1_0_2: IF(1,2,tthread1_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread1: + __CPROVER_assume(__cs_pc_cs[1] >= 3); + + + ; + ; + +tthread1_0_3: + + pthread_exit(0); + } + + + void *thread2_0(void *__cs_param_thread2_arg) + + { + +IF(2,0,tthread2_0_1) + + pthread_mutex_lock(& m); + +tthread2_0_1: IF(2,1,tthread2_0_2) + + data += (2); + +tthread2_0_2: IF(2,2,tthread2_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread2: + __CPROVER_assume(__cs_pc_cs[2] >= 3); + + + ; + ; + +tthread2_0_3: + + pthread_exit(0); + } + + + void *thread3_0(void *__cs_param_thread3_arg) + + { + +IF(3,0,tthread3_0_1) + + pthread_mutex_lock(& m); + + static _Bool __cs_local_thread3___cs_tmp_if_cond_0; + +tthread3_0_1: IF(3,1,tthread3_0_2) + + __cs_local_thread3___cs_tmp_if_cond_0 = (data >= 3); + + if (__cs_local_thread3___cs_tmp_if_cond_0) + + { + + assert(0); + + ; + ; + } + + + ; + +tthread3_0_2: IF(3,2,tthread3_0_3) + + pthread_mutex_unlock(& m); + + __exit_thread3: + __CPROVER_assume(__cs_pc_cs[3] >= 3); + + + ; + ; + +tthread3_0_3: + + pthread_exit(0); + } + + + int main_thread(void) + + { + +IF(0,0,tmain_1) + + pthread_mutex_init(& m, 0); + + static cspthread_t __cs_local_main_t1; + __cs_init_scalar(& __cs_local_main_t1, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t2; + __cs_init_scalar(& __cs_local_main_t2, sizeof(cspthread_t)); + + static cspthread_t __cs_local_main_t3; + __cs_init_scalar(& __cs_local_main_t3, sizeof(cspthread_t)); + + pthread_create(& __cs_local_main_t1, 0, thread1_0, 0, 1); + +tmain_1: IF(0,1,tmain_2) + + pthread_create(& __cs_local_main_t2, 0, thread2_0, 0, 2); + +tmain_2: IF(0,2,tmain_3) + + pthread_create(& __cs_local_main_t3, 0, thread3_0, 0, 3); + +tmain_3: IF(0,3,tmain_4) + + pthread_join(__cs_local_main_t1, 0); + +tmain_4: IF(0,4,tmain_5) + + pthread_join(__cs_local_main_t2, 0); + +tmain_5: IF(0,5,tmain_6) + + pthread_join(__cs_local_main_t3, 0); + + goto __exit_main; + ; + + __exit_main: + __CPROVER_assume(__cs_pc_cs[0] >= 6); + + + ; + ; + +tmain_6: + + pthread_exit(0); + } + + + int main(void) + { + +/* round 0 */ + +/* main */ + + __cs_thread_index = (0); + + unsigned __CPROVER_bitvector[3] __cs_tmp_t0_r0; + + __cs_pc_cs[0] = (__cs_tmp_t0_r0); + + __CPROVER_assume(__cs_pc_cs[0] > 0); + + __CPROVER_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + + __cs_pc[0] = (__cs_pc_cs[0]); + +/* thread1_0 */ + + unsigned __CPROVER_bitvector[2] __cs_tmp_t1_r0; + + if (__cs_active_thread[1]) + { + + __cs_thread_index = (1); + + __cs_pc_cs[1] = (__cs_tmp_t1_r0); + + __CPROVER_assume(__cs_pc_cs[1] <= 3); + + thread1_0(__cs_threadargs[1]); + + __cs_pc[1] = (__cs_pc_cs[1]); + } + + +/* thread2_0 */ + + unsigned __CPROVER_bitvector[2] __cs_tmp_t2_r0; + + if (__cs_active_thread[2]) + { + + __cs_thread_index = (2); + + __cs_pc_cs[2] = (__cs_tmp_t2_r0); + + __CPROVER_assume(__cs_pc_cs[2] <= 3); + + thread2_0(__cs_threadargs[2]); + + __cs_pc[2] = (__cs_pc_cs[2]); + } + + +/* thread3_0 */ + + unsigned __CPROVER_bitvector[2] __cs_tmp_t3_r0; + + if (__cs_active_thread[3]) + { + + __cs_thread_index = (3); + + __cs_pc_cs[3] = (__cs_tmp_t3_r0); + + __CPROVER_assume(__cs_pc_cs[3] <= 3); + + thread3_0(__cs_threadargs[3]); + + __cs_pc[3] = (__cs_pc_cs[3]); + } + + + unsigned __CPROVER_bitvector[3] __cs_tmp_t0_r1; + + if (__cs_active_thread[0]) + { + + __cs_thread_index = (0); + + __cs_pc_cs[0] = (__cs_tmp_t0_r1); + + __CPROVER_assume(__cs_pc_cs[0] >= __cs_pc[0]); + + __CPROVER_assume(__cs_pc_cs[0] <= 6); + + main_thread(); + } + + + return (0); + } + + diff --git a/utils/dev-llvm_6.0 b/utils/dev-llvm_6.0 deleted file mode 160000 index c29083537..000000000 --- a/utils/dev-llvm_6.0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c2908353736167de7213664aee9756b96d887b78 diff --git a/utils/llvm-docker-dev b/utils/llvm-docker-dev new file mode 160000 index 000000000..b4ff51183 --- /dev/null +++ b/utils/llvm-docker-dev @@ -0,0 +1 @@ +Subproject commit b4ff51183ad25218d4a12c0718f304b32534ade2