2014-05-23 11:26:28 -07:00
|
|
|
local env = environment()
|
2014-10-02 16:54:56 -07:00
|
|
|
env = add_decl(env, mk_constant_assumption("A", Prop))
|
2014-05-23 11:26:28 -07:00
|
|
|
local A = Const("A")
|
|
|
|
env = add_decl(env, mk_axiom("H1", A))
|
|
|
|
local H1 = Const("H1")
|
|
|
|
env = add_decl(env, mk_theorem("H2", A, H1))
|
|
|
|
assert(env:get("H2"):is_theorem())
|
2014-07-22 09:43:18 -07:00
|
|
|
env = add_decl(env, mk_definition("B", Prop, A))
|
2014-05-23 11:26:28 -07:00
|
|
|
env:export("mod1_mod.olean")
|
|
|
|
|
2014-05-29 11:03:44 -07:00
|
|
|
local env2 = import_modules("mod1_mod.olean", {keep_proofs=true})
|
2014-07-22 09:43:18 -07:00
|
|
|
assert(env2:get("A"):type() == Prop)
|
2014-10-02 16:54:56 -07:00
|
|
|
assert(env2:get("A"):is_constant_assumption())
|
2014-05-23 11:26:28 -07:00
|
|
|
assert(env2:get("H1"):type() == A)
|
|
|
|
assert(env2:get("H1"):is_axiom())
|
|
|
|
assert(env2:get("H2"):type() == A)
|
|
|
|
assert(env2:get("H2"):is_theorem())
|
|
|
|
assert(env2:get("H2"):value() == H1)
|
2014-07-22 09:43:18 -07:00
|
|
|
assert(env2:get("B"):type() == Prop)
|
2014-05-23 11:26:28 -07:00
|
|
|
assert(env2:get("B"):value() == A)
|
|
|
|
assert(env2:get("B"):is_definition())
|
2014-05-29 10:56:28 -07:00
|
|
|
|
|
|
|
local env3 = import_modules("mod1_mod.olean")
|
2014-07-22 09:43:18 -07:00
|
|
|
assert(env3:get("A"):type() == Prop)
|
2014-10-02 16:54:56 -07:00
|
|
|
assert(env3:get("A"):is_constant_assumption())
|
2014-05-29 10:56:28 -07:00
|
|
|
assert(env3:get("H1"):type() == A)
|
|
|
|
assert(env3:get("H1"):is_axiom())
|
|
|
|
assert(env3:get("H2"):type() == A)
|
|
|
|
assert(env3:get("H2"):is_axiom())
|
2014-07-22 09:43:18 -07:00
|
|
|
assert(env3:get("B"):type() == Prop)
|
2014-05-29 10:56:28 -07:00
|
|
|
assert(env3:get("B"):value() == A)
|
|
|
|
assert(env3:get("B"):is_definition())
|