Skip to content

Fix crash in restrict_fun2 on polymorphic THF unification#105

Open
Xujiangjing wants to merge 1 commit intosneeuwballen:masterfrom
Xujiangjing:fix-unif-restrict-fun2-get-exn
Open

Fix crash in restrict_fun2 on polymorphic THF unification#105
Xujiangjing wants to merge 1 commit intosneeuwballen:masterfrom
Xujiangjing:fix-unif-restrict-fun2-get-exn

Conversation

@Xujiangjing
Copy link
Copy Markdown
Contributor

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash (CCOption.get_exn) on polymorphic THF problem ANA088^1.p

1 participant