lambdapi icon indicating copy to clipboard operation
lambdapi copied to clipboard

Export to DK does not handle opaque symbols

Open thomastraversie opened this issue 2 years ago • 4 comments

When trying to export the Lambdapi code

symbol Prop : TYPE;
symbol Prf : Prop → TYPE;

opaque symbol theorem1 : Π P : Prop, Prf P → Prf P ≔
λ P : Prop, λ pP : Prf P, pP;

opaque symbol theorem2 : Π P : Prop, Prf P → Prf P ≔
begin 
    assume P pP;
    refine pP 
end;

to Dedukti, the theorems are just translated as definitions:

def Prop : Type.
def Prf : (Prop -> Type).
def theorem1 : (P : Prop -> ((Prf P) -> (Prf P))).
def theorem2 : (P : Prop -> ((Prf P) -> (Prf P))).

thomastraversie avatar Jan 24 '24 07:01 thomastraversie

I see. Currently, the export to dk is done after compilation but compilation does not record the definition of opaque symbols to save memory. To avoid this problem, we should modify the export to dk so that it is done just after parsing, like we do for the coq export. This would be much more efficient.

fblanqui avatar Jan 24 '24 10:01 fblanqui

Hi Thomas. One solution is make a copy of your files, remove the opaque modifiers with sed, and export files.

I'm working on having a dk output which does not require elaboration. But it won't be able to handle proofs. Proofs can only be translated after compilation.

fblanqui avatar Feb 26 '24 14:02 fblanqui

I see, thanks for the solution.

thomastraversie avatar Feb 28 '24 15:02 thomastraversie

See #1060

fblanqui avatar Mar 01 '24 09:03 fblanqui