Debian Codegraph @

src/Algebra/Solver/CommutativeMonoid/Example.agda

raw
1 ------------------------------------------------------------------------
2 -- The Agda standard library
3 --
4 -- An example of how Algebra.CommutativeMonoidSolver can be used
5 ------------------------------------------------------------------------
6
7 {-# OPTIONS --cubical-compatible --safe #-}
8
9 module Algebra.Solver.CommutativeMonoid.Example where
10
11 open import Relation.Binary.PropositionalEquality.Core using (_≡_)
12
13 open import Data.Bool.Base using (_∨_)
14 open import Data.Bool.Properties using (∨-commutativeMonoid)
15
16 open import Data.Fin.Base using (zero; suc)
17 open import Data.Vec.Base using ([]; _∷_)
18
19 open import Algebra.Solver.CommutativeMonoid ∨-commutativeMonoid
20
21 test : ∀ x y z → (x ∨ y) ∨ (x ∨ z) ≡ (z ∨ y) ∨ (x ∨ x)
22 test a b c = let _∨_ = _⊕_ in
23 prove 3 ((x ∨ y) ∨ (x ∨ z)) ((z ∨ y) ∨ (x ∨ x)) (a ∷ b ∷ c ∷ [])
24 where
25 x = var zero
26 y = var (suc zero)
27 z = var (suc (suc zero))