Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Agda generics for proof serialising #6425

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
dfde178
WIP
kwxm Aug 13, 2024
afa23a1
Merge branch 'master' into kwxm/metatheory/fix-test2
kwxm Aug 13, 2024
21607ed
Fix broken metatheory tests using textual comparison
kwxm Aug 14, 2024
f18ebe7
Refactor detailed tests
kwxm Aug 14, 2024
32c5a26
Refactor detailed tests
kwxm Aug 14, 2024
9f17fba
Re-enable plutus-metatheory:test2 in CI
kwxm Aug 14, 2024
4d32e29
Add raw certification component
ana-pantilie Aug 14, 2024
540b95b
Merge branch 'master' into kwxm/metatheory/fix-test2
kwxm Aug 14, 2024
225ac43
Fixes in project.nix
kwxm Aug 14, 2024
aa67c66
Remove unused files
kwxm Aug 14, 2024
16d004c
Remove the preCheck hack from plutus-metatheory.components.tests.test…
zeme-wana Aug 14, 2024
68652b3
Extra comments
kwxm Aug 14, 2024
5411479
Merge branch 'kwxm/metatheory/fix-test2' of github.com:IntersectMBO/p…
kwxm Aug 14, 2024
b3d582b
WIP
kwxm Aug 13, 2024
a2dfbcd
Fix broken metatheory tests using textual comparison
kwxm Aug 14, 2024
602d274
Refactor detailed tests
kwxm Aug 14, 2024
48543fd
Refactor detailed tests
kwxm Aug 14, 2024
2f43b7b
Re-enable plutus-metatheory:test2 in CI
kwxm Aug 14, 2024
526e3eb
Fixes in project.nix
kwxm Aug 14, 2024
5d177dc
Remove unused files
kwxm Aug 14, 2024
8fe533f
Extra comments
kwxm Aug 14, 2024
948bc91
Remove the preCheck hack from plutus-metatheory.components.tests.test…
zeme-wana Aug 14, 2024
fda7740
Rebase and remove dead code
zeme-wana Aug 14, 2024
3568d60
WIP: fix compilation errors
ana-pantilie Aug 14, 2024
89f9b08
Remove newline in error message
kwxm Aug 15, 2024
35ee520
Merge branch 'kwxm/metatheory/fix-test2' of github.com:IntersectMBO/p…
kwxm Aug 15, 2024
bcb1607
Fix compilation errors
ana-pantilie Aug 15, 2024
a2445ad
Small clean-up
ana-pantilie Aug 15, 2024
e5ddb90
Address some PR comments
kwxm Aug 16, 2024
3d9c46a
WIP
kwxm Aug 16, 2024
ee0e691
WIP
kwxm Aug 16, 2024
f389181
Add Output option to plc to make it consistent with uplc
kwxm Aug 16, 2024
36f8947
Tidy up output of evaluation/typecheching results
kwxm Aug 16, 2024
8c51c63
Tidy up output of evaluation/typecheching results
kwxm Aug 16, 2024
f9d5e2f
Name change
kwxm Aug 16, 2024
7ff26ec
WIP: clean-up
ana-pantilie Aug 16, 2024
f52e423
Merge remote-tracking branch 'origin/kwxm/metatheory/fix-test2' into …
ana-pantilie Aug 16, 2024
7778a19
Added plutus-executables package; moved uplc/pc/pir and metatheory tests
ana-pantilie Aug 16, 2024
33b6482
Add certifier to uplc optimiser
ana-pantilie Aug 16, 2024
1873aa8
Add certifier to uplc optimise
ana-pantilie Aug 16, 2024
99bd8ba
Merge remote-tracking branch 'origin/master' into ana/add-certificati…
ana-pantilie Aug 19, 2024
8d8d0a2
Fix
ana-pantilie Aug 19, 2024
5733c83
Clean-up
ana-pantilie Aug 19, 2024
f451581
Clean-up cabal file
ana-pantilie Aug 19, 2024
6c70e1c
Fix metatheory tests
ana-pantilie Aug 19, 2024
c24e54e
Fix isTransformation?
ana-pantilie Aug 19, 2024
d06b49b
Certifier properly handles results
ana-pantilie Aug 19, 2024
9e42982
Add documentation
ana-pantilie Aug 19, 2024
d8fa57a
Add a nix derivation for generics; upgrade stdlib to 2.1
ana-pantilie Aug 20, 2024
d1bb967
Use standard-library 2.0; fix build
ana-pantilie Aug 20, 2024
f0b9a85
Build MAlonzo with new stdlib
ana-pantilie Aug 20, 2024
b7ce4fa
WIP derive Show for Dec Trace
ana-pantilie Aug 21, 2024
dc339e3
Temp
ana-pantilie Aug 22, 2024
222190a
WIP: add agda-stdlib-meta derivation
ana-pantilie Aug 22, 2024
cc735cb
Fix derivations
ana-pantilie Aug 22, 2024
be317f6
Amazing
ana-pantilie Aug 22, 2024
22a40f9
Merge remote-tracking branch 'origin/master' into ana/use-generics-in…
ana-pantilie Oct 8, 2024
8aae4e9
Fix after master merge
ana-pantilie Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nix/agda-project.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pkgs.haskell-nix.hackage-project {
name = "Agda";

version = "2.6.4";
version = "2.6.4.3";

compiler-nix-name = "ghc96";

Expand Down
69 changes: 65 additions & 4 deletions nix/agda-with-stdlib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,88 @@ let
# Need a newer version for 2.6.2 compatibility
stdlib = repoRoot.nix.agda-packages.standard-library.overrideAttrs (oldAtts: rec {

version = "1.7.3";
version = "2.0";

src = pkgs.fetchFromGitHub {
repo = "agda-stdlib";
owner = "agda";
rev = "v${version}";
sha256 = "sha256-vtL6VPvTXhl/mepulUm8SYyTjnGsqno4RHDmTIy22Xg=";
sha256 = "sha256-TjGvY3eqpF+DDwatT7A78flyPcTkcLHQ1xcg+MKgCoE=";
};
# This is preConfigure is copied from more recent nixpkgs that also
# uses version 1.7 of standard-library. Old nixpkgs (that used 1.4)
# had a preConfigure step that worked with 1.7. Less old nixpkgs
# (that used 1.6) had a preConfigure step that attempts to `rm`
# files that are now in the .gitignore list for 1.
preConfigure = ''
runhaskell GenerateEverything.hs
runhaskell GenerateEverything.hs --include-deprecated
# We will only build/consider Everything.agda, in particular we don't want Everything*.agda
# do be copied to the store.
rm EverythingSafe.agda
'';
});

agda-stdlib-classes =
repoRoot.nix.agda-packages.mkDerivation {
pname = "agda-stdlib-classes";
meta = "...";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
repo = "agda-stdlib-classes";
owner = "omelkonian";
version = "2.0";
rev = "v2.0";
hash = "sha256-PcieRRnctjCzFCi+gUYAgyIAicMOAZPl8Sw35fZdt0E=";
};
buildInputs = [
stdlib
];
libraryFile = "agda-stdlib-classes.agda-lib";
everythingFile = "Classes.agda";
};

