Skip to content

A common execution path for universe restriction + universe declaration check - #19031

Merged
coqbot-app[bot] merged 3 commits into
rocq-prover:masterfrom
herbelin:master+factorization-make-univs-declare.ml
Sep 5, 2024
Merged

A common execution path for universe restriction + universe declaration check#19031
coqbot-app[bot] merged 3 commits into
rocq-prover:masterfrom
herbelin:master+factorization-make-univs-declare.ml

Conversation

@herbelin

@herbelin herbelin commented May 15, 2024

Copy link
Copy Markdown
Member

The PR redirects the calls to UState.restrict on definitions/theorems/fixpoints in declare.ml towards a reusable encapsulation make_univs of the three functions used to build monomorphic deferred, polymorphic private or regular universe restrictions (still to be done for obligations, Derive, Equations though).

In addtion to the centralization, it ensures that Set Private Universes is used when defining an opaque polymorphic non-interactive definition or fixpoint (so assuming that a sealed attribute is available).

Depends on:

@herbelin herbelin added kind: cleanup Code removal, deprecation, refactorings, etc. part: universes The universe system. needs: merge of dependency This PR depends on another PR being merged first. labels May 15, 2024
@herbelin herbelin added this to the 8.20+rc1 milestone May 15, 2024
@coqbot-app coqbot-app Bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label May 15, 2024
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label May 16, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label May 20, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from 836d873 to 384653c Compare May 20, 2024 12:41
@coqbot-app coqbot-app Bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels May 20, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label May 21, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from 384653c to c975015 Compare May 21, 2024 19:49
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label May 21, 2024
@herbelin
herbelin marked this pull request as ready for review May 21, 2024 19:49
@herbelin
herbelin requested review from a team as code owners May 21, 2024 19:49
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label May 24, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from c975015 to fbde001 Compare May 26, 2024 08:53
@coqbot-app coqbot-app Bot added needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. and removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. labels May 26, 2024
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label May 28, 2024
@proux01 proux01 removed the needs: merge of dependency This PR depends on another PR being merged first. label Jun 17, 2024
@proux01 proux01 modified the milestones: 8.20+rc1, 8.21+rc1 Jun 17, 2024
@coqbot-app

coqbot-app Bot commented Jun 27, 2024

Copy link
Copy Markdown
Contributor

The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed.

@coqbot-app coqbot-app Bot added the stale This PR will be closed unless it is rebased. label Jun 27, 2024
@herbelin herbelin changed the title Towards a common execution path for universe restriction + universe declaration check A common execution path for universe restriction + universe declaration check Jun 29, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 29, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from fbde001 to f626d99 Compare June 29, 2024 15:22
@coqbot-app coqbot-app Bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 2, 2024
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 3, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Jul 23, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from 29dfdca to ad41be4 Compare July 23, 2024 07:42
@coqbot-app coqbot-app Bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Jul 23, 2024
@coqbot-app

coqbot-app Bot commented Jul 23, 2024

Copy link
Copy Markdown
Contributor

🔴 CI failure at commit ad41be4 without any failure in the test-suite

✔️ Corresponding job for the base commit 43402d4 succeeded

❔ Ask me to try to extract a minimal test case that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following target: ci-category_theory
  • You can also pass me a specific list of targets to minimize as arguments.

@SkySkimmer

Copy link
Copy Markdown
Contributor

@coqbot ci minimize

@coqbot-app

coqbot-app Bot commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

I have initiated minimization at commit ad41be4 for the suggested target ci-category_theory as requested.

@coqbot-app

coqbot-app Bot commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

Minimized File /home/runner/work/run-coq-bug-minimizer/run-coq-bug-minimizer/builds/coq/coq-failing/_build_ci/category_theory/Lib/MapDecide.v (from ci-category_theory) (full log on GitHub Actions - verbose log)

We are collecting data on the user experience of the Coq Bug Minimizer.
If you haven't already filled the survey for this PR, please fill out our short survey!

