Fix crash in restrict_fun2 on polymorphic THF unification#105
Open
Xujiangjing wants to merge 1 commit intosneeuwballen:masterfrom
Open
Fix crash in restrict_fun2 on polymorphic THF unification#105Xujiangjing wants to merge 1 commit intosneeuwballen:masterfrom
Xujiangjing wants to merge 1 commit intosneeuwballen:masterfrom
Conversation
restrict_fun2 and flex_flex_matching compute the intersection of two argument lists using T.is_bvar_i (comparing only de Bruijn index), but mk_rhs searches using T.equal (comparing index + type). In polymorphic THF problems, the same de Bruijn index can have different types across scopes, causing CCList.find_idx to return None and CCOption.get_exn to crash with Invalid_argument. Fix: use T.is_bvar_i for lookup in mk_rhs to match the intersection logic, and switch from List.map to List.filter_map to handle missing entries gracefully. Reproducer: TPTP ANA088^1.p (TH1_THM_EQU_NAR, exported from HOL Light) crashes with 'Error: invalid_argument: CCOption.get_exn' on both the Isabelle-bundled binary and GitHub HEAD. After fix, Zipperposition correctly proves the theorem in 428 iterations.
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 #104
restrict_fun2 and flex_flex_matching compute the intersection of two argument lists using T.is_bvar_i (comparing only de Bruijn index), but mk_rhs searches using T.equal (comparing index + type). In polymorphic THF problems, the same de Bruijn index can have different types across scopes, causing CCList.find_idx to return None and CCOption.get_exn to crash with Invalid_argument.
Fix: use T.is_bvar_i for lookup in mk_rhs to match the intersection logic, and switch from List.map to List.filter_map to handle missing entries gracefully.
Reproducer: TPTP ANA088^1.p (TH1_THM_EQU_NAR, exported from HOL Light) crashes with 'Error: invalid_argument: CCOption.get_exn' on both the Isabelle-bundled binary and GitHub HEAD. After fix, Zipperposition correctly proves the theorem in 428 iterations.