agda-stdlib-meta =
repoRoot.nix.agda-packages.mkDerivation {
pname = "agda-stdlib-meta";
meta = "...";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
repo = "agda-stdlib-meta";
owner = "omelkonian";
version = "2.0";
rev = "v2.0";
hash = "sha256-yNinFcjx1ypYrOcj/uDDDlqWFBCqChCksX7c81wVKFY=";
};
buildInputs = [
stdlib
agda-stdlib-classes
];
libraryFile = "agda-stdlib-meta.agda-lib";
everythingFile = "Main.agda";
};

generics =
repoRoot.nix.agda-packages.mkDerivation {
pname = "generics";
meta = "...";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
repo = "generics";
owner = "flupe";
version = "1.0.1";
rev = "v1.0.1";
hash = "sha256-B1eT6F0Dp2zto50ulf+K/KYMlMp8Pgc/tO9qkcqn+O8=";
};
buildInputs = [
stdlib
];
};

in

repoRoot.nix.agda-packages.agda.withPackages [ stdlib ]
repoRoot.nix.agda-packages.agda.withPackages [
stdlib
generics
agda-stdlib-meta
agda-stdlib-classes
]
1 change: 1 addition & 0 deletions plutus-core/plutus-core/src/PlutusCore/Compiler/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module PlutusCore.Compiler.Types where

