From 8c3619fcb5e01b14eeab69bfa8c88cd75ed16ac9 Mon Sep 17 00:00:00 2001 From: braxtonhall Date: Sun, 23 Oct 2022 16:28:11 -0700 Subject: Make Jon's work/description consistent with everyone else --- README.md | 3 +++ entries/ionathanch/agda/Fib.agda | 19 +++++++++++++++++++ entries/ionchy/agda/Fib.agda | 19 ------------------- 3 files changed, 22 insertions(+), 19 deletions(-) create mode 100644 entries/ionathanch/agda/Fib.agda delete mode 100644 entries/ionchy/agda/Fib.agda diff --git a/README.md b/README.md index e2c309e..d126e3b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,9 @@ For a submission to the upcoming "Reclaim your space" exhibition at [Hatch Art G +### [`ionathanch`](https://github.com/ionathanch) +- [`agda`](./entries/ionathanch/agda/Fib.agda) + ### [`funemy`](https://github.com/funemy) - [`agda`](./entries/funemy/agda/fib1.agda) - [`z3`](./entries/funemy/z3/z3fib.sh) diff --git a/entries/ionathanch/agda/Fib.agda b/entries/ionathanch/agda/Fib.agda new file mode 100644 index 0000000..a12b0a5 --- /dev/null +++ b/entries/ionathanch/agda/Fib.agda @@ -0,0 +1,19 @@ + +open import Agda.Builtin.Nat +open import Agda.Builtin.List +open import Agda.Builtin.Reflection + +data Fib : Nat → Nat → Set where + instance F0 : Fib 0 0 + instance F1 : Fib 1 1 + instance Fk : ∀ {k n m} → ⦃ Fib k n ⦄ → ⦃ Fib (suc k) m ⦄ → Fib (suc (suc k)) (n + m) + +fib' : ∀ k {n} → ⦃ Fib k n ⦄ → Nat +fib' k {n} ⦃ fib ⦄ = n + +macro + fib : Term → Term → TC _ + fib t hole = unify hole (def (quote fib') (arg i t ∷ [])) + where i = arg-info visible (modality relevant quantity-ω) + +{- Get the [n]th Fibonacci number by normalization via C-n `fib [n]`. -} diff --git a/entries/ionchy/agda/Fib.agda b/entries/ionchy/agda/Fib.agda deleted file mode 100644 index a12b0a5..0000000 --- a/entries/ionchy/agda/Fib.agda +++ /dev/null @@ -1,19 +0,0 @@ - -open import Agda.Builtin.Nat -open import Agda.Builtin.List -open import Agda.Builtin.Reflection - -data Fib : Nat → Nat → Set where - instance F0 : Fib 0 0 - instance F1 : Fib 1 1 - instance Fk : ∀ {k n m} → ⦃ Fib k n ⦄ → ⦃ Fib (suc k) m ⦄ → Fib (suc (suc k)) (n + m) - -fib' : ∀ k {n} → ⦃ Fib k n ⦄ → Nat -fib' k {n} ⦃ fib ⦄ = n - -macro - fib : Term → Term → TC _ - fib t hole = unify hole (def (quote fib') (arg i t ∷ [])) - where i = arg-info visible (modality relevant quantity-ω) - -{- Get the [n]th Fibonacci number by normalization via C-n `fib [n]`. -} -- cgit v1.2.3-70-g09d2