- let name = UriManager.name_of_uri uri in
- let obj = Cic.Constant (name, body, ty, params, attrs) in
- let ugraph = CicUnivUtils.clean_and_fill uri obj ugraph in
- CicEnvironment.add_type_checked_term uri (obj, ugraph);
- MetadataDb.index_obj ~dbd ~uri; (* must be in the env *)
- let new_stuff = save_object_to_disk status uri obj in
- MatitaLog.message (sprintf "%s constant defined" suri);
- let status = add_aliases_for_object status suri in
- { status with objects = new_stuff @ status.objects }
- end
-
-let split_obj = function
- | Cic.Constant (name, body, ty, _, attrs)
- | Cic.Variable (name, body, ty, _, attrs) -> (name, body, ty, attrs)
- | _ -> assert false
-
-let add_inductive_def
- ~uri ~types ?(params = []) ?(leftno = 0) ?(attrs = []) ~ugraph status
-=
- let dbd = MatitaDb.instance () in
- let suri = UriManager.string_of_uri uri in
- if CicEnvironment.in_library uri then
- command_error (sprintf "%s inductive type already defined" suri)
- else begin
- let name = UriManager.name_of_uri uri in
- let obj = Cic.InductiveDefinition (types, params, leftno, attrs) in
- let ugraph = CicUnivUtils.clean_and_fill uri obj ugraph in
- CicEnvironment.put_inductive_definition uri (obj, ugraph);
- MetadataDb.index_obj ~dbd ~uri; (* must be in the env *)
- let new_stuff = save_object_to_disk status uri obj in
- MatitaLog.message (sprintf "%s inductive type defined" suri);
- let status = add_aliases_for_inductive_def status types suri in
- let status = { status with objects = new_stuff @ status.objects } in
- let elim sort status =