Skip to content

Commit fc8c21e

Browse files
Add solvers for rationals (#1394)
Co-authored-by: MatthewDaggitt <[email protected]>
1 parent 1fbb5e2 commit fc8c21e

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ New modules
291291
Algebra.Morphism.LatticeMonomorphism
292292
```
293293

294+
* Solvers for rationals
295+
```
296+
Data.Rational.Solver
297+
Data.Rational.Unnormalised.Solver
298+
```
299+
294300
* New ternary relation on lists:
295301
```
296302
Data.List.Relation.Ternary.Appending

src/Data/Rational/Solver.agda

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Automatic solvers for equations over rationals
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --without-K --safe #-}
8+
9+
module Data.Rational.Solver where
10+
11+
import Algebra.Solver.Ring.Simple as Solver
12+
import Algebra.Solver.Ring.AlmostCommutativeRing as ACR
13+
open import Data.Rational.Properties using (_≟_; +-*-commutativeRing)
14+
15+
------------------------------------------------------------------------
16+
-- A module for automatically solving propositional equivalences
17+
-- containing _+_ and _*_
18+
19+
module +-*-Solver =
20+
Solver (ACR.fromCommutativeRing +-*-commutativeRing) _≟_
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
------------------------------------------------------------------------
2+
-- The Agda standard library
3+
--
4+
-- Automatic solvers for equations over rationals
5+
------------------------------------------------------------------------
6+
7+
{-# OPTIONS --without-K --safe #-}
8+
9+
module Data.Rational.Unnormalised.Solver where
10+
11+
import Algebra.Solver.Ring.Simple as Solver
12+
import Algebra.Solver.Ring.AlmostCommutativeRing as ACR
13+
open import Data.Rational.Unnormalised.Properties using (_≃?_; +-*-commutativeRing)
14+
15+
------------------------------------------------------------------------
16+
-- A module for automatically solving propositional equivalences
17+
-- containing _+_ and _*_
18+
19+
module +-*-Solver =
20+
Solver (ACR.fromCommutativeRing +-*-commutativeRing) _≃?_
21+

0 commit comments

Comments
 (0)