Skip to content

Commit 5ee800e

Browse files
committed
More unified "judgment" type
1 parent b33a9bd commit 5ee800e

File tree

82 files changed

+3050
-3296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+3050
-3296
lines changed

common/theories/BasicAst.v

+16-14
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,22 @@ Proof.
213213
eapply map_def_spec; eauto.
214214
Qed.
215215

216-
Variant typ_or_sort_ {term} := Typ (T : term) | Sort.
217-
Arguments typ_or_sort_ : clear implicits.
218-
219-
Definition typ_or_sort_map {T T'} (f: T -> T') t :=
220-
match t with
221-
| Typ T => Typ (f T)
222-
| Sort => Sort
223-
end.
224-
225-
Definition typ_or_sort_default {T A} (f: T -> A) t d :=
226-
match t with
227-
| Typ T => f T
228-
| Sort => d
229-
end.
216+
Record judgment_ {universe Term} := Judge {
217+
j_term : option Term;
218+
j_typ : Term;
219+
j_univ : option universe;
220+
(* rel : option relevance; *)
221+
}.
222+
Arguments judgment_ : clear implicits.
223+
Arguments Judge {universe Term} _ _ _.
224+
Notation Typ typ := (Judge None typ None).
225+
Notation TermTyp tm ty := (Judge (Some tm) ty None).
226+
Notation TermoptTyp tm typ := (Judge tm typ None).
227+
Notation TypUniv ty u := (Judge None ty (Some u)).
228+
Notation TermTypUniv tm ty u := (Judge (Some tm) ty (Some u)).
229+
230+
Definition judgment_map {univ T A} (f: T -> A) (j : judgment_ univ T) :=
231+
Judge (option_map f (j_term j)) (f (j_typ j)) (j_univ j) (* rel *).
230232

231233
Section Contexts.
232234
Context {term : Type}.

common/theories/Environment.v

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Module Environment (T : Term).
121121
Import T.
122122
#[global] Existing Instance subst_instance_constr.
123123

124-
Definition typ_or_sort := typ_or_sort_ term.
124+
Definition judgment := judgment_ Universe.t term.
125125

126126
(** ** Declarations *)
127127
Notation context_decl := (context_decl term).

0 commit comments

Comments
 (0)