itp-interface 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (485) hide show
  1. itp_interface/__init__.py +0 -0
  2. itp_interface/agent/__init__.py +0 -0
  3. itp_interface/agent/simple_proof_agent.py +100 -0
  4. itp_interface/coq_ser_api/__init__.py +165 -0
  5. itp_interface/coq_ser_api/contexts.py +283 -0
  6. itp_interface/coq_ser_api/coq_agent.py +459 -0
  7. itp_interface/coq_ser_api/coq_backend.py +135 -0
  8. itp_interface/coq_ser_api/coq_util.py +839 -0
  9. itp_interface/coq_ser_api/example.py +67 -0
  10. itp_interface/coq_ser_api/lsp_backend.py +375 -0
  11. itp_interface/coq_ser_api/py.typed +0 -0
  12. itp_interface/coq_ser_api/serapi_backend.py +841 -0
  13. itp_interface/coq_ser_api/util.py +145 -0
  14. itp_interface/coq_ser_api_old/__init__.py +2583 -0
  15. itp_interface/coq_ser_api_old/contexts.py +172 -0
  16. itp_interface/coq_ser_api_old/util.py +146 -0
  17. itp_interface/lean_server/__init__.py +0 -0
  18. itp_interface/lean_server/commands.py +484 -0
  19. itp_interface/lean_server/lean3_search_tool.py +358 -0
  20. itp_interface/lean_server/lean4_repl_interface.py +151 -0
  21. itp_interface/lean_server/lean4_utils.py +255 -0
  22. itp_interface/lean_server/lean_cmd_server.py +111 -0
  23. itp_interface/lean_server/lean_context.py +60 -0
  24. itp_interface/lean_server/lean_sync_server.py +174 -0
  25. itp_interface/lean_server/lean_utils.py +199 -0
  26. itp_interface/lean_server/py.typed +1 -0
  27. itp_interface/main/__init__.py +0 -0
  28. itp_interface/main/config/afp_data_gen.yaml +14 -0
  29. itp_interface/main/config/benchmark/CompCert.yaml +366 -0
  30. itp_interface/main/config/benchmark/GeoCoq.yaml +930 -0
  31. itp_interface/main/config/benchmark/UniMath.yaml +2690 -0
  32. itp_interface/main/config/benchmark/afp_isabelle.yaml +29200 -0
  33. itp_interface/main/config/benchmark/agent_proverbot_hard.yaml +247 -0
  34. itp_interface/main/config/benchmark/category-theory.yaml +470 -0
  35. itp_interface/main/config/benchmark/compcert_118_subset.yaml +148 -0
  36. itp_interface/main/config/benchmark/compcert_benchmark.yaml +36 -0
  37. itp_interface/main/config/benchmark/compcert_benchmark_hard.yaml +498 -0
  38. itp_interface/main/config/benchmark/compcert_benchmark_hard_1.yaml +55 -0
  39. itp_interface/main/config/benchmark/compcert_benchmark_hard_2.yaml +24 -0
  40. itp_interface/main/config/benchmark/compcert_benchmark_hard_3.yaml +95 -0
  41. itp_interface/main/config/benchmark/compcert_benchmark_hard_7_per_cent.yaml +78 -0
  42. itp_interface/main/config/benchmark/compcert_benchmark_test.yaml +38 -0
  43. itp_interface/main/config/benchmark/compcert_benchmark_train.yaml +340 -0
  44. itp_interface/main/config/benchmark/leandojo_novel_premises_test.yaml +2908 -0
  45. itp_interface/main/config/benchmark/leandojo_novel_premises_train.yaml +98645 -0
  46. itp_interface/main/config/benchmark/leandojo_novel_premises_val.yaml +2912 -0
  47. itp_interface/main/config/benchmark/leandojo_random.yaml +2889 -0
  48. itp_interface/main/config/benchmark/leandojo_random_test.yaml +2421 -0
  49. itp_interface/main/config/benchmark/leandojo_random_train.yaml +62729 -0
  50. itp_interface/main/config/benchmark/leandojo_random_val.yaml +2504 -0
  51. itp_interface/main/config/benchmark/math-comp.yaml +200 -0
  52. itp_interface/main/config/benchmark/miniF2F_test.yaml +12 -0
  53. itp_interface/main/config/benchmark/miniF2F_test_aime.yaml +27 -0
  54. itp_interface/main/config/benchmark/miniF2F_test_algebra.yaml +30 -0
  55. itp_interface/main/config/benchmark/miniF2F_test_amc12.yaml +57 -0
  56. itp_interface/main/config/benchmark/miniF2F_test_few_shot_hard.yaml +231 -0
  57. itp_interface/main/config/benchmark/miniF2F_test_imo.yaml +32 -0
  58. itp_interface/main/config/benchmark/miniF2F_test_induction.yaml +20 -0
  59. itp_interface/main/config/benchmark/miniF2F_test_mathd_algebra.yaml +82 -0
  60. itp_interface/main/config/benchmark/miniF2F_test_mathd_algebra_hard.yaml +72 -0
  61. itp_interface/main/config/benchmark/miniF2F_test_mathd_numbertheory.yaml +72 -0
  62. itp_interface/main/config/benchmark/miniF2F_test_numbertheory.yaml +20 -0
  63. itp_interface/main/config/benchmark/minicompcert_benchmark_1.yaml +14 -0
  64. itp_interface/main/config/benchmark/proverbot_hard.yaml +104 -0
  65. itp_interface/main/config/benchmark/re_prover.yaml +66 -0
  66. itp_interface/main/config/benchmark/re_prover_hard.yaml +41 -0
  67. itp_interface/main/config/benchmark/re_prover_very_hard.yaml +22 -0
  68. itp_interface/main/config/benchmark/reprover_with_retrieval.yaml +73 -0
  69. itp_interface/main/config/benchmark/reprover_with_retrieval_hard.yaml +30 -0
  70. itp_interface/main/config/benchmark/reprover_with_retrieval_neg.yaml +195 -0
  71. itp_interface/main/config/benchmark/simple_benchmark_1.yaml +24 -0
  72. itp_interface/main/config/benchmark/simple_benchmark_8.yaml +50 -0
  73. itp_interface/main/config/benchmark/simple_benchmark_9.yaml +65 -0
  74. itp_interface/main/config/benchmark/simple_benchmark_isabelle.yaml +18 -0
  75. itp_interface/main/config/benchmark/simple_benchmark_lean.yaml +12 -0
  76. itp_interface/main/config/benchmark/simple_benchmark_lean_training_data.yaml +12 -0
  77. itp_interface/main/config/benchmark/simple_rl_benchmark_lean.yaml +14 -0
  78. itp_interface/main/config/benchmark/stack_machine.yaml +13 -0
  79. itp_interface/main/config/benchmark/stack_machine_hard.yaml +15 -0
  80. itp_interface/main/config/category_theory_data_gen.yaml +14 -0
  81. itp_interface/main/config/category_theory_data_gen_random.yaml +16 -0
  82. itp_interface/main/config/compcert_data_gen_test.yaml +10 -0
  83. itp_interface/main/config/compcert_data_gen_train.yaml +7 -0
  84. itp_interface/main/config/env_settings/bm25_retrieval.yaml +2 -0
  85. itp_interface/main/config/env_settings/bm25_retrieval_no_dfns.yaml +2 -0
  86. itp_interface/main/config/env_settings/bm25_retrieval_only_local_no_dfns.yaml +2 -0
  87. itp_interface/main/config/env_settings/bm25_retrieval_with_print.yaml +2 -0
  88. itp_interface/main/config/env_settings/bm25_retrieval_with_print_only_local.yaml +2 -0
  89. itp_interface/main/config/env_settings/bm25_retrieval_with_print_only_local_no_dfns.yaml +2 -0
  90. itp_interface/main/config/env_settings/no_retrieval.yaml +2 -0
  91. itp_interface/main/config/experiments.yaml +12 -0
  92. itp_interface/main/config/geo_coq_data_gen.yaml +14 -0
  93. itp_interface/main/config/geo_coq_data_gen_random.yaml +16 -0
  94. itp_interface/main/config/leandojo_random_data_gen.yaml +16 -0
  95. itp_interface/main/config/math_comp_data_gen.yaml +14 -0
  96. itp_interface/main/config/math_comp_data_gen_random.yaml +16 -0
  97. itp_interface/main/config/mathlib_data_gen.yaml +14 -0
  98. itp_interface/main/config/repo/coq_repos.yaml +191 -0
  99. itp_interface/main/config/run_settings/default_coq_data_generation_transforms.yaml +24 -0
  100. itp_interface/main/config/run_settings/default_isabelle_data_generation_transforms.yaml +24 -0
  101. itp_interface/main/config/run_settings/default_lean4_data_generation_transforms.yaml +24 -0
  102. itp_interface/main/config/run_settings/default_lean_data_generation_transforms.yaml +24 -0
  103. itp_interface/main/config/simple_coq_data_gen.yaml +12 -0
  104. itp_interface/main/config/simple_coq_data_gen_random.yaml +17 -0
  105. itp_interface/main/config/simple_lean_data_gen.yaml +12 -0
  106. itp_interface/main/config/simple_rl_lean_data_gen.yaml +12 -0
  107. itp_interface/main/config/uni_math_data_gen.yaml +14 -0
  108. itp_interface/main/config.py +192 -0
  109. itp_interface/main/extract_benchmark_dataset.py +106 -0
  110. itp_interface/main/filter_dataset.py +107 -0
  111. itp_interface/main/install.py +92 -0
  112. itp_interface/main/merge_dataset.py +96 -0
  113. itp_interface/main/run_tool.py +444 -0
  114. itp_interface/pisa/.git +1 -0
  115. itp_interface/pisa/.gitignore +125 -0
  116. itp_interface/pisa/.idea/.gitignore +8 -0
  117. itp_interface/pisa/.idea/ClojureProjectResolveSettings.xml +6 -0
  118. itp_interface/pisa/.idea/codeStyles/Project.xml +7 -0
  119. itp_interface/pisa/.idea/codeStyles/codeStyleConfig.xml +5 -0
  120. itp_interface/pisa/.idea/inspectionProfiles/Project_Default.xml +16 -0
  121. itp_interface/pisa/.idea/libraries/sbt__com_google_android_annotations_4_1_1_4_jar.xml +13 -0
  122. itp_interface/pisa/.idea/libraries/sbt__com_google_api_grpc_proto_google_common_protos_1_17_0_jar.xml +13 -0
  123. itp_interface/pisa/.idea/libraries/sbt__com_google_code_findbugs_jsr305_3_0_2_jar.xml +13 -0
  124. itp_interface/pisa/.idea/libraries/sbt__com_google_code_gson_gson_2_8_6_jar.xml +13 -0
  125. itp_interface/pisa/.idea/libraries/sbt__com_google_errorprone_error_prone_annotations_2_3_4_jar.xml +13 -0
  126. itp_interface/pisa/.idea/libraries/sbt__com_google_guava_failureaccess_1_0_1_jar.xml +13 -0
  127. itp_interface/pisa/.idea/libraries/sbt__com_google_guava_guava_30_0_jre_jar.xml +13 -0
  128. itp_interface/pisa/.idea/libraries/sbt__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava_jar.xml +9 -0
  129. itp_interface/pisa/.idea/libraries/sbt__com_google_j2objc_j2objc_annotations_1_3_jar.xml +13 -0
  130. itp_interface/pisa/.idea/libraries/sbt__com_google_protobuf_protobuf_java_3_12_0_jar.xml +13 -0
  131. itp_interface/pisa/.idea/libraries/sbt__com_google_protobuf_protobuf_java_util_3_12_0_jar.xml +13 -0
  132. itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_fastparse_2_13_2_3_0_jar.xml +13 -0
  133. itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_geny_2_13_0_6_0_jar.xml +13 -0
  134. itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_sourcecode_2_13_0_2_1_jar.xml +13 -0
  135. itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_lenses_2_13_0_10_9_jar.xml +13 -0
  136. itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_scalapb_runtime_2_13_0_10_9_jar.xml +13 -0
  137. itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_scalapb_runtime_grpc_2_13_0_10_9_jar.xml +13 -0
  138. itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_zio_grpc_zio_grpc_core_2_13_0_4_2_jar.xml +13 -0
  139. itp_interface/pisa/.idea/libraries/sbt__com_thoughtworks_paranamer_paranamer_2_8_jar.xml +13 -0
  140. itp_interface/pisa/.idea/libraries/sbt__commons_io_commons_io_2_8_0_jar.xml +13 -0
  141. itp_interface/pisa/.idea/libraries/sbt__de_unruh_java_patterns_0_1_0_jar.xml +13 -0
  142. itp_interface/pisa/.idea/libraries/sbt__de_unruh_scala_isabelle_2_13_master_SNAPSHOT_jar.xml +13 -0
  143. itp_interface/pisa/.idea/libraries/sbt__dev_zio_izumi_reflect_2_13_1_0_0_M9_jar.xml +13 -0
  144. itp_interface/pisa/.idea/libraries/sbt__dev_zio_izumi_reflect_thirdparty_boopickle_shaded_2_13_1_0_0_M9_jar.xml +13 -0
  145. itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_2_13_1_0_3_jar.xml +13 -0
  146. itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_stacktracer_2_13_1_0_3_jar.xml +13 -0
  147. itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_streams_2_13_1_0_3_jar.xml +13 -0
  148. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_api_1_34_0_jar.xml +13 -0
  149. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_context_1_34_0_jar.xml +13 -0
  150. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_core_1_34_0_jar.xml +13 -0
  151. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_netty_1_34_0_jar.xml +13 -0
  152. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_protobuf_1_34_0_jar.xml +13 -0
  153. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_protobuf_lite_1_34_0_jar.xml +13 -0
  154. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_services_1_34_0_jar.xml +13 -0
  155. itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_stub_1_34_0_jar.xml +13 -0
  156. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_buffer_4_1_51_Final_jar.xml +13 -0
  157. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_4_1_51_Final_jar.xml +13 -0
  158. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_http2_4_1_51_Final_jar.xml +13 -0
  159. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_http_4_1_51_Final_jar.xml +13 -0
  160. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_socks_4_1_51_Final_jar.xml +13 -0
  161. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_common_4_1_51_Final_jar.xml +13 -0
  162. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_handler_4_1_51_Final_jar.xml +13 -0
  163. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_handler_proxy_4_1_51_Final_jar.xml +13 -0
  164. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_resolver_4_1_51_Final_jar.xml +13 -0
  165. itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_transport_4_1_51_Final_jar.xml +13 -0
  166. itp_interface/pisa/.idea/libraries/sbt__io_perfmark_perfmark_api_0_19_0_jar.xml +13 -0
  167. itp_interface/pisa/.idea/libraries/sbt__net_java_dev_jna_jna_5_3_1_jar.xml +13 -0
  168. itp_interface/pisa/.idea/libraries/sbt__net_liftweb_lift_json_2_13_3_4_3_jar.xml +13 -0
  169. itp_interface/pisa/.idea/libraries/sbt__org_apache_commons_commons_lang3_3_11_jar.xml +13 -0
  170. itp_interface/pisa/.idea/libraries/sbt__org_apache_commons_commons_text_1_9_jar.xml +13 -0
  171. itp_interface/pisa/.idea/libraries/sbt__org_checkerframework_checker_qual_3_5_0_jar.xml +13 -0
  172. itp_interface/pisa/.idea/libraries/sbt__org_codehaus_mojo_animal_sniffer_annotations_1_18_jar.xml +13 -0
  173. itp_interface/pisa/.idea/libraries/sbt__org_jetbrains_annotations_20_1_0_jar.xml +13 -0
  174. itp_interface/pisa/.idea/libraries/sbt__org_jline_jline_3_16_0_jar.xml +13 -0
  175. itp_interface/pisa/.idea/libraries/sbt__org_log4s_log4s_2_13_1_9_0_jar.xml +13 -0
  176. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_modules_scala_collection_compat_2_13_2_1_6_jar.xml +13 -0
  177. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_modules_scala_xml_2_13_1_3_0_jar.xml +13 -0
  178. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_compiler_2_13_4_jar.xml +13 -0
  179. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_library_2_13_4_jar.xml +23 -0
  180. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_reflect_2_13_4_jar.xml +13 -0
  181. itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scalap_2_13_4_jar.xml +13 -0
  182. itp_interface/pisa/.idea/libraries/sbt__org_scalaz_scalaz_core_2_13_7_3_2_jar.xml +13 -0
  183. itp_interface/pisa/.idea/libraries/sbt__org_slf4j_slf4j_api_1_7_30_jar.xml +13 -0
  184. itp_interface/pisa/.idea/libraries/sbt__org_slf4j_slf4j_simple_1_7_30_jar.xml +13 -0
  185. itp_interface/pisa/.idea/misc.xml +7 -0
  186. itp_interface/pisa/.idea/modules/PISA-build.iml +127 -0
  187. itp_interface/pisa/.idea/modules/PISA.iml +94 -0
  188. itp_interface/pisa/.idea/modules.xml +9 -0
  189. itp_interface/pisa/.idea/other.xml +6 -0
  190. itp_interface/pisa/.idea/sbt.xml +20 -0
  191. itp_interface/pisa/.idea/scala_compiler.xml +6 -0
  192. itp_interface/pisa/.idea/uiDesigner.xml +124 -0
  193. itp_interface/pisa/.idea/vcs.xml +6 -0
  194. itp_interface/pisa/.scalafmt.conf +2 -0
  195. itp_interface/pisa/LICENSE +29 -0
  196. itp_interface/pisa/README.md +262 -0
  197. itp_interface/pisa/build.sbt +49 -0
  198. itp_interface/pisa/build.sh +26 -0
  199. itp_interface/pisa/command_generation/close_gaps.py +44 -0
  200. itp_interface/pisa/command_generation/conjecture_normal_order.py +62 -0
  201. itp_interface/pisa/command_generation/conjecturer_command_generator.py +36 -0
  202. itp_interface/pisa/command_generation/create_dirs.py +11 -0
  203. itp_interface/pisa/command_generation/find_std.py +67 -0
  204. itp_interface/pisa/command_generation/generate_build_commands_afp.py +15 -0
  205. itp_interface/pisa/command_generation/generate_build_commands_std.py +15 -0
  206. itp_interface/pisa/command_generation/generate_commands_afp.py +103 -0
  207. itp_interface/pisa/command_generation/generate_commands_mini.py +73 -0
  208. itp_interface/pisa/command_generation/generate_commands_std.py +69 -0
  209. itp_interface/pisa/command_generation/generate_hammer_extraction_text.py +5 -0
  210. itp_interface/pisa/command_generation/hammer_command_generator.py +40 -0
  211. itp_interface/pisa/command_generation/hp_search_command_generator.py +63 -0
  212. itp_interface/pisa/command_generation/oracle_command_generator.py +56 -0
  213. itp_interface/pisa/command_generation/search_command_generator.py +69 -0
  214. itp_interface/pisa/command_generation/summarise_problem_names.py +45 -0
  215. itp_interface/pisa/command_generation/tpu_hp_search.py +75 -0
  216. itp_interface/pisa/docker/Dockerfile +34 -0
  217. itp_interface/pisa/docker/docker_tutorial.md +64 -0
  218. itp_interface/pisa/eval_setup/copy_isabelle.py +42 -0
  219. itp_interface/pisa/eval_setup/copy_pisa_jars.py +18 -0
  220. itp_interface/pisa/mesh_transformer_utils/tokenization.py +86 -0
  221. itp_interface/pisa/project/build.properties +1 -0
  222. itp_interface/pisa/project/plugins.sbt +5 -0
  223. itp_interface/pisa/requirements.txt +4 -0
  224. itp_interface/pisa/scripts/extract_last_k_steps.py +28 -0
  225. itp_interface/pisa/scripts/extract_proof_corpus.py +26 -0
  226. itp_interface/pisa/scripts/gather_hammer_results.py +27 -0
  227. itp_interface/pisa/scripts/length_in_char_stats.py +20 -0
  228. itp_interface/pisa/scripts/mix.py +127 -0
  229. itp_interface/pisa/scripts/results_stat.py +52 -0
  230. itp_interface/pisa/scripts/test_array_job.sh +34 -0
  231. itp_interface/pisa/setup.sh +25 -0
  232. itp_interface/pisa/src/main/protobuf/server.proto +60 -0
  233. itp_interface/pisa/src/main/python/.idea/.gitignore +8 -0
  234. itp_interface/pisa/src/main/python/.idea/inspectionProfiles/Project_Default.xml +18 -0
  235. itp_interface/pisa/src/main/python/.idea/inspectionProfiles/profiles_settings.xml +6 -0
  236. itp_interface/pisa/src/main/python/.idea/misc.xml +4 -0
  237. itp_interface/pisa/src/main/python/.idea/modules.xml +8 -0
  238. itp_interface/pisa/src/main/python/.idea/python.iml +12 -0
  239. itp_interface/pisa/src/main/python/.idea/vcs.xml +6 -0
  240. itp_interface/pisa/src/main/python/conjecturing_parsing/conjecturer_postprocessing.py +59 -0
  241. itp_interface/pisa/src/main/python/data_extraction/extract_data.py +184 -0
  242. itp_interface/pisa/src/main/python/data_extraction/find_premises.py +221 -0
  243. itp_interface/pisa/src/main/python/data_extraction/process_data.py +129 -0
  244. itp_interface/pisa/src/main/python/legacy/PisaFlexibleClient.py +167 -0
  245. itp_interface/pisa/src/main/python/legacy/autof_test.py +74 -0
  246. itp_interface/pisa/src/main/python/legacy/cmd_client.py +23 -0
  247. itp_interface/pisa/src/main/python/legacy/convert_scala_dump_to_test_name_jsons.py +14 -0
  248. itp_interface/pisa/src/main/python/legacy/create_data_txt.py +72 -0
  249. itp_interface/pisa/src/main/python/legacy/create_finetune_tfrecords.py +311 -0
  250. itp_interface/pisa/src/main/python/legacy/demo.py +49 -0
  251. itp_interface/pisa/src/main/python/legacy/evaluate.py +108 -0
  252. itp_interface/pisa/src/main/python/legacy/extract_first_step.py +25 -0
  253. itp_interface/pisa/src/main/python/legacy/get_global_facts.py +35 -0
  254. itp_interface/pisa/src/main/python/legacy/mix_data.py +19 -0
  255. itp_interface/pisa/src/main/python/legacy/one_stage_extraction.py +111 -0
  256. itp_interface/pisa/src/main/python/legacy/prepare_episodic_transitions.py +137 -0
  257. itp_interface/pisa/src/main/python/legacy/prepare_translation_pairs.py +277 -0
  258. itp_interface/pisa/src/main/python/pisa_client.py +322 -0
  259. itp_interface/pisa/src/main/python/server_pb2.py +394 -0
  260. itp_interface/pisa/src/main/python/server_pb2_grpc.py +230 -0
  261. itp_interface/pisa/src/main/python/test_client.py +17 -0
  262. itp_interface/pisa/src/main/python/test_client2.py +79 -0
  263. itp_interface/pisa/src/main/python/utils/filters.py +59 -0
  264. itp_interface/pisa/src/main/python/utils/pisa_server_control.py +29 -0
  265. itp_interface/pisa/src/main/scala/pisa/agent/CheckSyntax.scala +257 -0
  266. itp_interface/pisa/src/main/scala/pisa/agent/DepThms.scala +29 -0
  267. itp_interface/pisa/src/main/scala/pisa/agent/PisaStat.scala +46 -0
  268. itp_interface/pisa/src/main/scala/pisa/agent/RefactorTest.scala +40 -0
  269. itp_interface/pisa/src/main/scala/pisa/agent/RepHammer.scala +95 -0
  270. itp_interface/pisa/src/main/scala/pisa/server/HammFacts.scala +63 -0
  271. itp_interface/pisa/src/main/scala/pisa/server/PisaOS.scala +881 -0
  272. itp_interface/pisa/src/main/scala/pisa/server/PisaOneStage.scala +540 -0
  273. itp_interface/pisa/src/main/scala/pisa/server/PisaOneStageServers.scala +1048 -0
  274. itp_interface/pisa/src/main/scala/pisa/utils/TheoryManager.scala +95 -0
  275. itp_interface/pisa/src/test/python/analyse_debug.py +33 -0
  276. itp_interface/pisa/src/test/python/extract_test_seq2seq.py +53 -0
  277. itp_interface/pisa/src/test/python/extract_test_theorem_ground_truth_indices.py +31 -0
  278. itp_interface/pisa/src/test/python/proof_originality.py +24 -0
  279. itp_interface/pisa/src/test/python/test_command_generator.py +25 -0
  280. itp_interface/pisa/src/test/python/test_model_sequence_accuracy.py +70 -0
  281. itp_interface/pisa/src/test/scala/pisa/Easy.scala +26 -0
  282. itp_interface/pisa/src/test/scala/pisa/TestCurl.scala +82 -0
  283. itp_interface/pisa/src/test/scala/pisa/TestIsa.scala +27 -0
  284. itp_interface/pisa/test.sh +19 -0
  285. itp_interface/pisa/universal_test_theorems.tar.gz +0 -0
  286. itp_interface/repo/build.py +78 -0
  287. itp_interface/repo/clone.py +79 -0
  288. itp_interface/repo/dataset_discovery.py +99 -0
  289. itp_interface/retrieval/__init__.py +0 -0
  290. itp_interface/retrieval/abstraction.py +35 -0
  291. itp_interface/retrieval/coq_bm25_reranker.py +153 -0
  292. itp_interface/retrieval/isabelle_bm25_reranker.py +86 -0
  293. itp_interface/retrieval/lean3_bm25_reranker.py +86 -0
  294. itp_interface/rl/__init__.py +0 -0
  295. itp_interface/rl/abstraction.py +168 -0
  296. itp_interface/rl/proof_action.py +172 -0
  297. itp_interface/rl/proof_state.py +149 -0
  298. itp_interface/rl/proof_tree.py +109 -0
  299. itp_interface/rl/simpl_proof_env_pool.py +16 -0
  300. itp_interface/rl/simple_proof_env.py +713 -0
  301. itp_interface/rl/simple_proof_env_pool.py +591 -0
  302. itp_interface/scripts/setup.sh +228 -0
  303. itp_interface/tools/__init__.py +0 -0
  304. itp_interface/tools/basic_utils.py +172 -0
  305. itp_interface/tools/bin_packing.py +61 -0
  306. itp_interface/tools/cache.py +93 -0
  307. itp_interface/tools/coq_build_spec.py +31 -0
  308. itp_interface/tools/coq_build_tool.py +319 -0
  309. itp_interface/tools/coq_context_helper.py +354 -0
  310. itp_interface/tools/coq_executor.py +508 -0
  311. itp_interface/tools/coq_local_data_generation_transform.py +158 -0
  312. itp_interface/tools/coq_parse_utils.py +154 -0
  313. itp_interface/tools/coq_raw_proofs.py +193 -0
  314. itp_interface/tools/coq_theorem_proof_pair_generation_transform.py +146 -0
  315. itp_interface/tools/coq_training_data_generator.py +76 -0
  316. itp_interface/tools/dynamic_coq_proof_exec.py +220 -0
  317. itp_interface/tools/dynamic_isabelle_proof_exec.py +229 -0
  318. itp_interface/tools/dynamic_lean4_proof_exec.py +236 -0
  319. itp_interface/tools/dynamic_lean_proof_exec.py +228 -0
  320. itp_interface/tools/isabelle_context_helper.py +66 -0
  321. itp_interface/tools/isabelle_executor.py +862 -0
  322. itp_interface/tools/isabelle_local_data_generation_transform.py +149 -0
  323. itp_interface/tools/isabelle_parse_utils.py +131 -0
  324. itp_interface/tools/isabelle_server.py +106 -0
  325. itp_interface/tools/lean4_context_helper.py +72 -0
  326. itp_interface/tools/lean4_local_data_generation_transform.py +122 -0
  327. itp_interface/tools/lean4_sync_executor.py +1193 -0
  328. itp_interface/tools/lean_cmd_executor.py +804 -0
  329. itp_interface/tools/lean_context_helper.py +327 -0
  330. itp_interface/tools/lean_dojo_data_generation_transform.py +206 -0
  331. itp_interface/tools/lean_executor.py +687 -0
  332. itp_interface/tools/lean_local_data_generation_transform.py +136 -0
  333. itp_interface/tools/lean_parse_utils.py +32 -0
  334. itp_interface/tools/log_utils.py +20 -0
  335. itp_interface/tools/proof_exec_callback.py +76 -0
  336. itp_interface/tools/ray_utils.py +265 -0
  337. itp_interface/tools/repl/.git +1 -0
  338. itp_interface/tools/repl/.github/workflows/ci.yml +24 -0
  339. itp_interface/tools/repl/.gitignore +7 -0
  340. itp_interface/tools/repl/.vscode/copyright.code-snippets +13 -0
  341. itp_interface/tools/repl/.vscode/extensions.json +13 -0
  342. itp_interface/tools/repl/.vscode/module-docstring.code-snippets +35 -0
  343. itp_interface/tools/repl/.vscode/settings.json +11 -0
  344. itp_interface/tools/repl/README.md +174 -0
  345. itp_interface/tools/repl/REPL/Frontend.lean +47 -0
  346. itp_interface/tools/repl/REPL/JSON.lean +186 -0
  347. itp_interface/tools/repl/REPL/Lean/ContextInfo.lean +9 -0
  348. itp_interface/tools/repl/REPL/Lean/Environment.lean +31 -0
  349. itp_interface/tools/repl/REPL/Lean/InfoTree/ToJson.lean +114 -0
  350. itp_interface/tools/repl/REPL/Lean/InfoTree.lean +272 -0
  351. itp_interface/tools/repl/REPL/Main.lean +323 -0
  352. itp_interface/tools/repl/REPL/Snapshots.lean +306 -0
  353. itp_interface/tools/repl/REPL/Util/Path.lean +36 -0
  354. itp_interface/tools/repl/REPL/Util/Pickle.lean +44 -0
  355. itp_interface/tools/repl/REPL.lean +4 -0
  356. itp_interface/tools/repl/lake-manifest.json +5 -0
  357. itp_interface/tools/repl/lakefile.lean +15 -0
  358. itp_interface/tools/repl/lean-toolchain +1 -0
  359. itp_interface/tools/repl/test/Mathlib/.gitignore +5 -0
  360. itp_interface/tools/repl/test/Mathlib/H20231110.sh +2 -0
  361. itp_interface/tools/repl/test/Mathlib/ReplMathlibTests.lean +1 -0
  362. itp_interface/tools/repl/test/Mathlib/lake-manifest.json +68 -0
  363. itp_interface/tools/repl/test/Mathlib/lakefile.lean +11 -0
  364. itp_interface/tools/repl/test/Mathlib/lean-toolchain +1 -0
  365. itp_interface/tools/repl/test/Mathlib/test/20240209.expected.out +20 -0
  366. itp_interface/tools/repl/test/Mathlib/test/20240209.in +3 -0
  367. itp_interface/tools/repl/test/Mathlib/test/20240209.lean +4 -0
  368. itp_interface/tools/repl/test/Mathlib/test/H20231020.expected.out +8 -0
  369. itp_interface/tools/repl/test/Mathlib/test/H20231020.in +8 -0
  370. itp_interface/tools/repl/test/Mathlib/test/H20231020.lean +22 -0
  371. itp_interface/tools/repl/test/Mathlib/test/H20231110.expected.out +4 -0
  372. itp_interface/tools/repl/test/Mathlib/test/H20231110.in +4 -0
  373. itp_interface/tools/repl/test/Mathlib/test/H20231115.expected.out +19 -0
  374. itp_interface/tools/repl/test/Mathlib/test/H20231115.in +5 -0
  375. itp_interface/tools/repl/test/Mathlib/test/H20231115_2.expected.out +18 -0
  376. itp_interface/tools/repl/test/Mathlib/test/H20231115_2.in +4 -0
  377. itp_interface/tools/repl/test/Mathlib/test/H20231115_3.expected.out +10 -0
  378. itp_interface/tools/repl/test/Mathlib/test/H20231115_3.in +4 -0
  379. itp_interface/tools/repl/test/Mathlib/test/H20231214.in +9 -0
  380. itp_interface/tools/repl/test/Mathlib/test/H20231214.lean +30 -0
  381. itp_interface/tools/repl/test/Mathlib/test/H20231215.expected.out +4 -0
  382. itp_interface/tools/repl/test/Mathlib/test/H20231215.in +4 -0
  383. itp_interface/tools/repl/test/Mathlib/test/H20231215_2.expected.out +14 -0
  384. itp_interface/tools/repl/test/Mathlib/test/H20231215_2.in +3 -0
  385. itp_interface/tools/repl/test/Mathlib/test/exact.expected.out +37 -0
  386. itp_interface/tools/repl/test/Mathlib/test/exact.in +10 -0
  387. itp_interface/tools/repl/test/Mathlib/test/import_Mathlib.lean +1 -0
  388. itp_interface/tools/repl/test/Mathlib/test/induction.expected.out +29 -0
  389. itp_interface/tools/repl/test/Mathlib/test/induction.in +10 -0
  390. itp_interface/tools/repl/test/Mathlib/test/induction.lean +6 -0
  391. itp_interface/tools/repl/test/Mathlib/test/on_goal.expected.out +22 -0
  392. itp_interface/tools/repl/test/Mathlib/test/on_goal.in +5 -0
  393. itp_interface/tools/repl/test/Mathlib/test/pickle.expected.out +16 -0
  394. itp_interface/tools/repl/test/Mathlib/test/pickle.in +6 -0
  395. itp_interface/tools/repl/test/Mathlib/test/pickle_2.expected.out +4 -0
  396. itp_interface/tools/repl/test/Mathlib/test/pickle_2.in +4 -0
  397. itp_interface/tools/repl/test/Mathlib/test.sh +41 -0
  398. itp_interface/tools/repl/test/all_tactics.expected.out +13 -0
  399. itp_interface/tools/repl/test/all_tactics.in +1 -0
  400. itp_interface/tools/repl/test/by_cases.expected.out +25 -0
  401. itp_interface/tools/repl/test/by_cases.in +8 -0
  402. itp_interface/tools/repl/test/by_cases.lean +4 -0
  403. itp_interface/tools/repl/test/calc.expected.out +32 -0
  404. itp_interface/tools/repl/test/calc.in +1 -0
  405. itp_interface/tools/repl/test/def_eval.expected.out +9 -0
  406. itp_interface/tools/repl/test/def_eval.in +3 -0
  407. itp_interface/tools/repl/test/enableInitializersExecution.expected.out +2 -0
  408. itp_interface/tools/repl/test/enableInitializersExecution.in +1 -0
  409. itp_interface/tools/repl/test/file.expected.out +8 -0
  410. itp_interface/tools/repl/test/file.in +1 -0
  411. itp_interface/tools/repl/test/file.lean +5 -0
  412. itp_interface/tools/repl/test/have_by_sorry.expected.out +28 -0
  413. itp_interface/tools/repl/test/have_by_sorry.in +6 -0
  414. itp_interface/tools/repl/test/import_lean.in +1 -0
  415. itp_interface/tools/repl/test/incomplete.expected.out +18 -0
  416. itp_interface/tools/repl/test/incomplete.in +3 -0
  417. itp_interface/tools/repl/test/incomplete.lean +0 -0
  418. itp_interface/tools/repl/test/infotree.expected.out +20 -0
  419. itp_interface/tools/repl/test/infotree.in +2 -0
  420. itp_interface/tools/repl/test/invalid_tactic.expected.out +20 -0
  421. itp_interface/tools/repl/test/invalid_tactic.in +3 -0
  422. itp_interface/tools/repl/test/name_generator.expected.out +53 -0
  423. itp_interface/tools/repl/test/name_generator.in +18 -0
  424. itp_interface/tools/repl/test/no_goal_sorry.expected.out +11 -0
  425. itp_interface/tools/repl/test/no_goal_sorry.in +1 -0
  426. itp_interface/tools/repl/test/no_goal_sorry_2.expected.out +12 -0
  427. itp_interface/tools/repl/test/no_goal_sorry_2.in +1 -0
  428. itp_interface/tools/repl/test/options.expected.out +17 -0
  429. itp_interface/tools/repl/test/options.in +6 -0
  430. itp_interface/tools/repl/test/pickle_environment.expected.out +8 -0
  431. itp_interface/tools/repl/test/pickle_environment.in +7 -0
  432. itp_interface/tools/repl/test/pickle_environment_with_imports.expected.out +10 -0
  433. itp_interface/tools/repl/test/pickle_environment_with_imports.in +9 -0
  434. itp_interface/tools/repl/test/pickle_open.expected.out +8 -0
  435. itp_interface/tools/repl/test/pickle_open.in +7 -0
  436. itp_interface/tools/repl/test/pickle_open_2.expected.out +4 -0
  437. itp_interface/tools/repl/test/pickle_open_2.in +3 -0
  438. itp_interface/tools/repl/test/pickle_open_scoped.expected.out +18 -0
  439. itp_interface/tools/repl/test/pickle_open_scoped.in +8 -0
  440. itp_interface/tools/repl/test/pickle_open_scoped_2.expected.out +14 -0
  441. itp_interface/tools/repl/test/pickle_open_scoped_2.in +3 -0
  442. itp_interface/tools/repl/test/pickle_proof_state_1.expected.out +26 -0
  443. itp_interface/tools/repl/test/pickle_proof_state_1.in +15 -0
  444. itp_interface/tools/repl/test/pickle_proof_state_2.expected.out +4 -0
  445. itp_interface/tools/repl/test/pickle_proof_state_2.in +3 -0
  446. itp_interface/tools/repl/test/pickle_proof_state_env.expected.out +26 -0
  447. itp_interface/tools/repl/test/pickle_proof_state_env.in +15 -0
  448. itp_interface/tools/repl/test/pickle_scoped_notation.in +16 -0
  449. itp_interface/tools/repl/test/pickle_scoped_notation_2.in +3 -0
  450. itp_interface/tools/repl/test/proof_step.expected.out +18 -0
  451. itp_interface/tools/repl/test/proof_step.in +7 -0
  452. itp_interface/tools/repl/test/readme.expected.out +16 -0
  453. itp_interface/tools/repl/test/readme.in +5 -0
  454. itp_interface/tools/repl/test/sorry_hypotheses.expected.out +16 -0
  455. itp_interface/tools/repl/test/sorry_hypotheses.in +4 -0
  456. itp_interface/tools/repl/test/synthesize_placeholder.expected.out +7 -0
  457. itp_interface/tools/repl/test/synthesize_placeholder.in +1 -0
  458. itp_interface/tools/repl/test/tactic_mode_sorry.expected.out +14 -0
  459. itp_interface/tools/repl/test/tactic_mode_sorry.in +3 -0
  460. itp_interface/tools/repl/test/tactic_sorry.expected.out +12 -0
  461. itp_interface/tools/repl/test/tactic_sorry.in +1 -0
  462. itp_interface/tools/repl/test/term_sorry.expected.out +12 -0
  463. itp_interface/tools/repl/test/term_sorry.in +1 -0
  464. itp_interface/tools/repl/test/trace_simp.expected.out +41 -0
  465. itp_interface/tools/repl/test/trace_simp.in +15 -0
  466. itp_interface/tools/repl/test/unfinished_tactic_block.expected.out +11 -0
  467. itp_interface/tools/repl/test/unfinished_tactic_block.in +1 -0
  468. itp_interface/tools/repl/test/unknown_environment.expected.out +2 -0
  469. itp_interface/tools/repl/test/unknown_environment.in +1 -0
  470. itp_interface/tools/repl/test/unknown_proof_state.expected.out +14 -0
  471. itp_interface/tools/repl/test/unknown_proof_state.in +3 -0
  472. itp_interface/tools/repl/test/unknown_tactic.expected.out +14 -0
  473. itp_interface/tools/repl/test/unknown_tactic.in +3 -0
  474. itp_interface/tools/repl/test/variables.expected.out +26 -0
  475. itp_interface/tools/repl/test/variables.in +5 -0
  476. itp_interface/tools/repl/test.sh +43 -0
  477. itp_interface/tools/run_data_generation_transforms.py +350 -0
  478. itp_interface/tools/theorem_details.py +25 -0
  479. itp_interface/tools/training_data.py +358 -0
  480. itp_interface/tools/training_data_format.py +599 -0
  481. itp_interface-1.0.0.dist-info/METADATA +78 -0
  482. itp_interface-1.0.0.dist-info/RECORD +485 -0
  483. itp_interface-1.0.0.dist-info/WHEEL +4 -0
  484. itp_interface-1.0.0.dist-info/entry_points.txt +3 -0
  485. itp_interface-1.0.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,45 @@
