Created
June 3, 2020 14:31
-
-
Save UlfNorell/7bd96a4f13acf3fbf62e2b2a7c05c438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# OPTIONS --rewriting #-} | |
module _ where | |
open import Agda.Builtin.Bool | |
open import Agda.Builtin.Equality | |
open import Agda.Builtin.Unit | |
open import Agda.Builtin.String renaming (primStringEquality to _==_) | |
open import Agda.Builtin.List | |
data ⊥ : Set where | |
postulate | |
primExec : String → List String → String | |
postulate | |
Problem : Set | |
⟦_⟧ : Problem → Set | |
formatP : Problem → String | |
prover : Problem → Bool | |
prover p = primExec "z3" (formatP p ∷ []) == "OK" | |
postulate | |
sound : ∀ p → prover p ≡ true → ⟦ p ⟧ | |
Proof : ∀ p → Set | |
Proof p with prover p | |
... | true = ⟦ p ⟧ | |
... | false = ⊤ | |
prove : ∀ p → Proof p | |
prove p with prover p | sound p | |
... | true | s = s refl | |
... | false | _ = _ | |
{-# BUILTIN REWRITE _≡_ #-} | |
postulate | |
hard-problem : Problem | |
eval-format : formatP hard-problem ≡ "hard-problem" | |
eval-exec : primExec "z3" ("hard-problem" ∷ []) ≡ "OK" | |
{-# REWRITE eval-format #-} | |
{-# REWRITE eval-exec #-} | |
test : ⟦ hard-problem ⟧ | |
test = prove hard-problem | |
check : test ≡ sound hard-problem refl | |
check = refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What it might look like with a
TC
version ofprimExec
: