Skip to content

Commit ba00867

Browse files
committed
Fix bug rocq-prover#4876: critical bug in guard condition checker.
1 parent e10c9ee commit ba00867

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

checker/inductive.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,10 @@ let check_one_fix renv recpos trees def =
988988
| (Ind _ | Construct _) ->
989989
List.iter (check_rec_call renv []) l
990990

991+
| Proj (p, c) ->
992+
List.iter (check_rec_call renv []) l;
993+
check_rec_call renv [] c
994+
991995
| Var _ -> anomaly (Pp.str "Section variable in Coqchk !")
992996

993997
| Sort _ -> assert (l = [])
@@ -997,8 +1001,6 @@ let check_one_fix renv recpos trees def =
9971001

9981002
| (App _ | LetIn _ | Cast _) -> assert false (* beta zeta reduction *)
9991003

1000-
| Proj (p, c) -> check_rec_call renv [] c
1001-
10021004
and check_nested_fix_body renv decr recArgsDecrArg body =
10031005
if decr = 0 then
10041006
check_rec_call (assign_var_spec renv (1,recArgsDecrArg)) [] body

kernel/inductive.ml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1010,6 +1010,10 @@ let check_one_fix renv recpos trees def =
10101010
| (Ind _ | Construct _) ->
10111011
List.iter (check_rec_call renv []) l
10121012

1013+
| Proj (p, c) ->
1014+
List.iter (check_rec_call renv []) l;
1015+
check_rec_call renv [] c
1016+
10131017
| Var id ->
10141018
begin
10151019
match pi2 (lookup_named id renv.env) with
@@ -1028,8 +1032,6 @@ let check_one_fix renv recpos trees def =
10281032
| (Evar _ | Meta _) -> ()
10291033

10301034
| (App _ | LetIn _ | Cast _) -> assert false (* beta zeta reduction *)
1031-
1032-
| Proj (p, c) -> check_rec_call renv [] c
10331035

10341036
and check_nested_fix_body renv decr recArgsDecrArg body =
10351037
if Int.equal decr 0 then

0 commit comments

Comments
 (0)