package coq-serapi
Serialization library and protocol for machine interaction with the Coq proof assistant
Install
Dune Dependency
Authors
Maintainers
Sources
coq-serapi-8.15.0.0.15.3.tbz
sha256=8eb6117bccd54843b5553562f8925f8dc24f502e323479b4eb6e7e28265c8fda
sha512=049e071e43eaa418b37cbc6222fb9244ce50f136084cbfd96ee0c545f1d031f57dc72a2de8a6da08225194bc851ec1c51eaf5d1f1299b5003d78f4a4ef5ea4d9
doc/src/coq-serapi.sertop_v8_12/sercomp_stats.ml.html
Source file sercomp_stats.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) (* v * INRIA, CNRS and contributors - Copyright 1999-2018 *) (* <O___,, * (see CREDITS file for the list of authors) *) (* \VV/ **************************************************************) (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (* * (see LICENSE file for the text of the license) *) (************************************************************************) (************************************************************************) (* Coq serialization API/Plugin *) (* Copyright 2016-2018 MINES ParisTech -- Dual License LGPL 2.1 / GPL3+ *) (* Written by: Emilio J. Gallego Arias *) (************************************************************************) (* Status: Very Experimental *) (************************************************************************) type stats = { mutable specs : int ; mutable proofs : int ; mutable misc : int } let stats = { specs = 0 ; proofs = 0 ; misc = 0 } (* XXX: Move to sertop_stats.ml *) let do_stats = let proof_loc = ref None in fun CAst.{ loc ; v = { Vernacexpr.expr; _ } } -> let open Vernacexpr in let incS ?loc f = Option.cata (fun loc -> let n_lines = Loc.(loc.line_nb_last - loc.line_nb + 1) in Format.printf "@[Adding %d lines@]@\n%!" n_lines; f + n_lines) f loc in match expr with (* Definition *) | VernacDefinition (_,_,_) | VernacFixpoint (_,_) | VernacInductive (_,_) | VernacCoFixpoint (_,_) | VernacNotation (_,_,_,_) -> stats.specs <- incS ?loc stats.specs (* Proofs *) | VernacStartTheoremProof (_,_) -> stats.specs <- incS ?loc stats.specs; Option.iter (fun loc -> proof_loc := Some Loc.(loc.line_nb_last)) loc | VernacProof (_,_) -> () (* XXX: Should we use the +1 rule here, what happens for proofs: Proof. exact: L. Qed. *) | VernacEndProof _ -> Option.iter (fun ll -> Option.iter (fun loc -> stats.proofs <- stats.proofs + (Loc.(loc.line_nb) - ll) + 1 ) loc ) !proof_loc; proof_loc := None (* This is tricky.. *) (* This is Ltac := ... *) | VernacExtend (("VernacDeclareTacticDefinition",_),_) -> stats.proofs <- incS ?loc stats.proofs; | _ -> if Option.is_empty !proof_loc then stats.misc <- incS ?loc stats.misc (* match vrn with | VernacLoad (_,_) -> (??) | VernacTime _ -> (??) | VernacRedirect (_,_) -> (??) | VernacTimeout (_,_) -> (??) | VernacFail _ -> (??) | VernacError _ -> (??) | VernacSyntaxExtension (_,_) -> (??) | VernacOpenCloseScope (_,_) -> (??) | VernacDelimiters (_,_) -> (??) | VernacBindScope (_,_) -> (??) | VernacInfix (_,_,_,_) -> (??) | VernacNotationAddFormat (_,_,_) -> (??) | VernacStartTheoremProof (_,_,_) -> (??) | VernacExactProof _ -> (??) | VernacAssumption (_,_,_) -> (??) | VernacScheme _ -> (??) | VernacCombinedScheme (_,_) -> (??) | VernacUniverse _ -> (??) | VernacConstraint _ -> (??) | VernacBeginSection _ -> (??) | VernacEndSegment _ -> (??) | VernacRequire (_,_,_) -> (??) | VernacImport (_,_) -> (??) | VernacCanonical _ -> (??) | VernacCoercion (_,_,_,_) -> (??) | VernacIdentityCoercion (_,_,_,_) -> (??) | VernacNameSectionHypSet (_,_) -> (??) | VernacInstance (_,_,_,_,_) -> (??) | VernacContext _ -> (??) | VernacDeclareInstances (_,_) -> (??) | VernacDeclareClass _ -> (??) | VernacDeclareModule (_,_,_,_) -> (??) | VernacDefineModule (_,_,_,_,_) -> (??) | VernacDeclareModuleType (_,_,_,_) -> (??) | VernacInclude _ -> (??) | VernacSolveExistential (_,_) -> (??) | VernacAddLoadPath (_,_,_) -> (??) | VernacRemoveLoadPath _ -> (??) | VernacAddMLPath (_,_) -> (??) | VernacDeclareMLModule _ -> (??) | VernacChdir _ -> (??) | VernacWriteState _ -> (??) | VernacRestoreState _ -> (??) | VernacResetName _ -> (??) | VernacResetInitial -> (??) | VernacBack _ -> (??) | VernacBackTo _ -> (??) | VernacCreateHintDb (_,_) -> (??) | VernacRemoveHints (_,_) -> (??) | VernacHints (_,_,_) -> (??) | VernacSyntacticDefinition (_,_,_,_) -> (??) | VernacDeclareImplicits (_,_) -> (??) | VernacArguments (_,_,_,_) -> (??) | VernacArgumentsScope (_,_) -> (??) | VernacReserve _ -> (??) | VernacGeneralizable _ -> (??) | VernacSetOpacity _ -> (??) | VernacSetStrategy _ -> (??) | VernacUnsetOption _ -> (??) | VernacSetOption (_,_) -> (??) | VernacAddOption (_,_) -> (??) | VernacRemoveOption (_,_) -> (??) | VernacMemOption (_,_) -> (??) | VernacPrintOption _ -> (??) | VernacCheckMayEval (_,_,_) -> (??) | VernacGlobalCheck _ -> (??) | VernacDeclareReduction (_,_) -> (??) | VernacPrint _ -> (??) | VernacSearch (_,_,_) -> (??) | VernacLocate _ -> (??) | VernacRegister (_,_) -> (??) | VernacComments _ -> (??) | VernacStm _ -> (??) | VernacAbort _ -> (??) | VernacAbortAll -> (??) | VernacRestart -> (??) | VernacUndo _ -> (??) | VernacUndoTo _ -> (??) | VernacBacktrack (_,_,_) -> (??) | VernacFocus _ -> (??) | VernacUnfocus -> (??) | VernacUnfocused -> (??) | VernacBullet _ -> (??) | VernacProgram _ -> (??) | VernacSubproof _ -> (??) | VernacEndSubproof -> (??) | VernacShow _ -> (??) | VernacCheckGuard -> (??) | VernacProofMode _ -> (??) | VernacToplevelControl _ -> (??) | VernacExtend (_,_) -> (??) | VernacPolymorphic (_,_) -> (??) | VernacLocal (_,_) -> (??) *) let print_stats () = Format.printf "Statistics:@\nSpecs: %d@\nProofs: %d@\nMisc: %d@\n%!" stats.specs stats.proofs stats.misc
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>