1
+ import argparse
2
+ import os
3
+ import json
4
+
5
+
6
+ if __name__ == "__main__":
7
+ parser = argparse.ArgumentParser(description='Summarise the names and files from extractions.')
8
+ parser.add_argument('--extraction-path', '-ep', help='The path to extraction files.')
9
+ parser.add_argument('--dataset-name', '-dn', help='Dataset name after dumping.')
10
+ parser.add_argument('--dump-path', '-dp', help='Path to dump the dataset.')
11
+ args = parser.parse_args()
12
+
13
+ dump_path = os.path.join(args.dump_path, args.dataset_name)
14
+ if os.path.isdir(dump_path):
15
+ os.rmdir(dump_path)
16
+
17
+ os.mkdir(dump_path)
18
+
19
+ total = 0
20
+ for split in os.listdir(args.extraction_path):
21
+ split_path = os.path.join(args.extraction_path, split)
22
+ for entry in os.listdir(split_path):
23
+ entry_path = os.path.join(split_path, entry)
24
+
25
+ if "ground_truth" in entry_path:
26
+ ground_truth = json.load(open(entry_path))
27
+ file_name = ground_truth["file_name"]
28
+ problem_names = ground_truth["problem_names"]
29
+ # if not len(problem_names) == 1:
30
+ # print(f"{len(problem_names)}, {file_name}")
31
+ # continue
32
+
33
+ for theorem_name in problem_names:
34
+ theorem_name = theorem_name.replace("\n", " ")
35
+ theorem_name = " ".join(theorem_name.split())
36
+ saving_name = file_name.split("/")[-1].strip(".thy")
37
+ total += 1
38
+ json.dump(
39
+ [
40
+ [file_name, theorem_name]
41
+ ],
42
+ open(
43
+ os.path.join(dump_path, f"test_name_{total}.json"), "w"
44
+ )
45
+ )
@@ -0,0 +1,75 @@
1
+ import glob
2
+ import os
3
+ import shutil
4
+
5
+ if __name__ == "__main__":
6
+ number_of_processes = input("Enter the number of processes you want to run at the same time:\n").strip()
7
+ number_of_processes = int(number_of_processes)
8
+ use_proof = input("Want to condition on the proof? (true/false)\n").strip()
9
+ use_conj = input("Want to conjecture? (true/false)\n").strip()
10
+ use_quick_ones = input("Want to use quick ones? (true/false)\n").strip()
11
+ use_state_first = input("Want to use the state-only agent for the first step? (true/false) (false recommended)\n").strip()
12
+ using_t5 = input("Are you using a T5 server? (true/false)?\n").strip()
13
+ greedy = input("Are you using greedy search? (true/false)?\n").strip()
14
+ last_k = input("How many last steps to incldue as context (>=0, 0 to disable)?\n").strip()
15
+ needed = input("Are you using needed steps as context (true/false)?\n").strip()
16
+
17
+
18
+ # script = 'echo "y" | sbt "runMain pisa.agent.TPUHPSearch {} {} {} {} {} {} {} {} {} {} {} {}"'
19
+
20
+ max_tokens = 64
21
+ max_trials = 100
22
+ timeout = 6000000
23
+ search_width = 8
24
+ total_cmds = list()
25
+ mql_sweep = 16
26
+ temperature = 1.0
27
+ # if using_t5.startswith("t"):
28
+ # using_t5 = "true"
29
+ # else:
30
+ # using_t5 = "false
31
+
32
+
33
+ results_dir = ""
34
+ if use_conj.startswith("t"):
35
+ results_dir = "results/search_eval_conj_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_usingT5_{}_greedy_{}_last_{}_needed_{}".format(
36
+ search_width, mql_sweep, temperature, max_tokens, max_trials, timeout, using_t5, greedy, last_k, needed)
37
+ elif use_proof.startswith("t"):
38
+ results_dir = "results/search_eval_proof_and_state_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_usingT5_{}_greedy_{}_last_{}_needed_{}".format(
39
+ search_width, mql_sweep, temperature, max_tokens, max_trials, timeout, using_t5, greedy, last_k, needed)
40
+ else:
41
+ results_dir = "results/search_eval_state_only_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_usingT5_{}_greedy_{}_last_{}_needed_{}".format(
42
+ search_width, mql_sweep, temperature, max_tokens, max_trials, timeout, using_t5, greedy, last_k, needed)
43
+
44
+ if os.path.isdir(results_dir):
45
+ shutil.rmtree(results_dir)
46
+ os.makedirs(results_dir)
47
+
48
+ if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
49
+ pattern = "universal_test_theorems/quick_test_name_{}.json"
50
+ for i in range (1, 301):
51
+ total_cmds.append(
52
+ f'echo "y" | sbt "runMain pisa.agent.TPUHPSearch {pattern.format(i)} {use_proof} {use_conj} {use_state_first} {results_dir} '
53
+ f'{search_width} {mql_sweep} {temperature} {max_tokens} {max_trials} {timeout} {using_t5} '
54
+ f'{greedy} {last_k} {needed}"'
55
+ )
56
+ else:
57
+ pattern = "universal_test_theorems/test_name_{}.json"
58
+ for i in range (1, 3001):
59
+ total_cmds.append(
60
+ f'echo "y" | sbt "runMain pisa.agent.TPUHPSearch {pattern.format(i)} {use_proof} {use_conj} {use_state_first} {results_dir} '
61
+ f'{search_width} {mql_sweep} {temperature} {max_tokens} {max_trials} {timeout} {using_t5} '
62
+ f'{greedy} {last_k} {needed}"'
63
+ )
64
+
65
+ process_number_to_cmds = {i: [] for i in range(number_of_processes)}
66
+ for i, cmd in enumerate(total_cmds):
67
+ process_number_to_cmds[i%number_of_processes].append(cmd)
68
+
69
+ for process_number, process_cmds in process_number_to_cmds.items():
70
+ with open("scripts/eval_search_conj_{}_use_proof_{}_use_state_first_{}_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_usingT5_{}_greedy_{}_last_{}_needed_{}_{}.sh".format(
71
+ use_conj, use_proof, use_state_first, search_width, "sweep_{}".format(mql_sweep), temperature, max_tokens, max_trials, timeout, using_t5, greedy, last_k, needed, process_number), "w") as f:
72
+ for process_cmd in process_cmds:
73
+ f.write(process_cmd+"\n")
74
+ f.write("PIDmain=$!\n")
75
+ f.write("wait $PIDmain\n")
@@ -0,0 +1,34 @@
1
+ FROM eclipse-temurin:11
2
+
3
+ RUN apt-get update && \
4
+ apt-get install -y python3-pip unzip zip vim tmux
5
+
6
+ RUN python3 -m pip install grpcio func_timeout protobuf==3.20.1
7
+
8
+ RUN curl -s "https://get.sdkman.io" | bash
9
+ SHELL ["/bin/bash", "-c"]
10
+
11
+ # Setting a work directory for PISA
12
+ WORKDIR /pisa
13
+
14
+ RUN apt-get install -y git && \
15
+ git clone https://github.com/albertqjiang/Portal-to-ISAbelle.git . && \
16
+ source "$HOME/.sdkman/bin/sdkman-init.sh" && \
17
+ sdk install java 11.0.11-open && \
18
+ sdk install sbt && \
19
+ sbt compile && \
20
+ sbt assembly
21
+
22
+ RUN wget https://isabelle.in.tum.de/dist/Isabelle2022_linux.tar.gz && \
23
+ tar -xzf Isabelle2022_linux.tar.gz
24
+
25
+ RUN echo 'alias isabelle=/pisa/Isabelle2022/bin/isabelle' >> ~/.bashrc
26
+
27
+ RUN /pisa/Isabelle2022/bin/isabelle build -b -D /pisa/Isabelle2022/src/HOL/ -j 20
28
+
29
+ # Comment out the next two lines if you want to build PISA without AFP
30
+ RUN wget https://archive.org/download/isabelle2022_afp20221206_heaps/isabelle2022heaps.tar.gz
31
+
32
+ RUN tar -xzf isabelle2022heaps.tar.gz -C /root/.isabelle
33
+
34
+ EXPOSE 8000-8200
@@ -0,0 +1,64 @@
1
+ # How to install PISA with Docker and start using it
2
+
3
+ This guide is designed to help you easily install and start using PISA via Docker.
4
+ Docker simplifies the deployment process by encapsulating the software and its dependencies into a single object called a Docker image. With Docker, you don't have to worry about installing all the necessary software and libraries manually.
5
+
6
+ ## 1. Prerequisites
7
+ Before getting started, please ensure that you have Docker installed on your machine.
8
+
9
+ You should also make sure that you have sufficient disk space. The PISA image is available in two versions:
10
+ - the first one is PISA with Isabelle standard library (you will need at least 10GB of disk space).
11
+ - the second one is PISA with Isabelle standard libary and the Archive of Formal Proofs (you will need at least 66GB of disk space).
12
+
13
+ ## 2. Pulling the PISA image from Docker and running the container
14
+ Open a terminal and pull the Docker image you want to use. If you want to use PISA with the standard library, type:
15
+ ```
16
+ $ docker pull dsantosmarco/pisa:pisa-sl
17
+ ```
18
+ If you prefer to use PISA with the standard library and the Archive of Formal Proofs, you should type:
19
+ ```
20
+ $ docker pull dsantosmarco/pisa:pisa-sl-afp
21
+ ```
22
+ Once the image is pulled, you can run a Docker container.
23
+ Depending on what PISA image you chose, type either:
24
+ ```
25
+ $ docker run -it --entrypoint=/bin/sh dsantosmarco/pisa:pisa-sl
26
+ ```
27
+ or:
28
+ ```
29
+ $ docker run -it --entrypoint=/bin/sh dsantosmarco/pisa:pisa-sl-afp
30
+ ```
31
+ Note that `--entrypoint=/bin/sh` is used to run the container in bash environment instead of jshell.
32
+
33
+ ## 3. Launching a PISA server and running test_client.py
34
+ Once the container is running, you can go to `/pisa/target/scala-2.13` and use `tmux` to open a new terminal window:
35
+ ```
36
+ $ cd /pisa/target/scala-2.13
37
+ $ tmux
38
+ ```
39
+ You can then run the following command to launch a PISA server in this new window:
40
+ ```
41
+ $ java -cp PISA-assembly-0.1.jar pisa.server.PisaOneStageServer8000
42
+ ```
43
+ You can then create an other window with `tmux` (using `Ctrl+B C`).
44
+ In this new window, you can go to `/pisa/src/main/python` and run the `test_client.py` file:
45
+ ```
46
+ $ cd /pisa/src/main/python
47
+ $ python3 test_client.py
48
+ ```
49
+ If everything worked, you should see the following printed in your terminal:
50
+ ```
51
+ ----------Path to Isabelle source----------
52
+ /pisa/Isabelle2022
53
+ ----------Path to Isabelle working directory----------
54
+ /pisa/Isabelle2022/src/HOL/Computational_Algebra
55
+ ----------Path to Isabelle theory file----------
56
+ /pisa/Isabelle2022/src/HOL/Computational_Algebra/Primes.thy
57
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58
+ Premise name: Primes.prime_int_iff'
59
+ Premise defn: prime_int_iff': fixes p :: "int" shows "prime p = (1 < p \<and> (\<forall>n\<in>{2..<p}. \<not> n dvd p))"
60
+ ```
61
+
62
+ ## Additional info: Building the PISA images yourself
63
+ If you prefer to build the PISA images yourself, you can use Docker to build them from the Dockerfile we added to the current folder "docker".
64
+ We used the same Dockerfile for both pisa-sl and pisa-sl-afp. If you want to build pisa-sl (without afp) you should comment out two lines of the Dockerfile (these are indicated in the Dockerfile).
@@ -0,0 +1,42 @@
1
+ import argparse
2
+ import shutil
3
+ import os
4
+ from tqdm import tqdm
5
+
6
+
7
+ if __name__ == "__main__":
8
+ parser = argparse.ArgumentParser()
9
+ parser.add_argument("--isabelle", type=str, required=True)
10
+ parser.add_argument("--isabelle-user", type=str, required=True)
11
+ parser.add_argument("--number-of-copies", type=int, required=True)
12
+ parser.add_argument("--output-path", type=str, required=True)
13
+ args = parser.parse_args()
14
+
15
+ isabelle_identifier = args.isabelle.split("/")
16
+ isabelle_identifier = isabelle_identifier[-1] if isabelle_identifier[-1] else isabelle_identifier[-2]
17
+
18
+ for index in tqdm(range(args.number_of_copies)):
19
+ index_path = os.path.join(args.output_path, f"isabelle_copy_{index}")
20
+ if not os.path.exists(index_path):
21
+ os.makedirs(index_path)
22
+
23
+ main_isa_path = os.path.join(index_path, "main_isa")
24
+ if not os.path.exists(main_isa_path):
25
+ os.makedirs(main_isa_path)
26
+ shutil.copytree(args.isabelle, os.path.join(main_isa_path, isabelle_identifier), symlinks=True)
27
+
28
+ user_isa_path = os.path.join(index_path, "user_isa")
29
+ if os.path.exists(user_isa_path):
30
+ raise AssertionError
31
+ shutil.copytree(args.isabelle_user, user_isa_path, symlinks=True)
32
+
33
+ # Edit the settings file such that the user home points to the right directory
34
+ original_isabelle_home_user_string = "$USER_HOME/.isabelle"
35
+ isabelle_home_user_string = str(user_isa_path)
36
+
37
+ isabelle_settings_path = os.path.join(main_isa_path, isabelle_identifier, "etc/settings")
38
+ with open(isabelle_settings_path, "r") as f:
39
+ settings = f.read()
40
+ settings = settings.replace(original_isabelle_home_user_string, isabelle_home_user_string)
41
+ with open(isabelle_settings_path, "w") as f:
42
+ f.write(settings)
@@ -0,0 +1,18 @@
1
+ import argparse
2
+ import shutil
3
+ import os
4
+ from tqdm import tqdm
5
+
6
+
7
+ if __name__ == "__main__":
8
+ parser = argparse.ArgumentParser()
9
+ parser.add_argument("--pisa-jar-path", type=str, required=True)
10
+ parser.add_argument("--number-of-jars", type=int, required=True)
11
+ parser.add_argument("--output-path", type=str, required=True)
12
+ args = parser.parse_args()
13
+
14
+ for index in tqdm(range(args.number_of_jars)):
15
+ shutil.copy2(
16
+ args.pisa_jar_path,
17
+ os.path.join(args.output_path, f"pisa_copy{index}.jar")
18
+ )
@@ -0,0 +1,86 @@
1
+ from transformers import GPT2TokenizerFast
2
+
3
+ from abc import ABC, abstractmethod
4
+ from typing import List
5
+ from tokenizers import Tokenizer
6
+
7
+
8
+ class TokenizerWrapper(ABC):
9
+ @abstractmethod
10
+ def encode(self, sequence) -> List[int]:
11
+ raise NotImplementedError
12
+
13
+ @abstractmethod
14
+ def decode(self, ids) -> str:
15
+ raise NotImplementedError
16
+
17
+ @property
18
+ @abstractmethod
19
+ def eos_token_id(self):
20
+ raise NotImplementedError
21
+
22
+ @property
23
+ def eos_token_str(self):
24
+ return '<|endoftext|>'
25
+
26
+ @property
27
+ def sep_token_str(self):
28
+ return ' Cambridge'
29
+
30
+ @property
31
+ def pad_token_str(self):
32
+ return ' Oxford'
33
+
34
+ @property
35
+ def sep_token_id(self):
36
+ tokens = self.encode(self.sep_token_str)
37
+ assert len(tokens) == 1
38
+ return tokens[0]
39
+
40
+ @property
41
+ def pad_token_id(self):
42
+ tokens = self.encode(self.pad_token_str)
43
+ assert len(tokens) == 1
44
+ return tokens[0]
45
+
46
+ @classmethod
47
+ def from_file_or_gpt(cls, tokenizer_path):
48
+ if tokenizer_path:
49
+ print(f'Using BPE tokenizer from: {tokenizer_path}')
50
+ return BPETokenizerWrapper(Tokenizer.from_file(tokenizer_path))
51
+ else:
52
+ print('Tokenizer not provided - using default gpt2')
53
+ GPT2TokenizerFast.max_model_input_sizes[
54
+ 'gpt2'] = 1e20 # disables a misleading warning
55
+ tokenizer = GPT2TokenizerFast.from_pretrained('gpt2')
56
+ return GPTTokenizerWrapper(tokenizer)
57
+
58
+
59
+ class GPTTokenizerWrapper(TokenizerWrapper):
60
+ def __init__(self, tokenizer: GPT2TokenizerFast):
61
+ self.tokenizer = tokenizer
62
+
63
+ def encode(self, sequence):
64
+ return self.tokenizer.encode(sequence)
65
+
66
+ def decode(self, ids):
67
+ return self.tokenizer.decode(ids)
68
+
69
+ @property
70
+ def eos_token_id(self):
71
+ return self.tokenizer.eos_token_id
72
+
73
+
74
+ class BPETokenizerWrapper(TokenizerWrapper):
75
+ def __init__(self, tokenizer: Tokenizer):
76
+ self.tokenizer = tokenizer
77
+
78
+ def encode(self, sequence):
79
+ return self.tokenizer.encode(sequence).ids
80
+
81
+ def decode(self, ids):
82
+ return self.tokenizer.decode(ids)
83
+
84
+ @property
85
+ def eos_token_id(self):
86
+ return self.tokenizer.token_to_id(self.eos_token_str)
@@ -0,0 +1 @@
1
+ sbt.version=1.4.3
@@ -0,0 +1,5 @@
1
+ val zioGrpcVersion = "0.4.2"
2
+
3
+ addSbtPlugin("com.thesamet" % "sbt-protoc" % "1.0.0-RC4")
4
+ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "1.2.0")
5
+ libraryDependencies += "com.thesamet.scalapb.zio-grpc" %% "zio-grpc-codegen" % zioGrpcVersion
@@ -0,0 +1,4 @@
1
+ protobuf==3.20.3
2
+ grpcio==1.51.1
3
+ grpcio-tools==1.44.0
4
+ func_timeout
@@ -0,0 +1,28 @@
1
+ import argparse
2
+ import os
3
+ from tqdm import tqdm
4
+
5
+
6
+ if __name__ == "__main__":
7
+ parser = argparse.ArgumentParser("Extract the last k steps of the proof to be used in automated proof search.")
8
+ parser.add_argument("--path-to-proof-and-state-file", "-ptpasf", type=str, help="Path to the file of the proof steps and states.")
9
+ parser.add_argument("--k", type=int, help="The number of steps you want to extract.")
10
+ parser.add_argument("--dump-path", "-dp", type=str, help="Path to dump the resulting files.")
11
+ args = parser.parse_args()
12
+
13
+ file_name = args.path_to_proof_and_state_file.split("/")[-1]
14
+ k_step = args.k
15
+
16
+ with open(os.path.join(args.dump_path, f"last_{k_step}_step_{file_name}"), "w") as f_out, \
17
+ open(args.path_to_proof_and_state_file) as f_in:
18
+ for line in tqdm(f_in.readlines()):
19
+ line = line.strip()
20
+ proof = line.split("<PS_SEP>")[0].strip().lstrip("Proof: ")
21
+ state = line.split("State:")[1].strip()
22
+
23
+ proof_steps = proof.split("\\n")
24
+ last_k_proof_steps = [element.strip() for element in proof_steps[-k_step:]]
25
+ last_k_proof_steps_string = " \\n ".join(last_k_proof_steps)
26
+ new_line = f"Proof: {last_k_proof_steps_string} State: {state}"
27
+ f_out.write(new_line)
28
+ f_out.write("\n")
@@ -0,0 +1,26 @@
1
+ import os
2
+ import sys
3
+ from tqdm import tqdm
4
+
5
+ file_path = sys.argv[1]
6
+ tgt_file_path = file_path.replace("src", "tgt")
7
+ output_file_path = sys.argv[2]
8
+
9
+ valid_proofs = list()
10
+
11
+ lines = open(file_path).readlines()
12
+ tgt_lines = open(tgt_file_path).readlines()
13
+
14
+ theorem_declaration = lines[0].strip()
15
+ for i, line in tqdm(enumerate(lines)):
16
+ line = line.strip()
17
+ if theorem_declaration in line:
18
+ pass
19
+ else:
20
+ theorem_declaration = line
21
+ valid_proofs.append(lines[i-1].strip() + " \\n " + tgt_lines[i-1].strip())
22
+
23
+ with open(output_file_path, "w") as fout:
24
+ for proof in valid_proofs:
25
+ fout.write(proof)
26
+ fout.write("\n")
@@ -0,0 +1,27 @@
1
+ import os
2
+
3
+ proof_dict = {}
4
+ for file_name in os.listdir("results/hammer_eval"):
5
+ if file_name.endswith("out"):
6
+ theorem_number = file_name.split("_")[0]
7
+ info_file_name = file_name.replace("out", "info")
8
+ info_file_path = os.path.join("results/hammer_eval", info_file_name)
9
+ if os.path.isfile(info_file_path):
10
+ info_lines = open(info_file_path).readlines()
11
+ proved = open(os.path.join("results/hammer_eval", file_name)).read().strip()
12
+ proved = True if (proved.startswith("t") or proved.startswith("T")) else False
13
+ proof_dict[theorem_number] = (proved, info_lines)
14
+
15
+ with open("results/hammer_eval/success", "w") as fhand:
16
+ for theorem_number in proof_dict:
17
+ info_tuple = proof_dict[theorem_number]
18
+ if info_tuple[0]:
19
+ fhand.writelines(info_tuple[1])
20
+ fhand.write("\n\n")
21
+
22
+ with open("results/hammer_eval/failure", "w") as fhand:
23
+ for theorem_number in proof_dict:
24
+ info_tuple = proof_dict[theorem_number]
25
+ if not info_tuple[0]:
26
+ fhand.writelines(info_tuple[1])
27
+ fhand.write("\n\n")
@@ -0,0 +1,20 @@
1
+ import argparse
2
+
3
+
4
+ if __name__ == "__main__":
5
+ parser = argparse.ArgumentParser("Get the ")
6
+ parser.add_argument("--path-to-proof-and-state-file", "-ptpasf", type=str, help="Path to the file of the proof steps and states.")
7
+ args = parser.parse_args()
8
+
9
+ lengths = list()
10
+ with open(args.path_to_proof_and_state_file) as fin:
11
+ for line in fin.readlines():
12
+ lengths.append(len(line.strip()))
13
+
14
+ maximum_sequence_length_in_chars = 256 * 3
15
+
16
+ print(f"Minimum: {min(lengths)}")
17
+ print(f"Maximum: {max(lengths)}")
18
+ print(f"Average: {sum(lengths)/len(lengths)}")
19
+ print(f"Median: {sorted(lengths)[int(len(lengths)/2)]}")
20
+ print(f"Retainment rate: {sorted(lengths + [maximum_sequence_length_in_chars]).index(maximum_sequence_length_in_chars) / (len(lengths)+1)}")
@@ -0,0 +1,127 @@
1
+ from tqdm import tqdm
2
+
3
+
4
+ def fill_dict_state_only(file1, file2, dictionary):
5
+ with open(file1) as fsrc:
6
+ with open(file2) as ftgt:
7
+ src_lines = fsrc.readlines()
8
+ tgt_lines = ftgt.readlines()
9
+
10
+ print(src_lines[0])
11
+ print(tgt_lines[0])
12
+
13
+ for i in tqdm(range(len(src_lines))):
14
+ src_line = src_lines[i].strip()
15
+ tgt_line = tgt_lines[i].strip()
16
+
17
+ src_line = src_line.replace("State:", "[IS] GOAL") + " PROOFSTEP"
18
+
19
+ if src_line in dictionary:
20
+ if tgt_line in dictionary[src_line]:
21
+ pass
22
+ else:
23
+ dictionary[src_line].append(tgt_line)
24
+ else:
25
+ dictionary[src_line] = [tgt_line]
26
+ return dictionary
27
+
28
+
29
+ def fill_dict_proof_and_state(file1, file2, dictionary):
30
+ with open(file1) as fsrc:
31
+ with open(file2) as ftgt:
32
+ src_lines = fsrc.readlines()
33
+ tgt_lines = ftgt.readlines()
34
+
35
+ print(src_lines[0])
36
+ print(tgt_lines[0])
37
+
38
+ for i in tqdm(range(len(src_lines))):
39
+ src_line = src_lines[i].strip()
40
+ tgt_line = tgt_lines[i].strip()
41
+
42
+ src_line = src_line.replace("Proof:", "[IS] PROOF").replace("State", "[IS] GOAL") + " PROOFSTEP"
43
+
44
+ if src_line in dictionary:
45
+ if tgt_line in dictionary[src_line]:
46
+ pass
47
+ else:
48
+ dictionary[src_line].append(tgt_line)
49
+ else:
50
+ dictionary[src_line] = [tgt_line]
51
+ return dictionary
52
+
53
+
54
+ def fill_dict_conjecture(file1, file2, dictionary):
55
+ with open(file1) as fsrc:
56
+ with open(file2) as ftgt:
57
+ src_lines = fsrc.readlines()
58
+ tgt_lines = ftgt.readlines()
59
+
60
+ print(src_lines[0])
61
+ print(tgt_lines[0])
62
+
63
+ for i in tqdm(range(len(src_lines))):
64
+ src_line = src_lines[i].strip()
65
+ tgt_line = tgt_lines[i].strip()
66
+
67
+ src_line = "[IS] GOAL " + src_line + " PROOFSTEP"
68
+
69
+ if src_line in dictionary:
70
+ if tgt_line in dictionary[src_line]:
71
+ pass
72
+ else:
73
+ dictionary[src_line].append(tgt_line)
74
+ else:
75
+ dictionary[src_line] = [tgt_line]
76
+ return dictionary
77
+
78
+ srcs_to_tgts = dict()
79
+ srcs_to_tgts = fill_dict_state_only("data/seq2seq/seq2seq_with_state/train.src", "data/seq2seq/seq2seq_with_state/train.tgt",
80
+ srcs_to_tgts)
81
+ srcs_to_tgts = fill_dict_proof_and_state("data/seq2seq/seq2seq_with_proof_and_state/train.src", "data/seq2seq/seq2seq_with_proof_and_state/train.tgt",
82
+ srcs_to_tgts)
83
+ srcs_to_tgts = fill_dict_conjecture("data/conjecturer_seq2seq/train.src", "data/conjecturer_seq2seq/train.tgt",
84
+ srcs_to_tgts)
85
+
86
+ with open("data/mixture/train.src", "w") as fsrc_out:
87
+ with open("data/mixture/train.tgt", "w") as ftgt_out:
88
+ for src_line, tgt_lines in srcs_to_tgts.items():
89
+ for tgt_line in tgt_lines:
90
+ fsrc_out.write(src_line)
91
+ fsrc_out.write("\n")
92
+ ftgt_out.write(tgt_line)
93
+ ftgt_out.write("\n")
94
+
95
+ srcs_to_tgts = dict()
96
+ srcs_to_tgts = fill_dict_state_only("data/seq2seq/seq2seq_with_state/val.src", "data/seq2seq/seq2seq_with_state/val.tgt",
97
+ srcs_to_tgts)
98
+ srcs_to_tgts = fill_dict_proof_and_state("data/seq2seq/seq2seq_with_proof_and_state/val.src", "data/seq2seq/seq2seq_with_proof_and_state/val.tgt",
99
+ srcs_to_tgts)
100
+ srcs_to_tgts = fill_dict_conjecture("data/conjecturer_seq2seq/val.src", "data/conjecturer_seq2seq/val.tgt",
101
+ srcs_to_tgts)
102
+
103
+ with open("data/mixture/val.src", "w") as fsrc_out:
104
+ with open("data/mixture/val.tgt", "w") as ftgt_out:
105
+ for src_line, tgt_lines in srcs_to_tgts.items():
106
+ for tgt_line in tgt_lines:
107
+ fsrc_out.write(src_line)
108
+ fsrc_out.write("\n")
109
+ ftgt_out.write(tgt_line)
110
+ ftgt_out.write("\n")
111
+
112
+ srcs_to_tgts = dict()
113
+ srcs_to_tgts = fill_dict_state_only("data/seq2seq/seq2seq_with_state/test.src", "data/seq2seq/seq2seq_with_state/test.tgt",
114
+ srcs_to_tgts)
115
+ srcs_to_tgts = fill_dict_proof_and_state("data/seq2seq/seq2seq_with_proof_and_state/test.src", "data/seq2seq/seq2seq_with_proof_and_state/test.tgt",
116
+ srcs_to_tgts)
117
+ srcs_to_tgts = fill_dict_conjecture("data/conjecturer_seq2seq/test.src", "data/conjecturer_seq2seq/test.tgt",
118
+ srcs_to_tgts)
119
+
120
+ with open("data/mixture/test.src", "w") as fsrc_out:
121
+ with open("data/mixture/test.tgt", "w") as ftgt_out:
122
+ for src_line, tgt_lines in srcs_to_tgts.items():
123
+ for tgt_line in tgt_lines:
124
+ fsrc_out.write(src_line)
125
+ fsrc_out.write("\n")
126
+ ftgt_out.write(tgt_line)
127
+ ftgt_out.write("\n")
@@ -0,0 +1,52 @@
1
+ import os
2
+ import sys
3
+
4
+ def stats_from_an_exp(exp_folder):
5
+ total = 0
6
+ correct = 0
7
+ for file_name in os.listdir(exp_folder):
8
+ if file_name.startswith("test_result"):
9
+ theorem_number = int(file_name.split("_")[-1])
10
+ total += 1
11
+ correct += float(open(os.path.join(exp_folder, file_name)).read())
12
+
13
+ print("Total: ", total)
14
+ success = 0
15
+ timeout = 0
16
+ fuelout = 0
17
+ queueout = 0
18
+ total = 0
19
+ for file_name in os.listdir(exp_folder):
20
+ if file_name.startswith("test_cause"):
21
+ total += 1
22
+ test_cause = open(os.path.join(exp_folder, file_name)).read()
23
+ if test_cause.startswith("Proved"):
24
+ success += 1
25
+ elif test_cause.startswith("Overall"):
26
+ timeout += 1
27
+ elif test_cause.startswith("Out"):
28
+ fuelout += 1
29
+ elif test_cause.startswith("Queue"):
30
+ queueout += 1
31
+ else:
32
+ raise NotImplementedError
33
+ print("Success | timeout | out of fuel | queue empty proportion:\n {} | {} | {} | {}".format(
34
+ success/total, timeout/total, fuelout/total, queueout/total
35
+ ))
36
+
37
+
38
+ all_folders = True
39
+ for file_name in os.listdir(sys.argv[1]):
40
+ if not file_name.startswith("."):
41
+ if not os.path.isdir(os.path.join(sys.argv[1], file_name)):
42
+ all_folders = False
43
+
44
+ if not all_folders:
45
+ print(sys.argv[1])
46
+ stats_from_an_exp(sys.argv[1])
47
+ else:
48
+ for file_name in os.listdir(sys.argv[1]):
49
+ try:
50
+ stats_from_an_exp(os.path.join(sys.argv[1], file_name))
51
+ except:
52
+ pass