Fix #737 by computing rec_type after adjust_sign_arity in equations.ml - #738
Open
blume0 wants to merge 1 commit into
Open
Fix #737 by computing rec_type after adjust_sign_arity in equations.ml#738blume0 wants to merge 1 commit into
rec_type after adjust_sign_arity in equations.ml#738blume0 wants to merge 1 commit into
Conversation
… in equations.ml - move the interpretation of `pre_equations` into `pre_clauses` and the call to `adjust_sign_arity` from `Covering.program_covering` to `Equations.define_by_eqs`. - compute `rec_type` data *after* adjusting the signature and the arity of the program - minor change: make `compute_fixdecls_data` take an evar_map instead of a reference since it doesn't modify it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #737.
Functions in covering.ml carry around information of type
int_data. It is computed in part in Equations.define_by_eqs and contains a fieldrec_typewhich among other things, for well-founded recursive definitions carries the data of the position at which the additional wf recursion argument should be added. This position is the length of context of the signature of the function to be defined, howerer this signature is sometimes extended when the return type is a product type. The constructed internal type of the function that is used for the fixpoint combinator uses this updated signature, making the computedrec_typeoutdated.This PR does the following:
pre_equationsintopre_clausesand the call toadjust_sign_arityfromCovering.program_coveringtoEquations.define_by_eqs.rec_typedata after adjusting the signature and the arity of the programcompute_fixdecls_datatake an evar_map instead of a reference since it doesn't modify itThere should not be any observable change in behavior apart from the rec_type now being computed with the relevant signature, because the two operations that were moved above were happening right after in
Covering.program_coveringwith the same arguments, andEquations.define_by_eqsis the only caller ofprogram_covering. This is also makes the treatement similar to the one done for local wheres inCovering.interp_wheresin which rec_type was computed after adjusting the signature.