From bfac93dbe8c98d193feb165a088c6a7c79382d27 Mon Sep 17 00:00:00 2001 From: Greg Brown Date: Fri, 25 Nov 2022 15:40:44 +0000 Subject: Provide more bundles from algebras. --- src/Soat/SecondOrder/Algebra.idr | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Soat/SecondOrder/Algebra.idr b/src/Soat/SecondOrder/Algebra.idr index 5457385..9f9719e 100644 --- a/src/Soat/SecondOrder/Algebra.idr +++ b/src/Soat/SecondOrder/Algebra.idr @@ -111,6 +111,19 @@ public export (.setoid) : Algebra sig -> ISetoid (Pair sig.T (List sig.T)) (.setoid) a = MkISetoid (uncurry a.raw.U) a.relation a.algebra.equivalence +public export +(.setoidAt) : Algebra sig -> (ctx : List sig.T) -> ISetoid sig.T +(.setoidAt) a ctx = MkISetoid + (flip a.raw.U ctx) + (\t => a.relation (t, ctx)) + (\_ => a.algebra.equivalence _) + +public export +(.varFunc) : (a : Algebra sig) -> (ctx : _) -> IFunction (isetoid (flip Elem ctx)) (a.setoidAt ctx) +(.varFunc) a ctx = MkIFunction + (\_ => a.raw.var) + (\_ => (a.algebra.equivalence _).equalImpliesEq . cong a.raw.var) + public export record IsHomomorphism {0 sig : Signature} (a, b : Algebra sig) -- cgit v1.2.3