├── smyth ├── suites ├── no-sketch │ ├── sketches │ ├── specifications │ └── examples │ │ ├── bool_neg.elm │ │ ├── nat_pred.elm │ │ ├── list_hd.elm │ │ ├── list_length.elm │ │ ├── list_sum.elm │ │ ├── list_tl.elm │ │ ├── nat_iseven.elm │ │ ├── list_stutter.elm │ │ ├── list_inc.elm │ │ ├── bool_band.elm │ │ ├── bool_bor.elm │ │ ├── bool_xor.elm │ │ ├── bool_impl.elm │ │ ├── list_rev_fold.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_rev_append.elm │ │ ├── list_last.elm │ │ ├── list_append.elm │ │ ├── nat_max.elm │ │ ├── nat_add.elm │ │ ├── list_pairwise_swap.elm │ │ ├── list_even_parity.elm │ │ ├── list_sort_sorted_insert.elm │ │ ├── list_map.elm │ │ ├── list_concat.elm │ │ ├── list_rev_tailcall.elm │ │ ├── tree_inorder.elm │ │ ├── tree_preorder.elm │ │ ├── list_snoc.elm │ │ ├── list_filter.elm │ │ ├── list_drop.elm │ │ ├── list_fold.elm │ │ ├── list_nth.elm │ │ ├── list_take.elm │ │ ├── list_compress.elm │ │ ├── list_sorted_insert.elm │ │ ├── tree_count_nodes.elm │ │ └── tree_collect_leaves.elm ├── myth │ ├── specifications │ ├── examples │ │ ├── bool_neg.elm │ │ ├── nat_pred.elm │ │ ├── list_hd.elm │ │ ├── list_sum.elm │ │ ├── list_length.elm │ │ ├── list_tl.elm │ │ ├── nat_iseven.elm │ │ ├── list_stutter.elm │ │ ├── list_inc.elm │ │ ├── bool_bor.elm │ │ ├── bool_band.elm │ │ ├── bool_impl.elm │ │ ├── bool_xor.elm │ │ ├── list_rev_append.elm │ │ ├── list_rev_fold.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_last.elm │ │ ├── list_append.elm │ │ ├── nat_add.elm │ │ ├── nat_max.elm │ │ ├── list_pairwise_swap.elm │ │ ├── list_sort_sorted_insert.elm │ │ ├── list_even_parity.elm │ │ ├── list_map.elm │ │ ├── list_rev_tailcall.elm │ │ ├── list_concat.elm │ │ ├── list_snoc.elm │ │ ├── tree_inorder.elm │ │ ├── tree_preorder.elm │ │ ├── list_drop.elm │ │ ├── list_filter.elm │ │ ├── list_fold.elm │ │ ├── list_nth.elm │ │ ├── list_take.elm │ │ ├── list_sorted_insert.elm │ │ ├── list_compress.elm │ │ ├── tree_count_nodes.elm │ │ └── tree_collect_leaves.elm │ └── sketches │ │ ├── nat_pred.elm │ │ ├── bool_neg.elm │ │ ├── nat_add.elm │ │ ├── bool_bor.elm │ │ ├── bool_band.elm │ │ ├── bool_impl.elm │ │ ├── bool_xor.elm │ │ ├── nat_iseven.elm │ │ ├── list_hd.elm │ │ ├── list_tl.elm │ │ ├── list_length.elm │ │ ├── list_nth.elm │ │ ├── list_drop.elm │ │ ├── list_snoc.elm │ │ ├── list_stutter.elm │ │ ├── list_take.elm │ │ ├── list_append.elm │ │ ├── list_pairwise_swap.elm │ │ ├── list_even_parity.elm │ │ ├── list_rev_tailcall.elm │ │ ├── list_last.elm │ │ ├── tree_count_nodes.elm │ │ ├── list_inc.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_rev_append.elm │ │ ├── list_map.elm │ │ ├── tree_count_leaves.elm │ │ ├── .tree_nodes_at_level.elm │ │ ├── list_concat.elm │ │ ├── tree_inorder.elm │ │ ├── .tree_postorder.elm │ │ ├── tree_preorder.elm │ │ ├── nat_max.elm │ │ ├── .list_compress.elm │ │ └── tree_collect_leaves.elm ├── poly-no-sketch │ ├── specifications │ ├── examples │ │ ├── list_length.elm │ │ ├── list_tl.elm │ │ ├── list_stutter.elm │ │ ├── list_rev_fold.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_rev_append.elm │ │ ├── list_last.elm │ │ ├── list_append.elm │ │ ├── list_pairwise_swap.elm │ │ ├── list_concat.elm │ │ ├── list_map.elm │ │ ├── list_snoc.elm │ │ ├── list_fold.elm │ │ ├── tree_inorder.elm │ │ ├── tree_preorder.elm │ │ ├── list_rev_tailcall.elm │ │ ├── list_filter.elm │ │ ├── list_drop.elm │ │ └── list_take.elm │ ├── .list_nth.elm │ ├── sketches │ │ ├── .list_hd.elm │ │ ├── list_tl.elm │ │ ├── list_length.elm │ │ ├── list_snoc.elm │ │ ├── list_append.elm │ │ ├── list_drop.elm │ │ ├── list_stutter.elm │ │ ├── list_take.elm │ │ ├── .list_pairwise_swap.elm │ │ ├── list_rev_tailcall.elm │ │ ├── list_last.elm │ │ ├── tree_count_nodes.elm │ │ ├── .list_inc.elm │ │ ├── list_rev_snoc.elm │ │ ├── tree_count_leaves.elm │ │ ├── list_concat.elm │ │ ├── list_rev_append.elm │ │ ├── list_map.elm │ │ ├── tree_inorder.elm │ │ ├── tree_preorder.elm │ │ ├── .tree_postorder.elm │ │ └── tree_collect_leaves.elm │ └── .tree_nodes_at_level.elm ├── base-case-sketch │ ├── specifications │ ├── examples │ │ ├── list_length.elm │ │ ├── nat_iseven.elm │ │ ├── list_stutter.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_rev_append.elm │ │ ├── list_last.elm │ │ ├── list_append.elm │ │ ├── nat_max.elm │ │ ├── nat_add.elm │ │ ├── list_even_parity.elm │ │ ├── list_pairwise_swap.elm │ │ ├── list_sort_sorted_insert.elm │ │ ├── list_map.elm │ │ ├── list_concat.elm │ │ ├── list_rev_tailcall.elm │ │ ├── tree_inorder.elm │ │ ├── tree_preorder.elm │ │ ├── list_snoc.elm │ │ ├── list_filter.elm │ │ ├── list_fold.elm │ │ ├── list_drop.elm │ │ ├── list_take.elm │ │ ├── list_nth.elm │ │ ├── list_sorted_insert.elm │ │ ├── tree_count_nodes.elm │ │ └── tree_collect_leaves.elm │ └── sketches │ │ ├── nat_add.elm │ │ ├── nat_iseven.elm │ │ ├── list_drop.elm │ │ ├── list_length.elm │ │ ├── list_take.elm │ │ ├── list_append.elm │ │ ├── list_stutter.elm │ │ ├── list_snoc.elm │ │ ├── .list_pairwise_swap.elm │ │ ├── list_even_parity.elm │ │ ├── list_rev_tailcall.elm │ │ ├── list_last.elm │ │ ├── list_nth.elm │ │ ├── tree_count_nodes.elm │ │ ├── list_rev_snoc.elm │ │ ├── list_rev_append.elm │ │ ├── tree_count_leaves.elm │ │ └── list_map.elm └── poly-base-case-sketch │ ├── specifications │ ├── examples │ ├── list_length.elm │ ├── list_stutter.elm │ ├── list_rev_snoc.elm │ ├── list_rev_append.elm │ ├── list_last.elm │ ├── list_append.elm │ ├── list_pairwise_swap.elm │ ├── list_concat.elm │ ├── list_map.elm │ ├── list_snoc.elm │ ├── list_fold.elm │ ├── tree_inorder.elm │ ├── tree_preorder.elm │ ├── list_rev_tailcall.elm │ ├── list_filter.elm │ ├── list_drop.elm │ └── list_take.elm │ └── sketches │ ├── .list_pairwise_swap.elm │ ├── list_drop.elm │ ├── list_length.elm │ ├── list_append.elm │ ├── list_stutter.elm │ ├── list_take.elm │ ├── list_snoc.elm │ ├── list_rev_tailcall.elm │ ├── list_last.elm │ ├── tree_count_nodes.elm │ ├── list_rev_snoc.elm │ ├── tree_count_leaves.elm │ ├── list_concat.elm │ └── list_rev_append.elm ├── .ocamlinit ├── dune-project ├── lib ├── stdlib2 │ ├── compilation2.mli │ ├── float2.mli │ ├── char2.mli │ ├── random2.mli │ ├── int2.mli │ ├── compilation2.ml │ ├── pair2.mli │ ├── pervasives2.ml │ ├── io2.mli │ ├── float2.ml │ ├── pervasives2.mli │ ├── pair2.ml │ ├── dune │ ├── char2.ml │ └── tree2.mli └── smyth │ ├── post_parse.mli │ ├── fresh.ml │ ├── pretty.mli │ ├── log.ml │ ├── dune │ ├── example.mli │ ├── solve.mli │ ├── fresh.mli │ └── refine.mli ├── experiments ├── exp-4-logic │ ├── generated │ │ ├── 1 │ │ │ ├── synquid_bool_neg.txt │ │ │ ├── synquid_bool_band.txt │ │ │ ├── synquid_bool_bor.txt │ │ │ ├── synquid_bool_impl.txt │ │ │ ├── synquid_bool_xor.txt │ │ │ ├── synquid_nat_pred.txt │ │ │ ├── leon_bool_neg.txt │ │ │ ├── leon_nat_pred.txt │ │ │ └── synquid_nat_iseven.txt │ │ └── 2a │ │ │ ├── leon_bool_neg.txt │ │ │ ├── leon_bool_xor.txt │ │ │ ├── leon_nat_max.txt │ │ │ ├── leon_list_compress.txt │ │ │ ├── leon_list_length.txt │ │ │ ├── leon_tree_binsert.txt │ │ │ ├── leon_tree_postorder.txt │ │ │ ├── synquid_bool_neg.txt │ │ │ ├── synquid_bool_xor.txt │ │ │ ├── synquid_list_length.txt │ │ │ ├── synquid_nat_max.txt │ │ │ ├── leon_list_even_parity.txt │ │ │ ├── leon_tree_nodes_at_level.txt │ │ │ ├── synquid_list_compress.txt │ │ │ ├── synquid_list_even_parity.txt │ │ │ ├── synquid_tree_binsert.txt │ │ │ ├── synquid_tree_postorder.txt │ │ │ ├── synquid_tree_nodes_at_level.txt │ │ │ ├── synquid_bool_band.txt │ │ │ ├── synquid_bool_bor.txt │ │ │ ├── synquid_bool_impl.txt │ │ │ ├── synquid_nat_pred.txt │ │ │ ├── leon_nat_pred.txt │ │ │ └── synquid_nat_iseven.txt │ ├── myth_benchmarks.py │ ├── results │ │ ├── 1 │ │ │ ├── synquid_bool_neg.txt │ │ │ ├── synquid_bool_bor.txt │ │ │ ├── synquid_bool_band.txt │ │ │ ├── synquid_bool_impl.txt │ │ │ ├── synquid_nat_pred.txt │ │ │ └── synquid_bool_xor.txt │ │ └── 2a │ │ │ ├── leon_bool_neg.txt │ │ │ ├── leon_bool_xor.txt │ │ │ ├── leon_list_length.txt │ │ │ ├── leon_nat_max.txt │ │ │ ├── synquid_bool_neg.txt │ │ │ ├── synquid_bool_xor.txt │ │ │ ├── synquid_nat_max.txt │ │ │ ├── leon_list_compress.txt │ │ │ ├── leon_list_even_parity.txt │ │ │ ├── leon_tree_binsert.txt │ │ │ ├── leon_tree_postorder.txt │ │ │ ├── synquid_list_compress.txt │ │ │ ├── synquid_list_length.txt │ │ │ ├── synquid_tree_binsert.txt │ │ │ ├── leon_tree_nodes_at_level.txt │ │ │ ├── synquid_list_even_parity.txt │ │ │ ├── synquid_tree_postorder.txt │ │ │ ├── synquid_tree_nodes_at_level.txt │ │ │ ├── synquid_bool_bor.txt │ │ │ ├── synquid_bool_band.txt │ │ │ ├── synquid_bool_impl.txt │ │ │ └── synquid_nat_pred.txt │ └── Makefile ├── run-simple-benchmarks ├── author-results │ └── data │ │ ├── exp-2b │ │ ├── png │ │ │ ├── bool_bor.png │ │ │ ├── bool_neg.png │ │ │ ├── bool_xor.png │ │ │ ├── list_hd.png │ │ │ ├── list_inc.png │ │ │ ├── list_nth.png │ │ │ ├── list_sum.png │ │ │ ├── list_tl.png │ │ │ ├── nat_add.png │ │ │ ├── nat_max.png │ │ │ ├── nat_pred.png │ │ │ ├── bool_band.png │ │ │ ├── bool_impl.png │ │ │ ├── list_drop.png │ │ │ ├── list_last.png │ │ │ ├── list_snoc.png │ │ │ ├── list_take.png │ │ │ ├── nat_iseven.png │ │ │ ├── list_append.png │ │ │ ├── list_concat.png │ │ │ ├── list_length.png │ │ │ ├── list_rev_fold.png │ │ │ ├── list_rev_snoc.png │ │ │ ├── list_stutter.png │ │ │ ├── tree_inorder.png │ │ │ ├── tree_preorder.png │ │ │ ├── list_rev_append.png │ │ │ ├── list_even_parity.png │ │ │ ├── list_rev_tailcall.png │ │ │ ├── tree_count_nodes.png │ │ │ ├── tree_collect_leaves.png │ │ │ └── list_sort_sorted_insert.png │ │ ├── histogram │ │ │ ├── k50.png │ │ │ ├── k90.png │ │ │ ├── k90.csv │ │ │ └── k50.csv │ │ └── csv │ │ │ ├── bool_neg.csv │ │ │ ├── bool_band.csv │ │ │ ├── bool_bor.csv │ │ │ ├── bool_impl.csv │ │ │ ├── bool_xor.csv │ │ │ ├── nat_pred.csv │ │ │ ├── nat_iseven.csv │ │ │ ├── list_length.csv │ │ │ ├── nat_add.csv │ │ │ ├── list_hd.csv │ │ │ ├── list_inc.csv │ │ │ ├── list_sum.csv │ │ │ ├── list_tl.csv │ │ │ ├── list_stutter.csv │ │ │ ├── nat_max.csv │ │ │ ├── list_rev_fold.csv │ │ │ ├── list_rev_snoc.csv │ │ │ ├── tree_inorder.csv │ │ │ ├── tree_preorder.csv │ │ │ ├── list_rev_append.csv │ │ │ ├── list_even_parity.csv │ │ │ └── tree_count_nodes.csv │ │ ├── exp-3b │ │ ├── png │ │ │ ├── list_nth.png │ │ │ ├── nat_add.png │ │ │ ├── nat_max.png │ │ │ ├── list_drop.png │ │ │ ├── list_last.png │ │ │ ├── list_snoc.png │ │ │ ├── list_take.png │ │ │ ├── nat_iseven.png │ │ │ ├── list_append.png │ │ │ ├── list_concat.png │ │ │ ├── list_length.png │ │ │ ├── list_rev_snoc.png │ │ │ ├── list_stutter.png │ │ │ ├── tree_inorder.png │ │ │ ├── tree_preorder.png │ │ │ ├── list_rev_append.png │ │ │ ├── list_even_parity.png │ │ │ ├── list_rev_tailcall.png │ │ │ ├── tree_count_nodes.png │ │ │ ├── tree_collect_leaves.png │ │ │ └── list_sort_sorted_insert.png │ │ ├── histogram │ │ │ ├── k50.png │ │ │ ├── k90.png │ │ │ ├── k50.csv │ │ │ └── k90.csv │ │ └── csv │ │ │ ├── nat_iseven.csv │ │ │ ├── list_length.csv │ │ │ ├── nat_add.csv │ │ │ ├── list_stutter.csv │ │ │ ├── nat_max.csv │ │ │ ├── list_rev_snoc.csv │ │ │ ├── tree_inorder.csv │ │ │ ├── tree_preorder.csv │ │ │ ├── list_rev_append.csv │ │ │ ├── list_even_parity.csv │ │ │ └── tree_count_nodes.csv │ │ ├── exp-5b │ │ ├── png │ │ │ ├── list_tl.png │ │ │ ├── list_drop.png │ │ │ ├── list_last.png │ │ │ ├── list_snoc.png │ │ │ ├── list_take.png │ │ │ ├── list_append.png │ │ │ ├── list_concat.png │ │ │ ├── list_length.png │ │ │ ├── list_rev_fold.png │ │ │ ├── list_rev_snoc.png │ │ │ ├── list_stutter.png │ │ │ ├── tree_inorder.png │ │ │ ├── tree_preorder.png │ │ │ ├── list_rev_append.png │ │ │ ├── list_rev_tailcall.png │ │ │ ├── tree_count_nodes.png │ │ │ └── tree_collect_leaves.png │ │ ├── histogram │ │ │ ├── k50.png │ │ │ ├── k90.png │ │ │ ├── k90.csv │ │ │ └── k50.csv │ │ ├── csv │ │ │ ├── list_length.csv │ │ │ ├── list_tl.csv │ │ │ ├── list_stutter.csv │ │ │ ├── list_rev_fold.csv │ │ │ ├── list_rev_snoc.csv │ │ │ ├── tree_inorder.csv │ │ │ ├── tree_preorder.csv │ │ │ ├── list_rev_append.csv │ │ │ └── tree_count_nodes.csv │ │ └── analysis.csv │ │ └── exp-6b │ │ ├── histogram │ │ ├── k50.csv │ │ ├── k50.png │ │ ├── k90.csv │ │ └── k90.png │ │ ├── png │ │ ├── list_drop.png │ │ ├── list_last.png │ │ ├── list_snoc.png │ │ ├── list_take.png │ │ ├── list_append.png │ │ ├── list_concat.png │ │ ├── list_length.png │ │ ├── list_rev_snoc.png │ │ ├── list_stutter.png │ │ ├── tree_inorder.png │ │ ├── tree_preorder.png │ │ ├── list_rev_append.png │ │ ├── list_rev_tailcall.png │ │ ├── tree_count_nodes.png │ │ └── tree_collect_leaves.png │ │ ├── csv │ │ ├── list_length.csv │ │ ├── list_stutter.csv │ │ ├── list_rev_snoc.csv │ │ ├── tree_inorder.csv │ │ ├── tree_preorder.csv │ │ ├── list_rev_append.csv │ │ └── tree_count_nodes.csv │ │ └── analysis.csv ├── exp-1 ├── exp-2a ├── exp-5a ├── exp-3a ├── exp-6a └── plot ├── specifications ├── mono │ ├── bool_neg.elm │ ├── nat_pred.elm │ ├── nat_iseven.elm │ ├── bool_band.elm │ ├── bool_bor.elm │ ├── bool_xor.elm │ ├── bool_impl.elm │ ├── list_length.elm │ ├── nat_add.elm │ ├── list_sum.elm │ ├── list_hd.elm │ ├── list_tl.elm │ ├── list_inc.elm │ ├── nat_max.elm │ ├── list_even_parity.elm │ ├── list_stutter.elm │ ├── list_rev_fold.elm │ ├── list_rev_snoc.elm │ ├── list_rev_append.elm │ └── list_nth.elm └── poly │ ├── .list_sum.elm │ ├── .list_hd.elm │ ├── .list_inc.elm │ ├── list_length.elm │ ├── .list_sort_sorted_insert.elm │ ├── .list_sorted_insert.elm │ ├── list_tl.elm │ ├── .list_nth.elm │ └── list_stutter.elm ├── src ├── show.mli ├── python_denotation.mli ├── fuzz.mli ├── references.mli └── denotation.mli ├── misc-utils ├── transfer.sh ├── add-module-overviews.sh ├── modify-odoc-css.sh └── convert-suite.sh ├── examples ├── mistyped_uneval.elm ├── strange_id.elm ├── stutter.elm ├── poly_stutter.elm ├── max.elm ├── stutter_sketch.elm ├── mult.elm ├── rev_concat.elm ├── minus.elm └── length_foldr.elm ├── test ├── fuzz ├── poly-fuzz ├── .gitignore ├── CONTRIBUTORS.md ├── smyth-stdlib2.opam ├── smyth.opam └── forge /smyth: -------------------------------------------------------------------------------- 1 | _build/default/src/main.exe -------------------------------------------------------------------------------- /suites/no-sketch/sketches: -------------------------------------------------------------------------------- 1 | ../myth/sketches/ -------------------------------------------------------------------------------- /.ocamlinit: -------------------------------------------------------------------------------- 1 | open Pervasives2 2 | open Smyth 3 | -------------------------------------------------------------------------------- /dune-project: -------------------------------------------------------------------------------- 1 | (lang dune 1.11) 2 | (name smyth) 3 | -------------------------------------------------------------------------------- /lib/stdlib2/compilation2.mli: -------------------------------------------------------------------------------- 1 | val is_js : bool 2 | -------------------------------------------------------------------------------- /suites/myth/specifications: -------------------------------------------------------------------------------- 1 | ../../specifications/mono/ -------------------------------------------------------------------------------- /lib/stdlib2/float2.mli: -------------------------------------------------------------------------------- 1 | val to_string : float -> string 2 | -------------------------------------------------------------------------------- /suites/no-sketch/specifications: -------------------------------------------------------------------------------- 1 | ../../specifications/mono/ -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_bool_neg.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_bool_xor.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_nat_max.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/myth_benchmarks.py: -------------------------------------------------------------------------------- 1 | ../myth_benchmarks.py -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_bool_neg.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_bool_xor.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_list_length.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_nat_max.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_bool_neg.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_bool_xor.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_nat_max.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/specifications: -------------------------------------------------------------------------------- 1 | ../../specifications/poly/ -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_list_compress.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_list_length.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_tree_binsert.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_tree_postorder.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_bool_neg.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_bool_xor.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_list_length.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_nat_max.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_list_compress.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_list_even_parity.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_tree_binsert.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_tree_postorder.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_list_compress.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_list_length.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_tree_binsert.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /suites/base-case-sketch/specifications: -------------------------------------------------------------------------------- 1 | ../../specifications/mono/ -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_list_even_parity.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_tree_nodes_at_level.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_list_compress.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_list_even_parity.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_tree_binsert.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_tree_postorder.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/leon_tree_nodes_at_level.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_list_even_parity.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_tree_postorder.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/specifications: -------------------------------------------------------------------------------- 1 | ../../specifications/poly/ -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_tree_nodes_at_level.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_tree_nodes_at_level.txt: -------------------------------------------------------------------------------- 1 | N/A 2 | -------------------------------------------------------------------------------- /specifications/mono/bool_neg.elm: -------------------------------------------------------------------------------- 1 | specifyFunction neg 2 | [ (F, T) 3 | , (T, F) 4 | ] 5 | -------------------------------------------------------------------------------- /experiments/run-simple-benchmarks: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./exp-2a 4 | ./exp-3a 5 | ./exp-5a 6 | ./exp-6a 7 | -------------------------------------------------------------------------------- /suites/myth/examples/bool_neg.elm: -------------------------------------------------------------------------------- 1 | specifyFunction neg 2 | [ (T (), F ()) 3 | , (F (), T ()) 4 | ] 5 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/bool_neg.elm: -------------------------------------------------------------------------------- 1 | specifyFunction neg 2 | [ (T (), F ()) 3 | , (F (), T ()) 4 | ] 5 | -------------------------------------------------------------------------------- /suites/myth/examples/nat_pred.elm: -------------------------------------------------------------------------------- 1 | specifyFunction natPred 2 | [ (0, 0) 3 | , (1, 0) 4 | , (2, 1) 5 | ] 6 | -------------------------------------------------------------------------------- /specifications/poly/.list_sum.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSum 2 | [ ([], 0) 3 | , ([1], 1) 4 | , ([2, 1], 3) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/list_hd.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listHead 2 | [ ([], 0) 3 | , ([0], 0) 4 | , ([1], 1) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/list_sum.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSum 2 | [ ([], 0) 3 | , ([1], 1) 4 | , ([2, 1], 3) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/nat_pred.elm: -------------------------------------------------------------------------------- 1 | specifyFunction natPred 2 | [ (0, 0) 3 | -- , (1, 0) 4 | , (2, 1) 5 | ] 6 | -------------------------------------------------------------------------------- /specifications/mono/nat_pred.elm: -------------------------------------------------------------------------------- 1 | specifyFunction natPred 2 | [ (0, 0) 3 | , (1, 0) 4 | , (3, 2) 5 | , (2, 1) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/myth/examples/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLength 2 | [ ([], 0) 3 | , ([0], 1) 4 | , ([0, 0], 2) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/list_tl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listTail 2 | [ ([], []) 3 | , ([0], []) 4 | , ([0, 0], [0]) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/sketches/nat_pred.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | natPred : Nat -> Nat 6 | natPred n = 7 | ?? 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_hd.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listHead 2 | [ ([], 0) 3 | -- , ([0], 0) 4 | , ([1], 1) 5 | ] 6 | -------------------------------------------------------------------------------- /lib/stdlib2/char2.mli: -------------------------------------------------------------------------------- 1 | val uppercase_char : char -> bool 2 | val lowercase_char : char -> bool 3 | val digit_char : char -> bool 4 | -------------------------------------------------------------------------------- /specifications/mono/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | specifyFunction isEven 2 | [ (0, T) 3 | , (1, F) 4 | , (2, T) 5 | , (3, F) 6 | ] 7 | -------------------------------------------------------------------------------- /src/show.mli: -------------------------------------------------------------------------------- 1 | open Smyth 2 | 3 | val error : Endpoint.error -> string 4 | 5 | val test_result : Endpoint.test_result -> string 6 | -------------------------------------------------------------------------------- /suites/myth/sketches/bool_neg.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | neg : Boolean -> Boolean 6 | neg p = 7 | ?? 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLength 2 | [ ([], 0) 3 | , ([0], 1) 4 | , ([0, 0], 2) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_sum.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSum 2 | [ ([], 0) 3 | -- , ([1], 1) 4 | , ([2, 1], 3) 5 | ] 6 | -------------------------------------------------------------------------------- /specifications/mono/bool_band.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 and 2 | [ (F, F, F) 3 | , (F, T, F) 4 | , (T, T, T) 5 | , (T, F, F) 6 | ] 7 | -------------------------------------------------------------------------------- /specifications/mono/bool_bor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 or 2 | [ (T, F, T) 3 | , (F, T, T) 4 | , (T, T, T) 5 | , (F, F, F) 6 | ] 7 | -------------------------------------------------------------------------------- /specifications/mono/bool_xor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 xor 2 | [ (T, F, T) 3 | , (T, T, F) 4 | , (F, T, T) 5 | , (F, F, F) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/myth/sketches/nat_add.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | natAdd : Nat -> Nat -> Nat 6 | natAdd m n = 7 | ?? 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_tl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listTail 2 | [ ([], []) 3 | -- , ([0], []) 4 | , ([0, 0], [0]) 5 | ] 6 | -------------------------------------------------------------------------------- /specifications/mono/bool_impl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 impl 2 | [ (T, T, T) 3 | , (T, F, F) 4 | , (F, T, T) 5 | , (F, F, T) 6 | ] 7 | -------------------------------------------------------------------------------- /specifications/poly/.list_hd.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listHead ) 2 | [ ([], 0) 3 | , ([0], 0) 4 | , ([1], 1) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | specifyFunction isEven 2 | [ (0, T ()) 3 | , (1, F ()) 4 | , (2, T ()) 5 | , (3, F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/myth/sketches/bool_bor.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | or : Boolean -> Boolean -> Boolean 6 | or p q = 7 | ?? 8 | -------------------------------------------------------------------------------- /lib/stdlib2/random2.mli: -------------------------------------------------------------------------------- 1 | val weighted : float * 'a -> (float * 'a) list -> 'a 2 | 3 | val sample_unique : (int * (unit -> 'a)) list -> 'a list 4 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLength 2 | [ -- ([], 0) 3 | ([0], 1) 4 | -- , ([0, 0], 2) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listStutter 2 | [ ([], []) 3 | , ([0], [0, 0]) 4 | , ([1, 0], [1, 1, 0, 0]) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/sketches/bool_band.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | and : Boolean -> Boolean -> Boolean 6 | and p q = 7 | ?? 8 | -------------------------------------------------------------------------------- /suites/myth/sketches/bool_impl.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | impl : Boolean -> Boolean -> Boolean 6 | impl p q = 7 | ?? 8 | -------------------------------------------------------------------------------- /suites/myth/sketches/bool_xor.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | xor : Boolean -> Boolean -> Boolean 6 | xor p q = 7 | ?? 8 | -------------------------------------------------------------------------------- /src/python_denotation.mli: -------------------------------------------------------------------------------- 1 | open Smyth 2 | open Lang 3 | 4 | val exp_collection : string -> string -> exp list -> string 5 | val exp : exp -> string 6 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | specifyFunction isEven 2 | [ (0, T ()) 3 | -- , (1, F ()) 4 | , (2, T ()) 5 | , (3, F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listStutter 2 | [ ([], []) 3 | -- , ([0], [0, 0]) 4 | , ([1, 0], [1, 1, 0, 0]) 5 | ] 6 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/bool_bor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/bool_bor.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/bool_neg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/bool_neg.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/bool_xor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/bool_xor.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_hd.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_inc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_inc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_nth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_nth.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_sum.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_sum.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_tl.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/nat_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/nat_add.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/nat_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/nat_max.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/nat_pred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/nat_pred.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_nth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_nth.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/nat_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/nat_add.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/nat_max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/nat_max.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_tl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_tl.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/histogram/k50.csv: -------------------------------------------------------------------------------- 1 | 2 2 | 3 3 | 7 4 | 3 5 | 2 6 | 2 7 | 3 8 | 2 9 | 2 10 | 2 11 | 5 12 | 1 13 | 2 14 | 2 15 | 1 16 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | specifyFunction isEven 2 | [ -- (0, T ()) 3 | (1, F ()) 4 | , (2, T ()) 5 | -- , (3, F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listLength ) 2 | [ ([], 0) 3 | , ([0], 1) 4 | , ([0, 0], 2) 5 | ] 6 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/histogram/k50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/histogram/k50.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/histogram/k90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/histogram/k90.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/bool_band.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/bool_band.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/bool_impl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/bool_impl.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_drop.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_last.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_take.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_take.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/nat_iseven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/nat_iseven.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/histogram/k50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/histogram/k50.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/histogram/k90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/histogram/k90.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_drop.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_last.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_take.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_take.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/nat_iseven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/nat_iseven.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/histogram/k50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/histogram/k50.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/histogram/k90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/histogram/k90.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_drop.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_last.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_take.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_take.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/histogram/k50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/histogram/k50.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/histogram/k90.csv: -------------------------------------------------------------------------------- 1 | 4 2 | 5 3 | 18 4 | 9 5 | 2 6 | 4 7 | 4 8 | 4 9 | 3 10 | 2 11 | 13 12 | 2 13 | 3 14 | 2 15 | 2 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/histogram/k90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/histogram/k90.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_drop.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_last.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_last.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_take.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_take.png -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listStutter 2 | [ -- ([], []) 3 | -- , ([0], [0, 0]) 4 | ([1, 0], [1, 1, 0, 0]) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/myth/examples/list_inc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listInc 2 | [ ([], []) 3 | , ([1, 2], [2, 3]) 4 | , ([0, 0], [1, 1]) 5 | , ([3, 4, 5], [4, 5, 6]) 6 | ] 7 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_concat.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_length.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_rev_fold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_rev_fold.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_rev_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_rev_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_stutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_stutter.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/tree_inorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/tree_inorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/tree_preorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/tree_preorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_concat.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_length.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_rev_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_rev_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_stutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_stutter.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/tree_inorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/tree_inorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/tree_preorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/tree_preorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_concat.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_length.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_rev_fold.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_rev_fold.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_rev_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_rev_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_stutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_stutter.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/tree_inorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/tree_inorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/tree_preorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/tree_preorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_concat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_concat.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_length.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_length.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_rev_snoc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_rev_snoc.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_stutter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_stutter.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/tree_inorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/tree_inorder.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/tree_preorder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/tree_preorder.png -------------------------------------------------------------------------------- /lib/stdlib2/int2.mli: -------------------------------------------------------------------------------- 1 | val partition : n:int -> k:int -> int list list 2 | val partition_permutations : n:int -> k:int -> int list list 3 | val pow : int -> int -> int 4 | -------------------------------------------------------------------------------- /suites/myth/examples/bool_bor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 or 2 | [ (T (), T (), T ()) 3 | , (T (), F (), T ()) 4 | , (F (), T (), T ()) 5 | , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_rev_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_rev_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_rev_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_rev_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/histogram/k90.csv: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 5 4 | 7 5 | 1 6 | 5 7 | 2 8 | 6 9 | 2 10 | 2 11 | 1 12 | 7 13 | 1 14 | 0 15 | 3 16 | 1 17 | 1 18 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_rev_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_rev_append.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_rev_append.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_rev_append.png -------------------------------------------------------------------------------- /lib/stdlib2/compilation2.ml: -------------------------------------------------------------------------------- 1 | let is_js : bool = 2 | match Sys.backend_type with 3 | | Sys.Other "js_of_ocaml" -> 4 | true 5 | 6 | | _ -> 7 | false 8 | -------------------------------------------------------------------------------- /suites/myth/examples/bool_band.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 and 2 | [ (T (), T (), T ()) 3 | , (T (), F (), F ()) 4 | , (F (), T (), F ()) 5 | , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/myth/examples/bool_impl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 impl 2 | [ (T (), T (), T ()) 3 | , (T (), F (), F ()) 4 | , (F (), T (), T ()) 5 | , (F (), F (), T ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/myth/examples/bool_xor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 xor 2 | [ (T (), T (), F ()) 3 | , (T (), F (), T ()) 4 | , (F (), T (), T ()) 5 | , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_inc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listInc 2 | [ ([], []) 3 | , ([1, 2], [2, 3]) 4 | -- , ([0, 0], [1, 1]) 5 | -- , ([3, 4, 5], [4, 5, 6]) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listLength ) 2 | [ -- ([], 0) 3 | ([0], 1) 4 | -- , ([0, 0], 2) 5 | ] 6 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_tl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listTail ) 2 | [ ([], []) 3 | -- , ([0], []) 4 | , ([0, 0], [0]) 5 | ] 6 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_even_parity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_even_parity.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_rev_tailcall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_rev_tailcall.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/tree_count_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/tree_count_nodes.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/histogram/k50.csv: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 2 4 | 6 5 | 2 6 | 2 7 | 3 8 | 3 9 | 2 10 | 2 11 | 5 12 | 3 13 | 2 14 | 5 15 | 2 16 | 2 17 | 2 18 | 2 19 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_even_parity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_even_parity.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_rev_tailcall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_rev_tailcall.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/tree_count_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/tree_count_nodes.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/histogram/k50.csv: -------------------------------------------------------------------------------- 1 | 0 2 | -1 3 | 2 4 | 3 5 | 0 6 | 2 7 | 0 8 | 1 9 | 0 10 | 0 11 | 0 12 | 3 13 | 0 14 | -1 15 | 1 16 | 0 17 | -1 18 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/list_rev_tailcall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/list_rev_tailcall.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/tree_count_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/tree_count_nodes.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/list_rev_tailcall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/list_rev_tailcall.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/tree_count_nodes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/tree_count_nodes.png -------------------------------------------------------------------------------- /misc-utils/transfer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # To be run from the root directory of the project 4 | 5 | make clean 6 | scp -r -P 5555 * artifact@localhost:/home/artifact/smyth 7 | -------------------------------------------------------------------------------- /specifications/mono/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLength 2 | [ ([], 0) 3 | , ([0, 3, 1, 0], 4) 4 | , ([3, 3, 2, 3], 4) 5 | , ([2, 2, 0], 3) 6 | , ([3], 1) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/bool_band.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 and 2 | [ (T (), T (), T ()) 3 | , (T (), F (), F ()) 4 | , (F (), T (), F ()) 5 | -- , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/bool_bor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 or 2 | [ -- (T (), T (), T ()) 3 | (T (), F (), T ()) 4 | , (F (), T (), T ()) 5 | , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/bool_xor.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 xor 2 | [ (T (), T (), F ()) 3 | , (T (), F (), T ()) 4 | , (F (), T (), T ()) 5 | , (F (), F (), F ()) 6 | ] 7 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/tree_collect_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/tree_collect_leaves.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/histogram/k90.csv: -------------------------------------------------------------------------------- 1 | 4 2 | 9 3 | 2 4 | 14 5 | 3 6 | 4 7 | 5 8 | 4 9 | 4 10 | 3 11 | 14 12 | 4 13 | 3 14 | 9 15 | 2 16 | 4 17 | 3 18 | 2 19 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/tree_collect_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/tree_collect_leaves.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/png/tree_collect_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-5b/png/tree_collect_leaves.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/png/tree_collect_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-6b/png/tree_collect_leaves.png -------------------------------------------------------------------------------- /experiments/exp-1: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 0 ]]; then 4 | echo "usage:" $0 5 | exit 1 6 | fi 7 | 8 | echo "Experiment 1" 9 | ../smyth suite-test ../suites/myth 10 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/bool_impl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 impl 2 | [ (T (), T (), T ()) 3 | , (T (), F (), F ()) 4 | -- , (F (), T (), T ()) 5 | , (F (), F (), T ()) 6 | ] 7 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/png/list_sort_sorted_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-2b/png/list_sort_sorted_insert.png -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/png/list_sort_sorted_insert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/UChicago-PL/smyth/HEAD/experiments/author-results/data/exp-3b/png/list_sort_sorted_insert.png -------------------------------------------------------------------------------- /suites/myth/examples/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevAppend 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/examples/list_rev_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevFold 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/examples/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevSnoc 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/sketches/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type Boolean 6 | = F () 7 | | T () 8 | 9 | isEven : Nat -> Boolean 10 | isEven n = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listStutter ) 2 | [ ([], []) 3 | -- , ([0], [0, 0]) 4 | , ([1, 0], [1, 1, 0, 0]) 5 | ] 6 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/Makefile: -------------------------------------------------------------------------------- 1 | benchmarks: 2 | ./generate-benchmarks.py 3 | rm myth_benchmarks.pyc 4 | 5 | summary: 6 | ./show-results.sh 7 | ./analyze-results.py 8 | rm myth_benchmarks.pyc 9 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_rev_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevFold 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | -- , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevSnoc 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /specifications/poly/.list_inc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listInc 2 | [ ([], []) 3 | , ([1, 2], [2, 3]) 4 | , ([0, 0], [1, 1]) 5 | , ([3, 4, 5], [4, 5, 6]) 6 | ] 7 | -------------------------------------------------------------------------------- /specifications/poly/list_length.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listLength ) 2 | [ ([], 0) 3 | , ([2, 1, 3, 1], 4) 4 | , ([1], 1) 5 | , ([0], 1) 6 | , ([1, 1, 0], 3) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevAppend 2 | [ ([], []) 3 | , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listStutter ) 2 | [ -- ([], []) 3 | -- , ([0], [0, 0]) 4 | ([1, 0], [1, 1, 0, 0]) 5 | ] 6 | -------------------------------------------------------------------------------- /experiments/exp-2a: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 0 ]]; then 4 | echo "usage:" $0 5 | exit 1 6 | fi 7 | 8 | echo "Experiment 2a" 9 | ../smyth suite-test ../suites/no-sketch --test-alert=top1 10 | -------------------------------------------------------------------------------- /lib/smyth/post_parse.mli: -------------------------------------------------------------------------------- 1 | (** Functions to be called after the corresponding functions in {!Parse}. 2 | 3 | (Ensures proper invariants are maintained.) *) 4 | 5 | open Lang 6 | 7 | val exp : exp -> exp 8 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevSnoc 2 | [ --([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | ([0, 1], [1, 0]) 6 | -- , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_hd.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listHead : NatList -> Nat 10 | listHead xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /experiments/exp-5a: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 0 ]]; then 4 | echo "usage:" $0 5 | exit 1 6 | fi 7 | 8 | echo "Experiment 5a" 9 | ../smyth suite-test ../suites/poly-no-sketch --test-alert=top1 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevAppend 2 | [ -- ([], []) 3 | ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/examples/list_last.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLast 2 | [ ([], None ()) 3 | , ([1], Some 1) 4 | , ([2], Some 2) 5 | , ([2, 1], Some 1) 6 | , ([1, 2], Some 2) 7 | , ([3, 2, 1], Some 1) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_tl.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listTail : NatList -> NatList 10 | listTail xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /experiments/exp-3a: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 0 ]]; then 4 | echo "usage:" $0 5 | exit 1 6 | fi 7 | 8 | echo "Experiment 3a" 9 | ../smyth suite-test ../suites/base-case-sketch --test-alert=top1r 10 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_length.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listLength : NatList -> Nat 10 | listLength xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_nth.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listNth : NatList -> Nat -> Nat 10 | listNth xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/.list_nth.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listNth : NatList -> Nat -> Nat 10 | listNth xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /experiments/exp-6a: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 0 ]]; then 4 | echo "usage:" $0 5 | exit 1 6 | fi 7 | 8 | echo "Experiment 6a" 9 | ../smyth suite-test ../suites/poly-base-case-sketch --test-alert=top1r 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/nat_add.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | natAdd : Nat -> Nat -> Nat 6 | natAdd m n = 7 | case m of 8 | Z _ -> 9 | n 10 | 11 | S m_ -> 12 | ?? 13 | -------------------------------------------------------------------------------- /suites/myth/examples/list_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 append 2 | [ ([], [], []) 3 | , ([], [0], [0]) 4 | , ([0], [], [0]) 5 | , ([0], [0], [0, 0]) 6 | , ([1, 0], [], [1, 0]) 7 | , ([1, 0], [0], [1, 0, 0]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_drop.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listDrop : NatList -> Nat -> NatList 10 | listDrop xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listSnoc : NatList -> Nat -> NatList 10 | listSnoc xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listStutter : NatList -> NatList 10 | listStutter xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_take.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listTake : Nat -> NatList -> NatList 10 | listTake n xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_last.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLast 2 | [ ([], None ()) 3 | , ([1], Some 1) 4 | -- , ([2], Some 2) 5 | -- , ([2, 1], Some 1) 6 | , ([1, 2], Some 2) 7 | , ([3, 2, 1], Some 1) 8 | ] 9 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/bool_neg.csv: -------------------------------------------------------------------------------- 1 | bool_neg 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,1.0000,0.0000 8 | -------------------------------------------------------------------------------- /lib/stdlib2/pair2.mli: -------------------------------------------------------------------------------- 1 | val pair : 'a -> 'b -> 'a * 'b 2 | val map_fst : ('a -> 'c) -> 'a * 'b -> 'c * 'b 3 | val map_snd : ('b -> 'c) -> 'a * 'b -> 'a * 'c 4 | val lift_snd_result : 'a * ('b, 'e) result -> ('a * 'b, 'e) result 5 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | append : NatList -> NatList -> NatList 10 | append xs ys = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/.list_hd.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listHead : forall a . List a -> a 10 | listHead xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /lib/stdlib2/pervasives2.ml: -------------------------------------------------------------------------------- 1 | let identity x = 2 | x 3 | 4 | let (<<) f g x = 5 | f (g x) 6 | 7 | let (>>) f g x = 8 | g (f x) 9 | 10 | let curry f x y = 11 | f (x, y) 12 | 13 | let uncurry f (x, y) = 14 | f x y 15 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_tl.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listTail : forall a . List a -> List a 10 | listTail xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /specifications/mono/nat_add.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natAdd 2 | [ (0, 0, 0) 3 | , (2, 2, 4) 4 | , (3, 0, 3) 5 | , (2, 1, 3) 6 | , (3, 3, 6) 7 | , (1, 2, 3) 8 | , (0, 2, 2) 9 | , (1, 3, 4) 10 | , (3, 2, 5) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_last.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listLast 2 | [ -- ([], None ()) 3 | -- , ([1], Some 1) 4 | ([2], Some 2) 5 | -- , ([2, 1], Some 1) 6 | -- , ([1, 2], Some 2) 7 | , ([3, 2, 1], Some 1) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/examples/nat_add.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natAdd 2 | [ (0, 0, 0) 3 | , (0, 1, 1) 4 | , (0, 2, 2) 5 | , (1, 0, 1) 6 | , (1, 1, 2) 7 | , (1, 2, 3) 8 | , (2, 0, 2) 9 | , (2, 1, 3) 10 | , (2, 2, 4) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/examples/nat_max.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natMax 2 | [ (0, 0, 0) 3 | , (0, 1, 1) 4 | , (0, 2, 2) 5 | , (1, 0, 1) 6 | , (1, 1, 1) 7 | , (1, 2, 2) 8 | , (2, 0, 2) 9 | , (2, 1, 2) 10 | , (2, 2, 2) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listPairwiseSwap : NatList -> NatList 10 | listPairwiseSwap xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 append 2 | [ ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([0], [], [0]) 5 | , ([0], [0], [0, 0]) 6 | , ([1, 0], [], [1, 0]) 7 | , ([1, 0], [0], [1, 0, 0]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_length.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listLength : forall a . List a -> Nat 10 | listLength xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listSnoc : forall a . List a -> a -> List a 10 | listSnoc xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /lib/smyth/fresh.ml: -------------------------------------------------------------------------------- 1 | let unused = 2 | -1 3 | 4 | let hole_counter = 5 | ref unused 6 | 7 | let set_largest_hole h = 8 | hole_counter := h 9 | 10 | let gen_hole () = 11 | hole_counter := !hole_counter + 1; 12 | !hole_counter 13 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = T () 3 | | F () 4 | 5 | type BooleanList 6 | = Nil () 7 | | Cons (Boolean, BooleanList) 8 | 9 | evenParity : BooleanList -> Boolean 10 | evenParity xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/nat_max.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natMax 2 | [ (0, 0, 0) 3 | , (0, 1, 1) 4 | , (0, 2, 2) 5 | , (1, 0, 1) 6 | , (1, 1, 1) 7 | , (1, 2, 2) 8 | , (2, 0, 2) 9 | , (2, 1, 2) 10 | , (2, 2, 2) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append xs ys = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_drop.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listDrop : forall a . List a -> Nat -> List a 10 | listDrop xs n = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listStutter : forall a . List a -> List a 10 | listStutter xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_take.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listTake : forall a . Nat -> List a -> List a 10 | listTake n xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /lib/stdlib2/io2.mli: -------------------------------------------------------------------------------- 1 | val read_all : in_channel -> string 2 | 3 | val read_file : string -> string 4 | 5 | val path : string list -> string 6 | 7 | val read_path : string list -> string 8 | 9 | val visible_files : string -> string list 10 | -------------------------------------------------------------------------------- /lib/stdlib2/float2.ml: -------------------------------------------------------------------------------- 1 | let to_string : float -> string = 2 | fun f -> 3 | let default = 4 | string_of_float f 5 | in 6 | if default.[String.length default - 1] = '.' then 7 | default ^ "0" 8 | else 9 | default 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 append 2 | [ -- ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([0], [], [0]) 5 | -- , ([0], [0], [0, 0]) 6 | ([1, 0], [], [1, 0]) 7 | -- , ([1, 0], [0], [1, 0, 0]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listRevTailcall : NatList -> NatList -> NatList 10 | listRevTailcall xs acc = 11 | ?? 12 | -------------------------------------------------------------------------------- /specifications/poly/.list_sort_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSortSortedInsert 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0, 0], [0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 1], [1]) 8 | , ([0, 1, 1], [0, 1]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/myth/examples/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listPairwiseSwap 2 | [ ([], []) 3 | , ([0], []) 4 | , ([1], []) 5 | , ([0, 1], [1, 0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 0, 1], []) 8 | , ([0, 1, 0, 1], [1, 0, 1, 0]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/myth/examples/list_sort_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSortSortedInsert 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0, 0], [0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 1], [1]) 8 | , ([0, 1, 1], [0, 1]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/nat_add.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natAdd 2 | [ (0, 0, 0) 3 | , (0, 1, 1) 4 | -- , (0, 2, 2) 5 | -- , (1, 0, 1) 6 | -- , (1, 1, 2) 7 | , (1, 2, 3) 8 | , (2, 0, 2) 9 | -- , (2, 1, 3) 10 | -- , (2, 2, 4) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/.list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listPairwiseSwap : forall a . List a -> List a 10 | listPairwiseSwap xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/histogram/k90.csv: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 1 4 | 0 5 | 0 6 | 0 7 | 1 8 | 4 9 | 1 10 | 0 11 | 5 12 | 1 13 | 9 14 | 5 15 | 2 16 | 3 17 | 1 18 | 1 19 | 3 20 | 1 21 | 0 22 | 4 23 | 1 24 | 2 25 | 1 26 | 3 27 | 1 28 | 1 29 | 0 30 | 1 31 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_rev_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listRevFold ) 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | , ([0, 1], [1, 0]) 6 | -- , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listRevSnoc ) 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/histogram/k50.csv: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 1 4 | 0 5 | 0 6 | -1 7 | -1 8 | 1 9 | 0 10 | 0 11 | 1 12 | 0 13 | 2 14 | 2 15 | 0 16 | 0 17 | 0 18 | 0 19 | 0 20 | 1 21 | 0 22 | 1 23 | 0 24 | 1 25 | 1 26 | -1 27 | 0 28 | 0 29 | -1 30 | 0 31 | -------------------------------------------------------------------------------- /src/fuzz.mli: -------------------------------------------------------------------------------- 1 | open Smyth 2 | open References 3 | 4 | val experiment_proj : 5 | poly:bool -> n:int -> 6 | (unit -> (Lang.exp * Lang.exp) list list list) reference_projection 7 | 8 | val specification_proj : 9 | poly:bool -> string reference_projection 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/nat_max.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natMax 2 | [ -- (0, 0, 0) 3 | -- , (0, 1, 1) 4 | -- , (0, 2, 2) 5 | (1, 0, 1) 6 | , (1, 1, 1) 7 | , (1, 2, 2) 8 | -- , (2, 0, 2) 9 | , (2, 1, 2) 10 | -- , (2, 2, 2) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/examples/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | specifyFunction evenParity 2 | [ ([], T ()) 3 | , ([F ()], T ()) 4 | , ([T ()], F ()) 5 | , ([F (), F ()], T ()) 6 | , ([F (), T ()], F ()) 7 | , ([T (), F ()], F ()) 8 | , ([T (), T ()], T ()) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listPairwiseSwap 2 | [ ([], []) 3 | -- , ([0], []) 4 | , ([1], []) 5 | -- , ([0, 1], [1, 0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 0, 1], []) 8 | , ([0, 1, 0, 1], [1, 0, 1, 0]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/.list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listPairwiseSwap : forall a . List a -> List a 10 | listPairwiseSwap xs = 11 | ?? 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listRevAppend ) 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 1], [1, 0]) 6 | , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listRevTailcall : forall a . List a -> List a -> List a 10 | listRevTailcall xs acc = 11 | ?? 12 | -------------------------------------------------------------------------------- /lib/stdlib2/pervasives2.mli: -------------------------------------------------------------------------------- 1 | val identity : 'a -> 'a 2 | 3 | val (<<) : ('b -> 'c) -> ('a -> 'b) -> ('a -> 'c) 4 | val (>>) : ('a -> 'b) -> ('b -> 'c) -> ('a -> 'c) 5 | 6 | val curry : ('a * 'b -> 'c) -> 'a -> 'b -> 'c 7 | val uncurry : ('a -> 'b -> 'c) -> 'a * 'b -> 'c 8 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/nat_add.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natAdd 2 | [ -- (0, 0, 0) 3 | -- , (0, 1, 1) 4 | -- , (0, 2, 2) 5 | -- , (1, 0, 1) 6 | -- , (1, 1, 2) 7 | -- , (1, 2, 3) 8 | -- , (2, 0, 2) 9 | -- , (2, 1, 3) 10 | (2, 2, 4) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_last.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatOpt 10 | = None () 11 | | Some Nat 12 | 13 | listLast : NatList -> NatOpt 14 | listLast xs = 15 | ?? 16 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | specifyFunction evenParity 2 | [ ([], T ()) 3 | , ([F ()], T ()) 4 | , ([T ()], F ()) 5 | , ([F (), F ()], T ()) 6 | , ([F (), T ()], F ()) 7 | , ([T (), F ()], F ()) 8 | , ([T (), T ()], T ()) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_sort_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSortSortedInsert 2 | [ ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 0], [0]) 6 | -- , ([1, 0], [0, 1]) 7 | , ([1, 1], [1]) 8 | , ([0, 1, 1], [0, 1]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listRevSnoc ) 2 | [ -- ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | ([0, 1], [1, 0]) 6 | -- , ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/bool_band.csv: -------------------------------------------------------------------------------- 1 | bool_band 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.2800,0.0000 9 | 4,1.0000,0.0000 10 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/bool_bor.csv: -------------------------------------------------------------------------------- 1 | bool_bor 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.2400,0.0000 9 | 4,1.0000,0.0000 10 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/bool_impl.csv: -------------------------------------------------------------------------------- 1 | bool_impl 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.2800,0.0000 9 | 4,1.0000,0.0000 10 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/bool_xor.csv: -------------------------------------------------------------------------------- 1 | bool_xor 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.0000,0.0000 9 | 4,1.0000,0.0000 10 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/nat_pred.csv: -------------------------------------------------------------------------------- 1 | nat_pred 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.6800,0.0000 8 | 3,1.0000,0.0000 9 | 4,1.0000,0.0000 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | specifyFunction evenParity 2 | [ ([], T ()) 3 | , ([F ()], T ()) 4 | , ([T ()], F ()) 5 | , ([F (), F ()], T ()) 6 | , ([F (), T ()], F ()) 7 | , ([T (), F ()], F ()) 8 | , ([T (), T ()], T ()) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listPairwiseSwap 2 | [ -- ([], []) 3 | -- , ([0], []) 4 | ([1], []) 5 | -- , ([0, 1], [1, 0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 0, 1], []) 8 | , ([0, 1, 0, 1], [1, 0, 1, 0]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/nat_iseven.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type Boolean 6 | = F () 7 | | T () 8 | 9 | isEven : Nat -> Boolean 10 | isEven n = 11 | case n of 12 | Z _ -> 13 | T () 14 | 15 | S n_ -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listRevAppend ) 2 | [ -- ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 1], [1, 0]) 6 | ([0, 0, 1], [1, 0, 0]) 7 | ] 8 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/nat_iseven.csv: -------------------------------------------------------------------------------- 1 | nat_iseven 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.2400,0.6000 9 | 4,1.0000,1.0000 10 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/nat_iseven.csv: -------------------------------------------------------------------------------- 1 | nat_iseven 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.4000,0.6800 9 | 4,1.0000,1.0000 10 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_bool_neg.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_neg :: p:Boolean -> { Boolean | 7 | 8 | (p == T ==> _v == F) && 9 | (p == F ==> _v == T) && 10 | True 11 | 12 | } 13 | bool_neg = ?? -------------------------------------------------------------------------------- /lib/smyth/pretty.mli: -------------------------------------------------------------------------------- 1 | (** Pretty-printing. *) 2 | 3 | open Lang 4 | 5 | val pat : pat -> string 6 | (** Pretty-prints a pattern. *) 7 | 8 | val typ : typ -> string 9 | (** Pretty-prints a type. *) 10 | 11 | val exp : exp -> string 12 | (** Pretty-prints an expression. *) 13 | -------------------------------------------------------------------------------- /specifications/mono/list_sum.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSum 2 | [ ([], 0) 3 | , ([0, 0, 3, 3], 6) 4 | , ([3, 1], 4) 5 | , ([3, 2], 5) 6 | , ([2, 3, 0], 5) 7 | , ([2, 3, 0, 2], 7) 8 | , ([2], 2) 9 | , ([3, 0], 3) 10 | , ([0], 0) 11 | , ([0, 2, 1], 3) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_sort_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listSortSortedInsert 2 | [ -- ([], []) 3 | -- , ([0], [0]) 4 | -- , ([1], [1]) 5 | -- , ([0, 0], [0]) 6 | ([1, 0], [0, 1]) 7 | -- , ([1, 1], [1]) 8 | -- , ([0, 1, 1], [0, 1]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/myth/examples/list_map.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listMap 2 | [ (inc, [], []) 3 | , (inc, [0], [1]) 4 | , (inc, [0, 0], [1, 1]) 5 | , (inc, [1], [2]) 6 | , (inc, [1, 1], [2, 2]) 7 | , (zero, [], []) 8 | , (zero, [0], [0]) 9 | , (zero, [0, 0], [0, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /examples/mistyped_uneval.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | foo : (Nat -> NatList -> NatList) -> NatList 10 | foo f = f 0 [] 11 | 12 | bar : NatList -> NatList 13 | bar = ?? 14 | 15 | assert bar [] == [] 16 | -------------------------------------------------------------------------------- /suites/myth/examples/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listRevTailcall 2 | [ ([], [], []) 3 | , ([], [0], [0]) 4 | , ([], [1], [1]) 5 | , ([], [1, 0], [1, 0]) 6 | , ([0], [], [0]) 7 | , ([1], [], [1]) 8 | , ([1], [0], [1, 0]) 9 | , ([0, 1], [], [1, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_last.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | type Option a 10 | = None () 11 | | Some a 12 | 13 | listLast : forall a . List a -> Option a 14 | listLast xs = 15 | ?? 16 | -------------------------------------------------------------------------------- /lib/stdlib2/pair2.ml: -------------------------------------------------------------------------------- 1 | let pair x y = 2 | (x, y) 3 | 4 | let map_fst f (x, y) = 5 | (f x, y) 6 | 7 | let map_snd f (x, y) = 8 | (x, f y) 9 | 10 | let lift_snd_result (x, r) = 11 | match r with 12 | | Ok y -> 13 | Ok (x, y) 14 | | Error e -> 15 | Error e 16 | -------------------------------------------------------------------------------- /specifications/mono/list_hd.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listHead 2 | [ ([], 0) 3 | , ([0, 3, 3, 0], 0) 4 | , ([0, 1, 3], 0) 5 | , ([0, 3, 2], 0) 6 | , ([2, 1], 2) 7 | , ([1, 3, 2], 1) 8 | , ([2], 2) 9 | , ([0, 3], 0) 10 | , ([2, 3, 0, 2], 2) 11 | , ([0, 0, 3, 2], 0) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/myth/examples/list_concat.elm: -------------------------------------------------------------------------------- 1 | specifyFunction concat 2 | [ (LNil (), []) 3 | , (LCons ([], LNil ()), []) 4 | , (LCons ([0], LNil ()), [0]) 5 | , (LCons ([0], LCons([0], LNil ())), [0, 0]) 6 | , (LCons ([1], LNil ()), [1]) 7 | , (LCons ([1], LCons([1], LNil ())), [1, 1]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_last.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listLast ) 2 | [ ([], None ()) 3 | , ([1], Some 1) 4 | -- , ([2], Some 2) 5 | -- , ([2, 1], Some 1) 6 | -- , ([1, 2], Some 2) 7 | , ([3, 2, 1], Some 1) 8 | ] 9 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_length.csv: -------------------------------------------------------------------------------- 1 | list_length 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0800,1.0000 8 | 3,0.7000,1.0000 9 | 4,0.9200,1.0000 10 | 5,0.9800,1.0000 11 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/list_length.csv: -------------------------------------------------------------------------------- 1 | list_length 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.1000,1.0000 8 | 3,0.7800,1.0000 9 | 4,0.9600,1.0000 10 | 5,0.9800,1.0000 11 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_length.csv: -------------------------------------------------------------------------------- 1 | list_length 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,1.0000 8 | 3,0.8600,1.0000 9 | 4,0.9000,1.0000 10 | 5,0.9600,1.0000 11 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/list_length.csv: -------------------------------------------------------------------------------- 1 | list_length 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,1.0000 8 | 3,0.6600,1.0000 9 | 4,0.8800,1.0000 10 | 5,1.0000,1.0000 11 | -------------------------------------------------------------------------------- /lib/stdlib2/dune: -------------------------------------------------------------------------------- 1 | ( library 2 | ( name 3 | stdlib2 4 | ) 5 | ( public_name 6 | smyth-stdlib2 7 | ) 8 | ( wrapped 9 | false 10 | ) 11 | ( flags 12 | (-w +a-4-9-42-48 -warn-error -a+1..66-3-33) 13 | ) 14 | ( ocamlopt_flags 15 | (-O3) 16 | ) 17 | ) 18 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_map.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listMap 2 | [ (inc, [], []) 3 | , (inc, [0], [1]) 4 | , (inc, [0, 0], [1, 1]) 5 | -- , (inc, [1], [2]) 6 | -- , (inc, [1, 1], [2, 2]) 7 | -- , (zero, [], []) 8 | -- , (zero, [0], [0]) 9 | , (zero, [0, 0], [0, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /examples/strange_id.elm: -------------------------------------------------------------------------------- 1 | type Bool = True () | False () 2 | 3 | id : Bool -> Bool 4 | id b = b 5 | 6 | to_id : (Bool -> Bool) -> (Bool -> Bool) 7 | to_id f = ?? 8 | 9 | ugly_id : Bool -> Bool 10 | ugly_id b = to_id id b 11 | 12 | assert ugly_id True == True 13 | assert ugly_id False == False 14 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_drop.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listDrop : NatList -> Nat -> NatList 10 | listDrop xs n = 11 | case n of 12 | Z _ -> 13 | xs 14 | 15 | S n_ -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_length.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listLength : NatList -> Nat 10 | listLength xs = 11 | case xs of 12 | Nil _ -> 13 | Z () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/myth/examples/list_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSnoc 2 | [ ([], 0, [0]) 3 | , ([], 1, [1]) 4 | , ([0], 0, [0, 0]) 5 | , ([0], 1, [0, 1]) 6 | , ([1, 0], 0, [1, 0, 0]) 7 | , ([1, 0], 1, [1, 0, 1]) 8 | , ([2, 1, 0], 0, [2, 1, 0, 0]) 9 | , ([2, 1, 0], 1, [2, 1, 0, 1]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/myth/examples/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeInOrder 2 | [ (Leaf (), []) 3 | , (Node (Leaf (), 1, Leaf ()), [1]) 4 | , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [1, 2]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/myth/examples/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treePreorder 2 | [ (Leaf (), []) 3 | , (Node (Leaf (), 1, Leaf ()), [1]) 4 | , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [2, 1]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_last.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listLast ) 2 | [ -- ([], None ()) 3 | -- , ([1], Some 1) 4 | ([2], Some 2) 5 | -- , ([2, 1], Some 1) 6 | -- , ([1, 2], Some 2) 7 | , ([3, 2, 1], Some 1) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_take.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listTake : Nat -> NatList -> NatList 10 | listTake n xs = 11 | case n of 12 | Z _ -> 13 | Nil () 14 | 15 | S n_ -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_concat.elm: -------------------------------------------------------------------------------- 1 | specifyFunction concat 2 | [ (LNil (), []) 3 | -- , (LCons ([], LNil ()), []) 4 | , (LCons ([0], LNil ()), [0]) 5 | -- , (LCons ([0], LCons([0], LNil ())), [0, 0]) 6 | -- , (LCons ([1], LNil ()), [1]) 7 | , (LCons ([1], LCons([1], LNil ())), [1, 1]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listRevTailcall 2 | [ ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([], [1], [1]) 5 | -- , ([], [1, 0], [1, 0]) 6 | , ([0], [], [0]) 7 | -- , ([1], [], [1]) 8 | -- , ([1], [0], [1, 0]) 9 | , ([0, 1], [], [1, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /examples/stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | stutter : NatList -> NatList 10 | stutter xs = 11 | ?? 12 | 13 | specifyFunction stutter 14 | [ ([], []) 15 | -- , ([0], [0, 0]) 16 | , ([1, 0], [1, 1, 0, 0]) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_map.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listMap 2 | [ -- (inc, [], []) 3 | (inc, [0], [1]) 4 | -- , (inc, [0, 0], [1, 1]) 5 | -- , (inc, [1], [2]) 6 | -- , (inc, [1, 1], [2, 2]) 7 | -- , (zero, [], []) 8 | -- , (zero, [0], [0]) 9 | , (zero, [0, 0], [0, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | append : NatList -> NatList -> NatList 10 | append xs ys = 11 | case xs of 12 | Nil _ -> 13 | ys 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listStutter : NatList -> NatList 10 | listStutter xs = 11 | case xs of 12 | Nil _ -> 13 | Nil () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeInOrder 2 | [ (Leaf (), []) 3 | , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [1, 2]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_concat.elm: -------------------------------------------------------------------------------- 1 | specifyFunction concat 2 | [ -- (LNil (), []) 3 | -- , (LCons ([], LNil ()), []) 4 | -- , (LCons ([0], LNil ()), [0]) 5 | -- , (LCons ([0], LCons([0], LNil ())), [0,0]) 6 | -- , (LCons ([1], LNil ()), [1]) 7 | (LCons ([1], LCons([1], LNil ())), [1, 1]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listRevTailcall 2 | [ -- ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([], [1], [1]) 5 | -- , ([], [1, 0], [1, 0]) 6 | -- ([0], [], [0]) 7 | -- , ([1], [], [1]) 8 | -- , ([1], [0], [1, 0]) 9 | ([0, 1], [], [1, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treePreorder 2 | [ (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [2, 1]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_drop.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listDrop : forall a . List a -> Nat -> List a 10 | listDrop xs n = 11 | case n of 12 | Z _ -> 13 | xs 14 | 15 | S n_ -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_length.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listLength : forall a . List a -> Nat 10 | listLength xs = 11 | case xs of 12 | Nil _ -> 13 | Z () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeInOrder 2 | [ -- (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [1, 2]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listSnoc : NatList -> Nat -> NatList 10 | listSnoc xs n = 11 | case xs of 12 | Nil _ -> 13 | Cons (n, Nil ()) 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSnoc 2 | [ ([], 0, [0]) 3 | , ([], 1, [1]) 4 | -- , ([0], 0, [0, 0]) 5 | -- , ([0], 1, [0, 1]) 6 | -- , ([1, 0], 0, [1, 0, 0]) 7 | -- , ([1, 0], 1, [1, 0, 1]) 8 | -- , ([2, 1, 0], 0, [2, 1, 0, 0]) 9 | , ([2, 1, 0], 1, [2, 1, 0, 1]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append xs ys = 11 | case xs of 12 | Nil _ -> 13 | ys 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /specifications/mono/list_tl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listTail 2 | [ ([], []) 3 | , ([2], []) 4 | , ([0, 3], [3]) 5 | , ([1], []) 6 | , ([3, 0, 1, 0], [0, 1, 0]) 7 | , ([2, 2, 2], [2, 2]) 8 | , ([3, 3, 2], [3, 2]) 9 | , ([0, 0, 2], [0, 2]) 10 | , ([2, 2, 0, 0], [2, 0, 0]) 11 | , ([3, 1, 1], [1, 1]) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treePreorder 2 | [ -- (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [2, 1]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/.list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listPairwiseSwap : NatList -> NatList 10 | listPairwiseSwap xs = 11 | case xs of 12 | Nil _ -> 13 | Nil () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listStutter : forall a . List a -> List a 10 | listStutter xs = 11 | case xs of 12 | Nil _ -> 13 | Nil () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_take.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (Nat, List a) 8 | 9 | listTake : forall a . Nat -> List a -> List a 10 | listTake n xs = 11 | case n of 12 | Z _ -> 13 | Nil () 14 | 15 | S n_ -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = T () 3 | | F () 4 | 5 | type BooleanList 6 | = Nil () 7 | | Cons (Boolean, BooleanList) 8 | 9 | evenParity : BooleanList -> Boolean 10 | evenParity xs = 11 | case xs of 12 | Nil _ -> 13 | T () 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/myth/examples/list_drop.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listDrop 2 | [ ([], 0, []) 3 | , ([], 1, []) 4 | , ([0], 0, [0]) 5 | , ([0], 1, []) 6 | , ([1], 0, [1]) 7 | , ([1], 1, []) 8 | , ([1, 0], 0, [1, 0]) 9 | , ([1, 0], 1, [0]) 10 | , ([0, 1], 0, [0, 1]) 11 | , ([0, 1], 1, [1]) 12 | , ([0, 1], 2, []) 13 | ] 14 | -------------------------------------------------------------------------------- /specifications/mono/list_inc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listInc 2 | [ ([], []) 3 | , ([2, 0], [3, 1]) 4 | , ([0, 3, 2, 2], [1, 4, 3, 3]) 5 | , ([3], [4]) 6 | , ([0], [1]) 7 | , ([2], [3]) 8 | , ([1, 0], [2, 1]) 9 | , ([1, 3, 1], [2, 4, 2]) 10 | , ([3, 0, 1, 3], [4, 1, 2, 4]) 11 | , ([2, 3, 3, 2], [3, 4, 4, 3]) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSnoc 2 | [ -- ([], 0, [0]) 3 | -- , ([], 1, [1]) 4 | -- , ([0], 0, [0, 0]) 5 | -- , ([0], 1, [0, 1]) 6 | -- , ([1, 0], 0, [1, 0, 0]) 7 | -- , ([1, 0], 1, [1, 0, 1]) 8 | -- , ([2, 1, 0], 0, [2, 1, 0, 0]) 9 | ([2, 1, 0], 1, [2, 1, 0, 1]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listRevTailcall : NatList -> NatList -> NatList 10 | listRevTailcall xs acc = 11 | case xs of 12 | Nil _ -> 13 | acc 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/myth/examples/list_filter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listFilter 2 | [ (isEven, [], []) 3 | , (isEven, [0], [0]) 4 | , (isEven, [1], []) 5 | , (isEven, [2], [2]) 6 | , (isEven, [0, 0], [0, 0]) 7 | , (isEven, [0, 1], [0]) 8 | , (isEven, [1, 0, 1], [0]) 9 | , (isNonzero, [], []) 10 | , (isNonzero, [0], []) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/examples/list_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction3 listFold 2 | [ (sum, 0, [], 0) 3 | , (sum, 0, [1], 1) 4 | , (sum, 0, [2, 1], 3) 5 | , (sum, 0, [3, 2, 1], 6) 6 | , (sum, 1, [], 1) 7 | , (countOdd, 0, [], 0) 8 | , (countOdd, 0, [1], 1) 9 | , (countOdd, 0, [2, 1], 1) 10 | , (countOdd, 0, [3, 2, 1], 2) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (append ) 2 | [ ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([0], [], [0]) 5 | -- , ([0], [0], [0, 0]) 6 | , ([1, 0], [], [1, 0]) 7 | , ([1, 0], [0], [1, 0, 0]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listSnoc : forall a . List a -> a -> List a 10 | listSnoc xs n = 11 | case xs of 12 | Nil _ -> 13 | Cons (n, Nil ()) 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listPairwiseSwap ) 2 | [ ([], []) 3 | , ([0], []) 4 | , ([1], []) 5 | , ([0, 1], [1, 0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 0, 1], []) 8 | , ([0, 1, 0, 1], [1, 0, 1, 0]) 9 | ] 10 | -------------------------------------------------------------------------------- /lib/stdlib2/char2.ml: -------------------------------------------------------------------------------- 1 | let uppercase_char : char -> bool = 2 | function 3 | | 'A' .. 'Z' -> true 4 | | _ -> false 5 | 6 | let lowercase_char : char -> bool = 7 | function 8 | | 'a' .. 'z' -> true 9 | | _ -> false 10 | 11 | let digit_char : char -> bool = 12 | function 13 | | '0' .. '9' -> true 14 | | _ -> false 15 | -------------------------------------------------------------------------------- /specifications/mono/nat_max.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 natMax 2 | [ (0, 0, 0) 3 | , (2, 2, 2) 4 | , (0, 3, 3) 5 | , (2, 1, 2) 6 | , (3, 0, 3) 7 | , (0, 1, 1) 8 | , (1, 0, 1) 9 | , (3, 2, 3) 10 | , (0, 2, 2) 11 | , (1, 1, 1) 12 | , (3, 1, 3) 13 | , (2, 0, 2) 14 | , (2, 3, 3) 15 | , (1, 2, 2) 16 | , (3, 3, 3) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (append ) 2 | [ -- ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([0], [], [0]) 5 | -- ([0], [0], [0, 0]) 6 | ([1, 0], [], [1, 0]) 7 | -- , ([1, 0], [0], [1, 0, 0]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_pairwise_swap.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listPairwiseSwap ) 2 | [ ([], []) 3 | , ([0], []) 4 | , ([1], []) 5 | , ([0, 1], [1, 0]) 6 | , ([1, 0], [0, 1]) 7 | , ([1, 0, 1], []) 8 | , ([0, 1, 0, 1], [1, 0, 1, 0]) 9 | ] 10 | -------------------------------------------------------------------------------- /suites/myth/sketches/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatTree 6 | = Leaf () 7 | | Node (NatTree, Nat, NatTree) 8 | 9 | sum : Nat -> Nat -> Nat 10 | sum n1 n2 = 11 | case n1 of 12 | Z _ -> n2 13 | S m -> S (sum m n2) 14 | 15 | treeCountNodes : NatTree -> Nat 16 | treeCountNodes tree = 17 | ?? 18 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_filter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listFilter 2 | [ (isEven, [], []) 3 | -- , (isEven, [0], [0]) 4 | -- , (isEven, [1], []) 5 | , (isEven, [2], [2]) 6 | , (isEven, [0, 0], [0, 0]) 7 | -- , (isEven, [0, 1], [0]) 8 | , (isEven, [1, 0, 1], [0]) 9 | -- , (isNonzero, [], []) 10 | , (isNonzero, [0], []) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listRevTailcall : forall a . List a -> List a -> List a 10 | listRevTailcall xs acc = 11 | case xs of 12 | Nil _ -> 13 | acc 14 | 15 | Cons p -> 16 | ?? 17 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_concat.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (concat ) 2 | [ ([], []) 3 | -- , ([[]], []) 4 | , ([[0]], [0]) 5 | -- , ([[0], [0]], [0, 0]) 6 | -- , ([[1]], [1]) 7 | , ([[1], [1]], [1, 1]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_drop.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listDrop 2 | [ ([], 0, []) 3 | -- , ([], 1, []) 4 | -- , ([0], 0, [0]) 5 | -- , ([0], 1, []) 6 | , ([1], 0, [1]) 7 | , ([1], 1, []) 8 | -- , ([1, 0], 0, [1, 0]) 9 | , ([1, 0], 1, [0]) 10 | -- , ([0, 1], 0, [0, 1]) 11 | -- , ([0, 1], 1, [1]) 12 | , ([0, 1], 2, []) 13 | ] 14 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction3 listFold 2 | [ (sum, 0, [], 0) 3 | -- , (sum, 0, [1], 1) 4 | , (sum, 0, [2, 1], 3) 5 | , (sum, 0, [3, 2, 1], 6) 6 | -- , (sum, 1, [], 1) 7 | -- , (countOdd, 0, [], 0) 8 | -- , (countOdd, 0, [1], 1) 9 | -- , (countOdd, 0, [2, 1], 1) 10 | -- , (countOdd, 0, [3, 2, 1], 2) 11 | ] 12 | -------------------------------------------------------------------------------- /test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 2 ]]; then 4 | echo "usage:" $0 " " 5 | exit 1 6 | fi 7 | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 9 | 10 | $DIR/smyth test \ 11 | $DIR/suites/$1/specifications/$2.elm \ 12 | $DIR/suites/$1/sketches/$2.elm \ 13 | $DIR/suites/$1/examples/$2.elm 14 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_filter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listFilter 2 | [ -- (isEven, [], []) 3 | -- , (isEven, [0], [0]) 4 | -- , (isEven, [1], []) 5 | (isEven, [2], [2]) 6 | , (isEven, [0, 0], [0, 0]) 7 | -- , (isEven, [0, 1], [0]) 8 | , (isEven, [1, 0, 1], [0]) 9 | -- , (isNonzero, [], []) 10 | , (isNonzero, [0], []) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_last.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatOpt 10 | = None () 11 | | Some Nat 12 | 13 | listLast : NatList -> NatOpt 14 | listLast xs = 15 | case xs of 16 | Nil _ -> 17 | None () 18 | 19 | Cons p -> 20 | ?? 21 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_concat.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (concat ) 2 | [ -- ([], []) 3 | -- , ([[]], []) 4 | -- , ([[0]], [0]) 5 | -- , ([[0], [0]], [0, 0]) 6 | -- , ([[1]], [1]) 7 | ([[1], [2]], [1, 2]) 8 | ] 9 | -------------------------------------------------------------------------------- /examples/poly_stutter.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | listStutter : forall a . List a -> List a 10 | listStutter xs = 11 | ?? 12 | 13 | specifyFunction (listStutter ) 14 | [ ([], []) 15 | -- , ([0], [0, 0]) 16 | , ([1, 0], [1, 1, 0, 0]) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction3 listFold 2 | [ -- (sum, 0, [], 0) 3 | -- , (sum, 0, [1], 1) 4 | -- , (sum, 0, [2, 1], 3) 5 | (sum, 0, [3, 2, 1], 6) 6 | , (sum, 1, [], 1) 7 | -- , (countOdd, 0, [], 0) 8 | , (countOdd, 0, [1], 1) 9 | -- , (countOdd, 0, [2, 1], 1) 10 | -- , (countOdd, 0, [3, 2, 1], 2) 11 | ] 12 | -------------------------------------------------------------------------------- /suites/myth/examples/list_nth.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listNth 2 | [ ([], 0, 0) 3 | , ([], 1, 0) 4 | , ([2], 0, 2) 5 | , ([2], 1, 0) 6 | , ([1, 2], 0, 1) 7 | , ([1, 2], 1, 2) 8 | , ([1], 0, 1) 9 | , ([1], 1, 0) 10 | , ([2, 1], 0, 2) 11 | , ([2, 1], 1, 1) 12 | , ([3, 2, 1], 0, 3) 13 | , ([3, 2, 1], 1, 2) 14 | , ([3, 2, 1], 2, 1) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/myth/examples/list_take.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listTake 2 | [ (0, [], []) 3 | , (0, [1], []) 4 | , (0, [0, 1], []) 5 | , (0, [1, 0, 1], []) 6 | , (1, [], []) 7 | , (1, [1], [1]) 8 | , (1, [0, 1], [0]) 9 | , (1, [1, 0, 1], [1]) 10 | , (2, [], []) 11 | , (2, [1], [1]) 12 | , (2, [0, 1], [0, 1]) 13 | , (2, [1, 0, 1], [1, 0]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_inc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | map : NatList -> (Nat -> Nat) -> NatList 10 | map xs f = 11 | case xs of 12 | Nil _ -> Nil () 13 | Cons p -> Cons (f (#2.1 p), map (#2.2 p) f) 14 | 15 | listInc : NatList -> NatList 16 | listInc xs = 17 | ?? 18 | -------------------------------------------------------------------------------- /examples/max.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | max : Nat -> Nat -> Nat 6 | max m n = 7 | case m of 8 | Z _ -> 9 | n 10 | 11 | S m_ -> 12 | case n of 13 | Z _ -> 14 | m 15 | 16 | S n_ -> 17 | ?? 18 | 19 | specifyFunction2 max 20 | [ (1, 1, 1) 21 | , (1, 2, 2) 22 | , (3, 1, 3) 23 | ] 24 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_bool_neg.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_neg :: p:Boolean -> { Boolean | 7 | 8 | (p == T ==> _v == F) && 9 | (p == F ==> _v == T) && 10 | True 11 | 12 | } 13 | bool_neg = ?? 14 | 15 | bool_neg = \p . 16 | match p with 17 | T -> F 18 | F -> T 19 | 20 | Correct 21 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_drop.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listDrop 2 | [ -- ([], 0, []) 3 | ([], 1, []) 4 | -- , ([0], 0, [0]) 5 | -- , ([0], 1, []) 6 | -- , ([1], 0, [1]) 7 | -- , ([1], 1, []) 8 | -- , ([1, 0], 0, [1, 0]) 9 | , ([1, 0], 1, [0]) 10 | -- , ([0, 1], 0, [0, 1]) 11 | -- , ([0, 1], 1, [1]) 12 | -- , ([0, 1], 2, []) 13 | ] 14 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type Tree a 6 | = Leaf () 7 | | Node (Tree a, a, Tree a) 8 | 9 | sum : Nat -> Nat -> Nat 10 | sum n1 n2 = 11 | case n1 of 12 | Z _ -> n2 13 | S m -> S (sum m n2) 14 | 15 | treeCountNodes : forall a . Tree a -> Nat 16 | treeCountNodes tree = 17 | ?? 18 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/nat_add.csv: -------------------------------------------------------------------------------- 1 | nat_add 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.1800 8 | 3,0.0600,0.8200 9 | 4,0.3800,0.9200 10 | 5,0.8200,1.0000 11 | 6,0.9800,1.0000 12 | 7,0.9800,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/nat_add.csv: -------------------------------------------------------------------------------- 1 | nat_add 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.3800 8 | 3,0.2400,0.6200 9 | 4,0.5200,0.9800 10 | 5,0.8200,0.9800 11 | 6,0.9800,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | -------------------------------------------------------------------------------- /fuzz: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 4 ]]; then 4 | echo "usage:" $0 " " 5 | exit 1 6 | fi 7 | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 9 | 10 | $DIR/smyth fuzz $1 \ 11 | $4 \ 12 | $DIR/suites/$3/specifications/$4.elm \ 13 | $DIR/suites/$3/sketches/$4.elm \ 14 | --timeout=$2 15 | -------------------------------------------------------------------------------- /lib/smyth/log.ml: -------------------------------------------------------------------------------- 1 | (** Logging utilities. 2 | 3 | Preferences for this module can be set in the {!Params} module. *) 4 | 5 | let info s = 6 | if !Params.log_info then 7 | prerr_endline @@ 8 | "[INFO] " ^ s 9 | else 10 | () 11 | 12 | let warn s = 13 | if !Params.log_warn then 14 | prerr_endline @@ 15 | "[WARN] " ^ s 16 | else 17 | () 18 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | snoc : NatList -> Nat -> NatList 10 | snoc xs n = 11 | case xs of 12 | Nil _ -> Cons (n, Nil ()) 13 | Cons p -> Cons (#2.1 p, snoc (#2.2 p) n) 14 | 15 | listRevSnoc : NatList -> NatList 16 | listRevSnoc xs = 17 | ?? 18 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_last.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | type Option a 10 | = None () 11 | | Some a 12 | 13 | listLast : forall a . List a -> Option a 14 | listLast xs = 15 | case xs of 16 | Nil _ -> 17 | None () 18 | 19 | Cons p -> 20 | ?? 21 | -------------------------------------------------------------------------------- /misc-utils/add-module-overviews.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 4 | 5 | python3 $DIR/add_module_overviews.py "_build/default/_doc/_html" \ 6 | > _build/default/_doc/_html/smyth/Smyth/index2.html 7 | 8 | mv _build/default/_doc/_html/smyth/Smyth/index2.html \ 9 | _build/default/_doc/_html/smyth/Smyth/index.html 10 | -------------------------------------------------------------------------------- /misc-utils/modify-odoc-css.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd _build/default/_doc/_html 4 | 5 | echo '' >> odoc.css 6 | echo '/* Custom Modifications */' >> odoc.css 7 | echo '' >> odoc.css 8 | 9 | echo 'b { font-weight: 600; }' >> odoc.css 10 | echo 'em { font-style: normal; font-variant: small-caps; }' >> odoc.css 11 | echo '.content > header + aside { margin-top: -15px; }' >> odoc.css 12 | -------------------------------------------------------------------------------- /specifications/poly/.list_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSortedInsert 2 | [ ([], 0, [0]) 3 | , ([], 1, [1]) 4 | , ([], 2, [2]) 5 | , ([0], 0, [0]) 6 | , ([0], 1, [0, 1]) 7 | , ([1], 0, [0, 1]) 8 | , ([1], 1, [1]) 9 | , ([1], 2, [1, 2]) 10 | , ([2], 0, [0, 2]) 11 | , ([2], 1, [1, 2]) 12 | , ([0, 1], 0, [0, 1]) 13 | , ([0, 1], 2, [0, 1, 2]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/myth/examples/list_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSortedInsert 2 | [ ([], 0, [0]) 3 | , ([], 1, [1]) 4 | , ([], 2, [2]) 5 | , ([0], 0, [0]) 6 | , ([0], 1, [0, 1]) 7 | , ([1], 0, [0, 1]) 8 | , ([1], 1, [1]) 9 | , ([1], 2, [1, 2]) 10 | , ([2], 0, [0, 2]) 11 | , ([2], 1, [1, 2]) 12 | , ([0, 1], 0, [0, 1]) 13 | , ([0, 1], 2, [0, 1, 2]) 14 | ] 15 | -------------------------------------------------------------------------------- /poly-fuzz: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ $# -ne 4 ]]; then 4 | echo "usage:" $0 " " 5 | exit 1 6 | fi 7 | 8 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 9 | 10 | $DIR/smyth poly-fuzz $1 \ 11 | $4 \ 12 | $DIR/suites/$3/specifications/$4.elm \ 13 | $DIR/suites/$3/sketches/$4.elm \ 14 | --timeout=$2 15 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_nth.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listNth 2 | [ -- ([], 0, 0) 3 | ([], 1, 0) 4 | -- , ([2], 0, 2) 5 | , ([2], 1, 0) 6 | , ([1, 2], 0, 1) 7 | , ([1, 2], 1, 2) 8 | -- , ([1], 0, 1) 9 | -- , ([1], 1, 0) 10 | , ([2, 1], 0, 2) 11 | -- , ([2, 1], 1, 1) 12 | -- , ([3, 2, 1], 0, 3) 13 | -- , ([3, 2, 1], 1, 2) 14 | -- , ([3, 2, 1], 2, 1) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_take.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listTake 2 | [ (0, [], []) 3 | -- , (0, [1], []) 4 | , (0, [0, 1], []) 5 | -- , (0, [1, 0, 1], []) 6 | -- , (1, [], []) 7 | , (1, [1], [1]) 8 | , (1, [0, 1], [0]) 9 | -- , (1, [1, 0, 1], [1]) 10 | -- , (2, [], []) 11 | -- , (2, [1], [1]) 12 | -- , (2, [0, 1], [0, 1]) 13 | , (2, [1, 0, 1], [1, 0]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/.list_inc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | map : forall a . List a -> (a -> a) -> List a 10 | map xs f = 11 | case xs of 12 | Nil _ -> Nil () 13 | Cons p -> Cons (f (#2.1 p), map (#2.2 p) f) 14 | 15 | listInc : List Nat -> List Nat 16 | listInc xs = 17 | ?? 18 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_hd.csv: -------------------------------------------------------------------------------- 1 | list_hd 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.7200,0.0000 8 | 3,0.9400,0.0000 9 | 4,1.0000,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_inc.csv: -------------------------------------------------------------------------------- 1 | list_inc 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,1.0000,0.0000 8 | 3,1.0000,0.0000 9 | 4,1.0000,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_sum.csv: -------------------------------------------------------------------------------- 1 | list_sum 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.9400,0.0000 8 | 3,1.0000,0.0000 9 | 4,1.0000,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_tl.csv: -------------------------------------------------------------------------------- 1 | list_tl 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.8000,0.0000 8 | 3,0.9800,0.0000 9 | 4,1.0000,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_tl.csv: -------------------------------------------------------------------------------- 1 | list_tl 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.7400,0.0000 8 | 3,1.0000,0.0000 9 | 4,0.9600,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_bool_band.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_band :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == F) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_band = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_bool_bor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_bor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_bor = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_bool_impl.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_impl :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == T) && 12 | True 13 | 14 | } 15 | bool_impl = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_bool_xor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_xor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == F) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_xor = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_bool_band.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_band :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == F) && 11 | -- (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_band = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_bool_bor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_bor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | -- (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_bor = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_bool_impl.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_impl :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | -- (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == T) && 12 | True 13 | 14 | } 15 | bool_impl = ?? -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_nth.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | listNth : NatList -> Nat -> Nat 10 | listNth xs n = 11 | case n of 12 | Z _ -> 13 | case xs of 14 | Nil _ -> 15 | Z () 16 | 17 | Cons p -> 18 | #2.1 p 19 | 20 | S n_ -> 21 | ?? 22 | -------------------------------------------------------------------------------- /suites/myth/examples/list_compress.elm: -------------------------------------------------------------------------------- 1 | specifyFunction compress 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0,0], [0]) 6 | , ([1,1], [1]) 7 | , ([2,0], [2,0]) 8 | , ([1,0,0], [1,0]) 9 | , ([0,1,1], [0,1]) 10 | , ([2,1,0,0], [2,1,0]) 11 | , ([2,2,1,0,0], [2,1,0]) 12 | , ([2,2,0], [2,0]) 13 | , ([2,2,2,0], [2,0]) 14 | , ([1,2,2,2,0], [1,2,0]) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_compress.elm: -------------------------------------------------------------------------------- 1 | specifyFunction compress 2 | [ ([], []) 3 | , ([0], [0]) 4 | , ([1], [1]) 5 | , ([0,0], [0]) 6 | , ([1,1], [1]) 7 | , ([2,0], [2,0]) 8 | , ([1,0,0], [1,0]) 9 | , ([0,1,1], [0,1]) 10 | , ([2,1,0,0], [2,1,0]) 11 | , ([2,2,1,0,0], [2,1,0]) 12 | , ([2,2,0], [2,0]) 13 | , ([2,2,2,0], [2,0]) 14 | , ([1,2,2,2,0], [1,2,0]) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_map.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listMap ) 2 | [ (inc, [], []) 3 | -- , (inc, [0], [1]) 4 | , (inc, [0, 0], [1, 1]) 5 | -- , (inc, [1], [2]) 6 | -- , (inc, [1, 1], [2, 2]) 7 | -- , (zero, [], []) 8 | -- , (zero, [0], [0]) 9 | -- , (zero, [0, 0], [0, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_stutter.csv: -------------------------------------------------------------------------------- 1 | list_stutter 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.4800,0.5800 8 | 3,0.9400,1.0000 9 | 4,1.0000,1.0000 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/list_stutter.csv: -------------------------------------------------------------------------------- 1 | list_stutter 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.3200,0.5000 8 | 3,0.9000,1.0000 9 | 4,0.9800,1.0000 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_stutter.csv: -------------------------------------------------------------------------------- 1 | list_stutter 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.7200,1.0000 8 | 3,0.9000,1.0000 9 | 4,0.9800,1.0000 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/list_stutter.csv: -------------------------------------------------------------------------------- 1 | list_stutter 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.7000,1.0000 8 | 3,0.9800,1.0000 9 | 4,0.9800,1.0000 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | -------------------------------------------------------------------------------- /specifications/poly/list_tl.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listTail ) 2 | [ ([], []) 3 | , ([2], []) 4 | , ([3], []) 5 | , ([0, 3], [3]) 6 | , ([3, 0, 3], [0, 3]) 7 | , ([1], []) 8 | , ([2, 3, 0], [3, 0]) 9 | , ([0, 0, 3], [0, 3]) 10 | , ([1, 3, 2], [3, 2]) 11 | , ([2, 1], [1]) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_take.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listTake 2 | [ -- (0, [], []) 3 | -- , (0, [1], []) 4 | -- , (0, [0, 1], []) 5 | -- , (0, [1, 0, 1], []) 6 | (1, [], []) 7 | -- , (1, [1], [1]) 8 | -- , (1, [0, 1], [0]) 9 | -- , (1, [1, 0, 1], [1]) 10 | -- , (2, [], []) 11 | -- , (2, [1], [1]) 12 | , (2, [0, 1], [0, 1]) 13 | , (2, [1, 0, 1], [1, 0]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/myth/examples/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCountNodes 2 | [ (Leaf (), 0) 3 | , (Node (Leaf (), 0, Leaf ()), 1) 4 | , (Node (Node (Leaf (), 0, Leaf ()), 0, Leaf ()), 2) 5 | , (Node (Leaf (), 0, Node(Leaf (), 0, Leaf ())), 2) 6 | , (Node (Node (Leaf (), 0, Node (Leaf (), 0, Leaf ())), 0, Leaf ()), 3) 7 | , (Node (Leaf (), 0, Node (Leaf (), 0, Node (Leaf (), 0, Leaf ()))), 3) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | append : NatList -> NatList -> NatList 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | listRevAppend : NatList -> NatList 18 | listRevAppend xs = 19 | ?? 20 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/list_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSortedInsert 2 | [ ([], 0, [0]) 3 | -- , ([], 1, [1]) 4 | -- , ([], 2, [2]) 5 | -- , ([0], 0, [0]) 6 | -- , ([0], 1, [0, 1]) 7 | -- , ([1], 0, [0, 1]) 8 | , ([1], 1, [1]) 9 | , ([1], 2, [1, 2]) 10 | , ([2], 0, [0, 2]) 11 | , ([2], 1, [1, 2]) 12 | , ([0, 1], 0, [0, 1]) 13 | , ([0, 1], 2, [0, 1, 2]) 14 | ] 15 | -------------------------------------------------------------------------------- /examples/stutter_sketch.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | stutter : NatList -> NatList 10 | stutter xs = 11 | case xs of 12 | Nil _ -> 13 | [] 14 | 15 | Cons (head, tail) -> 16 | ?? 17 | 18 | specifyFunction stutter 19 | [ -- ([], []) 20 | -- , ([0], [0, 0]) 21 | ([1, 0], [1, 1, 0, 0]) 22 | ] 23 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_nth.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listNth 2 | [ -- ([], 0, 0) 3 | ([], 1, 0) 4 | -- , ([2], 0, 2) 5 | -- , ([2], 1, 0) 6 | -- , ([1, 2], 0, 1) 7 | , ([1, 2], 1, 2) 8 | -- , ([1], 0, 1) 9 | -- , ([1], 1, 0) 10 | -- , ([2, 1], 0, 2) 11 | -- , ([2, 1], 1, 1) 12 | -- , ([3, 2, 1], 0, 3) 13 | -- , ([3, 2, 1], 1, 2) 14 | -- , ([3, 2, 1], 2, 1) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/list_sorted_insert.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listSortedInsert 2 | [ ([], 0, [0]) 3 | -- , ([], 1, [1]) 4 | -- , ([], 2, [2]) 5 | -- , ([0], 0, [0]) 6 | -- , ([0], 1, [0, 1]) 7 | -- , ([1], 0, [0, 1]) 8 | , ([1], 1, [1]) 9 | , ([1], 2, [1, 2]) 10 | , ([2], 0, [0, 2]) 11 | , ([2], 1, [1, 2]) 12 | , ([0, 1], 0, [0, 1]) 13 | , ([0, 1], 2, [0, 1, 2]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_map.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listMap ) 2 | [ -- (inc, [], []) 3 | (inc, [0], [1]) 4 | -- , (inc, [0, 0], [1, 1]) 5 | -- , (inc, [1], [2]) 6 | -- , (inc, [1, 1], [2, 2]) 7 | -- , (zero, [], []) 8 | -- , (zero, [0], [0]) 9 | -- , (zero, [0, 0], [0, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | nat_pred :: n:Nat -> { Nat | 11 | 12 | (n == Z ==> _v == Z) && 13 | (n == (S Z) ==> _v == Z) && 14 | (n == (S (S Z)) ==> _v == (S Z)) && 15 | True 16 | 17 | } 18 | nat_pred = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | nat_pred :: n:Nat -> { Nat | 11 | 12 | (n == Z ==> _v == Z) && 13 | -- (n == (S Z) ==> _v == Z) && 14 | (n == (S (S Z)) ==> _v == (S Z)) && 15 | True 16 | 17 | } 18 | nat_pred = ?? -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listSnoc ) 2 | [ ([], 0, [0]) 3 | -- , ([], 1, [1]) 4 | -- , ([0], 0, [0, 0]) 5 | -- , ([0], 1, [0, 1]) 6 | -- , ([1, 0], 0, [1, 0, 0]) 7 | -- , ([1, 0], 1, [1, 0, 1]) 8 | -- , ([2, 1, 0], 0, [2, 1, 0, 0]) 9 | , ([2, 1, 0], 1, [2, 1, 0, 1]) 10 | ] 11 | -------------------------------------------------------------------------------- /specifications/mono/list_even_parity.elm: -------------------------------------------------------------------------------- 1 | specifyFunction evenParity 2 | [ ([], T) 3 | , ([F, T], F) 4 | , ([F], T) 5 | , ([F, F], T) 6 | , ([T], F) 7 | , ([T, T, F], T) 8 | , ([T, T], T) 9 | , ([T, F, F, T], T) 10 | , ([F, T, T, T], F) 11 | , ([F, T, T], T) 12 | , ([T, F, T, T], F) 13 | , ([F, F, F, F], T) 14 | , ([T, T, T, F], F) 15 | , ([T, F, T], T) 16 | , ([F, T, F], F) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_map.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | zero : Nat -> Nat 10 | zero n = Z () 11 | 12 | inc : Nat -> Nat 13 | inc n = S n 14 | 15 | listMap : (Nat -> Nat) -> NatList -> NatList 16 | listMap f = 17 | let 18 | listMapFix : NatList -> NatList 19 | listMapFix xs = 20 | ?? 21 | in 22 | listMapFix 23 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCountNodes 2 | [ (Leaf (), 0) 3 | -- , (Node (Leaf (), 0, Leaf ()), 1) 4 | , (Node (Node (Leaf (), 0, Leaf ()), 0, Leaf ()), 2) 5 | -- , (Node (Leaf (), 0, Node(Leaf (), 0, Leaf ())), 2) 6 | , (Node (Node (Leaf (), 0, Node (Leaf (), 0, Leaf ())), 0, Leaf ()), 3) 7 | -- , (Node (Leaf (), 0, Node (Leaf (), 0, Node (Leaf (), 0, Leaf ()))), 3) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction3 (listFold ) 2 | [ (sum, 0, [], 0) 3 | -- , (sum, 0, [1], 1) 4 | , (sum, 0, [2, 1], 3) 5 | -- , (sum, 0, [3, 2, 1], 6) 6 | -- , (sum, 1, [], 1) 7 | -- , (countOdd, 0, [], 0) 8 | -- , (countOdd, 0, [1], 1) 9 | -- , (countOdd, 0, [2, 1], 1) 10 | -- , (countOdd, 0, [3, 2, 1], 2) 11 | ] 12 | -------------------------------------------------------------------------------- /lib/smyth/dune: -------------------------------------------------------------------------------- 1 | ( library 2 | ( name 3 | smyth 4 | ) 5 | ( public_name 6 | smyth 7 | ) 8 | ( libraries 9 | ; user libraries 10 | stdlib2 11 | 12 | ; opam libraries 13 | unix bark 14 | ) 15 | ( flags 16 | ; (-open Pervasives2) 17 | (-open Pervasives2 -w +a-4-9-42-48 -warn-error -a+1..66-3-33) 18 | ) 19 | ( ocamlopt_flags 20 | (-O3) 21 | ) 22 | ) 23 | -------------------------------------------------------------------------------- /suites/myth/examples/tree_collect_leaves.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCollectLeaves 2 | [ (Leaf (), []) 3 | , (Node (Leaf (), T (), Leaf ()), [T ()]) 4 | , (Node (Leaf (), F (), Leaf ()), [F ()]) 5 | , (Node (Node (Leaf (), T (), Leaf ()), F (), Leaf ()), [T (), F ()]) 6 | , (Node (Node (Leaf (), F (), Leaf ()), T (), Leaf ()), [F (), T ()]) 7 | , (Node (Leaf (), F (), Node (Leaf (), T (), Leaf ())), [F (), T ()]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/myth/sketches/tree_count_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type BooleanTree 6 | = Leaf () 7 | | Node (BooleanTree, Boolean, BooleanTree) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeCountLeaves : BooleanTree -> Nat 20 | treeCountLeaves tree = 21 | ?? 22 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listSnoc ) 2 | [ -- ([], 0, [0]) 3 | -- , ([], 1, [1]) 4 | -- , ([0], 0, [0, 0]) 5 | ([0], 1, [0, 1]) 6 | -- , ([1, 0], 0, [1, 0, 0]) 7 | -- , ([1, 0], 1, [1, 0, 1]) 8 | -- , ([2, 1, 0], 0, [2, 1, 0, 0]) 9 | -- , ([2, 1, 0], 1, [2, 1, 0, 1]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | snoc : forall a . List a -> a -> List a 10 | snoc xs n = 11 | case xs of 12 | Nil _ -> Cons (n, Nil ()) 13 | Cons p -> Cons (#2.1 p, snoc (#2.2 p) n) 14 | 15 | listRevSnoc : forall a . List a -> List a 16 | listRevSnoc xs = 17 | ?? 18 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/tree_count_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type Tree a 6 | = Leaf () 7 | | Node (Tree a, a, Tree a) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeCountLeaves : forall a . Tree a -> Nat 20 | treeCountLeaves tree = 21 | ?? 22 | -------------------------------------------------------------------------------- /examples/mult.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | plus : Nat -> Nat -> Nat 6 | plus m n = 7 | case m of 8 | Z _ -> 9 | n 10 | 11 | S m_ -> 12 | S (plus m_ n) 13 | 14 | mult : Nat -> Nat -> Nat 15 | mult p q = 16 | case p of 17 | Z _ -> 18 | 0 19 | 20 | S p_ -> 21 | plus ?? (mult ?? ??) 22 | 23 | specifyFunction2 mult 24 | [ (2, 1, 2) 25 | , (3, 2, 6) 26 | ] 27 | -------------------------------------------------------------------------------- /specifications/mono/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listStutter 2 | [ ([], []) 3 | , ([2, 3, 1, 2], [2, 2, 3, 3, 1, 1, 2, 2]) 4 | , ([3, 2], [3, 3, 2, 2]) 5 | , ([3, 3, 2, 2], [3, 3, 3, 3, 2, 2, 2, 2]) 6 | , ([3, 0, 3, 3], [3, 3, 0, 0, 3, 3, 3, 3]) 7 | , ([3], [3, 3]) 8 | , ([1, 2], [1, 1, 2, 2]) 9 | , ([2, 0, 2, 3], [2, 2, 0, 0, 2, 2, 3, 3]) 10 | , ([1, 1], [1, 1, 1, 1]) 11 | , ([1], [1, 1]) 12 | ] 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCountNodes 2 | [ -- (Leaf (), 0) 3 | -- , (Node (Leaf (), 0, Leaf ()), 1) 4 | (Node (Node (Leaf (), 0, Leaf ()), 0, Leaf ()), 2) 5 | -- , (Node (Leaf (), 0, Node(Leaf (), 0, Leaf ())), 2) 6 | , (Node (Node (Leaf (), 0, Node (Leaf (), 0, Leaf ())), 0, Leaf ()), 3) 7 | -- , (Node (Leaf (), 0, Node (Leaf (), 0, Node (Leaf (), 0, Leaf ()))), 3) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction3 (listFold ) 2 | [ -- (sum, 0, [], 0) 3 | -- , (sum, 0, [1], 1) 4 | -- , (sum, 0, [2, 1], 3) 5 | (sum, 0, [3, 2, 1], 6) 6 | -- , (sum, 1, [], 1) 7 | -- , (countOdd, 0, [], 0) 8 | -- , (countOdd, 0, [1], 1) 9 | -- , (countOdd, 0, [2, 1], 1) 10 | -- , (countOdd, 0, [3, 2, 1], 2) 11 | ] 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | _build/ 2 | *.merlin 3 | experiments/data 4 | experiments/summaries 5 | data-backup/ 6 | summaries-backup/ 7 | specifications-backup 8 | *swp 9 | *swo 10 | experiments/latex-tables/smyth-experiment-tables.aux 11 | experiments/latex-tables/smyth-experiment-tables.log 12 | experiments/latex-tables/smyth-experiment-tables.out 13 | experiments/exp-4-logic/myth_benchmarks.pyc 14 | generated/ 15 | smyth-experiment-tables.pdf 16 | -------------------------------------------------------------------------------- /examples/rev_concat.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | revConcat : NatList -> NatList -> NatList 10 | revConcat xs ys = 11 | case xs of 12 | Nil _ -> 13 | ?? 14 | 15 | Cons (head, tail) -> 16 | ?? 17 | 18 | assert revConcat [] [1] == [1] 19 | assert revConcat [0, 1] [2, 3] == [1, 0, 2, 3] 20 | assert revConcat [4] [5] == [4, 5] 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/analysis.csv: -------------------------------------------------------------------------------- 1 | task,k50,k90 2 | list_append,3,4 3 | list_concat,2,3 4 | list_drop,6,9 5 | list_last,6,10 6 | list_length,3,4 7 | list_rev_append,4,7 8 | list_rev_fold,2,4 9 | list_rev_snoc,3,8 10 | list_rev_tailcall,2,4 11 | list_snoc,2,4 12 | list_stutter,2,3 13 | list_take,6,10 14 | list_tl,2,3 15 | tree_collect_leaves,2,3 16 | tree_count_nodes,4,6 17 | tree_inorder,3,4 18 | tree_preorder,2,4 19 | -------------------------------------------------------------------------------- /specifications/poly/.list_nth.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listNth ) 2 | [ ([], 0, 0) 3 | , ([], 1, 0) 4 | , ([2], 0, 2) 5 | , ([2], 1, 0) 6 | , ([1, 2], 0, 1) 7 | , ([1, 2], 1, 2) 8 | , ([1], 0, 1) 9 | , ([1], 1, 0) 10 | , ([2, 1], 0, 2) 11 | , ([2, 1], 1, 1) 12 | , ([3, 2, 1], 0, 3) 13 | , ([3, 2, 1], 1, 2) 14 | , ([3, 2, 1], 2, 1) 15 | ] 16 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (treeInOrder ) 2 | [ (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [1, 2]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (treePreorder ) 2 | [ (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | , (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [2, 1]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_concat.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | concat : forall a . List (List a) -> List a 18 | concat xss = 19 | ?? 20 | -------------------------------------------------------------------------------- /suites/myth/sketches/.tree_nodes_at_level.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type BooleanTree 6 | = Leaf () 7 | | Node (BooleanTree, Boolean, BooleanTree) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeNodesAtLevel : BooleanTree -> Nat -> Nat 20 | treeNodesAtLevel tree n = 21 | ?? 22 | -------------------------------------------------------------------------------- /suites/no-sketch/examples/tree_collect_leaves.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCollectLeaves 2 | [ (Leaf (), []) 3 | -- , (Node (Leaf (), T (), Leaf ()), [T ()]) 4 | -- , (Node (Leaf (), F (), Leaf ()), [F ()]) 5 | , (Node (Node (Leaf (), T (), Leaf ()), F (), Leaf ()), [T (), F ()]) 6 | -- , (Node (Node (Leaf (), F (), Leaf ()), T (), Leaf ()), [F (), T ()]) 7 | , (Node (Leaf (), F (), Node (Leaf (), T (), Leaf ())), [F (), T ()]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/.tree_nodes_at_level.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type BooleanTree 6 | = Leaf () 7 | | Node (BooleanTree, Boolean, BooleanTree) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeNodesAtLevel : BooleanTree -> Nat -> Nat 20 | treeNodesAtLevel tree n = 21 | ?? 22 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listRevTailcall ) 2 | [ ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([], [1], [1]) 5 | -- , ([], [1, 0], [1, 0]) 6 | -- , ([0], [], [0]) 7 | -- , ([1], [], [1]) 8 | -- , ([1], [0], [1, 0]) 9 | , ([0, 1], [], [1, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (treeInOrder ) 2 | [ -- (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [1, 2]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (treePreorder ) 2 | [ -- (Leaf (), []) 3 | -- , (Node (Leaf (), 1, Leaf ()), [1]) 4 | -- , (Node (Leaf (), 2, Leaf ()), [2]) 5 | (Node (Node (Leaf (), 1, Leaf ()), 2, Leaf ()), [2, 1]) 6 | , (Node (Leaf (), 1, Node (Leaf (), 2, Leaf ())), [1, 2]) 7 | ] 8 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | listRevAppend : forall a . List a -> List a 18 | listRevAppend xs = 19 | ?? 20 | -------------------------------------------------------------------------------- /suites/base-case-sketch/examples/tree_collect_leaves.elm: -------------------------------------------------------------------------------- 1 | specifyFunction treeCollectLeaves 2 | [ -- (Leaf (), []) 3 | -- , (Node (Leaf (), T (), Leaf ()), [T ()]) 4 | -- , (Node (Leaf (), F (), Leaf ()), [F ()]) 5 | -- , (Node (Node (Leaf (), T (), Leaf ()), F (), Leaf ()), [T (), F ()]) 6 | (Node (Node (Leaf (), F (), Leaf ()), T (), Leaf ()), [F (), T ()]) 7 | , (Node (Leaf (), F (), Node (Leaf (), T (), Leaf ())), [F (), T ()]) 8 | ] 9 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatTree 6 | = Leaf () 7 | | Node (NatTree, Nat, NatTree) 8 | 9 | sum : Nat -> Nat -> Nat 10 | sum n1 n2 = 11 | case n1 of 12 | Z _ -> n2 13 | S m -> S (sum m n2) 14 | 15 | treeCountNodes : NatTree -> Nat 16 | treeCountNodes tree = 17 | case tree of 18 | Leaf _ -> 19 | Z () 20 | 21 | Node node -> 22 | ?? 23 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_rev_tailcall.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listRevTailcall ) 2 | [ -- ([], [], []) 3 | -- , ([], [0], [0]) 4 | -- , ([], [1], [1]) 5 | -- , ([], [1, 0], [1, 0]) 6 | -- , ([0], [], [0]) 7 | -- , ([1], [], [1]) 8 | -- , ([1], [0], [1, 0]) 9 | ([0, 1], [], [1, 0]) 10 | ] 11 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/list_map.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | zero : Nat -> Nat 10 | zero n = Z () 11 | 12 | inc : Nat -> Nat 13 | inc n = S n 14 | 15 | listMap : forall a . forall b . (a -> b) -> List a -> List b 16 | listMap f = 17 | let 18 | listMapFix : List a -> List b 19 | listMapFix xs = 20 | ?? 21 | in 22 | listMapFix 23 | -------------------------------------------------------------------------------- /misc-utils/convert-suite.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mkdir fresh_dir || exit 1 4 | 5 | gcsplit --suppress-matched -s -z $1 '/`````/' '{*}' 6 | 7 | for f in $(ls -p | grep -v /); do 8 | if [[ $f =~ x ]]; then 9 | mv $f r_$(head -1 $f).elm 10 | fi 11 | done 12 | 13 | for f in $(ls -p | grep -v /); do 14 | if [[ $f =~ r_ ]]; then 15 | gsed -i '1d' $f 16 | mv $f fresh_dir 17 | fi 18 | done 19 | 20 | cd fresh_dir 21 | rename 's/r_//' * 22 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/analysis.csv: -------------------------------------------------------------------------------- 1 | task,k50,k90 2 | list_append,1+2,1+4 3 | list_concat,1+3,1+5 4 | list_drop,1+8,1+19 5 | list_last,1+4,1+10 6 | list_length,1+2,1+2 7 | list_rev_append,1+2,1+4 8 | list_rev_snoc,1+3,1+4 9 | list_rev_tailcall,1+2,1+4 10 | list_snoc,1+2,1+3 11 | list_stutter,1+2,1+2 12 | list_take,1+7,1+15 13 | tree_collect_leaves,1+2,1+3 14 | tree_count_nodes,1+3,1+4 15 | tree_inorder,1+3,1+3 16 | tree_preorder,1+2,1+3 17 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_filter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listFilter ) 2 | [ (isEven, [], []) 3 | -- , (isEven, [0], [0]) 4 | -- , (isEven, [1], []) 5 | -- , (isEven, [2], [2]) 6 | , (isEven, [0, 0], [0, 0]) 7 | -- , (isEven, [0, 1], [0]) 8 | , (isEven, [1, 0, 1], [0]) 9 | -- , (isNonzero, [], []) 10 | -- , (isNonzero, [0], []) 11 | ] 12 | -------------------------------------------------------------------------------- /examples/minus.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | minus : Nat -> Nat -> Nat 6 | minus a b = 7 | let 8 | hole : Nat 9 | hole = 10 | ?? 11 | in 12 | case a of 13 | Z _ -> 14 | hole 15 | 16 | S a_ -> 17 | case b of 18 | Z _ -> 19 | hole 20 | 21 | S b_ -> 22 | minus ?? ?? 23 | 24 | specifyFunction2 minus 25 | [ (2, 0, 2) 26 | , (3, 2, 1) 27 | , (3, 1, 2) 28 | ] 29 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/tree_count_nodes.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type Tree a 6 | = Leaf () 7 | | Node (Tree a, a, Tree a) 8 | 9 | sum : Nat -> Nat -> Nat 10 | sum n1 n2 = 11 | case n1 of 12 | Z _ -> n2 13 | S m -> S (sum m n2) 14 | 15 | treeCountNodes : forall a . Tree a -> Nat 16 | treeCountNodes tree = 17 | case tree of 18 | Leaf _ -> 19 | Z () 20 | 21 | Node node -> 22 | ?? 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/leon_bool_neg.txt: -------------------------------------------------------------------------------- 1 | 2 | import leon.lang._ 3 | import leon.lang.synthesis._ 4 | import leon.annotation._ 5 | 6 | object Blah { 7 | 8 | sealed abstract class Boolean 9 | case object T extends Boolean 10 | case object F extends Boolean 11 | 12 | def bool_neg(p: Boolean): Boolean = { choose { (out:Boolean) => 13 | 14 | ((p == T) ==> (out == F)) && 15 | ((p == F) ==> (out == T)) && 16 | true 17 | 18 | } } 19 | 20 | } -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_filter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listFilter ) 2 | [ -- (isEven, [], []) 3 | -- , (isEven, [0], [0]) 4 | -- , (isEven, [1], []) 5 | -- , (isEven, [2], [2]) 6 | (isEven, [0, 0], [0, 0]) 7 | -- , (isEven, [0, 1], [0]) 8 | , (isEven, [1, 0, 1], [0]) 9 | -- , (isNonzero, [], []) 10 | -- , (isNonzero, [0], []) 11 | ] 12 | -------------------------------------------------------------------------------- /src/references.mli: -------------------------------------------------------------------------------- 1 | type ('i, 'o) reference = 2 | { function_name : string 3 | ; k_max : int 4 | ; d_in : 'i Denotation.t 5 | ; d_out : 'o Denotation.t 6 | ; input : 'i Sample2.gen 7 | ; base_case : 'i Sample2.gen option 8 | ; poly_args : Smyth.Lang.typ list 9 | ; func : 'i -> 'o 10 | } 11 | 12 | type 'a reference_projection = 13 | { proj : 'i 'o . ('i, 'o) reference -> 'a 14 | } 15 | 16 | val all : 'a reference_projection -> (string * 'a) list 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | snoc : NatList -> Nat -> NatList 10 | snoc xs n = 11 | case xs of 12 | Nil _ -> Cons (n, Nil ()) 13 | Cons p -> Cons (#2.1 p, snoc (#2.2 p) n) 14 | 15 | listRevSnoc : NatList -> NatList 16 | listRevSnoc xs = 17 | case xs of 18 | Nil _ -> 19 | Nil () 20 | 21 | Cons p -> 22 | ?? 23 | -------------------------------------------------------------------------------- /suites/myth/sketches/list_concat.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatListList 10 | = LNil () 11 | | LCons (NatList, NatListList) 12 | 13 | append : NatList -> NatList -> NatList 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | concat : NatListList -> NatList 22 | concat xss = 23 | ?? 24 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | # Contributors 2 | 3 | ## Smyth Code 4 | 5 | - Justin Lubin 6 | - Niek Mulleners 7 | 8 | ## Smyth Evaluation 9 | 10 | - Justin Lubin 11 | - Ravi Chugh 12 | 13 | ## Smyth Theory 14 | 15 | - Justin Lubin 16 | - Nick Collins 17 | - Cyrus Omar 18 | - Ravi Chugh 19 | 20 | _Note:_ This `CONTRIBUTORS.md` format is inspired by the [same 21 | file](https://github.com/hazelgrove/hazel/blob/dev/CONTRIBUTORS.md) in the 22 | [Hazel](https://hazel.org/) project. 23 | -------------------------------------------------------------------------------- /specifications/mono/list_rev_fold.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevFold 2 | [ ([], []) 3 | , ([1], [1]) 4 | , ([0, 1, 0], [0, 1, 0]) 5 | , ([3, 0, 0, 2], [2, 0, 0, 3]) 6 | , ([3], [3]) 7 | , ([2, 0, 1, 2], [2, 1, 0, 2]) 8 | , ([2, 0, 0, 2], [2, 0, 0, 2]) 9 | , ([3, 1], [1, 3]) 10 | , ([1, 2], [2, 1]) 11 | , ([0, 2, 1, 3], [3, 1, 2, 0]) 12 | , ([0], [0]) 13 | , ([0, 2], [2, 0]) 14 | , ([1, 3], [3, 1]) 15 | , ([3, 2], [2, 3]) 16 | , ([2], [2]) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/myth/sketches/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatTree 10 | = Leaf () 11 | | Node (NatTree, Nat, NatTree) 12 | 13 | append : NatList -> NatList -> NatList 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treeInOrder : NatTree -> NatList 22 | treeInOrder xss = 23 | ?? 24 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_drop.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listDrop ) 2 | [ ([], 0, []) 3 | -- , ([], 1, []) 4 | -- , ([0], 0, [0]) 5 | -- , ([0], 1, []) 6 | , ([1], 0, [1]) 7 | -- , ([1], 1, []) 8 | -- , ([2, 0], 0, [1, 0]) 9 | , ([1, 0], 1, [0]) 10 | -- , ([0, 1], 0, [0, 1]) 11 | -- , ([0, 1], 1, [1]) 12 | , ([0, 1], 2, []) 13 | ] 14 | -------------------------------------------------------------------------------- /lib/stdlib2/tree2.mli: -------------------------------------------------------------------------------- 1 | type 'a t = 2 | | Leaf 3 | | Node of 'a t * 'a * 'a t 4 | 5 | (* Assumes tree is a binary search tree *) 6 | val binsert : 'a -> 'a t -> 'a t 7 | 8 | val pre_order : 'a t -> 'a list 9 | 10 | val in_order : 'a t -> 'a list 11 | 12 | val post_order : 'a t -> 'a list 13 | 14 | val count_leaves : 'a t -> int 15 | 16 | val count_nodes : 'a t -> int 17 | 18 | val map : ('a -> 'b) -> 'a t -> 'b t 19 | 20 | val count_nodes_at_level : int -> 'a t -> int 21 | -------------------------------------------------------------------------------- /suites/myth/sketches/.tree_postorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatTree 10 | = Leaf () 11 | | Node (NatTree, Nat, NatTree) 12 | 13 | append : NatList -> NatList -> NatList 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treePostorder : NatTree -> NatList 22 | treePostorder tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /suites/myth/sketches/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type NatTree 10 | = Leaf () 11 | | Node (NatTree, Nat, NatTree) 12 | 13 | append : NatList -> NatList -> NatList 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treePreorder : NatTree -> NatList 22 | treePreorder tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_bool_bor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_bor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_bor = ?? 16 | 17 | bool_bor = \p . \q . 18 | match p with 19 | T -> p 20 | F -> q 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_bool_bor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_bor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | -- (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_bor = ?? 16 | 17 | bool_bor = \p . \q . 18 | match p with 19 | T -> p 20 | F -> q 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_bool_band.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_band :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == F) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_band = ?? 16 | 17 | bool_band = \p . \q . 18 | match p with 19 | T -> q 20 | F -> p 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_bool_impl.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_impl :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == T) && 12 | True 13 | 14 | } 15 | bool_impl = ?? 16 | 17 | bool_impl = \p . \q . 18 | match p with 19 | T -> q 20 | F -> T 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_bool_band.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_band :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | (p == F && q == T ==> _v == F) && 11 | -- (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_band = ?? 16 | 17 | bool_band = \p . \q . 18 | match p with 19 | T -> q 20 | F -> p 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_bool_impl.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_impl :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == T) && 9 | (p == T && q == F ==> _v == F) && 10 | -- (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == T) && 12 | True 13 | 14 | } 15 | bool_impl = ?? 16 | 17 | bool_impl = \p . \q . 18 | match p with 19 | T -> q 20 | F -> T 21 | 22 | Correct 23 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_drop.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listDrop ) 2 | [ -- ([], 0, []) 3 | ([], 1, []) 4 | -- , ([0], 0, [0]) 5 | -- , ([0], 1, []) 6 | -- , ([1], 0, [1]) 7 | -- , ([1], 1, []) 8 | -- , ([1, 0], 0, [1, 0]) 9 | , ([1, 0], 1, [0]) 10 | -- , ([0, 1], 0, [0, 1]) 11 | -- , ([0, 1], 1, [1]) 12 | -- , ([0, 1], 2, []) 13 | ] 14 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/leon_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | import leon.lang._ 3 | import leon.lang.synthesis._ 4 | import leon.annotation._ 5 | 6 | object Blah { 7 | 8 | sealed abstract class Nat 9 | case class S(nat: Nat) extends Nat 10 | case object Z extends Nat 11 | 12 | def nat_pred(n: Nat): Nat = { choose { (out:Nat) => 13 | 14 | ((n == Z) ==> (out == Z)) && 15 | ((n == S(Z)) ==> (out == Z)) && 16 | ((n == S(S(Z))) ==> (out == S(Z))) && 17 | true 18 | 19 | } } 20 | 21 | } -------------------------------------------------------------------------------- /specifications/mono/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevSnoc 2 | [ ([], []) 3 | , ([2, 1, 0], [0, 1, 2]) 4 | , ([2, 2, 0], [0, 2, 2]) 5 | , ([2, 3, 3], [3, 3, 2]) 6 | , ([2, 0], [0, 2]) 7 | , ([2], [2]) 8 | , ([2, 1, 3, 1], [1, 3, 1, 2]) 9 | , ([0, 2], [2, 0]) 10 | , ([2, 1, 3], [3, 1, 2]) 11 | , ([2, 2], [2, 2]) 12 | , ([3, 3, 0], [0, 3, 3]) 13 | , ([0], [0]) 14 | , ([0, 1], [1, 0]) 15 | , ([0, 3, 1, 0], [0, 1, 3, 0]) 16 | , ([1, 0, 0], [0, 0, 1]) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | append : NatList -> NatList -> NatList 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | listRevAppend : NatList -> NatList 18 | listRevAppend xs = 19 | case xs of 20 | Nil _ -> 21 | Nil () 22 | 23 | Cons p -> 24 | ?? 25 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/nat_max.csv: -------------------------------------------------------------------------------- 1 | nat_max 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.0000,0.0000 9 | 4,0.0000,0.0400 10 | 5,0.1000,0.1600 11 | 6,0.2200,0.3000 12 | 7,0.3600,0.4600 13 | 8,0.5200,0.5200 14 | 9,0.6600,0.7200 15 | 10,0.7400,0.8000 16 | 11,0.8200,0.8200 17 | 12,0.9800,0.9800 18 | 13,0.9800,0.9800 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/nat_max.csv: -------------------------------------------------------------------------------- 1 | nat_max 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.0000,0.0000 9 | 4,0.0800,0.1000 10 | 5,0.0400,0.1400 11 | 6,0.2000,0.3200 12 | 7,0.3600,0.4600 13 | 8,0.4600,0.5200 14 | 9,0.5000,0.5800 15 | 10,0.7400,0.7600 16 | 11,0.8200,0.8200 17 | 12,0.9000,0.9000 18 | 13,1.0000,1.0000 19 | 14,0.9800,0.9800 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/leon_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | import leon.lang._ 3 | import leon.lang.synthesis._ 4 | import leon.annotation._ 5 | 6 | object Blah { 7 | 8 | sealed abstract class Nat 9 | case class S(nat: Nat) extends Nat 10 | case object Z extends Nat 11 | 12 | def nat_pred(n: Nat): Nat = { choose { (out:Nat) => 13 | 14 | ((n == Z) ==> (out == Z)) && 15 | // ((n == S(Z)) ==> (out == Z)) && 16 | ((n == S(S(Z))) ==> (out == S(Z))) && 17 | true 18 | 19 | } } 20 | 21 | } -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | nat_pred :: n:Nat -> { Nat | 11 | 12 | (n == Z ==> _v == Z) && 13 | (n == (S Z) ==> _v == Z) && 14 | (n == (S (S Z)) ==> _v == (S Z)) && 15 | True 16 | 17 | } 18 | nat_pred = ?? 19 | 20 | nat_pred = \n . 21 | match n with 22 | Z -> n 23 | S x2 -> x2 24 | 25 | Correct 26 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/tree_inorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | type Tree a 10 | = Leaf () 11 | | Node (Tree a, a, Tree a) 12 | 13 | append : forall a . List a -> List a -> List a 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treeInOrder : forall a . Tree a -> List a 22 | treeInOrder xss = 23 | ?? 24 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_rev_fold.csv: -------------------------------------------------------------------------------- 1 | list_rev_fold 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.5400,0.0000 8 | 3,0.7800,0.0000 9 | 4,0.9400,0.0000 10 | 5,1.0000,0.0000 11 | 6,1.0000,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | 11,1.0000,0.0000 17 | 12,1.0000,0.0000 18 | 13,1.0000,0.0000 19 | 14,1.0000,0.0000 20 | 15,1.0000,0.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_rev_snoc.csv: -------------------------------------------------------------------------------- 1 | list_rev_snoc 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2400,0.5800 8 | 3,0.6000,0.8400 9 | 4,0.7000,0.9200 10 | 5,0.8600,0.9800 11 | 6,0.9600,1.0000 12 | 7,0.9600,1.0000 13 | 8,0.9800,1.0000 14 | 9,0.9800,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/tree_inorder.csv: -------------------------------------------------------------------------------- 1 | tree_inorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.8400,0.8400 9 | 4,0.9600,0.9600 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,0.9800,0.9800 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/tree_preorder.csv: -------------------------------------------------------------------------------- 1 | tree_preorder 2 | timeout,3.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.8800,0.8800 9 | 4,0.9800,0.9800 10 | 5,0.9800,0.9800 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/list_rev_snoc.csv: -------------------------------------------------------------------------------- 1 | list_rev_snoc 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2000,0.5400 8 | 3,0.7400,0.8400 9 | 4,0.8600,0.9800 10 | 5,0.9000,1.0000 11 | 6,0.9000,0.9800 12 | 7,0.9600,1.0000 13 | 8,0.9800,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/tree_inorder.csv: -------------------------------------------------------------------------------- 1 | tree_inorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.1200,0.1800 8 | 3,0.8400,0.8400 9 | 4,0.9800,0.9800 10 | 5,0.9800,0.9800 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/tree_preorder.csv: -------------------------------------------------------------------------------- 1 | tree_preorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.1200,0.1800 8 | 3,0.9400,0.9400 9 | 4,1.0000,1.0000 10 | 5,0.9800,0.9800 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_rev_fold.csv: -------------------------------------------------------------------------------- 1 | list_rev_fold 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.5600,0.0000 8 | 3,0.8200,0.0000 9 | 4,0.9800,0.0000 10 | 5,0.9600,0.0000 11 | 6,0.9800,0.0000 12 | 7,1.0000,0.0000 13 | 8,1.0000,0.0000 14 | 9,1.0000,0.0000 15 | 10,1.0000,0.0000 16 | 11,1.0000,0.0000 17 | 12,1.0000,0.0000 18 | 13,1.0000,0.0000 19 | 14,1.0000,0.0000 20 | 15,1.0000,0.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_rev_snoc.csv: -------------------------------------------------------------------------------- 1 | list_rev_snoc 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2000,0.5000 8 | 3,0.5800,0.8600 9 | 4,0.7800,1.0000 10 | 5,0.8400,1.0000 11 | 6,0.9400,1.0000 12 | 7,0.8800,1.0000 13 | 8,0.9600,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/tree_inorder.csv: -------------------------------------------------------------------------------- 1 | tree_inorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.4600,0.4600 8 | 3,0.8200,0.8200 9 | 4,0.9600,0.9600 10 | 5,0.9800,0.9800 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/tree_preorder.csv: -------------------------------------------------------------------------------- 1 | tree_preorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.6600,0.6600 8 | 3,0.8600,0.8600 9 | 4,0.9800,0.9800 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/list_rev_snoc.csv: -------------------------------------------------------------------------------- 1 | list_rev_snoc 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2000,0.4600 8 | 3,0.4800,0.7800 9 | 4,0.7800,0.9600 10 | 5,0.8800,0.9400 11 | 6,0.9400,1.0000 12 | 7,0.9600,1.0000 13 | 8,0.9800,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/tree_inorder.csv: -------------------------------------------------------------------------------- 1 | tree_inorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.4600,0.4600 8 | 3,0.9000,0.9000 9 | 4,0.9800,0.9800 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/tree_preorder.csv: -------------------------------------------------------------------------------- 1 | tree_preorder 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.5800,0.6000 8 | 3,0.9400,0.9400 9 | 4,0.9600,0.9600 10 | 5,1.0000,1.0000 11 | 6,1.0000,1.0000 12 | 7,1.0000,1.0000 13 | 8,1.0000,1.0000 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/2a/synquid_nat_pred.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | nat_pred :: n:Nat -> { Nat | 11 | 12 | (n == Z ==> _v == Z) && 13 | -- (n == (S Z) ==> _v == Z) && 14 | (n == (S (S Z)) ==> _v == (S Z)) && 15 | True 16 | 17 | } 18 | nat_pred = ?? 19 | 20 | nat_pred = \n . 21 | match n with 22 | Z -> n 23 | S x2 -> x2 24 | 25 | Correct 26 | -------------------------------------------------------------------------------- /suites/myth/sketches/nat_max.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type Boolean 6 | = F () 7 | | T () 8 | 9 | type Cmp 10 | = LT () 11 | | EQ () 12 | | GT () 13 | 14 | compare : Nat -> Nat -> Cmp 15 | compare n1 n2 = 16 | case n1 of 17 | Z _ -> 18 | case n2 of 19 | Z _ -> EQ () 20 | S _ -> LT () 21 | S m1 -> 22 | case n2 of 23 | Z _ -> GT () 24 | S m2 -> compare m1 m2 25 | 26 | natMax : Nat -> Nat -> Nat 27 | natMax m n = 28 | ?? 29 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_rev_snoc.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | snoc : forall a . List a -> a -> List a 10 | snoc xs n = 11 | case xs of 12 | Nil _ -> Cons (n, Nil ()) 13 | Cons p -> Cons (#2.1 p, snoc (#2.2 p) n) 14 | 15 | listRevSnoc : forall a . List a -> List a 16 | listRevSnoc xs = 17 | case xs of 18 | Nil _ -> 19 | Nil () 20 | 21 | Cons p -> 22 | ?? 23 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/tree_preorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | type Tree a 10 | = Leaf () 11 | | Node (Tree a, a, Tree a) 12 | 13 | append : forall a . List a -> List a -> List a 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treePreorder : forall a . Tree a -> List a 22 | treePreorder tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_rev_append.csv: -------------------------------------------------------------------------------- 1 | list_rev_append 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.2000,0.2000 9 | 4,0.3800,0.3800 10 | 5,0.6000,0.6000 11 | 6,0.7000,0.7000 12 | 7,0.7400,0.7400 13 | 8,0.9600,0.9600 14 | 9,0.9000,0.9000 15 | 10,0.9000,0.9000 16 | 11,0.9800,0.9800 17 | 12,0.9600,0.9600 18 | 13,0.9800,0.9800 19 | 14,0.9600,0.9600 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/list_rev_append.csv: -------------------------------------------------------------------------------- 1 | list_rev_append 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2000,0.4800 8 | 3,0.5200,0.8800 9 | 4,0.7200,0.9800 10 | 5,0.8200,1.0000 11 | 6,0.9800,1.0000 12 | 7,0.9400,1.0000 13 | 8,0.9400,1.0000 14 | 9,0.9800,1.0000 15 | 10,0.9800,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/list_rev_append.csv: -------------------------------------------------------------------------------- 1 | list_rev_append 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.2000,0.2000 8 | 3,0.4600,0.4600 9 | 4,0.7400,0.7400 10 | 5,0.8000,0.8000 11 | 6,0.8800,0.8800 12 | 7,0.9600,0.9600 13 | 8,0.9800,0.9800 14 | 9,1.0000,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/list_rev_append.csv: -------------------------------------------------------------------------------- 1 | list_rev_append 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.3400,0.6800 8 | 3,0.7000,0.8800 9 | 4,0.6600,0.9400 10 | 5,0.7800,1.0000 11 | 6,0.9400,1.0000 12 | 7,0.9200,0.9800 13 | 8,0.9600,1.0000 14 | 9,0.9600,1.0000 15 | 10,0.9600,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /specifications/mono/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | specifyFunction listRevAppend 2 | [ ([], []) 3 | , ([3], [3]) 4 | , ([2, 3], [3, 2]) 5 | , ([2, 0, 3, 3], [3, 3, 0, 2]) 6 | , ([3, 3, 0], [0, 3, 3]) 7 | , ([3, 0, 1], [1, 0, 3]) 8 | , ([1, 2], [2, 1]) 9 | , ([1, 1, 1], [1, 1, 1]) 10 | , ([0], [0]) 11 | , ([1, 3, 2], [2, 3, 1]) 12 | , ([0, 1, 3, 3], [3, 3, 1, 0]) 13 | , ([1, 3, 3, 1], [1, 3, 3, 1]) 14 | , ([1, 1, 3], [3, 1, 1]) 15 | , ([3, 3], [3, 3]) 16 | , ([3, 0, 2, 0], [0, 2, 0, 3]) 17 | ] 18 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/.tree_postorder.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | type Tree a 10 | = Leaf () 11 | | Node (Tree a, Nat, Tree a) 12 | 13 | append : forall a . List a -> List a -> List a 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treePostorder : forall a . Tree a -> List a 22 | treePostorder tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/list_even_parity.csv: -------------------------------------------------------------------------------- 1 | list_even_parity 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.0000,0.0000 9 | 4,0.0400,0.0400 10 | 5,0.0800,0.0800 11 | 6,0.1000,0.1000 12 | 7,0.3000,0.3200 13 | 8,0.3600,0.4000 14 | 9,0.2000,0.2200 15 | 10,0.2400,0.2400 16 | 11,0.0600,0.0600 17 | 12,0.0200,0.0200 18 | 13,0.0000,0.0000 19 | 14,0.0000,0.0000 20 | 15,0.0000,0.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-2b/csv/tree_count_nodes.csv: -------------------------------------------------------------------------------- 1 | tree_count_nodes 2 | timeout,10.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.3200,0.3200 9 | 4,0.6000,0.6000 10 | 5,0.7600,0.7600 11 | 6,0.8400,0.8400 12 | 7,0.9400,0.9400 13 | 8,1.0000,1.0000 14 | 9,0.9800,0.9800 15 | 10,0.9400,0.9400 16 | 11,0.9200,0.9200 17 | 12,0.9400,0.9400 18 | 13,0.8600,0.8600 19 | 14,0.8800,0.8800 20 | 15,0.8200,0.8200 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/list_even_parity.csv: -------------------------------------------------------------------------------- 1 | list_even_parity 2 | timeout,1.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.0000,0.0000 9 | 4,0.0000,0.0000 10 | 5,0.1000,0.1000 11 | 6,0.0600,0.0600 12 | 7,0.1800,0.1800 13 | 8,0.3800,0.4200 14 | 9,0.4800,0.5000 15 | 10,0.5800,0.5800 16 | 11,0.2800,0.2800 17 | 12,0.3200,0.3200 18 | 13,0.0600,0.0600 19 | 14,0.0200,0.0200 20 | 15,0.0000,0.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-3b/csv/tree_count_nodes.csv: -------------------------------------------------------------------------------- 1 | tree_count_nodes 2 | timeout,3.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.3000,0.5600 9 | 4,0.6400,0.8600 10 | 5,0.7800,1.0000 11 | 6,0.7800,1.0000 12 | 7,0.9000,1.0000 13 | 8,1.0000,1.0000 14 | 9,0.9800,1.0000 15 | 10,1.0000,1.0000 16 | 11,1.0000,1.0000 17 | 12,1.0000,1.0000 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-5b/csv/tree_count_nodes.csv: -------------------------------------------------------------------------------- 1 | tree_count_nodes 2 | timeout,10.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.4200,0.4200 9 | 4,0.7600,0.7600 10 | 5,0.8600,0.8600 11 | 6,0.9000,0.9000 12 | 7,0.9400,0.9400 13 | 8,0.9600,0.9600 14 | 9,1.0000,1.0000 15 | 10,0.9600,0.9600 16 | 11,1.0000,1.0000 17 | 12,0.9600,0.9600 18 | 13,1.0000,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /experiments/author-results/data/exp-6b/csv/tree_count_nodes.csv: -------------------------------------------------------------------------------- 1 | tree_count_nodes 2 | timeout,3.0 3 | trial count,50 4 | example count,top success percent,top recursive success percent 5 | 0,0.0000,0.0000 6 | 1,0.0000,0.0000 7 | 2,0.0000,0.0000 8 | 3,0.4400,0.8000 9 | 4,0.6600,0.9800 10 | 5,0.8400,0.9600 11 | 6,0.8800,1.0000 12 | 7,0.9000,1.0000 13 | 8,0.8800,1.0000 14 | 9,0.9800,1.0000 15 | 10,0.9800,1.0000 16 | 11,0.9800,1.0000 17 | 12,1.0000,1.0000 18 | 13,0.9800,1.0000 19 | 14,1.0000,1.0000 20 | 15,1.0000,1.0000 21 | -------------------------------------------------------------------------------- /lib/smyth/example.mli: -------------------------------------------------------------------------------- 1 | (** Example helpers and "ground truth" example satisfaction. *) 2 | 3 | open Lang 4 | 5 | val from_value : value -> example 6 | (** "Upcasts" a simple value to an example. *) 7 | 8 | val res_satisfies : hole_filling -> res -> example -> bool 9 | (** Example satisfaction as defined in {b Figure 5} of the ICFP 2020 paper. *) 10 | 11 | val exp_satisfies : hole_filling -> exp -> worlds -> bool 12 | (** Example constraint satisfaction as defined in {b Figure 5} of the 13 | ICFP 2020 paper. *) 14 | -------------------------------------------------------------------------------- /smyth-stdlib2.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "Additions to the standard library used by Smyth" 3 | maintainer: "Justin Lubin " 4 | authors: "Justin Lubin " 5 | license: "MIT License" 6 | homepage: "https://github.com/UChicago-PL/smyth" 7 | doc: "https://uchicago-pl.github.io/smyth/docs" 8 | bug-reports: "https://github.com/UChicago-PL/smyth/issues" 9 | build: make 10 | dev-repo: "git+https://github.com/UChicago-PL/smyth.git" 11 | name: "smyth-stdlib2" 12 | version: "~dev" 13 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/tree_count_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type Tree a 6 | = Leaf () 7 | | Node (Tree a, a, Tree a) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeCountLeaves : forall a . Tree a -> Nat 20 | treeCountLeaves tree = 21 | case tree of 22 | Leaf _ -> 23 | S (Z ()) 24 | 25 | Node node -> 26 | ?? 27 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/results/1/synquid_bool_xor.txt: -------------------------------------------------------------------------------- 1 | 2 | data Boolean where 3 | T :: Boolean 4 | F :: Boolean 5 | 6 | bool_xor :: p:Boolean -> q:Boolean -> { Boolean | 7 | 8 | (p == T && q == T ==> _v == F) && 9 | (p == T && q == F ==> _v == T) && 10 | (p == F && q == T ==> _v == T) && 11 | (p == F && q == F ==> _v == F) && 12 | True 13 | 14 | } 15 | bool_xor = ?? 16 | 17 | bool_xor = \p . \q . 18 | match p with 19 | T -> 20 | match q with 21 | T -> F 22 | F -> p 23 | F -> q 24 | 25 | Correct 26 | -------------------------------------------------------------------------------- /lib/smyth/solve.mli: -------------------------------------------------------------------------------- 1 | (** Constraint solving, as defined in {b Figure 8} of the ICFP 2020 paper. *) 2 | 3 | open Lang 4 | 5 | val solve_any : 6 | hole_ctx 7 | -> datatype_ctx 8 | -> constraints Nondet.t 9 | -> (hole_filling * hole_ctx) Nondet.t 10 | (** [solve_any delta sigma possible_ks] tries to solve any one of the possible 11 | constraints [possible_ks]. As soon as [solve_any] finds a solution to one 12 | of the [possible_ks], it returns that solution (which is a nondeterministic 13 | set.) *) 14 | -------------------------------------------------------------------------------- /smyth.opam: -------------------------------------------------------------------------------- 1 | opam-version: "2.0" 2 | synopsis: "Programming-by-example in a typed functional language with sketches" 3 | maintainer: "Justin Lubin " 4 | authors: "Justin Lubin " 5 | license: "MIT License" 6 | homepage: "https://github.com/UChicago-PL/smyth" 7 | doc: "https://uchicago-pl.github.io/smyth/docs" 8 | bug-reports: "https://github.com/UChicago-PL/smyth/issues" 9 | build: make 10 | dev-repo: "git+https://github.com/UChicago-PL/smyth.git" 11 | name: "smyth" 12 | version: "~dev" 13 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/tree_count_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type BooleanTree 6 | = Leaf () 7 | | Node (BooleanTree, Boolean, BooleanTree) 8 | 9 | type Nat 10 | = Z () 11 | | S Nat 12 | 13 | sum : Nat -> Nat -> Nat 14 | sum n1 n2 = 15 | case n1 of 16 | Z _ -> n2 17 | S m -> S (sum m n2) 18 | 19 | treeCountLeaves : BooleanTree -> Nat 20 | treeCountLeaves tree = 21 | case tree of 22 | Leaf _ -> 23 | S (Z ()) 24 | 25 | Node node -> 26 | ?? 27 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_concat.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | concat : forall a . List (List a) -> List a 18 | concat xss = 19 | case xss of 20 | Nil _ -> 21 | Nil () 22 | 23 | Cons p -> 24 | ?? 25 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/examples/list_take.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listTake ) 2 | [ (0, [], []) 3 | -- , (0, [1], []) 4 | , (0, [0, 1], []) 5 | -- , (0, [1, 0, 1], []) 6 | -- , (1, [], []) 7 | -- , (1, [1], [1]) 8 | -- , (1, [0, 1], [0]) 9 | -- , (1, [1, 0, 1], [1]) 10 | -- , (2, [], []) 11 | -- , (2, [1], [1]) 12 | -- , (2, [0, 1], [0, 1]) 13 | , (2, [1, 0, 1], [1, 0]) 14 | ] 15 | -------------------------------------------------------------------------------- /examples/length_foldr.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | succ : Nat -> Nat 10 | succ n = 11 | S n 12 | 13 | foldr : (Nat -> Nat -> Nat) -> Nat -> NatList -> Nat 14 | foldr f acc xs = 15 | case xs of 16 | Nil _ -> 17 | acc 18 | 19 | Cons p -> 20 | f (#2.1 p) (foldr f acc (#2.2 p)) 21 | 22 | length : NatList -> Nat 23 | length xs = 24 | foldr (\x y -> ??) ?? ?? 25 | 26 | specifyFunction length 27 | [ ([0, 0], 2) 28 | ] 29 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/examples/list_take.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 (listTake ) 2 | [ -- (0, [], []) 3 | -- , (0, [1], []) 4 | -- , (0, [0, 1], []) 5 | -- , (0, [1, 0, 1], []) 6 | (1, [], []) 7 | -- , (1, [1], [1]) 8 | -- , (1, [0, 1], [0]) 9 | -- , (1, [1, 0, 1], [1]) 10 | -- , (2, [], []) 11 | -- , (2, [1], [1]) 12 | , (2, [0, 1], [0, 1]) 13 | , (2, [1, 0, 1], [1, 0]) 14 | ] 15 | -------------------------------------------------------------------------------- /suites/poly-base-case-sketch/sketches/list_rev_append.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type List a 6 | = Nil () 7 | | Cons (a, List a) 8 | 9 | append : forall a . List a -> List a -> List a 10 | append l1 l2 = 11 | case l1 of 12 | Nil _ -> 13 | l2 14 | Cons p -> 15 | Cons (#2.1 p, append (#2.2 p) l2) 16 | 17 | listRevAppend : forall a . List a -> List a 18 | listRevAppend xs = 19 | case xs of 20 | Nil _ -> 21 | Nil () 22 | 23 | Cons p -> 24 | ?? 25 | -------------------------------------------------------------------------------- /suites/poly-no-sketch/sketches/tree_collect_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type Tree a 6 | = Leaf () 7 | | Node (Tree a, a, Tree a) 8 | 9 | type List a 10 | = Nil () 11 | | Cons (a, List a) 12 | 13 | append : forall a . List a -> List a -> List a 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treeCollectLeaves : forall a . Tree a -> List a 22 | treeCollectLeaves tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/1/synquid_nat_iseven.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | data Boolean where 11 | T :: Boolean 12 | F :: Boolean 13 | 14 | nat_iseven :: n:Nat -> { Boolean | 15 | 16 | (n == Z ==> _v == T) && 17 | (n == (S Z) ==> _v == F) && 18 | (n == (S (S Z)) ==> _v == T) && 19 | (n == (S (S (S Z))) ==> _v == F) && 20 | True 21 | 22 | } 23 | nat_iseven = ?? -------------------------------------------------------------------------------- /experiments/exp-4-logic/generated/2a/synquid_nat_iseven.txt: -------------------------------------------------------------------------------- 1 | 2 | data Nat where 3 | Z :: Nat 4 | S :: Nat -> Nat 5 | 6 | termination measure dec :: Nat -> {Int | _v >= 0} where 7 | Z -> 0 8 | S m -> 1 + dec m 9 | 10 | data Boolean where 11 | T :: Boolean 12 | F :: Boolean 13 | 14 | nat_iseven :: n:Nat -> { Boolean | 15 | 16 | (n == Z ==> _v == T) && 17 | -- (n == (S Z) ==> _v == F) && 18 | (n == (S (S Z)) ==> _v == T) && 19 | (n == (S (S (S Z))) ==> _v == F) && 20 | True 21 | 22 | } 23 | nat_iseven = ?? -------------------------------------------------------------------------------- /experiments/plot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | command -v octave >/dev/null 2>&1 || { 4 | echo "Octave not installed; skipping plot generation."; 5 | exit 1; 6 | } 7 | 8 | if [[ $# -ne 1 ]]; then 9 | echo "usage:" $0 "" 10 | exit 1 11 | fi 12 | 13 | mkdir -p data/$1/png 14 | mkdir -p data-backup/$1/png 15 | mv data/$1/png/*.png data-backup/$1/png 2> /dev/null 16 | 17 | shopt -s nullglob 18 | for file in data/$1/csv/*.csv; do 19 | name=$(basename $file .csv) 20 | octave --no-gui smyth_plot.m $1 $name 21 | done 22 | -------------------------------------------------------------------------------- /lib/smyth/fresh.mli: -------------------------------------------------------------------------------- 1 | (** Manages fresh (unique) hole names. 2 | 3 | {b Warning:} this module uses mutation! *) 4 | 5 | open Lang 6 | 7 | val unused : hole_name 8 | (** The canonical unused hole name. *) 9 | 10 | val set_largest_hole : hole_name -> unit 11 | (** [set_largest_hole h] sets the current laregest hole to be [h]; all new 12 | holes generated after calling [set_largest_hole h] will have hole name 13 | greater than [h]. *) 14 | 15 | val gen_hole : unit -> hole_name 16 | (** Generates a fresh (unique) hole name. *) 17 | -------------------------------------------------------------------------------- /suites/base-case-sketch/sketches/list_map.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | zero : Nat -> Nat 10 | zero n = 11 | Z () 12 | 13 | inc : Nat -> Nat 14 | inc n = 15 | S n 16 | 17 | listMap : (Nat -> Nat) -> NatList -> NatList 18 | listMap f = 19 | let 20 | listMapFix : NatList -> NatList 21 | listMapFix xs = 22 | case xs of 23 | Nil _ -> 24 | Nil () 25 | 26 | Cons p -> 27 | ?? 28 | in 29 | listMapFix 30 | -------------------------------------------------------------------------------- /suites/myth/sketches/.list_compress.elm: -------------------------------------------------------------------------------- 1 | type Nat 2 | = Z () 3 | | S Nat 4 | 5 | type NatList 6 | = Nil () 7 | | Cons (Nat, NatList) 8 | 9 | type Cmp 10 | = LT () 11 | | EQ () 12 | | GT () 13 | 14 | compare : Nat -> Nat -> Cmp 15 | compare n1 n2 = 16 | case n1 of 17 | Z _ -> 18 | case n2 of 19 | Z _ -> EQ () 20 | S _ -> LT () 21 | S m1 -> 22 | case n2 of 23 | Z _ -> GT () 24 | S m2 -> compare m1 m2 25 | 26 | compress : NatList -> NatList 27 | compress xs = 28 | ?? 29 | -------------------------------------------------------------------------------- /suites/myth/sketches/tree_collect_leaves.elm: -------------------------------------------------------------------------------- 1 | type Boolean 2 | = F () 3 | | T () 4 | 5 | type BooleanTree 6 | = Leaf () 7 | | Node (BooleanTree, Boolean, BooleanTree) 8 | 9 | type BooleanList 10 | = Nil () 11 | | Cons (Boolean, BooleanList) 12 | 13 | append : BooleanList -> BooleanList -> BooleanList 14 | append l1 l2 = 15 | case l1 of 16 | Nil _ -> 17 | l2 18 | Cons p -> 19 | Cons (#2.1 p, append (#2.2 p) l2) 20 | 21 | treeCollectLeaves : BooleanTree -> BooleanList 22 | treeCollectLeaves tree = 23 | ?? 24 | -------------------------------------------------------------------------------- /forge: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ -f forge_temp_file ]]; then 4 | echo "Forge temp file already exists." 5 | exit 1 6 | fi 7 | 8 | if [[ $# -ne 3 ]]; then 9 | echo "usage:" $0 " " 10 | exit 1 11 | fi 12 | 13 | DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" 14 | 15 | cat \ 16 | $DIR/suites/$2/sketches/$3.elm \ 17 | $DIR/suites/$2/examples/$3.elm \ 18 | > $DIR/forge_temp_file 19 | 20 | $DIR/smyth forge $DIR/forge_temp_file --show=$1 21 | 22 | rm $DIR/forge_temp_file 23 | -------------------------------------------------------------------------------- /src/denotation.mli: -------------------------------------------------------------------------------- 1 | open Smyth 2 | open Lang 3 | 4 | type 'a t = 5 | ('a -> exp) * typ 6 | 7 | val bool : bool t 8 | 9 | val int : int t 10 | 11 | val var : string t 12 | 13 | val opt : 'a t -> 'a option t 14 | 15 | val list : 'a t -> 'a list t 16 | 17 | val nested_list : 'a t -> 'a list list t 18 | 19 | val tree : 'a t -> 'a Tree2.t t 20 | 21 | val args2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t 22 | 23 | val args3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t 24 | 25 | val mono : 'a t -> 'a -> exp 26 | 27 | val poly : 'a t -> 'a -> exp 28 | -------------------------------------------------------------------------------- /lib/smyth/refine.mli: -------------------------------------------------------------------------------- 1 | (** Type-and-example-directed refinement, as defined in {b Figure 9} of the 2 | ICFP 2020 paper. *) 3 | 4 | open Lang 5 | 6 | val refine : 7 | hole_ctx 8 | -> datatype_ctx 9 | -> synthesis_goal 10 | -> (exp * fill_goal list) option 11 | (** [refine delta sigma goal] splits the synthesis goal [goal] into subgoals 12 | based on type-and-example-directed refinement. 13 | 14 | Type-and-example-directed refinement is deterministic but may fail; 15 | hence, this function returns an {!option}. *) 16 | -------------------------------------------------------------------------------- /specifications/mono/list_nth.elm: -------------------------------------------------------------------------------- 1 | specifyFunction2 listNth 2 | [ ([], 0, 0) 3 | , ([2], 0, 2) 4 | , ([3, 1, 2], 1, 1) 5 | , ([2, 3], 1, 3) 6 | , ([0, 2, 0], 3, 0) 7 | , ([1, 0], 2, 0) 8 | , ([3, 3, 1], 3, 0) 9 | , ([], 1, 0) 10 | , ([3, 3], 0, 3) 11 | , ([1, 3, 3, 1], 3, 1) 12 | , ([2], 3, 0) 13 | , ([3, 0], 0, 3) 14 | , ([0, 3], 0, 0) 15 | , ([0, 0, 2, 0], 1, 0) 16 | , ([0, 2, 1, 1], 2, 1) 17 | , ([3, 0, 2, 2], 3, 2) 18 | , ([], 2, 0) 19 | , ([3, 3, 3], 1, 3) 20 | , ([2, 1, 2], 1, 1) 21 | , ([3, 1, 1], 2, 1) 22 | ] 23 | -------------------------------------------------------------------------------- /specifications/poly/list_stutter.elm: -------------------------------------------------------------------------------- 1 | specifyFunction (listStutter ) 2 | [ ([], []) 3 | , ([2, 2, 0], [2, 2, 2, 2, 0, 0]) 4 | , ([3, 1], [3, 3, 1, 1]) 5 | , ([3], [3, 3]) 6 | , ([0, 0, 0, 2], [0, 0, 0, 0, 0, 0, 2, 2]) 7 | , ([2, 0, 1, 3], [2, 2, 0, 0, 1, 1, 3, 3]) 8 | , ([0, 2, 2, 0], [0, 0, 2, 2, 2, 2, 0, 0]) 9 | , ([0], [0, 0]) 10 | , ([2, 0, 2, 2], [2, 2, 0, 0, 2, 2, 2, 2]) 11 | , ([2, 3, 2, 3], [2, 2, 3, 3, 2, 2, 3, 3]) 12 | ] 13 | --------------------------------------------------------------------------------