Skip to content

Commit

Permalink
Merge pull request #180 from kavigupta/filter-tags
Browse files Browse the repository at this point in the history
add ability to filter tags
  • Loading branch information
mlb2251 authored Dec 7, 2023
2 parents 361467a + aa0fa84 commit 3d352e6
Show file tree
Hide file tree
Showing 8 changed files with 456 additions and 4 deletions.
91 changes: 91 additions & 0 deletions data/expected_outputs/neurosym_match_at_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
{
"cmd": "/home/kavi/mit/stitch/target/release/deps/integration_tests-782ce716bce4ad30",
"args": {
"iterations": 3,
"abstraction_prefix": "fn_",
"previous_abstractions": 0,
"shuffle": false,
"truncate": null,
"no_opt": false,
"silent": false,
"verbose_rewrite": false,
"step": {
"max_arity": 2,
"threads": 1,
"no_stats": false,
"batch": 1,
"dynamic_batch": false,
"eta_long": false,
"no_curried_metavars": false,
"no_curried_bodies": false,
"inv_candidates": 1,
"hole_choice": "DepthFirst",
"cost": {
"cost_lam": 1,
"cost_app": 1,
"cost_var": 100,
"cost_ivar": 100,
"cost_prim_default": 100
},
"no_mismatch_check": false,
"follow": null,
"follow_prune": false,
"verbose_worklist": false,
"verbose_best": false,
"print_stats": 0,
"show_rewritten": false,
"rewritten_dreamcoder": false,
"rewritten_intermediates": false,
"inv_arg_cap": false,
"allow_single_task": false,
"no_opt_single_use": false,
"no_opt_upper_bound": false,
"no_opt_force_multiuse": false,
"no_opt_useless_abstract": false,
"no_opt_arity_zero": false,
"no_other_util": false,
"structure_penalty": 1.0,
"rewrite_check": false,
"utility_by_rewrite": false,
"dreamcoder_comparison": false,
"quiet": false,
"fused_lambda_tags": {
"tags": null
}
}
},
"original_cost": 810,
"final_cost": 202,
"compression_ratio": 4.00990099009901,
"num_abstractions": 1,
"original": [
"(lam_1 (lam_2 (+ a b c)))",
"(lam_3 (lam_2 (+ a b c)))"
],
"rewritten": [
"(lam_1 fn_0)",
"(lam_3 fn_0)"
],
"rewritten_dreamcoder": null,
"abstractions": [
{
"body": "(lam_2 (+ a b c))",
"dreamcoder": "#(lambda_2 (+ a b c))",
"arity": 0,
"name": "fn_0",
"utility": 204,
"final_cost": 202,
"compression_ratio": 4.00990099009901,
"cumulative_compression_ratio": 4.00990099009901,
"num_uses": 2,
"rewritten": null,
"rewritten_dreamcoder": null,
"uses": [
{
"fn_0 ": "(lam_2 (+ a b c))"
}
],
"dc_comparison_millis": null
}
]
}
93 changes: 93 additions & 0 deletions data/expected_outputs/neurosym_match_at_tag_excluded.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"cmd": "/home/kavi/mit/stitch/target/release/deps/integration_tests-782ce716bce4ad30",
"args": {
"iterations": 3,
"abstraction_prefix": "fn_",
"previous_abstractions": 0,
"shuffle": false,
"truncate": null,
"no_opt": false,
"silent": false,
"verbose_rewrite": false,
"step": {
"max_arity": 2,
"threads": 1,
"no_stats": false,
"batch": 1,
"dynamic_batch": false,
"eta_long": false,
"no_curried_metavars": false,
"no_curried_bodies": false,
"inv_candidates": 1,
"hole_choice": "DepthFirst",
"cost": {
"cost_lam": 1,
"cost_app": 1,
"cost_var": 100,
"cost_ivar": 100,
"cost_prim_default": 100
},
"no_mismatch_check": false,
"follow": null,
"follow_prune": false,
"verbose_worklist": false,
"verbose_best": false,
"print_stats": 0,
"show_rewritten": false,
"rewritten_dreamcoder": false,
"rewritten_intermediates": false,
"inv_arg_cap": false,
"allow_single_task": false,
"no_opt_single_use": false,
"no_opt_upper_bound": false,
"no_opt_force_multiuse": false,
"no_opt_useless_abstract": false,
"no_opt_arity_zero": false,
"no_other_util": false,
"structure_penalty": 1.0,
"rewrite_check": false,
"utility_by_rewrite": false,
"dreamcoder_comparison": false,
"quiet": false,
"fused_lambda_tags": {
"tags": [
2
]
}
}
},
"original_cost": 810,
"final_cost": 204,
"compression_ratio": 3.9705882352941178,
"num_abstractions": 1,
"original": [
"(lam_1 (lam_2 (+ a b c)))",
"(lam_3 (lam_2 (+ a b c)))"
],
"rewritten": [
"(lam_1 (lam_2 fn_0))",
"(lam_3 (lam_2 fn_0))"
],
"rewritten_dreamcoder": null,
"abstractions": [
{
"body": "(+ a b c)",
"dreamcoder": "#(+ a b c)",
"arity": 0,
"name": "fn_0",
"utility": 203,
"final_cost": 204,
"compression_ratio": 3.9705882352941178,
"cumulative_compression_ratio": 3.9705882352941178,
"num_uses": 2,
"rewritten": null,
"rewritten_dreamcoder": null,
"uses": [
{
"fn_0 ": "(+ a b c)"
}
],
"dc_comparison_millis": null
}
]
}
94 changes: 94 additions & 0 deletions data/expected_outputs/neurosym_metavariable_with_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"cmd": "/home/kavi/mit/stitch/target/release/deps/integration_tests-782ce716bce4ad30",
"args": {
"iterations": 3,
"abstraction_prefix": "fn_",
"previous_abstractions": 0,
"shuffle": false,
"truncate": null,
"no_opt": false,
"silent": false,
"verbose_rewrite": false,
"step": {
"max_arity": 2,
"threads": 1,
"no_stats": false,
"batch": 1,
"dynamic_batch": false,
"eta_long": false,
"no_curried_metavars": false,
"no_curried_bodies": false,
"inv_candidates": 1,
"hole_choice": "DepthFirst",
"cost": {
"cost_lam": 1,
"cost_app": 1,
"cost_var": 100,
"cost_ivar": 100,
"cost_prim_default": 100
},
"no_mismatch_check": false,
"follow": null,
"follow_prune": false,
"verbose_worklist": false,
"verbose_best": false,
"print_stats": 0,
"show_rewritten": false,
"rewritten_dreamcoder": false,
"rewritten_intermediates": false,
"inv_arg_cap": false,
"allow_single_task": false,
"no_opt_single_use": false,
"no_opt_upper_bound": false,
"no_opt_force_multiuse": false,
"no_opt_useless_abstract": false,
"no_opt_arity_zero": false,
"no_other_util": false,
"structure_penalty": 1.0,
"rewrite_check": false,
"utility_by_rewrite": false,
"dreamcoder_comparison": false,
"quiet": false,
"fused_lambda_tags": {
"tags": null
}
}
},
"original_cost": 1214,
"final_cost": 404,
"compression_ratio": 3.004950495049505,
"num_abstractions": 1,
"original": [
"(lam_1 (+ 2 3 4 (lam_2 a) 5))",
"(lam_1 (+ 2 3 4 (lam_3 b) 5))"
],
"rewritten": [
"(fn_0 (lam_2 a))",
"(fn_0 (lam_3 b))"
],
"rewritten_dreamcoder": null,
"abstractions": [
{
"body": "(lam_1 (+ 2 3 4 #0 5))",
"dreamcoder": "#(lambda (lambda_1 (+ 2 3 4 $1 5)))",
"arity": 1,
"name": "fn_0",
"utility": 304,
"final_cost": 404,
"compression_ratio": 3.004950495049505,
"cumulative_compression_ratio": 3.004950495049505,
"num_uses": 2,
"rewritten": null,
"rewritten_dreamcoder": null,
"uses": [
{
"fn_0 (lam_2 a)": "(lam_1 (+ 2 3 4 (lam_2 a) 5))"
},
{
"fn_0 (lam_3 b)": "(lam_1 (+ 2 3 4 (lam_3 b) 5))"
}
],
"dc_comparison_millis": null
}
]
}
93 changes: 93 additions & 0 deletions data/expected_outputs/neurosym_metavariable_with_tag_excluded.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{
"cmd": "/home/kavi/mit/stitch/target/release/deps/integration_tests-782ce716bce4ad30",
"args": {
"iterations": 3,
"abstraction_prefix": "fn_",
"previous_abstractions": 0,
"shuffle": false,
"truncate": null,
"no_opt": false,
"silent": false,
"verbose_rewrite": false,
"step": {
"max_arity": 2,
"threads": 1,
"no_stats": false,
"batch": 1,
"dynamic_batch": false,
"eta_long": false,
"no_curried_metavars": false,
"no_curried_bodies": false,
"inv_candidates": 1,
"hole_choice": "DepthFirst",
"cost": {
"cost_lam": 1,
"cost_app": 1,
"cost_var": 100,
"cost_ivar": 100,
"cost_prim_default": 100
},
"no_mismatch_check": false,
"follow": null,
"follow_prune": false,
"verbose_worklist": false,
"verbose_best": false,
"print_stats": 0,
"show_rewritten": false,
"rewritten_dreamcoder": false,
"rewritten_intermediates": false,
"inv_arg_cap": false,
"allow_single_task": false,
"no_opt_single_use": false,
"no_opt_upper_bound": false,
"no_opt_force_multiuse": false,
"no_opt_useless_abstract": false,
"no_opt_arity_zero": false,
"no_other_util": false,
"structure_penalty": 1.0,
"rewrite_check": false,
"utility_by_rewrite": false,
"dreamcoder_comparison": false,
"quiet": false,
"fused_lambda_tags": {
"tags": [
2
]
}
}
},
"original_cost": 1214,
"final_cost": 608,
"compression_ratio": 1.9967105263157894,
"num_abstractions": 1,
"original": [
"(lam_1 (+ 2 3 4 (lam_2 a) 5))",
"(lam_1 (+ 2 3 4 (lam_3 b) 5))"
],
"rewritten": [
"(lam_1 (fn_0 (lam_2 a) 5))",
"(lam_1 (fn_0 (lam_3 b) 5))"
],
"rewritten_dreamcoder": null,
"abstractions": [
{
"body": "(+ 2 3 4)",
"dreamcoder": "#(+ 2 3 4)",
"arity": 0,
"name": "fn_0",
"utility": 203,
"final_cost": 608,
"compression_ratio": 1.9967105263157894,
"cumulative_compression_ratio": 1.9967105263157894,
"num_uses": 2,
"rewritten": null,
"rewritten_dreamcoder": null,
"uses": [
{
"fn_0 ": "(+ 2 3 4)"
}
],
"dc_comparison_millis": null
}
]
}
4 changes: 4 additions & 0 deletions data/neurosym/match_at_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"(lam_1 (lam_2 (+ a b c)))",
"(lam_3 (lam_2 (+ a b c)))"
]
4 changes: 4 additions & 0 deletions data/neurosym/metavariable_with_tag.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[
"(lam_1 (+ 2 3 4 (lam_2 a) 5))",
"(lam_1 (+ 2 3 4 (lam_3 b) 5))"
]
Loading

0 comments on commit 3d352e6

Please sign in to comment.