| 1 |
------------------------------------------------------------------------ |
| 2 |
-- The Agda standard library |
| 3 |
-- |
| 4 |
-- Convenient syntax for reasoning with a setoid |
| 5 |
------------------------------------------------------------------------ |
| 6 |
|
| 7 |
-- Example use: |
| 8 |
|
| 9 |
-- n*0≡0 : ∀ n → n * 0 ≡ 0 |
| 10 |
-- n*0≡0 zero = refl |
| 11 |
-- n*0≡0 (suc n) = begin |
| 12 |
-- suc n * 0 ≈⟨ refl ⟩ |
| 13 |
-- n * 0 + 0 ≈⟨ ... ⟩ |
| 14 |
-- n * 0 ≈⟨ n*0≡0 n ⟩ |
| 15 |
-- 0 ∎ |
| 16 |
|
| 17 |
-- Module `≡-Reasoning` in `Relation.Binary.PropositionalEquality` |
| 18 |
-- is recommended for equational reasoning when the underlying equality |
| 19 |
-- is `_≡_`. |
| 20 |
|
| 21 |
{-# OPTIONS --cubical-compatible --safe #-} |
| 22 |
|
| 23 |
open import Relation.Binary.Bundles using (Setoid) |
| 24 |
open import Relation.Binary.Reasoning.Syntax using (module ≈-syntax) |
| 25 |
|
| 26 |
module Relation.Binary.Reasoning.Setoid {s₁ s₂} (S : Setoid s₁ s₂) where |
| 27 |
|
| 28 |
open Setoid S |
| 29 |
|
| 30 |
import Relation.Binary.Reasoning.Base.Single _≈_ refl trans |
| 31 |
as SingleRelReasoning |
| 32 |
|
| 33 |
------------------------------------------------------------------------ |
| 34 |
-- Reasoning combinators |
| 35 |
|
| 36 |
-- Export the combinators for single relation reasoning, hiding the |
| 37 |
-- single misnamed combinator. |
| 38 |
open SingleRelReasoning public |
| 39 |
hiding (step-∼) |
| 40 |
renaming (∼-go to ≈-go) |
| 41 |
|
| 42 |
-- Re-export the equality-based combinators instead |
| 43 |
open ≈-syntax _IsRelatedTo_ _IsRelatedTo_ ≈-go sym public |