import Data.Hashable
import PlutusCore.Builtin
import PlutusCore.Default qualified as PLC
import PlutusCore.Name.Unique
import PlutusCore.Quote
import UntypedPlutusCore.Core.Type qualified as UPLC
Expand Down
2 changes: 1 addition & 1 deletion plutus-metatheory/Plutus.agda-lib
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
depend: standard-library
depend: standard-library generics standard-library-classes standard-library-meta
include: src
2 changes: 1 addition & 1 deletion plutus-metatheory/Setup.hs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ agdaPreProcessor _ lbi _ = D.PreProcessor
, "--compile"
, "--ghc-dont-call-ghc"
, "--local-interfaces"
, "src/Main.lagda.md"
, "src/MetatheoryMain.lagda.md"
]

agdaProgram :: D.ConfiguredProgram
Expand Down
5 changes: 3 additions & 2 deletions plutus-metatheory/src/Algorithmic/Erasure.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,9 @@ lem-erase'' refl t = refl
same : ∀{Φ Γ}{A : Φ ⊢⋆ *}(t : Γ D.⊢ A)
→ D.erase t ≡ subst _⊢ (lenLemma Γ) (erase (nfType t))

+cancel : ∀{m m' n n'} → m + n ≡ m' + n' → m ≡ m' → n ≡ n'
+cancel p refl = +-cancelˡ-≡ _ p
postulate
+cancel : ∀{m m' n n'} → m + n ≡ m' + n' → m ≡ m' → n ≡ n'
-- +cancel p refl = +-cancelˡ-≡ _ p

same-ConstrArgs : ∀{Φ}{Γ : D.Ctx Φ}{Ts : List (Φ ⊢⋆ *)}

Expand Down
126 changes: 64 additions & 62 deletions plutus-metatheory/src/Cost.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ mkKeyFromExBudgetCategory BStartup = "2"
TallyingBudget : Set
TallyingBudget = Map ExBudget × ExBudget

