Skip to content

Commit

Permalink
Refine definition of what it is to be a vacuous pattern
Browse files Browse the repository at this point in the history
Now, the code no longer classifies

  ([], []) => []

as vacuous.
  • Loading branch information
mn200 committed Feb 25, 2022
1 parent c600864 commit 56dc1e0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/boss/theory_tests/onelineScript.sml
Expand Up @@ -140,6 +140,6 @@ Definition test_def:
End

Theorem oneline_test[local] = DefnBase.one_line_ify NONE test_def

val _ = assert is_oneline oneline_test

val _ = export_theory();
2 changes: 2 additions & 0 deletions src/coretypes/DefnBase.sml
Expand Up @@ -468,8 +468,10 @@ fun one_line_ify heuristic def =
let
fun test ((_, args), bod) =
let val pat = List.nth(args, cnum)
val (_, args_of) = strip_comb pat
in
not (is_var pat) andalso
List.all is_var args_of andalso
null (op_intersect aconv (free_vars bod) (free_vars pat))
end
in
Expand Down

0 comments on commit 56dc1e0

Please sign in to comment.