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.
- itp_interface/__init__.py +0 -0
- itp_interface/agent/__init__.py +0 -0
- itp_interface/agent/simple_proof_agent.py +100 -0
- itp_interface/coq_ser_api/__init__.py +165 -0
- itp_interface/coq_ser_api/contexts.py +283 -0
- itp_interface/coq_ser_api/coq_agent.py +459 -0
- itp_interface/coq_ser_api/coq_backend.py +135 -0
- itp_interface/coq_ser_api/coq_util.py +839 -0
- itp_interface/coq_ser_api/example.py +67 -0
- itp_interface/coq_ser_api/lsp_backend.py +375 -0
- itp_interface/coq_ser_api/py.typed +0 -0
- itp_interface/coq_ser_api/serapi_backend.py +841 -0
- itp_interface/coq_ser_api/util.py +145 -0
- itp_interface/coq_ser_api_old/__init__.py +2583 -0
- itp_interface/coq_ser_api_old/contexts.py +172 -0
- itp_interface/coq_ser_api_old/util.py +146 -0
- itp_interface/lean_server/__init__.py +0 -0
- itp_interface/lean_server/commands.py +484 -0
- itp_interface/lean_server/lean3_search_tool.py +358 -0
- itp_interface/lean_server/lean4_repl_interface.py +151 -0
- itp_interface/lean_server/lean4_utils.py +255 -0
- itp_interface/lean_server/lean_cmd_server.py +111 -0
- itp_interface/lean_server/lean_context.py +60 -0
- itp_interface/lean_server/lean_sync_server.py +174 -0
- itp_interface/lean_server/lean_utils.py +199 -0
- itp_interface/lean_server/py.typed +1 -0
- itp_interface/main/__init__.py +0 -0
- itp_interface/main/config/afp_data_gen.yaml +14 -0
- itp_interface/main/config/benchmark/CompCert.yaml +366 -0
- itp_interface/main/config/benchmark/GeoCoq.yaml +930 -0
- itp_interface/main/config/benchmark/UniMath.yaml +2690 -0
- itp_interface/main/config/benchmark/afp_isabelle.yaml +29200 -0
- itp_interface/main/config/benchmark/agent_proverbot_hard.yaml +247 -0
- itp_interface/main/config/benchmark/category-theory.yaml +470 -0
- itp_interface/main/config/benchmark/compcert_118_subset.yaml +148 -0
- itp_interface/main/config/benchmark/compcert_benchmark.yaml +36 -0
- itp_interface/main/config/benchmark/compcert_benchmark_hard.yaml +498 -0
- itp_interface/main/config/benchmark/compcert_benchmark_hard_1.yaml +55 -0
- itp_interface/main/config/benchmark/compcert_benchmark_hard_2.yaml +24 -0
- itp_interface/main/config/benchmark/compcert_benchmark_hard_3.yaml +95 -0
- itp_interface/main/config/benchmark/compcert_benchmark_hard_7_per_cent.yaml +78 -0
- itp_interface/main/config/benchmark/compcert_benchmark_test.yaml +38 -0
- itp_interface/main/config/benchmark/compcert_benchmark_train.yaml +340 -0
- itp_interface/main/config/benchmark/leandojo_novel_premises_test.yaml +2908 -0
- itp_interface/main/config/benchmark/leandojo_novel_premises_train.yaml +98645 -0
- itp_interface/main/config/benchmark/leandojo_novel_premises_val.yaml +2912 -0
- itp_interface/main/config/benchmark/leandojo_random.yaml +2889 -0
- itp_interface/main/config/benchmark/leandojo_random_test.yaml +2421 -0
- itp_interface/main/config/benchmark/leandojo_random_train.yaml +62729 -0
- itp_interface/main/config/benchmark/leandojo_random_val.yaml +2504 -0
- itp_interface/main/config/benchmark/math-comp.yaml +200 -0
- itp_interface/main/config/benchmark/miniF2F_test.yaml +12 -0
- itp_interface/main/config/benchmark/miniF2F_test_aime.yaml +27 -0
- itp_interface/main/config/benchmark/miniF2F_test_algebra.yaml +30 -0
- itp_interface/main/config/benchmark/miniF2F_test_amc12.yaml +57 -0
- itp_interface/main/config/benchmark/miniF2F_test_few_shot_hard.yaml +231 -0
- itp_interface/main/config/benchmark/miniF2F_test_imo.yaml +32 -0
- itp_interface/main/config/benchmark/miniF2F_test_induction.yaml +20 -0
- itp_interface/main/config/benchmark/miniF2F_test_mathd_algebra.yaml +82 -0
- itp_interface/main/config/benchmark/miniF2F_test_mathd_algebra_hard.yaml +72 -0
- itp_interface/main/config/benchmark/miniF2F_test_mathd_numbertheory.yaml +72 -0
- itp_interface/main/config/benchmark/miniF2F_test_numbertheory.yaml +20 -0
- itp_interface/main/config/benchmark/minicompcert_benchmark_1.yaml +14 -0
- itp_interface/main/config/benchmark/proverbot_hard.yaml +104 -0
- itp_interface/main/config/benchmark/re_prover.yaml +66 -0
- itp_interface/main/config/benchmark/re_prover_hard.yaml +41 -0
- itp_interface/main/config/benchmark/re_prover_very_hard.yaml +22 -0
- itp_interface/main/config/benchmark/reprover_with_retrieval.yaml +73 -0
- itp_interface/main/config/benchmark/reprover_with_retrieval_hard.yaml +30 -0
- itp_interface/main/config/benchmark/reprover_with_retrieval_neg.yaml +195 -0
- itp_interface/main/config/benchmark/simple_benchmark_1.yaml +24 -0
- itp_interface/main/config/benchmark/simple_benchmark_8.yaml +50 -0
- itp_interface/main/config/benchmark/simple_benchmark_9.yaml +65 -0
- itp_interface/main/config/benchmark/simple_benchmark_isabelle.yaml +18 -0
- itp_interface/main/config/benchmark/simple_benchmark_lean.yaml +12 -0
- itp_interface/main/config/benchmark/simple_benchmark_lean_training_data.yaml +12 -0
- itp_interface/main/config/benchmark/simple_rl_benchmark_lean.yaml +14 -0
- itp_interface/main/config/benchmark/stack_machine.yaml +13 -0
- itp_interface/main/config/benchmark/stack_machine_hard.yaml +15 -0
- itp_interface/main/config/category_theory_data_gen.yaml +14 -0
- itp_interface/main/config/category_theory_data_gen_random.yaml +16 -0
- itp_interface/main/config/compcert_data_gen_test.yaml +10 -0
- itp_interface/main/config/compcert_data_gen_train.yaml +7 -0
- itp_interface/main/config/env_settings/bm25_retrieval.yaml +2 -0
- itp_interface/main/config/env_settings/bm25_retrieval_no_dfns.yaml +2 -0
- itp_interface/main/config/env_settings/bm25_retrieval_only_local_no_dfns.yaml +2 -0
- itp_interface/main/config/env_settings/bm25_retrieval_with_print.yaml +2 -0
- itp_interface/main/config/env_settings/bm25_retrieval_with_print_only_local.yaml +2 -0
- itp_interface/main/config/env_settings/bm25_retrieval_with_print_only_local_no_dfns.yaml +2 -0
- itp_interface/main/config/env_settings/no_retrieval.yaml +2 -0
- itp_interface/main/config/experiments.yaml +12 -0
- itp_interface/main/config/geo_coq_data_gen.yaml +14 -0
- itp_interface/main/config/geo_coq_data_gen_random.yaml +16 -0
- itp_interface/main/config/leandojo_random_data_gen.yaml +16 -0
- itp_interface/main/config/math_comp_data_gen.yaml +14 -0
- itp_interface/main/config/math_comp_data_gen_random.yaml +16 -0
- itp_interface/main/config/mathlib_data_gen.yaml +14 -0
- itp_interface/main/config/repo/coq_repos.yaml +191 -0
- itp_interface/main/config/run_settings/default_coq_data_generation_transforms.yaml +24 -0
- itp_interface/main/config/run_settings/default_isabelle_data_generation_transforms.yaml +24 -0
- itp_interface/main/config/run_settings/default_lean4_data_generation_transforms.yaml +24 -0
- itp_interface/main/config/run_settings/default_lean_data_generation_transforms.yaml +24 -0
- itp_interface/main/config/simple_coq_data_gen.yaml +12 -0
- itp_interface/main/config/simple_coq_data_gen_random.yaml +17 -0
- itp_interface/main/config/simple_lean_data_gen.yaml +12 -0
- itp_interface/main/config/simple_rl_lean_data_gen.yaml +12 -0
- itp_interface/main/config/uni_math_data_gen.yaml +14 -0
- itp_interface/main/config.py +192 -0
- itp_interface/main/extract_benchmark_dataset.py +106 -0
- itp_interface/main/filter_dataset.py +107 -0
- itp_interface/main/install.py +92 -0
- itp_interface/main/merge_dataset.py +96 -0
- itp_interface/main/run_tool.py +444 -0
- itp_interface/pisa/.git +1 -0
- itp_interface/pisa/.gitignore +125 -0
- itp_interface/pisa/.idea/.gitignore +8 -0
- itp_interface/pisa/.idea/ClojureProjectResolveSettings.xml +6 -0
- itp_interface/pisa/.idea/codeStyles/Project.xml +7 -0
- itp_interface/pisa/.idea/codeStyles/codeStyleConfig.xml +5 -0
- itp_interface/pisa/.idea/inspectionProfiles/Project_Default.xml +16 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_android_annotations_4_1_1_4_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_api_grpc_proto_google_common_protos_1_17_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_code_findbugs_jsr305_3_0_2_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_code_gson_gson_2_8_6_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_errorprone_error_prone_annotations_2_3_4_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_guava_failureaccess_1_0_1_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_guava_guava_30_0_jre_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_guava_listenablefuture_9999_0_empty_to_avoid_conflict_with_guava_jar.xml +9 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_j2objc_j2objc_annotations_1_3_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_protobuf_protobuf_java_3_12_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_google_protobuf_protobuf_java_util_3_12_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_fastparse_2_13_2_3_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_geny_2_13_0_6_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_lihaoyi_sourcecode_2_13_0_2_1_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_lenses_2_13_0_10_9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_scalapb_runtime_2_13_0_10_9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_scalapb_runtime_grpc_2_13_0_10_9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_thesamet_scalapb_zio_grpc_zio_grpc_core_2_13_0_4_2_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__com_thoughtworks_paranamer_paranamer_2_8_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__commons_io_commons_io_2_8_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__de_unruh_java_patterns_0_1_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__de_unruh_scala_isabelle_2_13_master_SNAPSHOT_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__dev_zio_izumi_reflect_2_13_1_0_0_M9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__dev_zio_izumi_reflect_thirdparty_boopickle_shaded_2_13_1_0_0_M9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_2_13_1_0_3_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_stacktracer_2_13_1_0_3_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__dev_zio_zio_streams_2_13_1_0_3_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_api_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_context_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_core_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_netty_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_protobuf_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_protobuf_lite_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_services_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_grpc_grpc_stub_1_34_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_buffer_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_http2_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_http_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_codec_socks_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_common_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_handler_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_handler_proxy_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_resolver_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_netty_netty_transport_4_1_51_Final_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__io_perfmark_perfmark_api_0_19_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__net_java_dev_jna_jna_5_3_1_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__net_liftweb_lift_json_2_13_3_4_3_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_apache_commons_commons_lang3_3_11_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_apache_commons_commons_text_1_9_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_checkerframework_checker_qual_3_5_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_codehaus_mojo_animal_sniffer_annotations_1_18_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_jetbrains_annotations_20_1_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_jline_jline_3_16_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_log4s_log4s_2_13_1_9_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_modules_scala_collection_compat_2_13_2_1_6_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_modules_scala_xml_2_13_1_3_0_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_compiler_2_13_4_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_library_2_13_4_jar.xml +23 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scala_reflect_2_13_4_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scala_lang_scalap_2_13_4_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_scalaz_scalaz_core_2_13_7_3_2_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_slf4j_slf4j_api_1_7_30_jar.xml +13 -0
- itp_interface/pisa/.idea/libraries/sbt__org_slf4j_slf4j_simple_1_7_30_jar.xml +13 -0
- itp_interface/pisa/.idea/misc.xml +7 -0
- itp_interface/pisa/.idea/modules/PISA-build.iml +127 -0
- itp_interface/pisa/.idea/modules/PISA.iml +94 -0
- itp_interface/pisa/.idea/modules.xml +9 -0
- itp_interface/pisa/.idea/other.xml +6 -0
- itp_interface/pisa/.idea/sbt.xml +20 -0
- itp_interface/pisa/.idea/scala_compiler.xml +6 -0
- itp_interface/pisa/.idea/uiDesigner.xml +124 -0
- itp_interface/pisa/.idea/vcs.xml +6 -0
- itp_interface/pisa/.scalafmt.conf +2 -0
- itp_interface/pisa/LICENSE +29 -0
- itp_interface/pisa/README.md +262 -0
- itp_interface/pisa/build.sbt +49 -0
- itp_interface/pisa/build.sh +26 -0
- itp_interface/pisa/command_generation/close_gaps.py +44 -0
- itp_interface/pisa/command_generation/conjecture_normal_order.py +62 -0
- itp_interface/pisa/command_generation/conjecturer_command_generator.py +36 -0
- itp_interface/pisa/command_generation/create_dirs.py +11 -0
- itp_interface/pisa/command_generation/find_std.py +67 -0
- itp_interface/pisa/command_generation/generate_build_commands_afp.py +15 -0
- itp_interface/pisa/command_generation/generate_build_commands_std.py +15 -0
- itp_interface/pisa/command_generation/generate_commands_afp.py +103 -0
- itp_interface/pisa/command_generation/generate_commands_mini.py +73 -0
- itp_interface/pisa/command_generation/generate_commands_std.py +69 -0
- itp_interface/pisa/command_generation/generate_hammer_extraction_text.py +5 -0
- itp_interface/pisa/command_generation/hammer_command_generator.py +40 -0
- itp_interface/pisa/command_generation/hp_search_command_generator.py +63 -0
- itp_interface/pisa/command_generation/oracle_command_generator.py +56 -0
- itp_interface/pisa/command_generation/search_command_generator.py +69 -0
- itp_interface/pisa/command_generation/summarise_problem_names.py +45 -0
- itp_interface/pisa/command_generation/tpu_hp_search.py +75 -0
- itp_interface/pisa/docker/Dockerfile +34 -0
- itp_interface/pisa/docker/docker_tutorial.md +64 -0
- itp_interface/pisa/eval_setup/copy_isabelle.py +42 -0
- itp_interface/pisa/eval_setup/copy_pisa_jars.py +18 -0
- itp_interface/pisa/mesh_transformer_utils/tokenization.py +86 -0
- itp_interface/pisa/project/build.properties +1 -0
- itp_interface/pisa/project/plugins.sbt +5 -0
- itp_interface/pisa/requirements.txt +4 -0
- itp_interface/pisa/scripts/extract_last_k_steps.py +28 -0
- itp_interface/pisa/scripts/extract_proof_corpus.py +26 -0
- itp_interface/pisa/scripts/gather_hammer_results.py +27 -0
- itp_interface/pisa/scripts/length_in_char_stats.py +20 -0
- itp_interface/pisa/scripts/mix.py +127 -0
- itp_interface/pisa/scripts/results_stat.py +52 -0
- itp_interface/pisa/scripts/test_array_job.sh +34 -0
- itp_interface/pisa/setup.sh +25 -0
- itp_interface/pisa/src/main/protobuf/server.proto +60 -0
- itp_interface/pisa/src/main/python/.idea/.gitignore +8 -0
- itp_interface/pisa/src/main/python/.idea/inspectionProfiles/Project_Default.xml +18 -0
- itp_interface/pisa/src/main/python/.idea/inspectionProfiles/profiles_settings.xml +6 -0
- itp_interface/pisa/src/main/python/.idea/misc.xml +4 -0
- itp_interface/pisa/src/main/python/.idea/modules.xml +8 -0
- itp_interface/pisa/src/main/python/.idea/python.iml +12 -0
- itp_interface/pisa/src/main/python/.idea/vcs.xml +6 -0
- itp_interface/pisa/src/main/python/conjecturing_parsing/conjecturer_postprocessing.py +59 -0
- itp_interface/pisa/src/main/python/data_extraction/extract_data.py +184 -0
- itp_interface/pisa/src/main/python/data_extraction/find_premises.py +221 -0
- itp_interface/pisa/src/main/python/data_extraction/process_data.py +129 -0
- itp_interface/pisa/src/main/python/legacy/PisaFlexibleClient.py +167 -0
- itp_interface/pisa/src/main/python/legacy/autof_test.py +74 -0
- itp_interface/pisa/src/main/python/legacy/cmd_client.py +23 -0
- itp_interface/pisa/src/main/python/legacy/convert_scala_dump_to_test_name_jsons.py +14 -0
- itp_interface/pisa/src/main/python/legacy/create_data_txt.py +72 -0
- itp_interface/pisa/src/main/python/legacy/create_finetune_tfrecords.py +311 -0
- itp_interface/pisa/src/main/python/legacy/demo.py +49 -0
- itp_interface/pisa/src/main/python/legacy/evaluate.py +108 -0
- itp_interface/pisa/src/main/python/legacy/extract_first_step.py +25 -0
- itp_interface/pisa/src/main/python/legacy/get_global_facts.py +35 -0
- itp_interface/pisa/src/main/python/legacy/mix_data.py +19 -0
- itp_interface/pisa/src/main/python/legacy/one_stage_extraction.py +111 -0
- itp_interface/pisa/src/main/python/legacy/prepare_episodic_transitions.py +137 -0
- itp_interface/pisa/src/main/python/legacy/prepare_translation_pairs.py +277 -0
- itp_interface/pisa/src/main/python/pisa_client.py +322 -0
- itp_interface/pisa/src/main/python/server_pb2.py +394 -0
- itp_interface/pisa/src/main/python/server_pb2_grpc.py +230 -0
- itp_interface/pisa/src/main/python/test_client.py +17 -0
- itp_interface/pisa/src/main/python/test_client2.py +79 -0
- itp_interface/pisa/src/main/python/utils/filters.py +59 -0
- itp_interface/pisa/src/main/python/utils/pisa_server_control.py +29 -0
- itp_interface/pisa/src/main/scala/pisa/agent/CheckSyntax.scala +257 -0
- itp_interface/pisa/src/main/scala/pisa/agent/DepThms.scala +29 -0
- itp_interface/pisa/src/main/scala/pisa/agent/PisaStat.scala +46 -0
- itp_interface/pisa/src/main/scala/pisa/agent/RefactorTest.scala +40 -0
- itp_interface/pisa/src/main/scala/pisa/agent/RepHammer.scala +95 -0
- itp_interface/pisa/src/main/scala/pisa/server/HammFacts.scala +63 -0
- itp_interface/pisa/src/main/scala/pisa/server/PisaOS.scala +881 -0
- itp_interface/pisa/src/main/scala/pisa/server/PisaOneStage.scala +540 -0
- itp_interface/pisa/src/main/scala/pisa/server/PisaOneStageServers.scala +1048 -0
- itp_interface/pisa/src/main/scala/pisa/utils/TheoryManager.scala +95 -0
- itp_interface/pisa/src/test/python/analyse_debug.py +33 -0
- itp_interface/pisa/src/test/python/extract_test_seq2seq.py +53 -0
- itp_interface/pisa/src/test/python/extract_test_theorem_ground_truth_indices.py +31 -0
- itp_interface/pisa/src/test/python/proof_originality.py +24 -0
- itp_interface/pisa/src/test/python/test_command_generator.py +25 -0
- itp_interface/pisa/src/test/python/test_model_sequence_accuracy.py +70 -0
- itp_interface/pisa/src/test/scala/pisa/Easy.scala +26 -0
- itp_interface/pisa/src/test/scala/pisa/TestCurl.scala +82 -0
- itp_interface/pisa/src/test/scala/pisa/TestIsa.scala +27 -0
- itp_interface/pisa/test.sh +19 -0
- itp_interface/pisa/universal_test_theorems.tar.gz +0 -0
- itp_interface/repo/build.py +78 -0
- itp_interface/repo/clone.py +79 -0
- itp_interface/repo/dataset_discovery.py +99 -0
- itp_interface/retrieval/__init__.py +0 -0
- itp_interface/retrieval/abstraction.py +35 -0
- itp_interface/retrieval/coq_bm25_reranker.py +153 -0
- itp_interface/retrieval/isabelle_bm25_reranker.py +86 -0
- itp_interface/retrieval/lean3_bm25_reranker.py +86 -0
- itp_interface/rl/__init__.py +0 -0
- itp_interface/rl/abstraction.py +168 -0
- itp_interface/rl/proof_action.py +172 -0
- itp_interface/rl/proof_state.py +149 -0
- itp_interface/rl/proof_tree.py +109 -0
- itp_interface/rl/simpl_proof_env_pool.py +16 -0
- itp_interface/rl/simple_proof_env.py +713 -0
- itp_interface/rl/simple_proof_env_pool.py +591 -0
- itp_interface/scripts/setup.sh +228 -0
- itp_interface/tools/__init__.py +0 -0
- itp_interface/tools/basic_utils.py +172 -0
- itp_interface/tools/bin_packing.py +61 -0
- itp_interface/tools/cache.py +93 -0
- itp_interface/tools/coq_build_spec.py +31 -0
- itp_interface/tools/coq_build_tool.py +319 -0
- itp_interface/tools/coq_context_helper.py +354 -0
- itp_interface/tools/coq_executor.py +508 -0
- itp_interface/tools/coq_local_data_generation_transform.py +158 -0
- itp_interface/tools/coq_parse_utils.py +154 -0
- itp_interface/tools/coq_raw_proofs.py +193 -0
- itp_interface/tools/coq_theorem_proof_pair_generation_transform.py +146 -0
- itp_interface/tools/coq_training_data_generator.py +76 -0
- itp_interface/tools/dynamic_coq_proof_exec.py +220 -0
- itp_interface/tools/dynamic_isabelle_proof_exec.py +229 -0
- itp_interface/tools/dynamic_lean4_proof_exec.py +236 -0
- itp_interface/tools/dynamic_lean_proof_exec.py +228 -0
- itp_interface/tools/isabelle_context_helper.py +66 -0
- itp_interface/tools/isabelle_executor.py +862 -0
- itp_interface/tools/isabelle_local_data_generation_transform.py +149 -0
- itp_interface/tools/isabelle_parse_utils.py +131 -0
- itp_interface/tools/isabelle_server.py +106 -0
- itp_interface/tools/lean4_context_helper.py +72 -0
- itp_interface/tools/lean4_local_data_generation_transform.py +122 -0
- itp_interface/tools/lean4_sync_executor.py +1193 -0
- itp_interface/tools/lean_cmd_executor.py +804 -0
- itp_interface/tools/lean_context_helper.py +327 -0
- itp_interface/tools/lean_dojo_data_generation_transform.py +206 -0
- itp_interface/tools/lean_executor.py +687 -0
- itp_interface/tools/lean_local_data_generation_transform.py +136 -0
- itp_interface/tools/lean_parse_utils.py +32 -0
- itp_interface/tools/log_utils.py +20 -0
- itp_interface/tools/proof_exec_callback.py +76 -0
- itp_interface/tools/ray_utils.py +265 -0
- itp_interface/tools/repl/.git +1 -0
- itp_interface/tools/repl/.github/workflows/ci.yml +24 -0
- itp_interface/tools/repl/.gitignore +7 -0
- itp_interface/tools/repl/.vscode/copyright.code-snippets +13 -0
- itp_interface/tools/repl/.vscode/extensions.json +13 -0
- itp_interface/tools/repl/.vscode/module-docstring.code-snippets +35 -0
- itp_interface/tools/repl/.vscode/settings.json +11 -0
- itp_interface/tools/repl/README.md +174 -0
- itp_interface/tools/repl/REPL/Frontend.lean +47 -0
- itp_interface/tools/repl/REPL/JSON.lean +186 -0
- itp_interface/tools/repl/REPL/Lean/ContextInfo.lean +9 -0
- itp_interface/tools/repl/REPL/Lean/Environment.lean +31 -0
- itp_interface/tools/repl/REPL/Lean/InfoTree/ToJson.lean +114 -0
- itp_interface/tools/repl/REPL/Lean/InfoTree.lean +272 -0
- itp_interface/tools/repl/REPL/Main.lean +323 -0
- itp_interface/tools/repl/REPL/Snapshots.lean +306 -0
- itp_interface/tools/repl/REPL/Util/Path.lean +36 -0
- itp_interface/tools/repl/REPL/Util/Pickle.lean +44 -0
- itp_interface/tools/repl/REPL.lean +4 -0
- itp_interface/tools/repl/lake-manifest.json +5 -0
- itp_interface/tools/repl/lakefile.lean +15 -0
- itp_interface/tools/repl/lean-toolchain +1 -0
- itp_interface/tools/repl/test/Mathlib/.gitignore +5 -0
- itp_interface/tools/repl/test/Mathlib/H20231110.sh +2 -0
- itp_interface/tools/repl/test/Mathlib/ReplMathlibTests.lean +1 -0
- itp_interface/tools/repl/test/Mathlib/lake-manifest.json +68 -0
- itp_interface/tools/repl/test/Mathlib/lakefile.lean +11 -0
- itp_interface/tools/repl/test/Mathlib/lean-toolchain +1 -0
- itp_interface/tools/repl/test/Mathlib/test/20240209.expected.out +20 -0
- itp_interface/tools/repl/test/Mathlib/test/20240209.in +3 -0
- itp_interface/tools/repl/test/Mathlib/test/20240209.lean +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231020.expected.out +8 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231020.in +8 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231020.lean +22 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231110.expected.out +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231110.in +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115.expected.out +19 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115.in +5 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115_2.expected.out +18 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115_2.in +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115_3.expected.out +10 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231115_3.in +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231214.in +9 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231214.lean +30 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231215.expected.out +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231215.in +4 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231215_2.expected.out +14 -0
- itp_interface/tools/repl/test/Mathlib/test/H20231215_2.in +3 -0
- itp_interface/tools/repl/test/Mathlib/test/exact.expected.out +37 -0
- itp_interface/tools/repl/test/Mathlib/test/exact.in +10 -0
- itp_interface/tools/repl/test/Mathlib/test/import_Mathlib.lean +1 -0
- itp_interface/tools/repl/test/Mathlib/test/induction.expected.out +29 -0
- itp_interface/tools/repl/test/Mathlib/test/induction.in +10 -0
- itp_interface/tools/repl/test/Mathlib/test/induction.lean +6 -0
- itp_interface/tools/repl/test/Mathlib/test/on_goal.expected.out +22 -0
- itp_interface/tools/repl/test/Mathlib/test/on_goal.in +5 -0
- itp_interface/tools/repl/test/Mathlib/test/pickle.expected.out +16 -0
- itp_interface/tools/repl/test/Mathlib/test/pickle.in +6 -0
- itp_interface/tools/repl/test/Mathlib/test/pickle_2.expected.out +4 -0
- itp_interface/tools/repl/test/Mathlib/test/pickle_2.in +4 -0
- itp_interface/tools/repl/test/Mathlib/test.sh +41 -0
- itp_interface/tools/repl/test/all_tactics.expected.out +13 -0
- itp_interface/tools/repl/test/all_tactics.in +1 -0
- itp_interface/tools/repl/test/by_cases.expected.out +25 -0
- itp_interface/tools/repl/test/by_cases.in +8 -0
- itp_interface/tools/repl/test/by_cases.lean +4 -0
- itp_interface/tools/repl/test/calc.expected.out +32 -0
- itp_interface/tools/repl/test/calc.in +1 -0
- itp_interface/tools/repl/test/def_eval.expected.out +9 -0
- itp_interface/tools/repl/test/def_eval.in +3 -0
- itp_interface/tools/repl/test/enableInitializersExecution.expected.out +2 -0
- itp_interface/tools/repl/test/enableInitializersExecution.in +1 -0
- itp_interface/tools/repl/test/file.expected.out +8 -0
- itp_interface/tools/repl/test/file.in +1 -0
- itp_interface/tools/repl/test/file.lean +5 -0
- itp_interface/tools/repl/test/have_by_sorry.expected.out +28 -0
- itp_interface/tools/repl/test/have_by_sorry.in +6 -0
- itp_interface/tools/repl/test/import_lean.in +1 -0
- itp_interface/tools/repl/test/incomplete.expected.out +18 -0
- itp_interface/tools/repl/test/incomplete.in +3 -0
- itp_interface/tools/repl/test/incomplete.lean +0 -0
- itp_interface/tools/repl/test/infotree.expected.out +20 -0
- itp_interface/tools/repl/test/infotree.in +2 -0
- itp_interface/tools/repl/test/invalid_tactic.expected.out +20 -0
- itp_interface/tools/repl/test/invalid_tactic.in +3 -0
- itp_interface/tools/repl/test/name_generator.expected.out +53 -0
- itp_interface/tools/repl/test/name_generator.in +18 -0
- itp_interface/tools/repl/test/no_goal_sorry.expected.out +11 -0
- itp_interface/tools/repl/test/no_goal_sorry.in +1 -0
- itp_interface/tools/repl/test/no_goal_sorry_2.expected.out +12 -0
- itp_interface/tools/repl/test/no_goal_sorry_2.in +1 -0
- itp_interface/tools/repl/test/options.expected.out +17 -0
- itp_interface/tools/repl/test/options.in +6 -0
- itp_interface/tools/repl/test/pickle_environment.expected.out +8 -0
- itp_interface/tools/repl/test/pickle_environment.in +7 -0
- itp_interface/tools/repl/test/pickle_environment_with_imports.expected.out +10 -0
- itp_interface/tools/repl/test/pickle_environment_with_imports.in +9 -0
- itp_interface/tools/repl/test/pickle_open.expected.out +8 -0
- itp_interface/tools/repl/test/pickle_open.in +7 -0
- itp_interface/tools/repl/test/pickle_open_2.expected.out +4 -0
- itp_interface/tools/repl/test/pickle_open_2.in +3 -0
- itp_interface/tools/repl/test/pickle_open_scoped.expected.out +18 -0
- itp_interface/tools/repl/test/pickle_open_scoped.in +8 -0
- itp_interface/tools/repl/test/pickle_open_scoped_2.expected.out +14 -0
- itp_interface/tools/repl/test/pickle_open_scoped_2.in +3 -0
- itp_interface/tools/repl/test/pickle_proof_state_1.expected.out +26 -0
- itp_interface/tools/repl/test/pickle_proof_state_1.in +15 -0
- itp_interface/tools/repl/test/pickle_proof_state_2.expected.out +4 -0
- itp_interface/tools/repl/test/pickle_proof_state_2.in +3 -0
- itp_interface/tools/repl/test/pickle_proof_state_env.expected.out +26 -0
- itp_interface/tools/repl/test/pickle_proof_state_env.in +15 -0
- itp_interface/tools/repl/test/pickle_scoped_notation.in +16 -0
- itp_interface/tools/repl/test/pickle_scoped_notation_2.in +3 -0
- itp_interface/tools/repl/test/proof_step.expected.out +18 -0
- itp_interface/tools/repl/test/proof_step.in +7 -0
- itp_interface/tools/repl/test/readme.expected.out +16 -0
- itp_interface/tools/repl/test/readme.in +5 -0
- itp_interface/tools/repl/test/sorry_hypotheses.expected.out +16 -0
- itp_interface/tools/repl/test/sorry_hypotheses.in +4 -0
- itp_interface/tools/repl/test/synthesize_placeholder.expected.out +7 -0
- itp_interface/tools/repl/test/synthesize_placeholder.in +1 -0
- itp_interface/tools/repl/test/tactic_mode_sorry.expected.out +14 -0
- itp_interface/tools/repl/test/tactic_mode_sorry.in +3 -0
- itp_interface/tools/repl/test/tactic_sorry.expected.out +12 -0
- itp_interface/tools/repl/test/tactic_sorry.in +1 -0
- itp_interface/tools/repl/test/term_sorry.expected.out +12 -0
- itp_interface/tools/repl/test/term_sorry.in +1 -0
- itp_interface/tools/repl/test/trace_simp.expected.out +41 -0
- itp_interface/tools/repl/test/trace_simp.in +15 -0
- itp_interface/tools/repl/test/unfinished_tactic_block.expected.out +11 -0
- itp_interface/tools/repl/test/unfinished_tactic_block.in +1 -0
- itp_interface/tools/repl/test/unknown_environment.expected.out +2 -0
- itp_interface/tools/repl/test/unknown_environment.in +1 -0
- itp_interface/tools/repl/test/unknown_proof_state.expected.out +14 -0
- itp_interface/tools/repl/test/unknown_proof_state.in +3 -0
- itp_interface/tools/repl/test/unknown_tactic.expected.out +14 -0
- itp_interface/tools/repl/test/unknown_tactic.in +3 -0
- itp_interface/tools/repl/test/variables.expected.out +26 -0
- itp_interface/tools/repl/test/variables.in +5 -0
- itp_interface/tools/repl/test.sh +43 -0
- itp_interface/tools/run_data_generation_transforms.py +350 -0
- itp_interface/tools/theorem_details.py +25 -0
- itp_interface/tools/training_data.py +358 -0
- itp_interface/tools/training_data_format.py +599 -0
- itp_interface-1.0.0.dist-info/METADATA +78 -0
- itp_interface-1.0.0.dist-info/RECORD +485 -0
- itp_interface-1.0.0.dist-info/WHEEL +4 -0
- itp_interface-1.0.0.dist-info/entry_points.txt +3 -0
- itp_interface-1.0.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
number_of_processes = input("Enter the number of processes you want to run at the same time:\n").strip()
|
|
2
|
+
number_of_processes = int(number_of_processes)
|
|
3
|
+
import glob
|
|
4
|
+
import os
|
|
5
|
+
script = 'echo "y" | sbt "runMain pisa.server.ConjecturerParser {} {} {} {}"'
|
|
6
|
+
|
|
7
|
+
total_cmds = list()
|
|
8
|
+
total_files = 0
|
|
9
|
+
for file_name in glob.glob("/home/ywu/afp-2021-02-11/thys/**/*.thy", recursive=True):
|
|
10
|
+
project_single_name = file_name.split("/")[5]
|
|
11
|
+
if not os.path.isdir(os.path.join("conjecturer_extractions", project_single_name)):
|
|
12
|
+
os.makedirs(os.path.join("conjecturer_extractions", project_single_name))
|
|
13
|
+
|
|
14
|
+
theory_single_name = file_name.split("/")[-1].split(".thy")[0]
|
|
15
|
+
if os.path.isfile(os.path.join("conjecturer_extractions", project_single_name, theory_single_name+".src")):
|
|
16
|
+
continue
|
|
17
|
+
thys_index = file_name.split("/").index("thys")
|
|
18
|
+
working_directory = "/".join(file_name.split("/")[:thys_index+2])
|
|
19
|
+
total_cmds.append(script.format(file_name,
|
|
20
|
+
working_directory,
|
|
21
|
+
"/home/ywu/Isabelle2020",
|
|
22
|
+
"conjecturer_extractions/"+project_single_name
|
|
23
|
+
))
|
|
24
|
+
total_files += 1
|
|
25
|
+
|
|
26
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
27
|
+
print("A total of {} files are due to be generated".format(total_files))
|
|
28
|
+
for i, cmd in enumerate(total_cmds):
|
|
29
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
30
|
+
|
|
31
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
32
|
+
with open("conjecturer_parser_{}.sh".format(process_number), "w") as f:
|
|
33
|
+
for process_cmd in process_cmds:
|
|
34
|
+
f.write(process_cmd+"\n")
|
|
35
|
+
f.write("PIDmain=$!\n")
|
|
36
|
+
f.write("wait $PIDmain\n")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
saving_directory = input("Enter the directory to save extractions at:\n").strip()
|
|
4
|
+
if not os.path.isdir(saving_directory):
|
|
5
|
+
os.makedirs(saving_directory)
|
|
6
|
+
|
|
7
|
+
theory_directory = input("Enter the directory to find extractions at:\n").strip()
|
|
8
|
+
|
|
9
|
+
for file_name in os.listdir(theory_directory):
|
|
10
|
+
create_name = os.path.join(saving_directory, file_name)
|
|
11
|
+
os.mkdir(create_name)
|
|
@@ -0,0 +1,67 @@
|
|
|
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.HPSearch {} {} {} {} {} {} {} {} {} {} {}"'
|
|
30
|
+
|
|
31
|
+
for repeat in range(8):
|
|
32
|
+
total_cmds = list()
|
|
33
|
+
if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
|
|
34
|
+
pattern = "universal_test_theorems/quick_test_name_*.json"
|
|
35
|
+
else:
|
|
36
|
+
pattern = "universal_test_theorems/test_name_*.json"
|
|
37
|
+
|
|
38
|
+
results_dir = ""
|
|
39
|
+
if use_conj.startswith("t"):
|
|
40
|
+
results_dir = "results/search_eval_conj_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}".format(
|
|
41
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, repeat)
|
|
42
|
+
elif use_proof.startswith("t"):
|
|
43
|
+
results_dir = "results/search_eval_proof_and_state_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}".format(
|
|
44
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, repeat)
|
|
45
|
+
else:
|
|
46
|
+
results_dir = "results/search_eval_state_only_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}".format(
|
|
47
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, repeat)
|
|
48
|
+
|
|
49
|
+
if os.path.isdir(results_dir):
|
|
50
|
+
shutil.rmtree(results_dir)
|
|
51
|
+
os.makedirs(results_dir)
|
|
52
|
+
|
|
53
|
+
for file_name in glob.glob(pattern, recursive=True):
|
|
54
|
+
total_cmds.append(script.format(file_name, use_proof, use_conj, use_state_first, results_dir,
|
|
55
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout))
|
|
56
|
+
|
|
57
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
58
|
+
for i, cmd in enumerate(total_cmds):
|
|
59
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
60
|
+
|
|
61
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
62
|
+
with open("scripts/eval_search_conj_{}_use_proof_{}_use_state_first_{}_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}_{}.sh".format(
|
|
63
|
+
use_conj, use_proof, use_state_first, search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, process_number, repeat), "w") as f:
|
|
64
|
+
for process_cmd in process_cmds:
|
|
65
|
+
f.write(process_cmd+"\n")
|
|
66
|
+
f.write("PIDmain=$!\n")
|
|
67
|
+
f.write("wait $PIDmain\n")
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
basic_command = "Isabelle2020/bin/isabelle build -b -d $AFP {}\n"
|
|
4
|
+
|
|
5
|
+
strings_to_write = []
|
|
6
|
+
thy_dir = "$AFP/thys"
|
|
7
|
+
for project in os.listdir(thy_dir):
|
|
8
|
+
if os.path.isdir(os.path.join(thy_dir, project)):
|
|
9
|
+
strings_to_write.append(basic_command.format(project))
|
|
10
|
+
|
|
11
|
+
print("{} projects in total".format(len(strings_to_write)))
|
|
12
|
+
|
|
13
|
+
with open("PISA/scripts/build_isabelle_afp.sh", "w") as fout:
|
|
14
|
+
for string_to_write in strings_to_write:
|
|
15
|
+
fout.write(string_to_write)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
basic_command = "/home/ywu/Isabelle2020/bin/isabelle build -b -d /home/ywu/Isabelle2020/src/{} \n"
|
|
4
|
+
|
|
5
|
+
strings_to_write = []
|
|
6
|
+
thy_dir = "/home/ywu/Isabelle2020/src"
|
|
7
|
+
for project in os.listdir(thy_dir):
|
|
8
|
+
if os.path.isdir(os.path.join(thy_dir, project)):
|
|
9
|
+
strings_to_write.append(basic_command.format(project))
|
|
10
|
+
|
|
11
|
+
print("{} projects in total".format(len(strings_to_write)))
|
|
12
|
+
|
|
13
|
+
with open("build_isabelle_std.sh", "w") as fout:
|
|
14
|
+
for string_to_write in strings_to_write:
|
|
15
|
+
fout.write(string_to_write)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
ports = str(input("Enter the ports, separated by commas:\n")).strip()
|
|
2
|
+
ports = ports.split(",")
|
|
3
|
+
ports = [int(port.strip()) for port in ports]
|
|
4
|
+
ports = [port for port in ports if port]
|
|
5
|
+
use_hammers = str(input("Use hammers (T/F):\n")).strip()
|
|
6
|
+
if use_hammers == "T" or use_hammers == "t":
|
|
7
|
+
use_hammers = True
|
|
8
|
+
elif use_hammers == "F" or use_hammers == "f":
|
|
9
|
+
use_hammers = False
|
|
10
|
+
else:
|
|
11
|
+
raise AssertionError
|
|
12
|
+
|
|
13
|
+
import glob
|
|
14
|
+
import os
|
|
15
|
+
import shutil
|
|
16
|
+
|
|
17
|
+
home_directory = "/private/home/aqj"
|
|
18
|
+
|
|
19
|
+
script = f"unset http_proxy; unset https_proxy; python3 src/main/python/one_stage_extraction.py --isa-path {home_directory}/Isabelle2021 -wd {home_directory}" + "/afp-2021-10-22/thys/{} --saving-directory afp_extractions/{} -tfp {}"
|
|
20
|
+
if use_hammers:
|
|
21
|
+
script = script + " -us"
|
|
22
|
+
|
|
23
|
+
n_threads = 1
|
|
24
|
+
|
|
25
|
+
cmds = []
|
|
26
|
+
|
|
27
|
+
IGNORED_THEORIES = {}
|
|
28
|
+
IGNORED_ENTRIES = {}
|
|
29
|
+
|
|
30
|
+
total_files = 0
|
|
31
|
+
for project_name in glob.glob("{}/afp-2021-10-22/thys/**/*.thy".format(home_directory), recursive=True):
|
|
32
|
+
project_single_name = project_name.split("/")[6]
|
|
33
|
+
file_single_name = project_name.split("/")[-1]
|
|
34
|
+
|
|
35
|
+
# Ignore already extracted files
|
|
36
|
+
if os.path.isfile("afp_extractions/{}/{}_ground_truth.json".format(
|
|
37
|
+
project_single_name, file_single_name.split(".thy")[0])):
|
|
38
|
+
continue
|
|
39
|
+
|
|
40
|
+
if project_single_name not in IGNORED_ENTRIES and \
|
|
41
|
+
project_single_name + "/" + file_single_name not in IGNORED_THEORIES:
|
|
42
|
+
cmds.append(
|
|
43
|
+
script.format(project_single_name, project_single_name, project_name))
|
|
44
|
+
total_files += 1
|
|
45
|
+
print("A total of {} files are due to be generated".format(total_files))
|
|
46
|
+
# num_cmd_per_thread = len(cmds) // n_threads + 1
|
|
47
|
+
# cmds_splits = [cmds[i*num_cmd_per_thread:(i+1)*num_cmd_per_thread] for i in range(n_threads)]
|
|
48
|
+
|
|
49
|
+
how_many_ports = len(ports)
|
|
50
|
+
indices_to_ports = {i: port for i, port in enumerate(ports)}
|
|
51
|
+
cmds_for_port = {port: [] for port in ports}
|
|
52
|
+
for i, cmd in enumerate(cmds):
|
|
53
|
+
port = indices_to_ports[i%how_many_ports]
|
|
54
|
+
cmds_for_port[port].append(cmd + " -p {} ".format(port))
|
|
55
|
+
|
|
56
|
+
if os.path.isdir("scripts/extraction"):
|
|
57
|
+
shutil.rmtree("scripts/extraction")
|
|
58
|
+
|
|
59
|
+
os.makedirs("scripts/extraction")
|
|
60
|
+
|
|
61
|
+
counter = 0
|
|
62
|
+
for j, port in enumerate(ports):
|
|
63
|
+
port_cmds = cmds_for_port[port]
|
|
64
|
+
for i, cmd in enumerate(port_cmds):
|
|
65
|
+
with open(f"scripts/extraction/script_{j}.sh", "a") as f:
|
|
66
|
+
f.write('unset http_proxy; unset https_proxy; sbt "runMain pisa.server.PisaOneStageServer{}"&\n'.format(port))
|
|
67
|
+
f.write("PIDmain=$!\n")
|
|
68
|
+
f.write("sleep 12\n")
|
|
69
|
+
f.write(cmd + "&\n")
|
|
70
|
+
f.write("PID=$!\n")
|
|
71
|
+
f.write("wait $PID\n")
|
|
72
|
+
f.write("rm -rf target/bg-jobs \n")
|
|
73
|
+
f.write("kill $PIDmain\n")
|
|
74
|
+
counter += 1
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
#
|
|
78
|
+
# with open("afp_extract_script_{}.sh".format(port), "w") as f:
|
|
79
|
+
# f.write('sbt "runMain pisa.server.PisaOneStageServer{}"&\n'.format(port))
|
|
80
|
+
# f.write("PIDmain=$!\n")
|
|
81
|
+
# f.write("sleep 12\n")
|
|
82
|
+
# wait_cmds = []
|
|
83
|
+
# for i, cmd in enumerate(port_cmds):
|
|
84
|
+
# if (i + 1) % n_threads == 0:
|
|
85
|
+
# f.write(cmd + "&\n")
|
|
86
|
+
# f.write("PID{}=$!\n".format(i % n_threads))
|
|
87
|
+
# wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
88
|
+
# for wait in wait_cmds:
|
|
89
|
+
# f.write(wait)
|
|
90
|
+
# wait_cmds = []
|
|
91
|
+
# # f.write("ps aux | grep scala | awk '{print $2}' | xargs kill\n")
|
|
92
|
+
# # f.write("ps aux | grep java | awk '{print $2}' | xargs kill\n")
|
|
93
|
+
# # f.write("ps aux | grep poly | awk '{print $2}' | xargs kill\n")
|
|
94
|
+
# f.write("kill $PIDmain\n")
|
|
95
|
+
# if (i+1) % 20 == 0:
|
|
96
|
+
# f.write("rm -rf target/bg-jobs/* \n")
|
|
97
|
+
# f.write('sbt "runMain pisa.server.PisaOneStageServer{}" &\n'.format(port))
|
|
98
|
+
# f.write("PIDmain=$!\n")
|
|
99
|
+
# f.write("sleep 12\n")
|
|
100
|
+
# else:
|
|
101
|
+
# f.write(cmd + "&\n")
|
|
102
|
+
# f.write("PID{}=$!\n".format(i % n_threads))
|
|
103
|
+
# wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
ports = str(input("Enter the ports, separated by commas:\n")).strip()
|
|
2
|
+
ports = ports.split(",")
|
|
3
|
+
ports = [int(port.strip()) for port in ports]
|
|
4
|
+
ports = [port for port in ports if port]
|
|
5
|
+
|
|
6
|
+
import glob
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
home_directory = "/home/qj213"
|
|
10
|
+
|
|
11
|
+
script = f"python3 src/main/python/one_stage_extraction.py --isa-path {home_directory}/Isabelle2021 " \
|
|
12
|
+
f"-wd {home_directory}" + "/afp-2021-10-22/thys/Symmetric_Polynomials --saving-directory mini_extractions/{} -tfp {}"
|
|
13
|
+
n_threads = 1
|
|
14
|
+
|
|
15
|
+
cmds = []
|
|
16
|
+
|
|
17
|
+
IGNORED_THEORIES = {}
|
|
18
|
+
IGNORED_ENTRIES = {}
|
|
19
|
+
|
|
20
|
+
total_files = 0
|
|
21
|
+
for project_name in glob.glob("{}/miniF2F/isabelle/**/*.thy".format(home_directory), recursive=True):
|
|
22
|
+
project_single_name = project_name.split("/")[5]
|
|
23
|
+
# file_single_name = project_name.split("/")[-1]
|
|
24
|
+
file_single_name = project_name.replace("/", "_")
|
|
25
|
+
# Ignore already extracted files
|
|
26
|
+
print("mini_extractions/{}/{}_ground_truth.json".format(project_single_name, file_single_name.split(".thy")[0]))
|
|
27
|
+
if os.path.isfile("mini_extractions/{}/{}_ground_truth.json".format(
|
|
28
|
+
project_single_name, file_single_name.split(".thy")[0])):
|
|
29
|
+
continue
|
|
30
|
+
|
|
31
|
+
if project_single_name not in IGNORED_ENTRIES and \
|
|
32
|
+
project_single_name + "/" + file_single_name not in IGNORED_THEORIES:
|
|
33
|
+
cmds.append(
|
|
34
|
+
script.format(project_single_name, project_name))
|
|
35
|
+
total_files += 1
|
|
36
|
+
print("A total of {} files are due to be generated".format(total_files))
|
|
37
|
+
# num_cmd_per_thread = len(cmds) // n_threads + 1
|
|
38
|
+
# cmds_splits = [cmds[i*num_cmd_per_thread:(i+1)*num_cmd_per_thread] for i in range(n_threads)]
|
|
39
|
+
|
|
40
|
+
how_many_ports = len(ports)
|
|
41
|
+
indices_to_ports = {i: port for i, port in enumerate(ports)}
|
|
42
|
+
cmds_for_port = {port: [] for port in ports}
|
|
43
|
+
for i, cmd in enumerate(cmds):
|
|
44
|
+
port = indices_to_ports[i%how_many_ports]
|
|
45
|
+
cmds_for_port[port].append(cmd + " -p {} ".format(port))
|
|
46
|
+
|
|
47
|
+
for port, port_cmds in cmds_for_port.items():
|
|
48
|
+
with open("mini_extract_script_{}.sh".format(port), "w") as f:
|
|
49
|
+
f.write('sbt "runMain pisa.server.PisaOneStageServer{}"&\n'.format(port))
|
|
50
|
+
f.write("PIDmain=$!\n")
|
|
51
|
+
f.write("sleep 12\n")
|
|
52
|
+
wait_cmds = []
|
|
53
|
+
for i, cmd in enumerate(port_cmds):
|
|
54
|
+
if (i + 1) % n_threads == 0:
|
|
55
|
+
f.write(cmd + "&\n")
|
|
56
|
+
f.write("PID{}=$!\n".format(i % n_threads))
|
|
57
|
+
wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
58
|
+
for wait in wait_cmds:
|
|
59
|
+
f.write(wait)
|
|
60
|
+
wait_cmds = []
|
|
61
|
+
# f.write("ps aux | grep scala | awk '{print $2}' | xargs kill\n")
|
|
62
|
+
# f.write("ps aux | grep java | awk '{print $2}' | xargs kill\n")
|
|
63
|
+
# f.write("ps aux | grep poly | awk '{print $2}' | xargs kill\n")
|
|
64
|
+
f.write("kill $PIDmain\n")
|
|
65
|
+
if (i+1) % 20 == 0:
|
|
66
|
+
f.write("rm -rf target/bg-jobs/* \n")
|
|
67
|
+
f.write('sbt "runMain pisa.server.PisaOneStageServer{}" &\n'.format(port))
|
|
68
|
+
f.write("PIDmain=$!\n")
|
|
69
|
+
f.write("sleep 12\n")
|
|
70
|
+
else:
|
|
71
|
+
f.write(cmd + "&\n")
|
|
72
|
+
f.write("PID{}=$!\n".format(i % n_threads))
|
|
73
|
+
wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
ports = input("Enter the ports, separated by commas:\n").strip()
|
|
2
|
+
ports = ports.split(",")
|
|
3
|
+
ports = [int(port.strip()) for port in ports]
|
|
4
|
+
ports = [port for port in ports if port]
|
|
5
|
+
|
|
6
|
+
import glob
|
|
7
|
+
import os
|
|
8
|
+
|
|
9
|
+
script = "python3 src/main/python/one_stage_extraction.py -wd {} --saving-directory std_extractions/{} --isa-path /home/qj213/Isabelle2021 -tfp {}"
|
|
10
|
+
n_threads = 1
|
|
11
|
+
|
|
12
|
+
cmds = []
|
|
13
|
+
|
|
14
|
+
IGNORED_THEORIES = {}
|
|
15
|
+
IGNORED_ENTRIES = {}
|
|
16
|
+
|
|
17
|
+
total_files = 0
|
|
18
|
+
for project_name in glob.glob("/home/qj213/Isabelle2021/src/**/*.thy", recursive=True):
|
|
19
|
+
project_single_name = project_name.split("/")[5]
|
|
20
|
+
file_single_name = project_name.split("/")[-1]
|
|
21
|
+
|
|
22
|
+
# Ignore already extracted files
|
|
23
|
+
if os.path.isfile("/home/qj213/Portal-to-ISAbelle/std_extractions/{}/{}_ground_truth.json".format(
|
|
24
|
+
project_single_name, file_single_name.split(".thy")[0])):
|
|
25
|
+
continue
|
|
26
|
+
|
|
27
|
+
if project_single_name not in IGNORED_ENTRIES and \
|
|
28
|
+
project_single_name + "/" + file_single_name not in IGNORED_THEORIES:
|
|
29
|
+
cmds.append(
|
|
30
|
+
script.format("/".join(project_name.split("/")[:-1]), project_single_name, project_name))
|
|
31
|
+
total_files += 1
|
|
32
|
+
print("A total of {} files are due to be generated".format(total_files))
|
|
33
|
+
# num_cmd_per_thread = len(cmds) // n_threads + 1
|
|
34
|
+
# cmds_splits = [cmds[i*num_cmd_per_thread:(i+1)*num_cmd_per_thread] for i in range(n_threads)]
|
|
35
|
+
|
|
36
|
+
how_many_ports = len(ports)
|
|
37
|
+
indices_to_ports = {i: port for i, port in enumerate(ports)}
|
|
38
|
+
cmds_for_port = {port: [] for port in ports}
|
|
39
|
+
for i, cmd in enumerate(cmds):
|
|
40
|
+
port = indices_to_ports[i%how_many_ports]
|
|
41
|
+
cmds_for_port[port].append(cmd + " -p {} ".format(port))
|
|
42
|
+
|
|
43
|
+
for port, port_cmds in cmds_for_port.items():
|
|
44
|
+
with open("std_extract_script_{}.sh".format(port), "w") as f:
|
|
45
|
+
f.write('sbt "runMain pisa.server.PisaOneStageServer{}"&\n'.format(port))
|
|
46
|
+
f.write("PIDmain=$!\n")
|
|
47
|
+
f.write("sleep 12\n")
|
|
48
|
+
wait_cmds = []
|
|
49
|
+
for i, cmd in enumerate(port_cmds):
|
|
50
|
+
if (i + 1) % n_threads == 0:
|
|
51
|
+
f.write(cmd + "&\n")
|
|
52
|
+
f.write("PID{}=$!\n".format(i % n_threads))
|
|
53
|
+
wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
54
|
+
for wait in wait_cmds:
|
|
55
|
+
f.write(wait)
|
|
56
|
+
wait_cmds = []
|
|
57
|
+
# f.write("ps aux | grep scala | awk '{print $2}' | xargs kill\n")
|
|
58
|
+
# f.write("ps aux | grep java | awk '{print $2}' | xargs kill\n")
|
|
59
|
+
# f.write("ps aux | grep poly | awk '{print $2}' | xargs kill\n")
|
|
60
|
+
f.write("kill $PIDmain\n")
|
|
61
|
+
if (i+1) % 20 == 0:
|
|
62
|
+
f.write("rm -rf target/bg-jobs/* \n")
|
|
63
|
+
f.write('sbt "runMain pisa.server.PisaOneStageServer{}" &\n'.format(port))
|
|
64
|
+
f.write("PIDmain=$!\n")
|
|
65
|
+
f.write("sleep 12\n")
|
|
66
|
+
else:
|
|
67
|
+
f.write(cmd + "&\n")
|
|
68
|
+
f.write("PID{}=$!\n".format(i % n_threads))
|
|
69
|
+
wait_cmds.append("wait $PID{}\n".format(i % n_threads))
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
number_of_processes = input("Enter the number of processes you want to run at the same time:\n").strip()
|
|
2
|
+
number_of_processes = int(number_of_processes)
|
|
3
|
+
mini = input("Are we doing MiniF2F? (Y/N)\n").strip()
|
|
4
|
+
mini = True if mini.strip().startswith("Y") else False
|
|
5
|
+
heuristic = input("Are we doing heuristics? (Y/N)\n").strip()
|
|
6
|
+
heuristic = True if heuristic.strip().startswith("Y") else False
|
|
7
|
+
import glob
|
|
8
|
+
import os
|
|
9
|
+
|
|
10
|
+
if heuristic:
|
|
11
|
+
script = 'echo "y" | sbt "runMain pisa.agent.PisaHammerTest {} true"'
|
|
12
|
+
else:
|
|
13
|
+
script = 'echo "y" | sbt "runMain pisa.agent.PisaHammerTest {} false"'
|
|
14
|
+
|
|
15
|
+
theorem_names_path = "/home/qj213/mini_names" if mini else "/home/qj213/Portal-to-ISAbelle/universal_test_theorems"
|
|
16
|
+
|
|
17
|
+
total_cmds = list()
|
|
18
|
+
total_files = 0
|
|
19
|
+
for file_name in glob.glob(f"{theorem_names_path}/test_name_*.json", recursive=True):
|
|
20
|
+
number = int(file_name.split("/")[-1].rstrip(".json").split("_")[-1])
|
|
21
|
+
if number <= 1000:
|
|
22
|
+
total_cmds.append(script.format(file_name))
|
|
23
|
+
total_files += 1
|
|
24
|
+
|
|
25
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
26
|
+
print("A total of {} files are due to be generated".format(total_files))
|
|
27
|
+
for i, cmd in enumerate(total_cmds):
|
|
28
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
29
|
+
|
|
30
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
31
|
+
with open("scripts/eval_hammer_{}.sh".format(process_number), "w") as f:
|
|
32
|
+
for process_cmd in process_cmds:
|
|
33
|
+
f.write(process_cmd+"\n")
|
|
34
|
+
f.write("PIDmain=$!\n")
|
|
35
|
+
f.write("wait $PIDmain\n")
|
|
36
|
+
# f.write("ps -ef | grep z3 | awk '{print $2}' | xargs kill -9\n")
|
|
37
|
+
# f.write("ps -ef | grep veriT | awk '{print $2}' | xargs kill -9\n")
|
|
38
|
+
# f.write("ps -ef | grep cvc4 | awk '{print $2}' | xargs kill -9\n")
|
|
39
|
+
# f.write("ps -ef | grep eprover | awk '{print $2}' | xargs kill -9\n")
|
|
40
|
+
# f.write("ps -ef | grep SPASS | awk '{print $2}' | xargs kill -9\n")
|
|
@@ -0,0 +1,63 @@
|
|
|
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
|
+
engine_id = input("What engine id to use? (starting https: and ending with completions) (blank and will use small model by default)\n").strip()
|
|
13
|
+
if (len(engine_id) == 0):
|
|
14
|
+
engine_id = ""
|
|
15
|
+
|
|
16
|
+
script = 'echo "y" | sbt "runMain pisa.agent.HPSearch {} {} {} {} {} {} {} {} {} {} {} {}"'
|
|
17
|
+
|
|
18
|
+
max_tokens = 128
|
|
19
|
+
max_trials = 200
|
|
20
|
+
timeout = 240000
|
|
21
|
+
search_width = 32
|
|
22
|
+
total_cmds = list()
|
|
23
|
+
mql_sweep = [8, 16, 32]
|
|
24
|
+
for temperature in [0.7, 0.8, 1.0, 1.2]:
|
|
25
|
+
for maximum_queue_length in mql_sweep:
|
|
26
|
+
if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
|
|
27
|
+
pattern = "universal_test_theorems/quick_test_name_*.json"
|
|
28
|
+
else:
|
|
29
|
+
pattern = "universal_test_theorems/test_name_*.json"
|
|
30
|
+
|
|
31
|
+
results_dir = ""
|
|
32
|
+
if use_conj.startswith("t"):
|
|
33
|
+
results_dir = "results/search_eval_conj_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
|
|
34
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
|
|
35
|
+
elif use_proof.startswith("t"):
|
|
36
|
+
results_dir = "results/search_eval_proof_and_state_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
|
|
37
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
|
|
38
|
+
else:
|
|
39
|
+
results_dir = "results/search_eval_state_only_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
|
+
|
|
42
|
+
if os.path.isdir(results_dir):
|
|
43
|
+
shutil.rmtree(results_dir)
|
|
44
|
+
os.makedirs(results_dir)
|
|
45
|
+
|
|
46
|
+
for file_name in glob.glob(pattern, recursive=True):
|
|
47
|
+
total_cmds.append(script.format(file_name, use_proof, use_conj, use_state_first, results_dir,
|
|
48
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, engine_id))
|
|
49
|
+
|
|
50
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
51
|
+
for i, cmd in enumerate(total_cmds):
|
|
52
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
53
|
+
|
|
54
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
55
|
+
with open("scripts/eval_search_conj_{}_use_proof_{}_use_state_first_{}_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}.sh".format(
|
|
56
|
+
use_conj, use_proof, use_state_first, search_width, "sweep_{}".format("_".join([str(element) for element in mql_sweep])), temperature, max_tokens, max_trials, timeout, process_number), "w") as f:
|
|
57
|
+
for process_cmd in process_cmds:
|
|
58
|
+
f.write(process_cmd+"\n")
|
|
59
|
+
f.write("PIDmain=$!\n")
|
|
60
|
+
f.write("wait $PIDmain\n")
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
deduplication
|
|
@@ -0,0 +1,56 @@
|
|
|
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 = 32
|
|
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.OracleAgent {} {} {} {} {} {} {} {} {} {} {}"'
|
|
30
|
+
|
|
31
|
+
total_cmds = list()
|
|
32
|
+
if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
|
|
33
|
+
pattern = "1000_train_theorems/train_theorem_*.json"
|
|
34
|
+
else:
|
|
35
|
+
pattern = "1000_train_theorems/train_theorem_*.json"
|
|
36
|
+
|
|
37
|
+
results_dir = "oracle_results"
|
|
38
|
+
|
|
39
|
+
if os.path.isdir(results_dir):
|
|
40
|
+
shutil.rmtree(results_dir)
|
|
41
|
+
os.makedirs(results_dir)
|
|
42
|
+
|
|
43
|
+
for file_name in glob.glob(pattern, recursive=True):
|
|
44
|
+
total_cmds.append(script.format(file_name, use_proof, use_conj, use_state_first, results_dir,
|
|
45
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout))
|
|
46
|
+
|
|
47
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
48
|
+
for i, cmd in enumerate(total_cmds):
|
|
49
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
50
|
+
|
|
51
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
52
|
+
with open("scripts/oracle_{}.sh".format(process_number), "w") as f:
|
|
53
|
+
for process_cmd in process_cmds:
|
|
54
|
+
f.write(process_cmd+"\n")
|
|
55
|
+
f.write("PIDmain=$!\n")
|
|
56
|
+
f.write("wait $PIDmain\n")
|
|
@@ -0,0 +1,69 @@
|
|
|
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 = 32,
|
|
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.HPSearch {} {} {} {} {} {} {} {} {} {} {}"'
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
total_cmds = list()
|
|
33
|
+
if use_quick_ones.startswith("t") or use_quick_ones.startswith("T"):
|
|
34
|
+
pattern = "universal_test_theorems/quick_test_name_*.json"
|
|
35
|
+
else:
|
|
36
|
+
pattern = "universal_test_theorems/test_name_*.json"
|
|
37
|
+
|
|
38
|
+
results_dir = ""
|
|
39
|
+
if use_conj.startswith("t"):
|
|
40
|
+
results_dir = "results/search_eval_conj_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
|
|
41
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
|
|
42
|
+
elif use_proof.startswith("t"):
|
|
43
|
+
results_dir = "results/search_eval_proof_and_state_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
|
|
44
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
|
|
45
|
+
else:
|
|
46
|
+
results_dir = "results/search_eval_state_only_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}".format(
|
|
47
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
if os.path.isdir(results_dir):
|
|
51
|
+
shutil.rmtree(results_dir)
|
|
52
|
+
os.makedirs(results_dir)
|
|
53
|
+
|
|
54
|
+
for file_name in glob.glob(pattern, recursive=True):
|
|
55
|
+
total_cmds.append(script.format(file_name, use_proof, use_conj, use_state_first, results_dir,
|
|
56
|
+
search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout))
|
|
57
|
+
|
|
58
|
+
process_number_to_cmds = {i: [] for i in range(number_of_processes)}
|
|
59
|
+
for i, cmd in enumerate(total_cmds):
|
|
60
|
+
process_number_to_cmds[i%number_of_processes].append(cmd)
|
|
61
|
+
|
|
62
|
+
for process_number, process_cmds in process_number_to_cmds.items():
|
|
63
|
+
with open("scripts/eval_search_conj_{}_use_proof_{}_use_state_first_{}_search_width_{}_maximum_queue_length_{}_temperature_{}_max_tokens_{}_max_trials_{}_timeout_{}_{}.sh".format(
|
|
64
|
+
use_conj, use_proof, use_state_first, search_width, maximum_queue_length, temperature, max_tokens, max_trials, timeout, process_number), "w") as f:
|
|
65
|
+
|
|
66
|
+
for process_cmd in process_cmds:
|
|
67
|
+
f.write(process_cmd+"\n")
|
|
68
|
+
f.write("PIDmain=$!\n")
|
|
69
|
+
f.write("wait $PIDmain\n")
|