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,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="PySciProjectComponent">
4
+ <option name="PY_SCI_VIEW_SUGGESTED" value="true" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,20 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ScalaSbtSettings">
4
+ <option name="customVMEnabled" value="true" />
5
+ <option name="customVMPath" value="/Library/Java/JavaVirtualMachines/openjdk-11.jdk/Contents/Home" />
6
+ <option name="linkedExternalProjectsSettings">
7
+ <SbtProjectSettings>
8
+ <option name="converterVersion" value="1" />
9
+ <option name="externalProjectPath" value="$PROJECT_DIR$" />
10
+ <option name="modules">
11
+ <set>
12
+ <option value="$PROJECT_DIR$" />
13
+ <option value="$PROJECT_DIR$/project" />
14
+ </set>
15
+ </option>
16
+ <option name="sbtVersion" value="1.4.3" />
17
+ </SbtProjectSettings>
18
+ </option>
19
+ </component>
20
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ScalaCompilerConfiguration">
4
+ <profile name="sbt 1" modules="PISA,pisa,portal-to-isabelle_2717" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,124 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Palette2">
4
+ <group name="Swing">
5
+ <item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
6
+ <default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
7
+ </item>
8
+ <item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
9
+ <default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
10
+ </item>
11
+ <item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
12
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
13
+ </item>
14
+ <item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
15
+ <default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
16
+ </item>
17
+ <item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
18
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
19
+ <initial-values>
20
+ <property name="text" value="Button" />
21
+ </initial-values>
22
+ </item>
23
+ <item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
24
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
25
+ <initial-values>
26
+ <property name="text" value="RadioButton" />
27
+ </initial-values>
28
+ </item>
29
+ <item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
30
+ <default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
31
+ <initial-values>
32
+ <property name="text" value="CheckBox" />
33
+ </initial-values>
34
+ </item>
35
+ <item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
36
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
37
+ <initial-values>
38
+ <property name="text" value="Label" />
39
+ </initial-values>
40
+ </item>
41
+ <item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
42
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
43
+ <preferred-size width="150" height="-1" />
44
+ </default-constraints>
45
+ </item>
46
+ <item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
47
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
48
+ <preferred-size width="150" height="-1" />
49
+ </default-constraints>
50
+ </item>
51
+ <item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
52
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
53
+ <preferred-size width="150" height="-1" />
54
+ </default-constraints>
55
+ </item>
56
+ <item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
57
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
58
+ <preferred-size width="150" height="50" />
59
+ </default-constraints>
60
+ </item>
61
+ <item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
62
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
63
+ <preferred-size width="150" height="50" />
64
+ </default-constraints>
65
+ </item>
66
+ <item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
67
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
68
+ <preferred-size width="150" height="50" />
69
+ </default-constraints>
70
+ </item>
71
+ <item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
72
+ <default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
73
+ </item>
74
+ <item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
75
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
76
+ <preferred-size width="150" height="50" />
77
+ </default-constraints>
78
+ </item>
79
+ <item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
80
+ <default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
81
+ <preferred-size width="150" height="50" />
82
+ </default-constraints>
83
+ </item>
84
+ <item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
85
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
86
+ <preferred-size width="150" height="50" />
87
+ </default-constraints>
88
+ </item>
89
+ <item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
90
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
91
+ <preferred-size width="200" height="200" />
92
+ </default-constraints>
93
+ </item>
94
+ <item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
95
+ <default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
96
+ <preferred-size width="200" height="200" />
97
+ </default-constraints>
98
+ </item>
99
+ <item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
100
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
101
+ </item>
102
+ <item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
103
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
104
+ </item>
105
+ <item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
106
+ <default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
107
+ </item>
108
+ <item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
109
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
110
+ </item>
111
+ <item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
112
+ <default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
113
+ <preferred-size width="-1" height="20" />
114
+ </default-constraints>
115
+ </item>
116
+ <item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
117
+ <default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
118
+ </item>
119
+ <item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
120
+ <default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
121
+ </item>
122
+ </group>
123
+ </component>
124
+ </project>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,2 @@
1
+ version = "3.5.3"
2
+ runner.dialect = scala213
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, Albert Qiaochu Jiang
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,262 @@
1
+ # PISA (Portal to ISAbelle)
2
+ PISA supports automated proof search with the interactive theorem prover [Isabelle](https://isabelle.in.tum.de).
3
+
4
+ PISA can also be used to extract proof corpus. We extracted the datasets in our AITP 2021 paper [LISA: Language models of ISAbelle proofs](http://aitp-conference.org/2021/abstract/paper_17.pdf) with it.
5
+
6
+
7
+ ## Installation
8
+ 1. **Scala configuration**
9
+
10
+ Install SDKMAN
11
+ ```shell
12
+ curl -s "https://get.sdkman.io" | bash
13
+ source .bashrc
14
+ ```
15
+ Try
16
+ ```shell
17
+ sdk help
18
+ ```
19
+ to makes ure sdk is properly installed.
20
+
21
+ Install JAVA 11 and sbt
22
+ ```shell
23
+ sdk install java 11.0.11-open
24
+ sdk install sbt
25
+ ```
26
+ 2. **Clone project and make sure it compiles**
27
+
28
+ ```shell
29
+ git clone https://github.com/albertqjiang/Portal-to-ISAbelle.git
30
+ cd Portal-to-ISAbelle
31
+ ```
32
+
33
+ Then compile the project:
34
+ ```shell
35
+ sbt compile
36
+ ```
37
+
38
+ 3. **Configure Isabelle**
39
+
40
+ Go back to home directory first and download isabelle2021
41
+ ```shell
42
+ cd ~
43
+ wget https://isabelle.in.tum.de/dist/Isabelle2022_linux.tar.gz
44
+ tar -xzf Isabelle2022_linux.tar.gz
45
+ alias isabelle=~/Isabelle2022/bin/isabelle
46
+ ```
47
+
48
+ 4. **Build Isabelle HOL**
49
+
50
+ To build with 20 parallel processes:
51
+ ```shell
52
+ isabelle build -b -D Isabelle2022/src/HOL/ -j 20
53
+ ```
54
+ This takes ~8 hours of CPU time. The actual time depends on the number of CPUs you have. On a 96-core TPU VM it takes about 15 minutes.
55
+
56
+ 5. **Download and build afp**
57
+
58
+ To build with 10 parallel processes:
59
+ ```shell
60
+ wget https://www.isa-afp.org/release/afp-current.tar.gz
61
+ tar -xzf afp-current.tar.gz
62
+ export AFP=afp-{$AFP_DATE}/thys
63
+ isabelle build -b -D $AFP -j 20
64
+ ```
65
+ This takes ~150 hours of CPU time. On a 96-core TPU VM it takes ~5 wall-clock hours. We can extract ~93% of all afp theory files.
66
+
67
+ We built the heap images for two options:
68
+ 1. Isabelle2021 with afp-2021-10-22 for linux machines (ubuntu). You can download it at:
69
+ https://archive.org/download/isabelle_heaps.tar/isabelle_heaps.tar.gz
70
+ and decompress it as ~/.isabelle.
71
+ 2. Isabelle2022 with afp-2022-12-06 for linux machines (ubuntu). You can download it at:
72
+ https://archive.org/download/isabelle2022_afp20221206_heaps/isabelle2022heaps.tar.gz and decompress it as ~/.isabelle.
73
+
74
+ Note: this does not always work on different operating systems.
75
+
76
+ 6. **Extract the test theorems**
77
+ The universal test theorems contains 3000 theorems with their file paths and names. The first 600 of them are packaged as "quick" theorems if you have no patience testing all 3000 out.
78
+ ```shell
79
+ tar -xzf universal_test_theorems.tar.gz
80
+ ```
81
+
82
+ ## Evaluation setup (if you want to have N (N>50) PISA servers running on your machine)
83
+ 1. **Create some PISA jars**
84
+
85
+ For a single process, sbt is good enough. But for multiple processes, to have native JAVA processes running is a better idea. We first use sbt-assembly to create a fat jar (a jar where all the java code is compiled into and can be run independently).
86
+ ```shell
87
+ sbt assembly
88
+ ```
89
+
90
+ The assembly process should take less than 5 minutes. The compiled jar file is in the target/scala-2.13/ directory as PISA-assembly-0.1.jar. You can then copy the PISA jar for N times if you want the jars to be truly independent and separated by calling the following script:
91
+ ```shell
92
+ python eval_setup/copy_pisa_jars.py --pisa-jar-path target/scala-2.13/PISA-assembly-0.1.jar --number-of-jars $N --output-path $OUTPUT_PATH
93
+ ```
94
+
95
+ 2. **Create some Isabelle copies**
96
+
97
+ This step is to create multiple copies of the Isabelle software as well as the built heap images to avoid IO errors which can occur when many processes are run at the same time. We use $ISABELLE to denote where your Isabelle software lives and $ISABELLE_USER to denote where your built heap images live, which is usually at $USER/.isabelle
98
+
99
+ Note that one copy of the Isabelle software plus all the heaps needed for the Archive of Formal Proofs amount to **35GB** of disk space. So create copies with care. Alternatively, you can start by trimming the heaps so only the ones you need are kept.
100
+
101
+ Use the following script to create the copies:
102
+ ```shell
103
+ python eval_setup/copy_isabelle.py --isabelle $ISABELLE --isabelle-user $ISABELLE_USER --number-of-copies $N --output-path $OUTPUT_PATH
104
+ ```
105
+
106
+ ## Extract PISA dataset
107
+ ### Archive of formal proofs
108
+ Generate commands for extracting proofs.
109
+ Edit line 9 of command_generation/generate_commands_afp.py so that it uses your actually home directory.
110
+ Run the following command:
111
+ ```shell
112
+ python command_generation/generate_commands_afp.py
113
+ ```
114
+ and follow the instructions. At the first step it asks you which ports you want to use. We current support ports 8000-8200, 9000, 10000, 11000, 12000. You can also add your favourites by editing src/scala/server/PisaOneStageServers.scala. This dictates how many processes for extraction you wish to run at the same time.
115
+
116
+ It should say "A total of X files are due to be generated" with X > 5000.
117
+ And you should see files called afp_extract_script_${port_number}.sh in the directory.
118
+
119
+ To extract the files, run the following commands to install necessary libraries and execute the commands:
120
+ ```shell
121
+ pip install grpc
122
+ pip install func_timeout
123
+ bash afp_extract_script_${port_number_1}.sh &
124
+ bash afp_extract_script_${port_number_2}.sh &
125
+ bash afp_extract_script_${port_number_3}.sh &
126
+ ...
127
+ bash afp_extract_script_${port_number_n}.sh &
128
+ ```
129
+
130
+ With a single process, the extraction takes ~5 days. This will extract files to the directory afp_extractions. We have also extracted this dataset, available for download at https://archive.org/download/afp_extractions.tar/afp_extractions.tar.gz.
131
+
132
+ To extract state-only source-to-target pairs, run the following command:
133
+ ```shell
134
+ python3 src/main/python/prepare_episodic_transitions.py -efd afp_extractions -sd data/state_only --state
135
+ ```
136
+
137
+ To extract proof-only source-to-target pairs, run the following command:
138
+ ```shell
139
+ python3 src/main/python/prepare_episodic_transitions.py -efd afp_extractions -sd data/proof_only --proof
140
+ ```
141
+
142
+ To extract proof-and-state source-to-target pairs, run the following command:
143
+ ```shell
144
+ python3 src/main/python/prepare_episodic_transitions.py -efd afp_extractions -sd data/proof_and_state --proof --state
145
+ ```
146
+ Note that extraction involving proofs will take pretty long and will result in large files. State-only files amount to 8.1G. With proof steps it's even much larger.
147
+
148
+ # Acknowledgement
149
+ This library is heavily based on [scala-isabelle](https://github.com/dominique-unruh/scala-isabelle), the work of Dominique Unruh. We are very grateful to Dominique for his kind help and guidance.
150
+
151
+ # Citation
152
+ If you use this directory, or our code, please cite the paper we published at AITP 2021.
153
+ ```bibtex
154
+ @article{jiang2021lisa,
155
+ title={LISA: Language models of ISAbelle proofs},
156
+ author={Jiang, Albert Q. and Li, Wenda and Han, Jesse Michael and Wu, Yuhuai},
157
+ year={2021},
158
+ journal={6th Conference on Artificial Intelligence and Theorem Proving},
159
+ }
160
+ ```
161
+
162
+ <!-- # Untested legacy stuff
163
+ **The following content was built on the 2020 version of Isabelle with afp-2021-02-11. They have not been tested with Isabelle2021 and might contain bugs.**
164
+ ## Running proof search
165
+ After the heap images have been built, experiments of proof searching can be run.
166
+ 1. Configure the Isabelle binary path and the AFP path
167
+
168
+ Go to PisaSearch.scala, change the second string of line 352 so that it points to your afp path.
169
+
170
+ Change the string in line 383 so that it points to the directory where Isabelle was installed.
171
+
172
+ (For the last two steps, be careful because the substitution is based on strings and quite subtle. Make sure everything checks out.)
173
+
174
+ Lines 46-79 contain the querying commands. Change these to use OpenAI's internal API.
175
+
176
+ 2. Get the universal test theorem names
177
+
178
+ ```shell
179
+ cd Portal-to-ISAbelle
180
+ wget http://www.cs.toronto.edu/~ajiang/universal_test_theorems.tar.gz
181
+ tar -xzvf universal_test_theorems.tar.gz
182
+ ```
183
+ 3. Generate the proof search scripts
184
+
185
+ ```shell
186
+ mkdir results
187
+ python command_generation/search_command_generator.py
188
+ ```
189
+ Follow the instructions.
190
+
191
+ 4. Run the proof search experiments
192
+
193
+ In scripts, some files have been generated in the format of
194
+ eval_search_conj_{boolean}_use_proof_{boolean}_use_state_first_{boolean}_{$script_number}.sh
195
+
196
+ Wrap them with Python to use subprocesses.
197
+
198
+ The results will be in the results directory.
199
+
200
+
201
+ ### Python packages
202
+ grpc
203
+
204
+ It might work with lower versions but they have not been tested.
205
+
206
+ ## Usage
207
+ <!-- ### Build AFP heap images
208
+ First you should know the path to the Isabelle binary executable.
209
+ On MacOS, with Isabelle2020, the path to it is
210
+ ```shell
211
+ /Applications/Isabelle2020.app/Isabelle/bin/isabelle
212
+ ```
213
+ On linux, it might be
214
+ ```shell
215
+ ~/Isabelle2020/bin/isabelle
216
+ ```
217
+
218
+ I will alias this to isabelle for convenience:
219
+ ```shell
220
+ alias isabelle="PATH TO THE EXECUTABLE"
221
+ ```
222
+
223
+ Download the [Archive of Formal Proofs](https://www.isa-afp.org/download.html).
224
+ We use the version afp-2021-02-11 for data extraction, but a later version is also fine.
225
+ Let's say the path to this is AFP_PATH. Build the afp entries:
226
+ ```shell
227
+ isabelle build -b -D $AFP_PATH/thys
228
+ ```
229
+ This will take ~12 hours with an 8-core CPU.
230
+ You should check that in the process, heaps are built for each afp project in the directory
231
+ ```shell
232
+ ~/.isabelle/Isabelle2020/heaps/polyml-5.8.1_x86_64_32-darwin
233
+ ```
234
+ (The exact path might differ if you have different OS or polyml verions but should be easy to find) -->
235
+
236
+
237
+ <!-- ### Model evaluation
238
+ See src/main/python/load_problem_by_file_and_name.py for an example of using an oracle theorem prover
239
+ to evaluate on some problems.
240
+
241
+ Notice in line 101, the theory file path is altered.
242
+ This is because the afp extraction and evaluation happened on different machines.
243
+ Comment this line out if you manually extracted the afp files, or swap
244
+ ```shell
245
+ /Users/qj213/Projects/afp-2021-02-11
246
+ ```
247
+ for the location of afp files on your computer.
248
+
249
+ When doing evaluation, in one terminal, run
250
+ ```shell
251
+ sbt "runMain pisa.server.PisaOneStageServer9000"
252
+ ```
253
+ You can switch to port 8000, 10000, 11000, or 12000. 9000 is the default used in the Python file.
254
+ In another terminal, use Python function evaluate_problem to obtain a proof success or failure.
255
+
256
+ You will need to pass in a model as an argument that has the method predict.
257
+ model.predict takes in a string of proof state, and return the next proof transition.
258
+
259
+ The evaluate_problem method executes prediction for a maximum of 100 steps by default.
260
+
261
+ Problem evaluation currently only allows agents based on proof states only.
262
+ Agents based on previous proof segments and hybrid-input agents will be supported in the near future. -->
@@ -0,0 +1,49 @@
1
+ name := "PISA"
2
+
3
+ version := "0.1"
4
+
5
+ scalaVersion := "2.13.4"
6
+
7
+ val grpcVersion = "1.34.0"
8
+
9
+ PB.targets in Compile := Seq(
10
+ scalapb.gen(grpc = true) -> (sourceManaged in Compile).value,
11
+ scalapb.zio_grpc.ZioCodeGenerator -> (sourceManaged in Compile).value,
12
+ )
13
+
14
+ libraryDependencies ++= Seq(
15
+ "com.thesamet.scalapb" %% "scalapb-runtime-grpc" % scalapb.compiler.Version.scalapbVersion,
16
+ "io.grpc" % "grpc-netty" % grpcVersion
17
+ )
18
+ // libraryDependencies += "de.unruh" %% "scala-isabelle" % "master-SNAPSHOT" from "file:/large_experiments/theorem/aqj/third_party_software/Portal-to-ISAbelle/lib/scala-isabelle_2.13.jar"// development snapshot
19
+ // libraryDependencies += "de.unruh" %% "scala-isabelle" % "master-SNAPSHOT" from "file:/Users/qj213/Projects/Portal-to-ISAbelle/lib/scala-isabelle_2.13.jar"// development snapshot
20
+ libraryDependencies += "de.unruh" %% "scala-isabelle" % "0.4.1" // release
21
+ // libraryDependencies += "de.unruh" %% "scala-isabelle" % "master-SNAPSHOT"
22
+ resolvers += Resolver.sonatypeRepo("snapshots")
23
+
24
+ libraryDependencies += "net.liftweb" %% "lift-json" % "3.4.3"
25
+ // https://mvnrepository.com/artifact/org.log4s/log4s
26
+ libraryDependencies += "org.log4s" %% "log4s" % "1.10.0"
27
+ // https://mvnrepository.com/artifact/org.slf4j/slf4j-simple
28
+ libraryDependencies += "org.slf4j" % "slf4j-simple" % "1.7.32"
29
+ // https://mvnrepository.com/artifact/commons-io/commons-io
30
+ libraryDependencies += "commons-io" % "commons-io" % "2.11.0"
31
+ // https://mvnrepository.com/artifact/org.scalaz/scalaz-core
32
+ libraryDependencies += "org.scalaz" %% "scalaz-core" % "7.3.5"
33
+ // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
34
+ libraryDependencies += "org.apache.commons" % "commons-lang3" % "3.12.0"
35
+ // https://mvnrepository.com/artifact/org.apache.commons/commons-text
36
+ libraryDependencies += "org.apache.commons" % "commons-text" % "1.9"
37
+ // https://mvnrepository.com/artifact/com.google.guava/guava
38
+ libraryDependencies += "com.google.guava" % "guava" % "31.0.1-jre"
39
+ libraryDependencies += "org.jetbrains" % "annotations" % "23.0.0"
40
+ libraryDependencies += "com.ibm.icu" % "icu4j" % "70.1"
41
+
42
+ assemblyMergeStrategy in assembly := {
43
+ case x if x.contains("de/unruh") => MergeStrategy.first
44
+ case PathList("META-INF", "MANIFEST.MF") => MergeStrategy.discard
45
+ case x if x.contains("META-INF") => MergeStrategy.first
46
+ case x =>
47
+ val oldStrategy = (assemblyMergeStrategy in assembly).value
48
+ oldStrategy(x)
49
+ }
@@ -0,0 +1,26 @@
1
+ #!/bin/bash
2
+
3
+ echo "SCALA CONFIGURATION"
4
+ curl -s "https://get.sdkman.io" | bash
5
+ source ~/.bashrc
6
+
7
+ sdk install java 11.0.11-open
8
+ sdk install sbt
9
+
10
+ echo "CHECKOUT origin/state_initiate"
11
+ git checkout origin/state_initiate
12
+ echo "RUNNING sbt compile"
13
+ sbt compile
14
+
15
+ echo "DOWNLOAD ISABELLE"
16
+ cd ~
17
+ wget https://isabelle.in.tum.de/website-Isabelle2020/dist/Isabelle2020_linux.tar.gz
18
+ tar -xzf Isabelle2020_linux.tar.gz
19
+ alias isabelle=~/Isabelle2020/bin/isabell
20
+
21
+ echo "DOWNLOAD AND BUILD AFP"
22
+ wget https://www.isa-afp.org/release/afp-2021-02-11.tar.gz
23
+ tar -xzf afp-2021-02-11.tar.gz
24
+ export AFP=afp-2021-02-11/thys
25
+ python ./PISA/command_generation/generate_build_commands_afp.py
26
+ ./PISA/scripts/build_isabelle_afp.sh
@@ -0,0 +1,44 @@
1
+ import argparse
2
+ import os
3
+
4
+
5
+ starter = """#!/bin/bash
6
+ #SBATCH --job-name=myJobarrayTest
7
+ #SBATCH --nodes=1 --ntasks=1
8
+ #SBATCH --time=5:00
9
+ #SBATCH --output=test_%A_%a.out
10
+ #SBATCH --error=test_%A_%a.err
11
+ #SBATCH --partition cpu
12
+ #SBATCH --array=0-4
13
+
14
+ commands=(\n"""
15
+
16
+ finisher = """);
17
+
18
+ sbt "runMain ${commands[$SLURM_ARRAY_TASK_ID]}"
19
+ """
20
+
21
+ if __name__ == "__main__":
22
+ args = argparse.ArgumentParser()
23
+ args.add_argument("-i", "--input_directory",
24
+ help="Where to look for the input thy files", required=True)
25
+ args.add_argument("-o", "--output_path",
26
+ help="Path to put the output shell file", required=True)
27
+ args.add_argument("-d", "--dump_path",
28
+ help="Where to dump the results", required=True)
29
+ args.add_argument("-ip", "--isabelle_path",
30
+ help="Where is Isabelle", required=False)
31
+ args = args.parse_args()
32
+
33
+
34
+ list_of_files = []
35
+ for file in os.listdir(args.input_directory):
36
+ if file.endswith(".thy"):
37
+ list_of_files.append(os.path.join(file))
38
+
39
+ with open(args.output_path, "w") as output_file:
40
+ output_file.write(starter)
41
+ for file in list_of_files:
42
+ dump_path = os.path.join(args.dump_path, f"{file.split('/')[-1]}.result")
43
+ output_file.write(f"\"{args.isabelle_path} {args.input_directory} {file} {dump_path}\"\n")
44
+ output_file.write(finisher)
@@ -0,0 +1,62 @@
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
+
13
+ use_default = input("What to use default hyperparameters? (true/false)\n").strip()
14
+ if use_default.startswith("true"):
15
+ search_width = 32
16
+ maximum_queue_length = 8
17
+ temperature = 0.8
18
+ max_tokens = 128
19
+ max_trials = 200
20
+ timeout = 240000
21
+ else:
22
+ search_width = int(input("search_width:\n"))
23
+ maximum_queue_length = int(input("maximum_queue_length:\n"))
24
+ temperature = float(input("temperature:\n"))
25
+ max_tokens = int(input("max_tokens:\n"))
26
+ max_trials = int(input("max_trials:\n"))
27
+ timeout = int(input("timeout:\n"))
28
+
29
+ script = 'echo "y" | sbt "runMain pisa.agent.PisaConjecturerNormalOrder {} {} {} {} {} {} {} {} {} {} {}"'
30
+
31
+ total_cmds = list()
32
+ if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
33
+ pattern = "universal_test_theorems/quick_test_name_*.json"
34
+ else:
35
+ pattern = "universal_test_theorems/test_name_*.json"
36
+
37
+ results_dir = ""
38
+ if use_conj.startswith("t"):
39
+ results_dir = "results/search_eval_conj_normal_order_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
40
+ search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
41
+ else:
42
+ raise AssertionError
43
+
44
+ if os.path.isdir(results_dir):
45
+ shutil.rmtree(results_dir)
46
+ os.makedirs(results_dir)
47
+
48
+ for file_name in glob.glob(pattern, recursive=True):
49
+ total_cmds.append(script.format(file_name, use_proof, use_conj, use_state_first, results_dir,
50
+ search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout))
51
+
52
+ process_number_to_cmds = {i: [] for i in range(number_of_processes)}
53
+ for i, cmd in enumerate(total_cmds):
54
+ process_number_to_cmds[i%number_of_processes].append(cmd)
55
+
56
+ for process_number, process_cmds in process_number_to_cmds.items():
57
+ with open("scripts/eval_search_conj_normal_order_{}_use_proof_{}_use_state_first_{}_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}.sh".format(
58
+ use_conj, use_proof, use_state_first, search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, process_number), "w") as f:
59
+ for process_cmd in process_cmds:
60
+ f.write(process_cmd+"\n")
61
+ f.write("PIDmain=$!\n")
62
+ f.write("wait $PIDmain\n")