@@ -262,8 +262,8 @@ let mkCExplVar loc id n =
262
262
CAppExpl (loc, (None , Ident (loc, id), None ), mkCHoles loc n)
263
263
let mkCLambda loc name ty t =
264
264
CLambdaN (loc, [[loc, name], Default Explicit , ty], t)
265
- let mkCLetIn loc name bo t =
266
- CLetIn (loc, (loc, name), bo, t)
265
+ let mkCLetIn loc name bo oty t =
266
+ CLetIn (loc, (loc, name), bo, oty, t)
267
267
let mkCArrow loc ty t =
268
268
CProdN (loc, [[dummy_loc,Anonymous ], Default Explicit , ty], t)
269
269
let mkCCast loc t ty = CCast (loc,t, dC ty)
@@ -1386,7 +1386,7 @@ END
1386
1386
1387
1387
let rec splay_search_pattern na = function
1388
1388
| Pattern. PApp (fp , args ) -> splay_search_pattern (na + Array. length args) fp
1389
- | Pattern. PLetIn (_ , _ , bp ) -> splay_search_pattern na bp
1389
+ | Pattern. PLetIn (_ , _ , _ , bp ) -> splay_search_pattern na bp
1390
1390
| Pattern. PRef hr -> hr, na
1391
1391
| _ -> CErrors. error " no head constant in head search pattern"
1392
1392
@@ -1587,7 +1587,7 @@ GEXTEND Gram
1587
1587
GLOBAL : closed_binder;
1588
1588
closed_binder: [
1589
1589
[ [" of" | "&" ]; c = operconstr LEVEL "99" ->
1590
- [LocalRawAssum ([! @ loc, Anonymous ], Default Explicit , c)]
1590
+ [CLocalAssum ([! @ loc, Anonymous ], Default Explicit , c)]
1591
1591
] ];
1592
1592
END
1593
1593
(* }}} *)
@@ -3381,15 +3381,15 @@ let pf_interp_ty ?(resolve_typeclasses=false) ist gl ty =
3381
3381
| a , (t , None) ->
3382
3382
let rec force_type = function
3383
3383
| GProd (l , x , k , s , t ) -> incr n_binders; GProd (l, x, k, s, force_type t)
3384
- | GLetIn (l , x , v , t ) -> incr n_binders; GLetIn (l, x, v, force_type t)
3384
+ | GLetIn (l , x , v , oty , t ) -> incr n_binders; GLetIn (l, x, v, oty , force_type t)
3385
3385
| ty -> mkRCast ty mkRType in
3386
3386
a, (force_type t, None )
3387
3387
| _ , (_ , Some ty ) ->
3388
3388
let rec force_type = function
3389
3389
| CProdN (l , abs , t ) ->
3390
3390
n_binders := ! n_binders + List. length (List. flatten (List. map pi1 abs));
3391
3391
CProdN (l, abs, force_type t)
3392
- | CLetIn (l , n , v , t ) -> incr n_binders; CLetIn (l, n, v, force_type t)
3392
+ | CLetIn (l , n , v , oty , t ) -> incr n_binders; CLetIn (l, n, v, oty , force_type t)
3393
3393
| ty -> mkCCast dummy_loc ty (mkCType dummy_loc) in
3394
3394
mk_term ' ' (force_type ty) in
3395
3395
let strip_cast (sigma , t ) =
@@ -5384,7 +5384,7 @@ type ssrbindfmt =
5384
5384
| BFvar
5385
5385
| BFdecl of int (* #xs *)
5386
5386
| BFcast (* final cast *)
5387
- | BFdef of bool (* has cast? *)
5387
+ | BFdef
5388
5388
| BFrec of bool * bool (* has struct? * has cast? *)
5389
5389
5390
5390
let rec mkBstruct i = function
@@ -5397,15 +5397,12 @@ let rec mkBstruct i = function
5397
5397
| [] -> []
5398
5398
5399
5399
let rec format_local_binders h0 bl0 = match h0, bl0 with
5400
- | BFvar :: h , LocalRawAssum ([_ , x ], _ , _ ) :: bl ->
5400
+ | BFvar :: h , CLocalAssum ([_ , x ], _ , _ ) :: bl ->
5401
5401
Bvar x :: format_local_binders h bl
5402
- | BFdecl _ :: h , LocalRawAssum (lxs , _ , t ) :: bl ->
5402
+ | BFdecl _ :: h , CLocalAssum (lxs , _ , t ) :: bl ->
5403
5403
Bdecl (List. map snd lxs, t) :: format_local_binders h bl
5404
- | BFdef false :: h , LocalRawDef ((_ , x ), v ) :: bl ->
5405
- Bdef (x, None , v) :: format_local_binders h bl
5406
- | BFdef true :: h,
5407
- LocalRawDef ((_, x), CCast (_, v, CastConv t)) :: bl ->
5408
- Bdef (x, Some t, v) :: format_local_binders h bl
5404
+ | BFdef :: h , CLocalDef ((_ , x ), v , oty ) :: bl ->
5405
+ Bdef (x, oty, v) :: format_local_binders h bl
5409
5406
| _ -> []
5410
5407
5411
5408
let rec format_constr_expr h0 c0 = match h0, c0 with
@@ -5415,12 +5412,9 @@ let rec format_constr_expr h0 c0 = match h0, c0 with
5415
5412
| BFdecl _ :: h , CLambdaN (_ , [lxs , _ , t ], c ) ->
5416
5413
let bs, c' = format_constr_expr h c in
5417
5414
Bdecl (List. map snd lxs, t) :: bs, c'
5418
- | BFdef false :: h , CLetIn (_ , (_ , x ), v , c ) ->
5415
+ | BFdef :: h , CLetIn (_ , (_ , x ), v , oty , c ) ->
5419
5416
let bs, c' = format_constr_expr h c in
5420
- Bdef (x, None , v) :: bs, c'
5421
- | BFdef true :: h , CLetIn (_ , (_ , x ), CCast (_ , v , CastConv t ), c ) ->
5422
- let bs, c' = format_constr_expr h c in
5423
- Bdef (x, Some t, v) :: bs, c'
5417
+ Bdef (x, oty, v) :: bs, c'
5424
5418
| [BFcast ], CCast (_ , c , CastConv t ) ->
5425
5419
[Bcast t], c
5426
5420
| BFrec (has_str, has_cast) :: h,
@@ -5443,10 +5437,8 @@ let rec format_glob_decl h0 d0 = match h0, d0 with
5443
5437
| Bdecl (xs , _ ) :: bs -> Bdecl (x :: xs, t) :: bs
5444
5438
| bs -> Bdecl ([x], t) :: bs
5445
5439
end
5446
- | BFdef false :: h , (x , _ , Some v , _ ) :: d ->
5440
+ | BFdef :: h , (x , _ , Some v , _ ) :: d ->
5447
5441
Bdef (x, None , v) :: format_glob_decl h d
5448
- | BFdef true :: h , (x , _ , Some (GCast (_ , v , CastConv t )), _ ) :: d ->
5449
- Bdef (x, Some t, v) :: format_glob_decl h d
5450
5442
| _ , (x , _ , None, t ) :: d ->
5451
5443
Bdecl ([x], t) :: format_glob_decl [] d
5452
5444
| _ , (x , _ , Some v , _ ) :: d ->
@@ -5465,12 +5457,9 @@ let rec format_glob_constr h0 c0 = match h0, c0 with
5465
5457
| Bdecl (xs , _ ) :: bs , c' -> Bdecl (x :: xs, t) :: bs, c'
5466
5458
| _ -> [Bdecl ([x], t)], c
5467
5459
end
5468
- | BFdef false :: h , GLetIn (_ , x , v , c ) ->
5469
- let bs, c' = format_glob_constr h c in
5470
- Bdef (x, None , v) :: bs, c'
5471
- | BFdef true :: h , GLetIn (_ , x , GCast (_ , v , CastConv t ), c ) ->
5460
+ | BFdef :: h , GLetIn (_ , x , v , oty , c ) ->
5472
5461
let bs, c' = format_glob_constr h c in
5473
- Bdef (x, Some t , v) :: bs, c'
5462
+ Bdef (x, oty , v) :: bs, c'
5474
5463
| [BFcast ], GCast (_ , c , CastConv t ) ->
5475
5464
[Bcast t], c
5476
5465
| BFrec (has_str, has_cast) :: h, GRec (_, f, _, bl, t, c)
@@ -5577,11 +5566,9 @@ ARGUMENT EXTEND ssrbinder TYPED AS ssrfwdfmt * constr PRINTED BY pr_ssrbinder
5577
5566
(FwdPose , [BFdecl n]),
5578
5567
CLambdaN (loc, [xs, Default Explicit , t], mkCHole loc) ]
5579
5568
| [ " (" ssrbvar(id) " :" lconstr(t) " :=" lconstr(v) " )" ] ->
5580
- [ let loc' = Loc. join_loc (constr_loc t) (constr_loc v) in
5581
- let v' = CCast (loc', v, dC t) in
5582
- (FwdPose ,[BFdef true ]), CLetIn (loc,bvar_lname id, v',mkCHole loc) ]
5569
+ [ (FwdPose ,[BFdef ]), CLetIn (loc,bvar_lname id, v, Some t, mkCHole loc) ]
5583
5570
| [ " (" ssrbvar(id) " :=" lconstr(v) " )" ] ->
5584
- [ (FwdPose ,[BFdef false ]), CLetIn (loc,bvar_lname id, v,mkCHole loc) ]
5571
+ [ (FwdPose ,[BFdef ]), CLetIn (loc,bvar_lname id, v, None , mkCHole loc) ]
5585
5572
END
5586
5573
5587
5574
GEXTEND Gram
@@ -5605,8 +5592,8 @@ let push_binders c2 bs =
5605
5592
CProdN (mkloc loc1, b, loop ty c bs)
5606
5593
| (_ , CLambdaN (loc1 , b , _ )) :: bs ->
5607
5594
CLambdaN (mkloc loc1, b, loop ty c bs)
5608
- | (_ , CLetIn (loc1 , x , v , _ )) :: bs ->
5609
- CLetIn (mkloc loc1, x, v, loop ty c bs)
5595
+ | (_ , CLetIn (loc1 , x , v , oty , _ )) :: bs ->
5596
+ CLetIn (mkloc loc1, x, v, oty, loop ty c bs)
5610
5597
| [] -> c
5611
5598
| _ -> anomaly " binder not a lambda nor a let in" in
5612
5599
match c2 with
@@ -5616,9 +5603,9 @@ let push_binders c2 bs =
5616
5603
5617
5604
let rec fix_binders = function
5618
5605
| (_ , CLambdaN (_ , [xs , _ , t ], _ )) :: bs ->
5619
- LocalRawAssum (xs, Default Explicit , t) :: fix_binders bs
5620
- | (_ , CLetIn (_ , x , v , _ )) :: bs ->
5621
- LocalRawDef (x, v) :: fix_binders bs
5606
+ CLocalAssum (xs, Default Explicit , t) :: fix_binders bs
5607
+ | (_ , CLetIn (_ , x , v , oty , _ )) :: bs ->
5608
+ CLocalDef (x, v, oty ) :: fix_binders bs
5622
5609
| _ -> []
5623
5610
5624
5611
let pr_ssrstruct _ _ _ = function
@@ -5784,8 +5771,8 @@ let binder_to_intro_id = List.map (function
5784
5771
| (FwdPose , [BFvar ]), CLambdaN (_,[ids,_,_],_)
5785
5772
| (FwdPose, [BFdecl _ ]), CLambdaN (_ ,[ids ,_ ,_ ],_ ) ->
5786
5773
List. map (function (_ , Name id ) -> IpatId id | _ -> IpatAnon ) ids
5787
- | (FwdPose, [BFdef _ ]), CLetIn (_ ,(_ ,Name id ),_ ,_ ) -> [IpatId id]
5788
- | (FwdPose, [BFdef _ ]), CLetIn (_ ,(_ ,Anonymous),_ ,_ ) -> [IpatAnon ]
5774
+ | (FwdPose, [BFdef]), CLetIn (_ ,(_ ,Name id ), _ ,_ ,_ ) -> [IpatId id]
5775
+ | (FwdPose, [BFdef]), CLetIn (_ ,(_ ,Anonymous), _ ,_ ,_ ) -> [IpatAnon ]
5789
5776
| _ -> anomaly " ssrbinder is not a binder" )
5790
5777
5791
5778
let pr_ssrhavefwdwbinders _ _ prt (tr ,((hpats , (fwd , hint )))) =
0 commit comments