🌟 Minimized Coq File (consider adding this file to the test-suite)
(* -*- mode: coq; coq-prog-args: ("-emacs" "-q" "-w" "-deprecated-native-compiler-option" "-native-compiler" "no" "-R" "/github/workspace/builds/coq/coq-failing/_build_ci/category_theory" "Category" "-Q" "/github/workspace/cwd" "Top" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Equations" "Equations" "-Q" "/github/workspace/builds/coq/coq-failing/_install_ci/lib/coq/user-contrib/Ltac2" "Ltac2" "-top" "Category.Lib.MapDecide") -*- *)
(* File reduced by coq-bug-minimizer from original input, then from 623 lines to 153 lines, then from 166 lines to 1050 lines, then from 1055 lines to 178 lines, then from 191 lines to 221 lines, then from 226 lines to 187 lines, then from 200 lines to 540 lines, then from 545 lines to 187 lines, then from 200 lines to 338 lines, then from 343 lines to 186 lines, then from 199 lines to 295 lines, then from 300 lines to 186 lines, then from 199 lines to 273 lines, then from 278 lines to 184 lines, then from 189 lines to 186 lines *)
(* coqc version 8.21+alpha compiled with OCaml 4.09.0
   coqtop version runner-t7b1znuaq-project-4504-concurrent-0:/builds/coq/coq/_build/default,(HEAD detached at 14d8c90519eb69) (14d8c90519eb6969fe87f3a9232e07b074dd7387)
   Expected coqc runtime on this file: 0.468 sec *)

Require Coq.FSets.FMaps.
Require Coq.Program.Program.

Axiom proof_admitted : False.
Tactic Notation "admit" := abstract case proof_admitted.

Declare Scope category_theory_scope.
Open Scope category_theory_scope.

Notation "∀  x .. y , P" := (forall x, .. (forall y, P) ..)
  (at level 200, x binder, y binder, right associativity) :
  category_theory_scope.

Notation "x → y" := (x -> y)
  (at level 99, y at level 200, right associativity): category_theory_scope.
Notation "x ≠ y" := (x <> y) (at level 70) : category_theory_scope.
Module Export Category_DOT_Lib_WRAPPED.
Module Export Lib.
#[export] Set Universe Polymorphism.
#[export] Set Uniform Inductive Parameters.
#[export] Unset Universe Minimization ToSet.

End Lib.

End Category_DOT_Lib_WRAPPED.
Module Export Category_DOT_Lib_DOT_FMapExt_WRAPPED.
Module Export FMapExt.
Import Coq.FSets.FMapFacts.

Module FMapExt (E : DecidableType) (M : WSfun E).

Module P := WProperties_fun E M.
Module F := P.F.

#[export] Hint Extern 5 =>
  match goal with
    [ H : M.MapsTo _ _ (M.empty _) |- _ ] =>
      apply F.empty_mapsto_iff in H; contradiction
  end : core.

End FMapExt.

End FMapExt.

End Category_DOT_Lib_DOT_FMapExt_WRAPPED.
Module Export Lib.
Module Export FMapExt.
Include Category_DOT_Lib_DOT_FMapExt_WRAPPED.FMapExt.
End FMapExt.

End Lib.
Import Coq.NArith.NArith.
Import Coq.FSets.FMaps.

Module PO := PairOrderedType N_as_OT N_as_OT.
Module M  := FMapList.Make(PO).
Module Import FMapExt := FMapExt PO M.

Inductive partial (P : Prop) : Set :=
| Proved : P → partial
| Uncertain : partial.

Notation "[ P ]" := (partial P) : type_scope.

Notation "'Yes'" := (Proved _ _) : partial_scope.
Notation "'No'" := (Uncertain _) : partial_scope.

#[local] Open Scope partial_scope.

Notation "'Reduce' v" := (if v then Yes else No) (at level 100) : partial_scope.
Notation "x && y" := (if x then Reduce y else No) : partial_scope.

Record environment : Set := {
  vars : positive → N
}.

Inductive term : Set :=
  | Var   : positive → term
  | Value : N → term.

Program Definition term_eq_dec (x y : term) : {x = y} + {x ≠ y} :=
  match x, y with
  | Var x,   Var y   => if Pos.eq_dec x y then left _ else right _
  | Value x, Value y => if N.eq_dec   x y then left _ else right _
  | _, _ => right _
  end.
Definition subst_all {A} (f : A → term → term → A) :
  A → list (term * term) → A.
exact (fold_right (fun '(v, v') rest => f rest v v')).
Defined.

Definition term_denote env (x : term) : N :=
  match x with
  | Var n => vars env n
  | Value n => n
  end.

Inductive map_expr : Set :=
  | Empty : map_expr
  | Add   : term → term → term → map_expr → map_expr.

Fixpoint map_expr_denote env (m : map_expr) : M.t N :=
  match m with
  | Empty => M.empty N
  | Add x y f m' => M.add (term_denote env x, term_denote env y)
                          (term_denote env  f) (map_expr_denote env m')
  end.

Inductive formula : Set :=
  | Top    : formula
  | Bottom : formula
  | Maps   : term → term → term → map_expr → formula
  | Impl   : formula → formula → formula.
Fixpoint subst_formula (t : formula) (v v' : term) : formula.
Admitted.

Fixpoint formula_denote env (t : formula) : Prop :=
  match t with
  | Top => True
  | Bottom => False
  | Maps x y f m =>
    M.MapsTo (term_denote env x, term_denote env y)
             (term_denote env f) (map_expr_denote env m)
  | Impl p q => formula_denote env p → formula_denote env q
  end.
Fixpoint formula_size (t : formula) : nat.
Admitted.
Fixpoint substitutions (xs : list (term * term)) : list (term * term).
Admitted.
Fixpoint remove_conflicts (x y f : term) (m : map_expr) : map_expr.
Admitted.

Import ListNotations.

Program Definition formula_forward (t : formula) env (hyp : formula)
        (cont : ∀ env' defs,
            [formula_denote env' (subst_all subst_formula t defs)]) :
  [formula_denote env hyp → formula_denote env t] :=
  match hyp with
  | Top => Reduce (cont env [])
  | Bottom => Yes
  | Maps x y f m =>
    let fix go n : [formula_denote env (Maps x y f n)
                    → formula_denote env t] :=
        match n with
        | Empty => Yes
        | Add x' y' f' m' =>
          cont env (substitutions [(x, x'); (y, y'); (f, f')]) && go m'
        end in Reduce (go (remove_conflicts x y f m))
  | Impl _ _ => Reduce (cont env [])
  end.
Next Obligation.
Admitted.
Next Obligation.
admit.
Defined.
Admit Obligations.

Fixpoint map_contains env (x y : N) (m : map_expr) : option term :=
  match m with
  | Empty => None
  | Add x' y' f' m' =>
    if (N.eqb x (term_denote env x') &&
        N.eqb y (term_denote env y'))%bool
    then Some f'
    else map_contains env x y m'
  end.

Program Fixpoint formula_backward (t : formula) env {measure (formula_size t)} :
  [formula_denote env t] :=
  match t with
  | Top => Yes
  | Bottom => No
  | Maps x y f m =>
    match map_contains env (term_denote env x) (term_denote env y) m with
    | Some f' => Reduce (term_eq_dec f' f)
    | None => No
    end
  | Impl p q =>
    formula_forward q env p
      (fun env' defs' => formula_backward (subst_all subst_formula q defs') env')
  end.
Admit Obligations.
🛠️ Intermediate Coq File (useful for debugging if minimization did not go as far as you wanted)
🛠️ 📜 Intermediate Coq File log (useful for debugging if minimization did not go as far as you wanted)
📜 Build Log (contains the Coq error message) (truncated to last 8.0KiB; full 3.0MiB file on GitHub Actions Artifacts under build.log)
   
0m04.58s | 413424 ko | Instance/Parallel.vo                          
0m03.86s | 400296 ko | Construction/Cayley.vo                        
0m03.82s | 383252 ko | Instance/AST.vo                               
0m03.65s | 482388 ko | Instance/Lambda.vo                            
0m03.28s | 384656 ko | Instance/Shapes.vo                            
0m03.14s | 377440 ko | Structure/Cocartesian.vo                      
0m03.01s | 439876 ko | Construction/Product/Comma.vo                 
0m03.00s | 380144 ko | Instance/Cat.vo                               
0m03.00s | 379624 ko | Theory/Functor.vo                             
0m02.93s | 376236 ko | Instance/Two/Discrete.vo                      
0m02.89s | 375948 ko | Instance/Two.vo                               
0m02.77s | 388080 ko | Structure/Monoidal/Naturality.vo              
0m02.71s | 389572 ko | Instance/Sets/Par.vo                          
0m02.69s | 448100 ko | Instance/Lambda/Exp.vo                        
0m02.57s | 396860 ko | Construction/Slice/Pullback.vo                
0m02.50s | 378240 ko | Functor/Construction/Product.vo               
0m02.39s | 379700 ko | Instance/Coq/ParE.vo                          
0m02.38s | 381408 ko | Theory/Natural/Transformation.vo              
0m02.37s | 386832 ko | Instance/Fun.vo                               
0m02.29s | 379456 ko | Functor/Strong.vo                             
0m02.14s | 395844 ko | Instance/Sets.vo                              
0m01.97s | 379472 ko | Structure/Monoidal/Braided.vo                 
0m01.90s | 379488 ko | Theory/Adjunction.vo                          
0m01.88s | 379440 ko | Structure/Monoidal/Semicartesian/Proofs.vo    
0m01.87s | 382304 ko | Instance/Fun/Cartesian.vo                     
0m01.85s | 415252 ko | Instance/Lambda/Step.vo                       
0m01.72s | 376484 ko | Functor/Hom/Internal.vo                       
0m01.67s | 412916 ko | Instance/Lambda/Full.vo                       
0m01.67s | 431144 ko | Instance/Lambda/Sub.vo                        
0m01.66s | 377812 ko | Instance/Cat/Cocartesian.vo                   
0m01.65s | 376496 ko | Structure/Monoidal/Symmetric.vo               
0m01.65s | 379176 ko | Theory/Universal/Arrow.vo                     
0m01.60s | 373140 ko | Theory/Isomorphism.vo                         
0m01.51s | 380448 ko | Functor/Traversable/Product.vo                
0m01.48s | 401112 ko | Construction/Enriched.vo                      
0m01.40s | 385504 ko | Construction/Free.vo                          
0m01.33s | 372356 ko | Adjunction/Natural/Transformation/Universal.vo
0m01.28s | 377304 ko | Functor/Structure/Monoidal/Pure.vo            
0m01.23s | 377436 ko | Functor/Hom.vo                                
0m01.21s | 376348 ko | Functor/Hom/Yoneda.vo                         
0m01.20s | 401904 ko | Instance/Lambda/Ren.vo                        
0m01.12s | 375288 ko | Functor/Structure/Monoidal/Id.vo              
0m01.12s | 369252 ko | Instance/Cat/Cartesian.vo                     
0m01.01s | 387108 ko | Construction/Free/Quiver.vo                   
0m00.99s | 373380 ko | Instance/Coq.vo                               
0m00.97s | 373704 ko | Adjunction/Diagonal/Product.vo                
0m00.97s | 369328 ko | Functor/Product/Internal.vo                   
0m00.94s | 366084 ko | Instance/Comp.vo                              
0m00.88s | 376644 ko | Instance/Ens.vo                               
0m00.85s | 363132 ko | Construction/Coproduct.vo                     
0m00.81s | 430484 ko | Lib/MapDecide.vo                              
0m00.79s | 391004 ko | Instance/Lambda/Sem.vo                        
0m00.71s | 368580 ko | Structure/Monoidal/Cartesian.vo               
0m00.66s | 370036 ko | Functor/Diagonal.vo                           
0m00.65s | 368792 ko | Construction/Subcategory.vo                   
0m00.63s | 369252 ko | Functor/Structure/Cartesian/Closed.vo         
0m00.59s | 368828 ko | Functor/Structure/Monoidal.vo                 
0m00.59s | 364192 ko | Theory/Morphisms.vo                           
0m00.58s | 367812 ko | Instance/Fact.vo                              
0m00.58s | 368940 ko | Structure/Monoidal/Cartesian/Cartesian.vo     
0m00.57s | 392720 ko | Instance/Lambda/Norm.vo                       
0m00.56s | 369172 ko | Instance/Rel.vo                               
0m00.53s | 366696 ko | Instance/Sets/Cartesian/Closed.vo             
0m00.53s | 367372 ko | Instance/Sets/Cocartesian.vo                  
0m00.52s | 367812 ko | Functor/Bifunctor.vo                          
0m00.51s | 368324 ko | Structure/Monoidal/Closed.vo                  
0m00.48s | 365280 ko | Functor/Product.vo                            
0m00.45s | 367192 ko | Construction/Product.vo                       
0m00.41s | 366296 ko | Instance/Cones.vo                             
0m00.40s | 366964 ko | Theory/Naturality.vo                          
0m00.39s | 368268 ko | Functor/Structure/Cartesian.vo                
0m00.39s | 386800 ko | Instance/Lambda/Example.vo                    
0m00.39s | 389280 ko | Instance/Lambda/Multi.vo                      
0m00.39s | 366052 ko | Instance/Sets/Cartesian.vo                    
0m00.38s | 365996 ko | Functor/Coproduct.vo                          
0m00.38s | 378376 ko | Instance/Lambda/Value.vo                      
0m00.35s | 388412 ko | Instance/Lambda/Log.vo                        
0m00.33s | 390052 ko | Instance/Lambda/Sound.vo                      
0m00.33s | 366412 ko | Structure/Cone.vo                             
0m00.32s | 369704 ko | Instance/Props.vo                             
0m00.30s | 366776 ko | Structure/Limit.vo                            
0m00.28s | 361816 ko | Construction/Opposite.vo                      
0m00.27s | 342740 ko | Structure/Monoidal.vo                         
0m00.26s | 316008 ko | Instance/Coq/Monad.vo                         
0m00.26s | 309824 ko | Instance/One.vo                               
0m00.26s | 323320 ko | Instance/Zero.vo                              
0m00.25s | 299444 ko | Adjunction/Natural/Transformation/Opposite.vo 
0m00.25s | 321012 ko | Construction/Groupoid.vo                      
0m00.23s | 256016 ko | Structure/Monoidal/Semicartesian.vo           
0m00.18s | 186420 ko | Instance/Coq/Applicative.vo                   
0m00.18s | 183416 ko | Instance/One/Diagonal.vo                      
0m00.18s | 204016 ko | Structure/Monoidal/Balanced.vo                
0m00.18s | 200436 ko | Theory/Sheaf.vo                               
0m00.17s | 179636 ko | Adjunction/Opposite.vo                        
0m00.17s | 175660 ko | Functor/Applicative.vo                        
0m00.17s | 166712 ko | Natural/Transformation/Applicative.vo         
0m00.17s | 170516 ko | Natural/Transformation/Monoidal.vo            
0m00.17s | 162600 ko | Natural/Transformation/Strong.vo              
0m00.17s | 167528 ko | Theory/Monad.vo                               
0m00.16s | 162684 ko | Adjunction/Natural/Transformation.vo          
0m00.16s | 151600 ko | Construction/Arrow.vo                         
0m00.16s | 162764 ko | Functor/Opposite.vo                           
0m00.16s | 156292 ko | Functor/Representable.vo                      
0m00.16s | 153544 ko | Functor/Structure/Constant.vo                 
0m00.16s | 155696 ko | Functor/Structure/Terminal.vo                 
0m00.16s | 155124 ko | Instance/Cones/Limit.vo                       
0m00.16s | 160708 ko | Instance/StrictCat.vo                         
0m00.16s | 155644 ko | Lib/Tactics2.vo                               
0m00.16s | 148168 ko | Structure/Distributive.vo                     
0m00.16s | 151916 ko | Structure/Pullback.vo                         
0m00.15s | 143304 ko | Instance/Poset.vo                             
0m00.15s | 138812 ko | Structure/Constant.vo                         
0m00.15s | 144996 ko | Structure/Initial.vo                          
0m00.15s | 143456 ko | Structure/Terminal.vo                         
0m00.15s | 136928 ko | Theory/Coq/Monoid.vo                          
+ '[' '' ']'
+ exit 2
make: *** [Makefile.ci:191: ci-category_theory] Error 2
/github/workspace/builds/coq /github/workspace
::endgroup::
📜 🔎 Minimization Log (truncated to last 8.0KiB; full 370KiB file on GitHub Actions Artifacts under bug.log)
la t defs)]
x : term
y : term
f : term
m : map_expr
Heq_hyp : Maps x y f m = hyp
go :
  ∀ n : map_expr, [formula_denote env (Maps x y f n) → formula_denote env t]
n : map_expr
program_branch_0 := fun Heq_n : Empty = n => Yes :
  Empty = n → [formula_denote env (Maps x y f Empty) → formula_denote env t]
x' : term
y' : term
f' : term
m' : map_expr
x'0 := x' : term
y'0 := y' : term
f'0 := f' : term
m'0 := m' : map_expr
Heq_n : Add x'0 y'0 f'0 m'0 = n
f0 :
  formula_denote env
    (subst_all subst_formula t (substitutions [(x, x'0); (y, y'0); (f, f'0)]))
f1 : formula_denote env (Maps x y f m'0) → formula_denote env t
Recursive call to go has not enough arguments.
Recursive definition is:
"fun n : map_expr =>
 let program_branch_0 := fun Heq_n : Empty = n => Yes in
 let program_branch_1 :=
   fun (x' y' f' : term) (m' : map_expr) (Heq_n : Add x' y' f' m' = n) =>
   match cont env (substitutions [(x, x'); (y, y'); (f, f')]) with
   | Proved _ x0 => match go m' with
                    | Proved _ x1 => Yes
                    | No => No
                    end
   | No => No
   end in
 match
   n as n'
   return
     (n' = n → [formula_denote env (Maps x y f n') → formula_denote env t])
 with
 | Empty => program_branch_0
 | Add x' y' f' m' => program_branch_1 x' y' f' m'
 end eq_refl".


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting Obligations unsuccessful.
No successful changes.

I will now attempt to admit lemmas with Admitted
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with Admitted

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmpgzlcz47q/Category/Lib/MapDecide.v", line 73, characters 0-49:
Warning: Declaring a scope implicitly is deprecated; use in advance an
explicit "Declare Scope partial_scope.".
[undeclared-scope,deprecated-since-8.10,deprecated,default]
File "/tmp/tmpgzlcz47q/Category/Lib/MapDecide.v", line 163, characters 0-18:
Error:
Recursive definition of go is ill-formed.
In environment
t : formula
env : environment
hyp : formula
cont :
  ∀ (env' : environment) (defs : list (term * term)),
  [formula_denote env' (subst_all subst_formula t defs)]
x : term
y : term
f : term
m : map_expr
Heq_hyp : Maps x y f m = hyp
go :
  ∀ n : map_expr, [formula_denote env (Maps x y f n) → formula_denote env t]
n : map_expr
program_branch_0 := fun Heq_n : Empty = n => Yes :
  Empty = n → [formula_denote env (Maps x y f Empty) → formula_denote env t]
x' : term
y' : term
f' : term
m' : map_expr
x'0 := x' : term
y'0 := y' : term
f'0 := f' : term
m'0 := m' : map_expr
Heq_n : Add x'0 y'0 f'0 m'0 = n
f0 :
  formula_denote env
    (subst_all subst_formula t (substitutions [(x, x'0); (y, y'0); (f, f'0)]))
f1 : formula_denote env (Maps x y f m'0) → formula_denote env t
Recursive call to go has not enough arguments.
Recursive definition is:
"fun n : map_expr =>
 let program_branch_0 := fun Heq_n : Empty = n => Yes in
 let program_branch_1 :=
   fun (x' y' f' : term) (m' : map_expr) (Heq_n : Add x' y' f' m' = n) =>
   match cont env (substitutions [(x, x'); (y, y'); (f, f')]) with
   | Proved _ x0 => match go m' with
                    | Proved _ x1 => Yes
                    | No => No
                    end
   | No => No
   end in
 match
   n as n'
   return
     (n' = n → [formula_denote env (Maps x y f n') → formula_denote env t])
 with
 | Empty => program_branch_0
 | Add x' y' f' m' => program_branch_1 x' y' f' m'
 end eq_refl".


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to admit lemmas with admit. Defined
�[92m
Admitting lemmas successful.�[0m
Failed to do everything at once; trying one at a time.
Admitting lemmas unsuccessful.
No successful changes.

I will now attempt to admit definitions with admit. Defined

Non-fatal error: Failed to admit definitions and preserve the error.  
The new error was:
File "/tmp/tmpvsht0yoa/Category/Lib/MapDecide.v", line 73, characters 0-49:
Warning: Declaring a scope implicitly is deprecated; use in advance an
explicit "Declare Scope partial_scope.".
[undeclared-scope,deprecated-since-8.10,deprecated,default]
File "/tmp/tmpvsht0yoa/Category/Lib/MapDecide.v", line 165, characters 0-18:
Error:
Recursive definition of go is ill-formed.
In environment
t : formula
env : environment
hyp : formula
cont :
  ∀ (env' : environment) (defs : list (term * term)),
  [formula_denote env' (subst_all subst_formula t defs)]
x : term
y : term
f : term
m : map_expr
Heq_hyp : Maps x y f m = hyp
go :
  ∀ n : map_expr, [formula_denote env (Maps x y f n) → formula_denote env t]
n : map_expr
program_branch_0 := fun Heq_n : Empty = n => Yes :
  Empty = n → [formula_denote env (Maps x y f Empty) → formula_denote env t]
x' : term
y' : term
f' : term
m' : map_expr
x'0 := x' : term
y'0 := y' : term
f'0 := f' : term
m'0 := m' : map_expr
Heq_n : Add x'0 y'0 f'0 m'0 = n
f0 :
  formula_denote env
    (subst_all subst_formula t (substitutions [(x, x'0); (y, y'0); (f, f'0)]))
f1 : formula_denote env (Maps x y f m'0) → formula_denote env t
Recursive call to go has not enough arguments.
Recursive definition is:
"fun n : map_expr =>
 let program_branch_0 := fun Heq_n : Empty = n => Yes in
 let program_branch_1 :=
   fun (x' y' f' : term) (m' : map_expr) (Heq_n : Add x' y' f' m' = n) =>
   match cont env (substitutions [(x, x'); (y, y'); (f, f')]) with
   | Proved _ x0 => match go m' with
                    | Proved _ x1 => Yes
                    | No => No
                    end
   | No => No
   end in
 match
   n as n'
   return
     (n' = n → [formula_denote env (Maps x y f n') → formula_denote env t])
 with
 | Empty => program_branch_0
 | Add x' y' f' m' => program_branch_1 x' y' f' m'
 end eq_refl".


�[93mIntermediate code not saved.�[0m
Failed to do everything at once; trying one at a time.
Admitting definitions unsuccessful.
No successful changes.

I will now attempt to export modules
Module exportation unsuccessful.

I will now attempt to split imports and exports
Import/Export splitting unsuccessful.

I will now attempt to split := definitions
One-line definition splitting unsuccessful.

I will now attempt to remove all lines, one at a time
Line removal unsuccessful.

I will now attempt to remove goals ending in [Abort.]
�[92m
Aborted removal successful.�[0m

I will now attempt to remove unused Ltacs
�[92m
Ltac removal successful.�[0m

I will now attempt to remove unused definitions

Non-fatal error: Failed to remove definitions and preserve the error.  
The new error was:
File "/tmp/tmp3xmxsggt/Category/Lib/MapDecide.v", line 73, characters 0-49:
Warning: Declaring a scope implicitly is deprecated; use in advance an
explicit "Declare Scope partial_scope.".
[undeclared-scope,deprecated-since-8.10,deprecated,default]
File "/tmp/tmp3xmxsggt/Category/Lib/MapDecide.v", line 90, characters 0-16:
Error: No obligations remaining


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused non-instance, non-canonical structure definitions

Non-fatal error: Failed to remove non-instance definitions and preserve the error.  
The new error was:
File "/tmp/tmp3xmxsggt/Category/Lib/MapDecide.v", line 73, characters 0-49:
Warning: Declaring a scope implicitly is deprecated; use in advance an
explicit "Declare Scope partial_scope.".
[undeclared-scope,deprecated-since-8.10,deprecated,default]
File "/tmp/tmp3xmxsggt/Category/Lib/MapDecide.v", line 90, characters 0-16:
Error: No obligations remaining


�[93mIntermediate code not saved.�[0m

I will now attempt to remove unused variables
�[92m
Variable removal successful.�[0m

I will now attempt to remove unused contexts
�[92m
Context removal successful.�[0m

I will now attempt to remove empty sections

No empty sections to remove.

Now, I will attempt to strip repeated newlines and trailing spaces from this file...
�[92m
Succeeded in stripping newlines and spaces.�[0m

If you have any comments on your experience of the minimizer, please share them in a reply (possibly tagging @JasonGross).
If you believe there's a bug in the bug minimizer, please report it on the bug minimizer issue tracker.

@herbelin

Copy link
Copy Markdown
Member Author

The category_theory failure is due to the hook receiving the unrestricted uctx instead of the restricted one (in declare_definition_core of the second commit). Will double-check that this is done in all cases of application of a hook (i.e. also declare_possibly_mutual_definition).

@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 25, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Jul 26, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from ad41be4 to db327ce Compare July 26, 2024 12:26
@coqbot-app coqbot-app Bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. request: full CI Use this label when you want your next push to trigger a full CI. labels Jul 26, 2024
herbelin added 2 commits July 26, 2024 15:43
…efinitions and fixpoints.

Note: That would require a "sealed" attribute to be observed (as in CEP rocq-prover#42).
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Jul 26, 2024
@herbelin
herbelin force-pushed the master+factorization-make-univs-declare.ml branch from db327ce to 832aeb9 Compare July 26, 2024 13:56
@coqbot-app coqbot-app Bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Jul 26, 2024
@herbelin

Copy link
Copy Markdown
Member Author

I fixed the ustate for the hook in prepare_definition and CI is green.

@herbelin

Copy link
Copy Markdown
Member Author

This PR is a priori ready. Looking for a reviewer.

@SkySkimmer SkySkimmer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems ok

@SkySkimmer SkySkimmer self-assigned this Sep 5, 2024
@SkySkimmer

Copy link
Copy Markdown
Contributor

@coqbot merge now

@coqbot-app
coqbot-app Bot merged commit 9c1e8bd into rocq-prover:master Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: cleanup Code removal, deprecation, refactorings, etc. part: universes The universe system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants