Skip to content

Commit 9b9e03d

Browse files
committed
Update to Agda 2.6.3
1 parent 099debe commit 9b9e03d

File tree

10 files changed

+52
-57
lines changed

10 files changed

+52
-57
lines changed

Diff for: .github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ jobs:
1010
- uses: actions/[email protected]
1111
- uses: omelkonian/setup-agda@master
1212
with:
13-
agda-version: 2.6.2.1
14-
stdlib-version: 1.7
13+
agda-version: 2.6.3
14+
stdlib-version: 1.7.2
1515
main: Main
1616
deploy: ${{ github.ref == 'refs/heads/master' }}
1717
token: ${{ secrets.GITHUB_TOKEN }}

Diff for: Class/MonadTC.agda

+13-13
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ record TCEnv : Set where
3737
reconstruction : Bool
3838
noConstraints : Bool
3939
reduction : ReductionOptions
40-
globalContext : List $ Arg Type
41-
localContext : List $ Abs $ Arg Type
40+
globalContext : Telescope
41+
localContext : Telescope
4242
goal : Term ⊎ Type
4343
debug : DebugOptions
4444

@@ -236,21 +236,21 @@ module _ {M : ∀ {f} → Set f → Set f}
236236
isAppliedToUnknownsAndMetas (meta x args) = isUnknownsAndMetas args
237237
isAppliedToUnknownsAndMetas _ = true
238238

239-
extendContext : Arg Type M A M A
240-
extendContext ty = local λ where e@record { localContext = Γ } record e { localContext = abs "" ty ∷ Γ }
239+
extendContext : String × Arg Type M A M A
240+
extendContext ty = local λ where e@record { localContext = Γ } record e { localContext = ty ∷ Γ }
241241

