~ubuntu-branches/ubuntu/wily/coq-doc/wily

« back to all changes in this revision

Viewing changes to checker/check_stat.ml

  • Committer: Bazaar Package Importer
  • Author(s): Stéphane Glondu, Stéphane Glondu, Samuel Mimram
  • Date: 2010-01-07 22:50:39 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20100107225039-n3cq82589u0qt0s2
Tags: 8.2pl1-1
[ Stéphane Glondu ]
* New upstream release (Closes: #563669)
  - remove patches
* Packaging overhaul:
  - use git, advertise it in Vcs-* fields of debian/control
  - use debhelper 7 and dh with override
  - use source format 3.0 (quilt)
* debian/control:
  - set Maintainer to d-o-m, set Uploaders to Sam and myself
  - add Homepage field
  - bump Standards-Version to 3.8.3
* Register PDF documentation into doc-base
* Add debian/watch
* Update debian/copyright

[ Samuel Mimram ]
* Change coq-doc's description to mention that it provides documentation in
  pdf format, not postscript, closes: #543545.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
(************************************************************************)
 
2
(*  v      *   The Coq Proof Assistant  /  The Coq Development Team     *)
 
3
(* <O___,, * CNRS-Ecole Polytechnique-INRIA Futurs-Universite Paris Sud *)
 
4
(*   \VV/  **************************************************************)
 
5
(*    //   *      This file is distributed under the terms of the       *)
 
6
(*         *       GNU Lesser General Public License Version 2.1        *)
 
7
(************************************************************************)
 
8
 
 
9
open Pp
 
10
open Util
 
11
open System
 
12
open Flags
 
13
open Names
 
14
open Term
 
15
open Declarations
 
16
open Environ
 
17
 
 
18
let memory_stat = ref false
 
19
 
 
20
let print_memory_stat () = 
 
21
  if !memory_stat then begin
 
22
    Format.printf "total heap size = %d kbytes\n" (heap_size_kb ());
 
23
    Format.print_newline();
 
24
    flush_all()
 
25
  end
 
26
 
 
27
let output_context = ref false
 
28
 
 
29
let pr_engt = function
 
30
    Some ImpredicativeSet ->
 
31
      str "Theory: Set is impredicative"
 
32
  | None ->
 
33
      str "Theory: Set is predicative"
 
34
 
 
35
let cst_filter f csts =
 
36
  Cmap.fold
 
37
    (fun c ce acc -> if f c ce then c::acc else acc)
 
38
    csts []
 
39
 
 
40
let is_ax _ cb = cb.const_body = None 
 
41
 
 
42
let pr_ax csts =
 
43
  let axs = cst_filter is_ax csts in
 
44
  if axs = [] then
 
45
    str "Axioms: <none>"
 
46
  else
 
47
    hv 2 (str "Axioms:" ++ fnl() ++ prlist_with_sep fnl Indtypes.prcon axs)
 
48
 
 
49
let print_context env =
 
50
  if !output_context then begin
 
51
    let
 
52
      {env_globals=
 
53
        {env_constants=csts; env_inductives=inds;
 
54
         env_modules=mods; env_modtypes=mtys};
 
55
       env_stratification=
 
56
        {env_universes=univ; env_engagement=engt}} = env in
 
57
    msgnl(hov 0
 
58
      (fnl() ++ str"CONTEXT SUMMARY" ++ fnl() ++
 
59
      str"===============" ++ fnl() ++ fnl() ++
 
60
      str "* " ++ hov 0 (pr_engt engt ++ fnl()) ++ fnl() ++
 
61
      str "* " ++ hov 0 (pr_ax csts) ++
 
62
      fnl()))
 
63
  end
 
64
 
 
65
let stats () =
 
66
  print_context (Safe_typing.get_env());
 
67
  print_memory_stat ()