@@ -249,8 +249,8 @@ let mkCExplVar loc id n =
249
249
CAppExpl (loc, (None , Ident (loc, id), None ), mkCHoles loc n)
250
250
let mkCLambda loc name ty t =
251
251
CLambdaN (loc, [[loc, name], Default Explicit , ty], t)
252
- let mkCLetIn loc name bo t =
253
- CLetIn (loc, (loc, name), bo, t)
252
+ let mkCLetIn loc name bo oty t =
253
+ CLetIn (loc, (loc, name), bo, oty, t)
254
254
let mkCArrow loc ty t =
255
255
CProdN (loc, [[dummy_loc,Anonymous ], Default Explicit , ty], t)
256
256
let mkCCast loc t ty = CCast (loc,t, dC ty)
@@ -1359,7 +1359,7 @@ END
1359
1359
1360
1360
let rec splay_search_pattern na = function
1361
1361
| Pattern. PApp (fp , args ) -> splay_search_pattern (na + Array. length args) fp
1362
- | Pattern. PLetIn (_ , _ , bp ) -> splay_search_pattern na bp
1362
+ | Pattern. PLetIn (_ , _ , _ , bp ) -> splay_search_pattern na bp
1363
1363
| Pattern. PRef hr -> hr, na
1364
1364
| _ -> CErrors. error " no head constant in head search pattern"
1365
1365
@@ -1556,7 +1556,7 @@ GEXTEND Gram
1556
1556
GLOBAL : closed_binder;
1557
1557
closed_binder: [
1558
1558
[ [" of" | "&" ]; c = operconstr LEVEL "99" ->
1559
- [LocalRawAssum ([! @ loc, Anonymous ], Default Explicit , c)]
1559
+ [CLocalAssum ([! @ loc, Anonymous ], Default Explicit , c)]
1560
1560
] ];
1561
1561
END
1562
1562
(* }}} *)
@@ -3343,15 +3343,15 @@ let pf_interp_ty ?(resolve_typeclasses=false) ist gl ty =
3343
3343
| a , (t , None) ->
3344
3344
let rec force_type = function
3345
3345
| GProd (l , x , k , s , t ) -> incr n_binders; GProd (l, x, k, s, force_type t)
3346
- | GLetIn (l , x , v , t ) -> incr n_binders; GLetIn (l, x, v, force_type t)
3346
+ | GLetIn (l , x , v , oty , t ) -> incr n_binders; GLetIn (l, x, v, oty , force_type t)
3347
3347
| ty -> mkRCast ty mkRType in
3348
3348
a, (force_type t, None )
3349
3349
| _ , (_ , Some ty ) ->
3350
3350
let rec force_type = function
3351
3351
| CProdN (l , abs , t ) ->
3352
3352
n_binders := ! n_binders + List. length (List. flatten (List. map pi1 abs));
3353
3353
CProdN (l, abs, force_type t)
3354
- | CLetIn (l , n , v , t ) -> incr n_binders; CLetIn (l, n, v, force_type t)
3354
+ | CLetIn (l , n , v , oty , t ) -> incr n_binders; CLetIn (l, n, v, oty , force_type t)
3355
3355
| ty -> mkCCast dummy_loc ty (mkCType dummy_loc) in
3356
3356
mk_term ' ' (force_type ty) in
3357
3357
let strip_cast (sigma , t ) =
@@ -5308,7 +5308,7 @@ type ssrbindfmt =
5308
5308
| BFvar
5309
5309
| BFdecl of int (* #xs *)
5310
5310
| BFcast (* final cast *)
5311
- | BFdef of bool (* has cast? *)
5311
+ | BFdef
5312
5312
| BFrec of bool * bool (* has struct? * has cast? *)
5313
5313
5314
5314
let rec mkBstruct i = function
@@ -5321,15 +5321,12 @@ let rec mkBstruct i = function
5321
5321
| [] -> []
5322
5322
5323
5323
let rec format_local_binders h0 bl0 = match h0, bl0 with
5324
- | BFvar :: h , LocalRawAssum ([_ , x ], _ , _ ) :: bl ->
5324
+ | BFvar :: h , CLocalAssum ([_ , x ], _ , _ ) :: bl ->
5325
5325
Bvar x :: format_local_binders h bl
5326
- | BFdecl _ :: h , LocalRawAssum (lxs , _ , t ) :: bl ->
5326
+ | BFdecl _ :: h , CLocalAssum (lxs , _ , t ) :: bl ->
5327
5327
Bdecl (List. map snd lxs, t) :: format_local_binders h bl
5328
- | BFdef false :: h , LocalRawDef ((_ , x ), v ) :: bl ->
5329
- Bdef (x, None , v) :: format_local_binders h bl
5330
- | BFdef true :: h,
5331
- LocalRawDef ((_, x), CCast (_, v, CastConv t)) :: bl ->
5332
- Bdef (x, Some t, v) :: format_local_binders h bl
5328
+ | BFdef :: h , CLocalDef ((_ , x ), v , oty ) :: bl ->
5329
+ Bdef (x, oty, v) :: format_local_binders h bl
5333
5330
| _ -> []
5334
5331
5335
5332
let rec format_constr_expr h0 c0 = match h0, c0 with
@@ -5339,12 +5336,9 @@ let rec format_constr_expr h0 c0 = match h0, c0 with
5339
5336
| BFdecl _ :: h , CLambdaN (_ , [lxs , _ , t ], c ) ->
5340
5337
let bs, c' = format_constr_expr h c in
5341
5338
Bdecl (List. map snd lxs, t) :: bs, c'
5342
- | BFdef false :: h , CLetIn (_ , (_ , x ), v , c ) ->
5339
+ | BFdef :: h , CLetIn (_ , (_ , x ), v , oty , c ) ->
5343
5340
let bs, c' = format_constr_expr h c in
5344
- Bdef (x, None , v) :: bs, c'
5345
- | BFdef true :: h , CLetIn (_ , (_ , x ), CCast (_ , v , CastConv t ), c ) ->
5346
- let bs, c' = format_constr_expr h c in
5347
- Bdef (x, Some t, v) :: bs, c'
5341
+ Bdef (x, oty, v) :: bs, c'
5348
5342
| [BFcast ], CCast (_ , c , CastConv t ) ->
5349
5343
[Bcast t], c
5350
5344
| BFrec (has_str, has_cast) :: h,
@@ -5367,10 +5361,8 @@ let rec format_glob_decl h0 d0 = match h0, d0 with
5367
5361
| Bdecl (xs , _ ) :: bs -> Bdecl (x :: xs, t) :: bs
5368
5362
| bs -> Bdecl ([x], t) :: bs
5369
5363
end
5370
- | BFdef false :: h , (x , _ , Some v , _ ) :: d ->
5364
+ | BFdef :: h , (x , _ , Some v , _ ) :: d ->
5371
5365
Bdef (x, None , v) :: format_glob_decl h d
5372
- | BFdef true :: h , (x , _ , Some (GCast (_ , v , CastConv t )), _ ) :: d ->
5373
- Bdef (x, Some t, v) :: format_glob_decl h d
5374
5366
| _ , (x , _ , None, t ) :: d ->
5375
5367
Bdecl ([x], t) :: format_glob_decl [] d
5376
5368
| _ , (x , _ , Some v , _ ) :: d ->
@@ -5389,12 +5381,9 @@ let rec format_glob_constr h0 c0 = match h0, c0 with
5389
5381
| Bdecl (xs , _ ) :: bs , c' -> Bdecl (x :: xs, t) :: bs, c'
5390
5382
| _ -> [Bdecl ([x], t)], c
5391
5383
end
5392
- | BFdef false :: h , GLetIn (_ , x , v , c ) ->
5393
- let bs, c' = format_glob_constr h c in
5394
- Bdef (x, None , v) :: bs, c'
5395
- | BFdef true :: h , GLetIn (_ , x , GCast (_ , v , CastConv t ), c ) ->
5384
+ | BFdef :: h , GLetIn (_ , x , v , oty , c ) ->
5396
5385
let bs, c' = format_glob_constr h c in
5397
- Bdef (x, Some t , v) :: bs, c'
5386
+ Bdef (x, oty , v) :: bs, c'
5398
5387
| [BFcast ], GCast (_ , c , CastConv t ) ->
5399
5388
[Bcast t], c
5400
5389
| BFrec (has_str, has_cast) :: h, GRec (_, f, _, bl, t, c)
@@ -5501,11 +5490,9 @@ ARGUMENT EXTEND ssrbinder TYPED AS ssrfwdfmt * constr PRINTED BY pr_ssrbinder
5501
5490
(FwdPose , [BFdecl n]),
5502
5491
CLambdaN (loc, [xs, Default Explicit , t], mkCHole loc) ]
5503
5492
| [ " (" ssrbvar(id) " :" lconstr(t) " :=" lconstr(v) " )" ] ->
5504
- [ let loc' = Loc. join_loc (constr_loc t) (constr_loc v) in
5505
- let v' = CCast (loc', v, dC t) in
5506
- (FwdPose ,[BFdef true ]), CLetIn (loc,bvar_lname id, v',mkCHole loc) ]
5493
+ [ (FwdPose ,[BFdef ]), CLetIn (loc,bvar_lname id, v, Some t, mkCHole loc) ]
5507
5494
| [ " (" ssrbvar(id) " :=" lconstr(v) " )" ] ->
5508
- [ (FwdPose ,[BFdef false ]), CLetIn (loc,bvar_lname id, v,mkCHole loc) ]
5495
+ [ (FwdPose ,[BFdef ]), CLetIn (loc,bvar_lname id, v, None , mkCHole loc) ]
5509
5496
END
5510
5497
5511
5498
GEXTEND Gram
@@ -5529,8 +5516,8 @@ let push_binders c2 bs =
5529
5516
CProdN (mkloc loc1, b, loop ty c bs)
5530
5517
| (_ , CLambdaN (loc1 , b , _ )) :: bs ->
5531
5518
CLambdaN (mkloc loc1, b, loop ty c bs)
5532
- | (_ , CLetIn (loc1 , x , v , _ )) :: bs ->
5533
- CLetIn (mkloc loc1, x, v, loop ty c bs)
5519
+ | (_ , CLetIn (loc1 , x , v , oty , _ )) :: bs ->
5520
+ CLetIn (mkloc loc1, x, v, oty, loop ty c bs)
5534
5521
| [] -> c
5535
5522
| _ -> anomaly " binder not a lambda nor a let in" in
5536
5523
match c2 with
@@ -5540,9 +5527,9 @@ let push_binders c2 bs =
5540
5527
5541
5528
let rec fix_binders = function
5542
5529
| (_ , CLambdaN (_ , [xs , _ , t ], _ )) :: bs ->
5543
- LocalRawAssum (xs, Default Explicit , t) :: fix_binders bs
5544
- | (_ , CLetIn (_ , x , v , _ )) :: bs ->
5545
- LocalRawDef (x, v) :: fix_binders bs
5530
+ CLocalAssum (xs, Default Explicit , t) :: fix_binders bs
5531
+ | (_ , CLetIn (_ , x , v , oty , _ )) :: bs ->
5532
+ CLocalDef (x, v, oty ) :: fix_binders bs
5546
5533
| _ -> []
5547
5534
5548
5535
let pr_ssrstruct _ _ _ = function
@@ -5708,8 +5695,8 @@ let binder_to_intro_id = List.map (function
5708
5695
| (FwdPose , [BFvar ]), CLambdaN (_,[ids,_,_],_)
5709
5696
| (FwdPose, [BFdecl _ ]), CLambdaN (_ ,[ids ,_ ,_ ],_ ) ->
5710
5697
List. map (function (_ , Name id ) -> IpatId id | _ -> IpatAnon ) ids
5711
- | (FwdPose, [BFdef _ ]), CLetIn (_ ,(_ ,Name id ),_ ,_ ) -> [IpatId id]
5712
- | (FwdPose, [BFdef _ ]), CLetIn (_ ,(_ ,Anonymous),_ ,_ ) -> [IpatAnon ]
5698
+ | (FwdPose, [BFdef]), CLetIn (_ ,(_ ,Name id ), _ ,_ ,_ ) -> [IpatId id]
5699
+ | (FwdPose, [BFdef]), CLetIn (_ ,(_ ,Anonymous), _ ,_ ,_ ) -> [IpatAnon ]
5713
5700
| _ -> anomaly " ssrbinder is not a binder" )
5714
5701
5715
5702
let pr_ssrhavefwdwbinders _ _ prt (tr ,((hpats , (fwd , hint )))) =
0 commit comments