242-
getContext : M $ List $ Arg Type
242+
getContext : M Telescope
243243
getContext = reader λ where
244-
e@record { localContext = Γ ; globalContext = Γ' } map unAbs Γ Data.List.++ Γ'
244+
e@record { localContext = Γ ; globalContext = Γ' } Γ Data.List.++ Γ'
245245

246-
getLocalContext : M $ List $ Arg Type
247-
getLocalContext = reader λ where e@record { localContext = Γ } map unAbs Γ
246+
getLocalContext : M Telescope
247+
getLocalContext = reader λ where e@record { localContext = Γ } Γ
248248

249-
inContext : List $ Arg Type M A M A
250-
inContext ctx = local λ e record e { localContext = map (abs "") ctx }
249+
inContext : Telescope M A M A
250+
inContext ctx = local λ e record e { localContext = ctx }
251251

252252
-- extend context by multiple variables
253-
extendContext' : List (Arg Type) M A M A
253+
extendContext' : Telescope M A M A
254254
extendContext' [] x = x
255255
extendContext' (c ∷ cs) x = extendContext c (extendContext' cs x)
256256

@@ -311,8 +311,8 @@ module _ {M : ∀ {f} → Set f → Set f}
311311
getConstrsForTerm t = getConstrsForType =<< inferType t
312312

313313
-- run a TC computation to arrive at the term under the binder for the pattern
314-
withPattern : List (String × Arg Type) List (Arg Pattern) M Term M Clause
315-
withPattern tel ps t = Clause.clause tel ps <$> extendContext' (map proj₂ tel) t
314+
withPattern : Telescope List (Arg Pattern) M Term M Clause
315+
withPattern tel ps t = Clause.clause tel ps <$> extendContext' tel t
316316

317317
unifyWithGoal : Term M ⊤
318318
unifyWithGoal t = do

Diff for: Generics/Debug.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open import Reflection.Meta
2020

2121
open import Class.Show.Core
2222
open import Class.Show.Instances
23-
open import Class.Functor.Instances
23+
open import Class.Functor
2424
open import Class.Monad
2525
open import Class.Traversable.Core
2626
open import Class.Traversable.Instances
@@ -74,7 +74,7 @@ module Debug (v : String × ℕ) where
7474
go (i , ty) = print $ "\t" Str.++ show i Str.++ " : " Str.++ show ty
7575

7676
printCurrentContext : TC ⊤
77-
printCurrentContext = printContext =<< getContext
77+
printCurrentContext = printContext =<< (Data.List.map proj₂ <$> getContext)
7878

7979
-- ** definitions
8080
genSimpleDef : Name Type Term TC ⊤

Diff for: Reflection/TCI.agda

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ applyNoConstraints : TC A → TC A
5050
applyNoConstraints x r@record { noConstraints = false } = x r
5151
applyNoConstraints x r@record { noConstraints = true } = R'.noConstraints (x r)
5252

53-
applyExtContext : List (Arg Term) R.TC A R.TC A
53+
applyExtContext : Telescope R.TC A R.TC A
5454
applyExtContext [] x = x
55-
applyExtContext (t ∷ ts) x = applyExtContext ts $ R.extendContext t x
55+
applyExtContext (t ∷ ts) x = applyExtContext ts $ (uncurry R.extendContext) t x
5656

5757
private
5858
liftTC : R.TC A TC A
59-
liftTC x = λ r applyExtContext (map unAbs $ r .TCEnv.localContext) x
59+
liftTC x = λ r applyExtContext (r .TCEnv.localContext) x
6060

6161
liftTC1 : (A R.TC B) A TC B
6262
liftTC1 f a = liftTC (f a)

Diff for: Tactic/ClauseBuilder.agda

+4-6
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
103103
ctxSinglePatterns : M (List SinglePattern)
104104
ctxSinglePatterns = do
105105
ctx getContext
106-
return (singlePatternFromPattern <$> zipWithIndex (λ where k (arg i _) arg i (` k)) ctx)
106+
return (singlePatternFromPattern <$> zipWithIndex (λ where k (_ , (arg i _)) arg i (` k)) ctx)
107107

108108
-- TODO: add the ability to match initial hidden arguments
109109
-- TODO: add dot patterns
@@ -243,7 +243,7 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
243243
isProj _ = false
244244

245245
-- if the goal is of type (a : A) → B, return the type of the branch of pattern p and new context
246-
specializeType : SinglePattern Type M (Type × List (Arg Type))
246+
specializeType : SinglePattern Type M (Type × Telescope)
247247
specializeType p@(t , arg i p') goalTy = markDontFail "specializeType" $ inDebugPath "specializeType" $ runAndReset do
248248
debugLog ("Goal type to specialize: " ∷ᵈ goalTy ∷ᵈ [])
249249
cls@((Clause.clause tel _ _) ∷ _) return $ clauseExprToClauses $ MatchExpr $
@@ -256,12 +256,10 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
256256
∷ᵈ "\nWith type:" ∷ᵈ goalTy ∷ᵈ "\nSinglePattern:" -- ∷ᵈ {!p!}
257257
∷ᵈ []) >> error1 "BUG"
258258
let varsToUnbind = 0
259-
let newCtx = proj₂ <$> tel'
259+
let newCtx = tel'
260260
let m = meta x (map-Args (mapVars (_∸ varsToUnbind)) $ take (length ap ∸ varsToUnbind) ap)
261-
logCurrentContext
262261
debugLog1 "New context:"
263-
logTelescope (Data.List.map (nothing ,_) newCtx)
264-
debugLog1 "TEST"
262+
logContext newCtx
265263
goalTy' extendContext' newCtx $ inferType m
266264
return (goalTy' , newCtx)
267265

Diff for: Tactic/Derive.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ genClassType arity dName wName = do
6161
adjustParams [] = return []
6262
adjustParams (abs x (arg _ t) ∷ l) = do
6363
a (if_then [ (abs "_" (iArg (className ∙⟦ ♯ 0 ⟧)) , false) ] else []) <$> isNArySort arity t
64-
ps extendContext (hArg t) (adjustParams l)
64+
ps extendContext (x , hArg t) (adjustParams l)
6565
let ps' = flip L.map ps λ where
6666
(abs s (arg i t) , b) (abs s (arg i (mapVars (_+ (if b then length a else 0)) t)) , b)
6767
return (((abs x (hArg t) , true) ∷ a) ++ ps')

Diff for: Tactic/Helpers.agda

+5-5
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
6060
(just "") "_"
6161
(just x) x
6262
debugLog (" " ∷ᵈ name ∷ᵈ " : " ∷ᵈ mapVars (_∸ (n ∸ (1 + length l))) t ∷ᵈ [])
63-
extendContext ty $ helper n l
63+
extendContext (name , ty) $ helper n l
6464

65-
logContext : List $ Arg Type M ⊤
65+
logContext : Telescope M ⊤
6666
logContext l = withAppendDebugPath "context" do
6767
debugLog1 "Context:"
6868
catch (helper (length l) l) (λ _ debugLog1 "Error while printing the context!")
@@ -74,9 +74,9 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
7474
where _ error1 "Bug in logContext!"
7575
debugLog ("Error while infering the goal type! Goal: " ∷ᵈ t ∷ᵈ [])
7676
where
77-
helper : List $ Arg Type M ⊤
77+
helper : Telescope M ⊤
7878
helper n [] = return _
79-
helper n (arg _ t ∷ l) = do
79+
helper n ((_ , arg _ t) ∷ l) = do
8080
helper n l
8181
debugLog (" " ∷ᵈ ♯ (n ∸ (length l + 1)) ∷ᵈ " : " ∷ᵈ mapVars (_+ (n ∸ length l)) t ∷ᵈ [])
8282

@@ -95,7 +95,7 @@ module _ {M : ∀ {a} → Set a → Set a} ⦃ _ : Monad M ⦄ ⦃ me : MonadErr
9595
helper : Type M TypeView
9696
helper ty zero = return $ viewTy ty
9797
helper ty (suc k) with viewTy ty
98-
... | (tel , ty') = extendContext' (map unAbs tel) $ do
98+
... | (tel , ty') = extendContext' (map (λ where (abs s t) s , t) tel) $ do
9999
rTy reduce ty'
100100
(tel' , rTy') helper rTy k
101101
return (tel ++ tel' , rTy')

Diff for: Tactics/Existentials.agda

+3-6
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ mkExistential lvl t = do
2525
go n₀ (suc n) = quote ∃ ∙⟦ (`λ "_" ⇒ go n₀ n) ⟧
2626

2727
macro
28-
mk∃[nest:_] : Name Tactic
29-
mk∃[nest:_] lvl t hole = mkExistential lvl t >>= unify hole
30-
3128
mk∃ : Name Tactic
3229
mk∃ t hole = mkExistential 0 t >>= unify hole
3330

@@ -42,18 +39,18 @@ private
4239
data Y : String Set where
4340
mkY : Y "" 1
4441

45-
_ : mk∃[nest: 1 ] Y
42+
_ : mk∃ Y
4643
_ = "" , 1 , mkY
4744

4845
module _ (s : String) where
4946

5047
data Z : Set where
5148
mkZ : Z 1
5249

53-
_ : mk∃[nest: 2 ] Z
50+
_ : mk∃ Z
5451
_ = 1 , mkZ
5552

56-
_ : mk∃[nest: 1 ] Z
53+
_ : mk∃ Z
5754
_ = "sth" , 1 , mkZ
5855

5956
_ : mk∃ Y

Diff for: Tactics/Intro.agda

+17-17
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ intro hole k = do
2424
case ty of λ where
2525
(pi argTy@(arg (arg-info v _) _) (abs x ty′)) do
2626
ctx getContext
27-
hole′ inContext (argTy ∷ ctx) $ do
27+
hole′ inContext (("" , argTy) ∷ ctx) $ do
2828
hole′ newMeta ty′
2929
return hole′
3030
unifyStrict (hole , ty) (lam v (abs "_" hole′))
31-
extendContext argTy $ do
31+
extendContext x argTy $ do
3232
k hole′
3333
_ k hole
3434

@@ -37,15 +37,15 @@ intros : Hole → Tactic → TC ⊤
3737
intros hole k = do
3838
ty inferType hole
3939
case ty of λ where
40-
(pi argTy@(arg (arg-info v _) _) (abs _ ty′)) do
40+
(pi argTy@(arg (arg-info v _) _) (abs x ty′)) do
4141
ctx getContext
4242
print $ "\t* " ◇ show argTy
43-
printContext ctx
44-
hole′ inContext (argTy ∷ ctx) $ do
43+
printCurrentContext
44+
hole′ inContext ((x , argTy) ∷ ctx) $ do
4545
hole′ newMeta ty′
4646
return hole′
4747
unifyStrict (hole , ty) (lam v (abs "_" hole′))
48-
extendContext argTy $ do
48+
extendContext x argTy $ do
4949
intros hole′ k
5050
_ k hole
5151

@@ -54,7 +54,7 @@ private
5454
fillFromContext hole = do
5555
ty inferType hole
5656
ctx getContext
57-
printContext ctx
57+
printCurrentContext
5858
let n = length ctx
5959
let vs = applyUpTo ♯ n
6060
unifyStricts (hole , ty) vs
@@ -119,8 +119,8 @@ private
119119
_ : {n : Bool} Bool
120120
_ = intros→fill
121121

122-
_ : {n : ℕ} (b : Bool) Bool
123-
_ = intros→fill
122+
-- _ : {n : ℕ} (b : Bool) Bool
123+
-- _ = intros→fill
124124

125125
_ : (n : ℕ) Bool Bool
126126
_ = intros→fill
@@ -131,19 +131,19 @@ private
131131
_ : (b : Bool) {n : ℕ}
132132
_ = intros→fill
133133

134-
_ : {b : Bool} (n : ℕ)
135-
_ = intros→fill
134+
-- _ : {b : Bool} (n : ℕ)
135+
-- _ = intros→fill
136136

137137
_ : (b : Bool) (n : ℕ) Bool
138138
_ = intros→fill
139139

140140
open import Data.List.Membership.Propositional
141141

142-
_ : {x : ℕ} {xs} x ∈ xs x ∈ xs
143-
_ = intro→fill
142+
-- _ : {x : ℕ} {xs} x ∈ xs x ∈ xs
143+
-- _ = intro→fill
144144

145-
_ : {x y : ℕ} {xs ys} x ∈ xs y ∈ ys x ∈ xs
146-
_ = intros→fill
145+
-- _ : {x y : ℕ} {xs ys} x ∈ xs y ∈ ys x ∈ xs
146+
-- _ = intros→fill
147147

148-
_ : {x y : ℕ} {xs} x ∈ xs y ∈ xs y ∈ xs
149-
_ = intros→fill
148+
-- _ : {x y : ℕ} {xs} x ∈ xs y ∈ xs y ∈ xs
149+
-- _ = intros→fill

Diff for: Tactics/Try.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,13 @@ tryWith userDB f₀ hole₀ = do
217217
(f , fTy) viewTerm f₀
218218
print $ show f ◇ " : " ◇ show fTy
219219
ctx getContext
220-
prints "ctx" ctx
220+
printCurrentContext
221221
let
222222
db : List Term
223223
db = nodup
224224
$ map ♯ (upTo $ length ctx)
225225
++ subterms holeTy
226-
++ subterms ctx
226+
++ subterms (map proj₂ ctx)
227227
++ userDB
228228
++ [ unknown ]
229229
prints "db" db

0 commit comments

Comments
 (0)