lookup : Map ExBudget → ExBudgetCategory → ExBudget
lookup m k with lookupAVL (mkKeyFromExBudgetCategory k) m
... | just x = x
... | nothing = ε€
postulate
lookup : Map ExBudget → ExBudgetCategory → ExBudget
-- lookup m k with lookupAVL (mkKeyFromExBudgetCategory k) m
-- ... | just x = x
-- ... | nothing = ε€
```

As required, `TallyingBudget` is a monoid.
Expand Down Expand Up @@ -208,62 +209,63 @@ tallyingMachineParameters cm = record {
; costMonoid = isMonoidTallyingBudget
}

tallyingReport : TallyingBudget → String
tallyingReport (mp , budget) =
countingReport budget
++ "\n"
++ "\n"
++ printStepReport mp
++ "\n"
++ "startup " ++ budgetToString (lookup mp BStartup) ++ "\n"
++ "compute " ++ budgetToString totalComputeCost ++ "\n"
-- ++ "AST nodes " ++ ++ "\n"
++ "\n\n"
++ printBuiltinReport mp
++ "\n"
++ "Total builtin costs: " ++ budgetToString totalBuiltinCosts ++ "\n"
-- We would like to be able to print the following number as "%4.2f"
-- but Agda's printf currently doesn't support it.
++ printf "Time spent executing builtins: %f%%\n" (fromℕ 100 *f (getCPU totalBuiltinCosts) ÷ (getCPU budget)) ++ "\n"
++ "\n"
++ "Total budget spent: " ++ budgetToString budget ++ "\n"
++ "Predicted execution time: " ++ formatTimePicoseconds (getCPU budget)
where
totalComputeCost totalBuiltinCosts : ExBudget
totalComputeCost = L.foldr (λ x acc → (lookup mp (BStep x)) ∙€ acc) ε€ stepKindList
totalBuiltinCosts = L.foldr _∙€_ ε€ (L.map (lookup mp ∘ (λ b → BBuiltinApp b (replicate (V-con (atomic aUnit) tt)))) builtinList)

getCPU : ExBudget → Float
getCPU n = fromℕ (ExCPU n)

budgetToString : ExBudget → String
budgetToString (mkExBudget cpu mem) = padLeft ' ' 15 (showℕ cpu) ++ " "
++ padLeft ' ' 15 (showℕ mem)

printStepCost : StepKind → ExBudget → String
printStepCost sk budget = padRight ' ' 10 (showStepKind sk) ++ " "
++ padLeft ' ' 20 (budgetToString budget) ++ "\n"

printStepReport : Map ExBudget → String
printStepReport mp = L.foldr (λ s xs → printStepCost s (lookup mp (BStep s)) ++ xs)
""
stepKindList

printBuiltinCost : Builtin → ExBudget → String
printBuiltinCost b (mkExBudget 0 0) = ""
printBuiltinCost b budget = padRight ' ' 22 (showBuiltin b) ++ " "
++ budgetToString budget ++ "\n"

printBuiltinReport : Map ExBudget → String
printBuiltinReport mp =
L.foldr (λ b xs → printBuiltinCost b (lookup mp (BBuiltinApp b (replicate (V-con (atomic aUnit) tt)))) ++ xs)
""
builtinList

formatTimePicoseconds : Float → String
formatTimePicoseconds t = if 1e12 ≤ᵇ t then (printf "%f s" (t ÷ 1e12)) else
if 1e9 ≤ᵇ t then (printf "%f ms" (t ÷ 1e9)) else
if 1e6 ≤ᵇ t then (printf "%f μs" (t ÷ 1e6)) else
if 1e3 ≤ᵇ t then (printf "%f ns" (t ÷ 1e3)) else
printf "%f ps" t
postulate
tallyingReport : TallyingBudget → String
-- tallyingReport (mp , budget) =
-- countingReport budget
-- ++ "\n"
-- ++ "\n"
-- ++ printStepReport mp
-- ++ "\n"
-- ++ "startup " ++ budgetToString (lookup mp BStartup) ++ "\n"
-- ++ "compute " ++ budgetToString totalComputeCost ++ "\n"
-- -- ++ "AST nodes " ++ ++ "\n"
-- ++ "\n\n"
-- ++ printBuiltinReport mp
-- ++ "\n"
-- ++ "Total builtin costs: " ++ budgetToString totalBuiltinCosts ++ "\n"
-- -- We would like to be able to print the following number as "%4.2f"
-- -- but Agda's printf currently doesn't support it.
-- ++ printf "Time spent executing builtins: %f%%\n" (fromℕ 100 *f (getCPU totalBuiltinCosts) ÷ (getCPU budget)) ++ "\n"
-- ++ "\n"
-- ++ "Total budget spent: " ++ budgetToString budget ++ "\n"
-- ++ "Predicted execution time: " ++ formatTimePicoseconds (getCPU budget)
-- where
-- totalComputeCost totalBuiltinCosts : ExBudget
-- totalComputeCost = L.foldr (λ x acc → (lookup mp (BStep x)) ∙€ acc) ε€ stepKindList
-- totalBuiltinCosts = L.foldr _∙€_ ε€ (L.map (lookup mp ∘ (λ b → BBuiltinApp b (replicate (V-con (atomic aUnit) tt)))) builtinList)
--
-- getCPU : ExBudget → Float
-- getCPU n = fromℕ (ExCPU n)
--
-- budgetToString : ExBudget → String
-- budgetToString (mkExBudget cpu mem) = padLeft ' ' 15 (showℕ cpu) ++ " "
-- ++ padLeft ' ' 15 (showℕ mem)
--
-- printStepCost : StepKind → ExBudget → String
-- printStepCost sk budget = padRight ' ' 10 (showStepKind sk) ++ " "
-- ++ padLeft ' ' 20 (budgetToString budget) ++ "\n"
--
-- printStepReport : Map ExBudget → String
-- printStepReport mp = L.foldr (λ s xs → printStepCost s (lookup mp (BStep s)) ++ xs)
-- ""
-- stepKindList
--
-- printBuiltinCost : Builtin → ExBudget → String
-- printBuiltinCost b (mkExBudget 0 0) = ""
-- printBuiltinCost b budget = padRight ' ' 22 (showBuiltin b) ++ " "
-- ++ budgetToString budget ++ "\n"
--
-- printBuiltinReport : Map ExBudget → String
-- printBuiltinReport mp =
-- L.foldr (λ b xs → printBuiltinCost b (lookup mp (BBuiltinApp b (replicate (V-con (atomic aUnit) tt)))) ++ xs)
-- ""
-- builtinList
--
-- formatTimePicoseconds : Float → String
-- formatTimePicoseconds t = if 1e12 ≤ᵇ t then (printf "%f s" (t ÷ 1e12)) else
-- if 1e9 ≤ᵇ t then (printf "%f ms" (t ÷ 1e9)) else
-- if 1e6 ≤ᵇ t then (printf "%f μs" (t ÷ 1e6)) else
-- if 1e3 ≤ᵇ t then (printf "%f ns" (t ÷ 1e3)) else
-- printf "%f ps" t
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Main
layout: page
---
```
module Main where
module MetatheoryMain where

