summaryrefslogtreecommitdiff
path: root/src/Soat/SecondOrder/Algebra/Lift.idr
diff options
context:
space:
mode:
authorGreg Brown <greg.brown01@ed.ac.uk>2022-12-06 16:18:29 +0000
committerGreg Brown <greg.brown01@ed.ac.uk>2022-12-06 16:18:29 +0000
commitfcd024cb01e484dc3c92212f4317b254bbd7580b (patch)
tree99f8f7f834524e38aed09b5abece1b2db47a8a01 /src/Soat/SecondOrder/Algebra/Lift.idr
parent83c85bf396949287365a694a89e0f49a58cab5a2 (diff)
Add smart constructor for first-order algebras.refactor/strict
Diffstat (limited to 'src/Soat/SecondOrder/Algebra/Lift.idr')
-rw-r--r--src/Soat/SecondOrder/Algebra/Lift.idr9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Soat/SecondOrder/Algebra/Lift.idr b/src/Soat/SecondOrder/Algebra/Lift.idr
index d80eeb1..8bbcf9e 100644
--- a/src/Soat/SecondOrder/Algebra/Lift.idr
+++ b/src/Soat/SecondOrder/Algebra/Lift.idr
@@ -26,11 +26,10 @@ project a ctx = MkRawAlgebra
public export
projectAlgebra : (0 sig : _) -> Algebra (lift sig) -> (ctx : List sig.T) -> Algebra sig
projectAlgebra sig a ctx = MkAlgebra
- { raw = project a.raw ctx
- , algebra = MkIsAlgebra
- { equivalence = (reindex (flip MkPair ctx) a.setoid).equivalence
- , semCong = \op => a.algebra.semCong ctx (MkOp (Op op.op)) . wrapIntro
- }
+ { U = a.setoidAt ctx
+ , sem = \op =>
+ a.semFunc ctx (MkOp (Op op.op)) .
+ index (wrapFunc (reindex (\ty => (snd ty, fst ty ++ ctx)) a.setoid) (MkPair [])) _
}
public export