Issue4169-2.agda 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. module _ where
  2. import Agda.Builtin.Equality
  3. open import Agda.Builtin.Sigma
  4. open import Agda.Builtin.Unit
  5. open import Agda.Primitive
  6. open import Common.IO
  7. data ⊥ : Set where
  8. record R₁ a : Set (lsuc a) where
  9. field
  10. R : {A : Set a} → A → A → Set a
  11. r : {A : Set a} (x : A) → R x x
  12. P : Set a → Set a
  13. P A = (x y : A) → R x y
  14. record R₂ (r : ∀ ℓ → R₁ ℓ) : Set₁ where
  15. field
  16. f :
  17. {X Y : Σ Set (R₁.P (r lzero))} →
  18. R₁.R (r (lsuc lzero)) X Y → fst X → fst Y
  19. module M (r₁ : ∀ ℓ → R₁ ℓ) (r₂ : R₂ r₁) where
  20. open module R₁′ {ℓ} = R₁ (r₁ ℓ) public using (P)
  21. open module R₂′ = R₂ r₂ public
  22. ⊥-elim : {A : Set} → ⊥ → A
  23. ⊥-elim ()
  24. p : P ⊥
  25. p x = ⊥-elim x
  26. open Agda.Builtin.Equality
  27. r₁ : ∀ ℓ → R₁ ℓ
  28. R₁.R (r₁ _) = _≡_
  29. R₁.r (r₁ _) = λ _ → refl
  30. r₂ : R₂ r₁
  31. R₂.f r₂ refl x = x
  32. open M r₁ r₂
  33. data Unit : Set where
  34. unit : Unit
  35. g : Σ Unit λ _ → P (Σ Set P) → ⊥
  36. g = unit , λ h → f (h (⊤ , λ _ _ → refl) (⊥ , p)) tt
  37. main : IO ⊤
  38. main = return _