Group all operations on subterms in a single module, simplify on_branches#21681
Group all operations on subterms in a single module, simplify on_branches#21681yannl35133 wants to merge 2 commits intorocq-prover:masterfrom
Conversation
a9ad8a1 to
e46d06f
Compare
e46d06f to
2090263
Compare
yannl35133
left a comment
There was a problem hiding this comment.
I split off the reimplementation of tree/automaton pruning since it is more difficult to write and to review. This should not change behaviour.
| val is_norec : t -> bool | ||
| val is_inductive : env -> inductive -> t -> bool | ||
| val is_primitive : env -> Constant.t -> t -> bool | ||
| val is_primitive_positive_container : env -> Constant.t -> t -> bool |
There was a problem hiding this comment.
If you want a faithful name this should rather be is_primitive_array, I find your choice extremely verbose.
There was a problem hiding this comment.
Not my choice, it's already used in get_recargs_approx. Plus it should be about more than arrays, but less than all primitives.
2090263 to
6f67e5f
Compare
| val is_norec : t -> bool | ||
| val is_inductive : env -> inductive -> t -> bool | ||
| val is_primitive : env -> Constant.t -> t -> bool | ||
| val is_primitive_positive_container : env -> Constant.t -> t -> bool |
There was a problem hiding this comment.
Not my choice, it's already used in get_recargs_approx. Plus it should be about more than arrays, but less than all primitives.
| let (ci, (p,_), _iv, c, lbr) = expand_case renv.env (ci, u, pms, p, iv, c, lbr) in | ||
| let stack' = push_stack_closures renv l stack in | ||
| let stack' = filter_stack_domain cache stack_element_specif Fun.id ?evars renv.env p stack' in | ||
| let cases_spec = | ||
| branches_specif renv (lazy_subterm_specif cache ?evars renv [] c) ci | ||
| in | ||
| let cases_spec = Subterm.on_branches renv.env ci.ci_ind (lazy_subterm_specif cache ?evars renv [] c) in | ||
| let stl = | ||
| Array.mapi (fun i br' -> | ||
| let stack_br = push_stack_args (cases_spec.(i)) stack' in | ||
| let stack_br = push_stack_args (cases_spec i) stack' in | ||
| subterm_specif cache ?evars renv stack_br br') | ||
| lbr in |
There was a problem hiding this comment.
Subterm.on_branches can stop constructing a list when this code stops needlessly expanding the case: constructor arguments should just be pushed directly in the renv, they don't need to go in the stack in the first place.
|
@coqbot bench |
No description provided.