indexvar index, i, j, n, m  ::= {{ isa nat }} {{ coq nat }} {{ hol num }} {{ lex numeral }}
  {{ com indices }} 

grammar
formula :: formula_ ::=          
  | formula1 .. formulan   :: :: dots
  | j INDEXES t1 .. tn                  ::   :: Indexesv
        {{ coq (1 <= [[j]] /\ [[j]] <= length (unmake_list't [[t1..tn]])) }}
        {{ hol (1 <= [[j]] /\ [[j]] <= LENGTH [[t1..tn]]) }}
        {{ isa (1 <= [[j]] & [[j]] <= length [[t1..tn]]) }}
  | j INDEXES T1 .. Tn                  ::   :: IndexesT
        {{ coq (1 <= [[j]] /\ [[j]] <= length (unmake_list'T [[T1..Tn]])) }}
        {{ hol (1 <= [[j]] /\ [[j]] <= LENGTH [[T1..Tn]]) }}
        {{ isa (1 <= [[j]] & [[j]] <= length [[T1..Tn]]) }}

embed
{{ coq
(*
These definitions are a hack to make [unmake_list'T] (and similarly
[unmake_list't]) work whether native lists or specific lists are
generated by ott. We use [unmake_list'T] in homs, and that should be a
function that converts from whatever type ott uses to represent lists
of [T] to standard lists of [T]. The type [list'T] is defined just so
as to express the argument type of [unmake_list'T].
*)
Definition list'T : Set. exact list_T || exact (list T). Defined.
Definition unmake_list'T : list'T -> list T.
  exact unmake_list_T || exact (fun x => x). Defined.
Definition list't : Set. exact list_t || exact (list t). Defined.
Definition unmake_list't : list't -> list t.
  exact unmake_list_t || exact (fun x => x). Defined.
}}