import VerifiedCompilation
open import Agda.Builtin.IO using (IO)
Expand Down
9 changes: 5 additions & 4 deletions plutus-metatheory/src/Utils/List.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,11 @@ Some cancellation lemmas
<>>[]-cancelʳ : ∀{A : Set} (bs bs' : Bwd A) → bs <>> [] ≡ bs' <>> [] → bs ≡ bs'
<>>[]-cancelʳ bs bs' p = trans (sym (lemma<>2' bs (bs' <>> []) p)) (lemma<>2 bs' [])

<>>-cancelʳ : ∀{A : Set} (bs bs' : Bwd A) xs → bs <>> xs ≡ bs' <>> xs → bs ≡ bs'
<>>-cancelʳ bs bs' xs p = <>>[]-cancelʳ bs bs'
(++-cancelʳ (bs <>> []) (bs' <>> []) (trans (sym (lemma-<>>-++ bs [] xs))
(trans p (lemma-<>>-++ bs' [] xs))))
postulate
<>>-cancelʳ : ∀{A : Set} (bs bs' : Bwd A) xs → bs <>> xs ≡ bs' <>> xs → bs ≡ bs'
-- <>>-cancelʳ bs bs' xs p = <>>[]-cancelʳ bs bs'
-- (++-cancelʳ (bs <>> []) (bs' <>> []) (trans (sym (lemma-<>>-++ bs [] xs))
-- (trans p (lemma-<>>-++ bs' [] xs))))

<>>-cancelˡ : ∀{A : Set} (bs : Bwd A) xs xs' → bs <>> xs ≡ bs <>> xs' → xs ≡ xs'
<>>-cancelˡ [] xs xs' p = p
Expand Down
63 changes: 53 additions & 10 deletions plutus-metatheory/src/VerifiedCompilation.lagda.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ module VerifiedCompilation where
import Data.Bool.Base using (Bool; true; false; T; _∧_; _∨_; not)
open import Data.Nat using (ℕ; zero; suc)
open import Relation.Nullary using (Dec; yes; no; ¬_)
import Relation.Nullary.Negation using (¬?)
import Relation.Nullary.Product using (_×-dec_)
import Relation.Nullary using (¬?)
import Relation.Nullary using (_×-dec_)
import Relation.Binary using (Decidable)
open import Untyped
open import Utils as U using (Maybe;nothing;just;Either;inj₁;inj₂;List;[];_∷_;_×_;_,_)
Expand All @@ -55,6 +55,16 @@ import Relation.Binary as Binary using (Decidable)
open import VerifiedCompilation.UntypedTranslation using (Translation; Relation; translation?)
import Relation.Binary as Binary using (Decidable)
import Relation.Unary as Unary using (Decidable)
import Tactic
open import Tactic.Defaults
import Agda.Builtin.List as DList
import Data.Product.Base as DProd
open import Class.Show.Core
open import Algorithmic using (⟦_⟧)
open import Type.BetaNormal using (_⊢Nf⋆_; _⊢Ne⋆_)
open import Type using (_∋⋆_)
open import Builtin.Constant.Type using (TyCon; AtomicTyCon)
open import Data.Vec.Base using (Vec)
```

## Compiler optimisation traces
Expand Down Expand Up @@ -95,7 +105,6 @@ isTrace? {X} {R} isR? ((x₁ , x₂) ∷ xs) with isTrace? {X} {R} isR? xs
... | yes p with isR? x₁ x₂
... | no ¬p = no λ {(cons x x₁) → ¬p x}
... | yes p₁ = yes (cons p₁ p)

isTransformation? : {X : Set} {{_ : DecEq X}} → Binary.Decidable (IsTransformation {X})
isTransformation? ast₁ ast₂ with UCC.isCoC? ast₁ ast₂
... | scrt with UFD.isFD? zero zero ast₁ ast₂
Expand Down Expand Up @@ -127,13 +136,47 @@ showTranslation (Translation.case x t) = "(case TODO " ++ showTranslation t ++ "
showTranslation Translation.builtin = "builtin"
showTranslation Translation.error = "error"

showTrace : {X : Set} {{_ : DecEq X}} {xs : List ((X ⊢) × (X ⊢))} → Trace (Translation IsTransformation) xs → String
showTrace empty = "empty"
showTrace (cons x bla) = "(cons " ++ showTranslation x ++ showTrace bla ++ ")"
-- showTrace : {X : Set} {xs : List ((X ⊢) × (X ⊢))} → Trace (Translation IsTransformation) xs → String
-- showTrace empty = "empty"
-- showTrace (cons x bla) = "(cons " ++ showTranslation x ++ showTrace bla ++ ")"

-- serializeTraceProof : {X : Set} {xs : List ((X ⊢) × (X ⊢))} → Dec (Trace (Translation IsTransformation) xs) → String
-- serializeTraceProof (no ¬p) = "no"
-- serializeTraceProof (yes p) = "yes " ++ showTrace p -- ++ show p

{-# TERMINATING #-}
derive-Show' = Tactic.derive-Show


unquoteDecl Show-Maybe = Tactic.derive-Show ((quote Maybe DProd., Show-Maybe) DList.∷ DList.[])

unquoteDecl Show-DList =
Tactic.derive-Show ((quote DList.List DProd., Show-DList) DList.∷ DList.[])
unquoteDecl Show-Vec =
Tactic.derive-Show ((quote Vec DProd., Show-Vec) DList.∷ DList.[])
unquoteDecl Show-AtomicTyCon =
Tactic.derive-Show ((quote AtomicTyCon DProd., Show-AtomicTyCon) DList.∷ DList.[])
unquoteDecl Show-TyCon =
Tactic.derive-Show ((quote TyCon DProd., Show-TyCon) DList.∷ DList.[])

unquoteDecl Show-MAD1 Show-MAD2 Show-MAD3 Show-TmCon
= derive-Show'
( (quote (_⊢Nf⋆_) DProd., Show-MAD1)
DList.∷ (quote (_⊢Ne⋆_) DProd., Show-MAD2)
DList.∷ (quote (_∋⋆_) DProd., Show-MAD3)
DList.∷ (quote RawU.TmCon DProd., Show-TmCon)
DList.∷ DList.[]
)

-- unquoteDecl Show-_⊢ = Tactic.derive-Show ((quote (_⊢) DProd., Show-_⊢) DList.∷ DList.[])
-- unquoteDecl Show-CoC = Tactic.derive-Show ((quote UCC.CoC DProd., Show-CoC) DList.∷ DList.[])
-- unquoteDecl Show-IsTransformation =
-- Tactic.derive-Show ((quote IsTransformation DProd., Show-IsTransformation) DList.∷ DList.[])

-- Uncomment to find a bug!
-- unquoteDecl Show-Translation = Tactic.derive-Show ((quote Translation DProd., Show-Translation) DList.∷ DList.[])

serializeTraceProof : {X : Set} {{_ : DecEq X}} {xs : List ((X ⊢) × (X ⊢))} → Dec (Trace (Translation IsTransformation) xs) → String
serializeTraceProof (no ¬p) = "no"
serializeTraceProof (yes p) = "yes " ++ showTrace p
-- unquoteDecl Show-Trace = Tactic.derive-Show ((quote Trace DProd., Show-Trace) DList.∷ DList.[])

```

Expand Down Expand Up @@ -184,7 +227,7 @@ certifier {X} rawInput isRTrace? with traverseEitherList toWellScoped rawInput
... | inj₁ err = inj₁ err
... | inj₂ rawTrace =
let inputTrace = buildPairs rawTrace
in inj₂ (serializeTraceProof (isRTrace? inputTrace))
in ? -- inj₂ (serializeTraceProof (isRTrace? inputTrace))

runCertifier : String → List Untyped → IO ⊤
runCertifier fileName rawInput with certifier rawInput (isTrace? {Maybe ⊥} {Translation IsTransformation} (translation? isTransformation?))
Expand Down
Loading