mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-18 10:54:09 +00:00
Compare commits
3 Commits
array_atta
...
skip_kerne
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0d1882853 | ||
|
|
c88a46a953 | ||
|
|
a5ab12830e |
@@ -8,8 +8,17 @@ import Lean.CoreM
|
||||
|
||||
namespace Lean
|
||||
|
||||
register_builtin_option debug.skipKernelTC : Bool := {
|
||||
defValue := false
|
||||
group := "debug"
|
||||
descr := "skip kernel type checker. WARNING: setting this option to true may compromise soundness because your proofs will not be checked by the Lean kernel"
|
||||
}
|
||||
|
||||
def Environment.addDecl (env : Environment) (opts : Options) (decl : Declaration) : Except KernelException Environment :=
|
||||
addDeclCore env (Core.getMaxHeartbeats opts).toUSize decl
|
||||
if debug.skipKernelTC.get opts then
|
||||
addDeclWithoutChecking env decl
|
||||
else
|
||||
addDeclCore env (Core.getMaxHeartbeats opts).toUSize decl
|
||||
|
||||
def Environment.addAndCompile (env : Environment) (opts : Options) (decl : Declaration) : Except KernelException Environment := do
|
||||
let env ← addDecl env opts decl
|
||||
|
||||
@@ -244,10 +244,21 @@ inductive KernelException where
|
||||
|
||||
namespace Environment
|
||||
|
||||
/-- Type check given declaration and add it to the environment -/
|
||||
/--
|
||||
Type check given declaration and add it to the environment
|
||||
-/
|
||||
@[extern "lean_add_decl"]
|
||||
opaque addDeclCore (env : Environment) (maxHeartbeats : USize) (decl : @& Declaration) : Except KernelException Environment
|
||||
|
||||
/--
|
||||
Add declaration to kernel without type checking it.
|
||||
**WARNING** This function is meant for temporarily working around kernel performance issues.
|
||||
It compromises soundness because, for example, a buggy tactic may produce an invalid proof,
|
||||
and the kernel will not catch it if the new option is set to true.
|
||||
-/
|
||||
@[extern "lean_add_decl_without_checking"]
|
||||
opaque addDeclWithoutChecking (env : Environment) (decl : @& Declaration) : Except KernelException Environment
|
||||
|
||||
end Environment
|
||||
|
||||
namespace ConstantInfo
|
||||
|
||||
@@ -299,6 +299,12 @@ extern "C" LEAN_EXPORT object * lean_add_decl(object * env, size_t max_heartbeat
|
||||
});
|
||||
}
|
||||
|
||||
extern "C" LEAN_EXPORT object * lean_add_decl_without_checking(object * env, object * decl) {
|
||||
return catch_kernel_exceptions<environment>([&]() {
|
||||
return environment(env).add(declaration(decl, true), false);
|
||||
});
|
||||
}
|
||||
|
||||
void environment::for_each_constant(std::function<void(constant_info const & d)> const & f) const {
|
||||
smap_foreach(cnstr_get(raw(), 1), [&](object *, object * v) {
|
||||
constant_info cinfo(v, true);
|
||||
|
||||
BIN
stage0/src/kernel/environment.cpp
generated
BIN
stage0/src/kernel/environment.cpp
generated
Binary file not shown.
BIN
stage0/src/library/constructions/CMakeLists.txt
generated
BIN
stage0/src/library/constructions/CMakeLists.txt
generated
Binary file not shown.
BIN
stage0/src/library/constructions/brec_on.cpp
generated
BIN
stage0/src/library/constructions/brec_on.cpp
generated
Binary file not shown.
BIN
stage0/src/library/constructions/brec_on.h
generated
BIN
stage0/src/library/constructions/brec_on.h
generated
Binary file not shown.
BIN
stage0/src/library/constructions/util.cpp
generated
BIN
stage0/src/library/constructions/util.cpp
generated
Binary file not shown.
BIN
stage0/src/library/constructions/util.h
generated
BIN
stage0/src/library/constructions/util.h
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Data/Array/Basic.c
generated
BIN
stage0/stdlib/Init/Data/Array/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Data/Array/Subarray.c
generated
BIN
stage0/stdlib/Init/Data/Array/Subarray.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Data/BitVec/Basic.c
generated
BIN
stage0/stdlib/Init/Data/BitVec/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Data/ByteArray/Basic.c
generated
BIN
stage0/stdlib/Init/Data/ByteArray/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Data/FloatArray/Basic.c
generated
BIN
stage0/stdlib/Init/Data/FloatArray/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/GetElem.c
generated
BIN
stage0/stdlib/Init/GetElem.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/Meta.c
generated
BIN
stage0/stdlib/Init/Meta.c
generated
Binary file not shown.
BIN
stage0/stdlib/Init/NotationExtra.c
generated
BIN
stage0/stdlib/Init/NotationExtra.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Build/Executable.c
generated
BIN
stage0/stdlib/Lake/Build/Executable.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Build/Imports.c
generated
BIN
stage0/stdlib/Lake/Build/Imports.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Build/Index.c
generated
BIN
stage0/stdlib/Lake/Build/Index.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Build/Module.c
generated
BIN
stage0/stdlib/Lake/Build/Module.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Build/Run.c
generated
BIN
stage0/stdlib/Lake/Build/Run.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/CLI/Main.c
generated
BIN
stage0/stdlib/Lake/CLI/Main.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/DSL/Script.c
generated
BIN
stage0/stdlib/Lake/DSL/Script.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Load/Lean/Elab.c
generated
BIN
stage0/stdlib/Lake/Load/Lean/Elab.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lake/Load/Manifest.c
generated
BIN
stage0/stdlib/Lake/Load/Manifest.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/AddDecl.c
generated
BIN
stage0/stdlib/Lean/AddDecl.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/CSimpAttr.c
generated
BIN
stage0/stdlib/Lean/Compiler/CSimpAttr.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/Basic.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/Borrow.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/Borrow.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/Boxing.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/Boxing.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/ElimDeadBranches.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/EmitC.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/EmitC.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/EmitLLVM.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/EmitLLVM.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/ExpandResetReuse.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/ExpandResetReuse.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/RC.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/RC.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/IR/SimpCase.c
generated
BIN
stage0/stdlib/Lean/Compiler/IR/SimpCase.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Basic.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Check.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Check.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/ElimDeadBranches.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/ElimDeadBranches.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/InferType.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/InferType.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/MonoTypes.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/MonoTypes.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/PassManager.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/PassManager.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/PullFunDecls.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/PullFunDecls.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/DefaultAlt.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/DefaultAlt.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/InlineCandidate.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/InlineCandidate.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/InlineProj.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/InlineProj.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/JpCases.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/JpCases.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/Main.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/Main.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/SimpValue.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/SimpValue.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/Used.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/Simp/Used.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/SpecInfo.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/SpecInfo.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToDecl.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToDecl.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToExpr.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToExpr.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToLCNF.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToLCNF.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToMono.c
generated
BIN
stage0/stdlib/Lean/Compiler/LCNF/ToMono.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Compiler/Specialize.c
generated
BIN
stage0/stdlib/Lean/Compiler/Specialize.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/CoreM.c
generated
BIN
stage0/stdlib/Lean/CoreM.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/Array.c
generated
BIN
stage0/stdlib/Lean/Data/Array.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/HashMap.c
generated
BIN
stage0/stdlib/Lean/Data/HashMap.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/Lsp/Internal.c
generated
BIN
stage0/stdlib/Lean/Data/Lsp/Internal.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/PersistentArray.c
generated
BIN
stage0/stdlib/Lean/Data/PersistentArray.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/PersistentHashMap.c
generated
BIN
stage0/stdlib/Lean/Data/PersistentHashMap.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Data/Position.c
generated
BIN
stage0/stdlib/Lean/Data/Position.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/App.c
generated
BIN
stage0/stdlib/Lean/Elab/App.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Binders.c
generated
BIN
stage0/stdlib/Lean/Elab/Binders.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/BuiltinCommand.c
generated
BIN
stage0/stdlib/Lean/Elab/BuiltinCommand.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/BuiltinNotation.c
generated
BIN
stage0/stdlib/Lean/Elab/BuiltinNotation.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/BuiltinTerm.c
generated
BIN
stage0/stdlib/Lean/Elab/BuiltinTerm.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Command.c
generated
BIN
stage0/stdlib/Lean/Elab/Command.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/ComputedFields.c
generated
BIN
stage0/stdlib/Lean/Elab/ComputedFields.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/DeclNameGen.c
generated
BIN
stage0/stdlib/Lean/Elab/DeclNameGen.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/BEq.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/BEq.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Basic.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/DecEq.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/DecEq.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/FromToJson.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/FromToJson.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Hashable.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Hashable.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Inhabited.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Inhabited.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Ord.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Ord.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Repr.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Repr.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Deriving/Util.c
generated
BIN
stage0/stdlib/Lean/Elab/Deriving/Util.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Do.c
generated
BIN
stage0/stdlib/Lean/Elab/Do.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/ElabRules.c
generated
BIN
stage0/stdlib/Lean/Elab/ElabRules.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Inductive.c
generated
BIN
stage0/stdlib/Lean/Elab/Inductive.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/LetRec.c
generated
BIN
stage0/stdlib/Lean/Elab/LetRec.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/MacroRules.c
generated
BIN
stage0/stdlib/Lean/Elab/MacroRules.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Match.c
generated
BIN
stage0/stdlib/Lean/Elab/Match.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/MutualDef.c
generated
BIN
stage0/stdlib/Lean/Elab/MutualDef.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Notation.c
generated
BIN
stage0/stdlib/Lean/Elab/Notation.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/Open.c
generated
BIN
stage0/stdlib/Lean/Elab/Open.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PatternVar.c
generated
BIN
stage0/stdlib/Lean/Elab/PatternVar.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Basic.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Basic.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Eqns.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Eqns.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Main.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Main.c
generated
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/MkInhabitant.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/MkInhabitant.c
generated
Binary file not shown.
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Eqns.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Eqns.c
generated
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c
generated
BIN
stage0/stdlib/Lean/Elab/PreDefinition/Structural/Main.c
generated
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user