mirror of
https://github.com/c-cube/sidekick.git
synced 2025-12-06 03:05:31 -05:00
wip: leancheck
This commit is contained in:
parent
8d70c10e18
commit
1530b761b0
1 changed files with 13 additions and 8 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
module T = Sidekick_cic_lib.Term
|
module T = Sidekick_cic_lib.Term
|
||||||
module Const = Sidekick_cic_lib.Const
|
module Const = Sidekick_cic_lib.Const
|
||||||
module Level = Sidekick_cic_lib.Level
|
module Level = Sidekick_cic_lib.Level
|
||||||
|
module Inductive = Sidekick_cic_lib.Inductive
|
||||||
|
|
||||||
let ( let@ ) = ( @@ )
|
let ( let@ ) = ( @@ )
|
||||||
|
|
||||||
|
|
@ -141,20 +142,24 @@ let process_files ~max_err (files : string list) : unit =
|
||||||
let ind ~n_params ~nidx ~tyidx ~intros ~univ_params : unit =
|
let ind ~n_params ~nidx ~tyidx ~intros ~univ_params : unit =
|
||||||
let name = Idx.get_name idx nidx in
|
let name = Idx.get_name idx nidx in
|
||||||
let ty = Idx.get_term idx tyidx in
|
let ty = Idx.get_term idx tyidx in
|
||||||
let intros =
|
let cstors =
|
||||||
List.map
|
List.map
|
||||||
(fun (i, j) -> Idx.get_name idx i, Idx.get_term idx j)
|
(fun (i, j) ->
|
||||||
|
{
|
||||||
|
Inductive.c_name = Idx.get_name idx i;
|
||||||
|
c_ty = Idx.get_term idx j;
|
||||||
|
})
|
||||||
intros
|
intros
|
||||||
in
|
in
|
||||||
let univ_params =
|
let univ_params =
|
||||||
List.map (fun i -> Idx.get_name idx i) univ_params
|
List.map (fun i -> Idx.get_name idx i) univ_params
|
||||||
in
|
in
|
||||||
Fmt.eprintf "@[<2>>> @{<Green>Ind@} %s %a:%a [%d params] :=@ %a@]@."
|
|
||||||
name
|
let spec = { Inductive.name; ty; n_params; univ_params; cstors } in
|
||||||
Fmt.Dump.(list string)
|
|
||||||
univ_params T.pp_debug ty n_params
|
Fmt.eprintf "@[<2>@{<Green>Ind@}@ %a@]@." Inductive.pp_spec spec;
|
||||||
Fmt.(hvbox @@ Dump.(list @@ pair string T.pp_debug))
|
(* TODO: register to the conversion relation *)
|
||||||
intros;
|
Fmt.eprintf "is valid: %B@." (Inductive.is_valid spec);
|
||||||
()
|
()
|
||||||
|
|
||||||
let after_line () = Fmt.eprintf "%a@." Idx.dump idx
|
let after_line () = Fmt.eprintf "%a@." Idx.dump idx
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue