<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>Maybe I miss something but why don’t we represent strictly positive functors just as indexed containers, that is </div>
<div><br>
</div>
<div>Cont I O = Sigma S : O -> Set. P : (o : O) -> S o -> I -> Set</div>
<div><br>
</div>
<div>This gives rise to an indexed functor and it is closed under all desired operations including fixed points without any problems with the positivity checker. This was carried out in some detail in our papers on indexed containers
<a href="http://www.cs.nott.ac.uk/~psztxa/publ/jcont.pdf">http://www.cs.nott.ac.uk/~psztxa/publ/jcont.pdf</a> [JFP15],<a href="http://www.cs.nott.ac.uk/~psztxa/publ/ICont.pdf">http://www.cs.nott.ac.uk/~psztxa/publ/ICont.pdf</a> [LICS 09], which should have
been cited btw. </div>
<div><br>
</div>
<div>Thorsten</div>
<div><br>
</div>
<div>P.S. The version of the journal paper on my web page is a bit behind – please refer to the published version</div>
<div><a href="http://dx.doi.org/10.1017/S095679681500009X">http://dx.doi.org/10.1017/S095679681500009X</a></div>
<div>If you can :-)</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:11pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Martin Stone Davis <<a href="mailto:martin.stone.davis@gmail.com">martin.stone.davis@gmail.com</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, 7 January 2016 04:03<br>
<span style="font-weight:bold">To: </span>agda <<a href="mailto:agda@lists.chalmers.se">agda@lists.chalmers.se</a>><br>
<span style="font-weight:bold">Subject: </span>[Agda] Generic Programming with Indexed Functors<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr">{-<br>
The fixed-point definition in section 2.3 of <a href="https://www.researchgate.net/publication/228944016_Generic_Programming_with_Indexed_Functors">
Generic Programming with Indexed Functors</a> no longer type-checks in the latest version of Agda, which complains that μ is not strictly positive:<br>
<br>
data μ {I O : Set} (F : (I ⊎ O) ▶ O) (r : Indexed I) (o : O) : Set where<br>
⟨_⟩ : ⟦ F ⟧ (r ∣ μ F r) o → μ F r o<br>
<br>
I haven't had any luck finding a workaround. The code below is ripped from the article and reproduces the problem I'm having. Thanks in advance for any help solving this.<br>
-}<br>
<br>
module IndexedFunctor where<br>
open import Function using (_∘_)<br>
open import Relation.Binary.Core using (_≡_)<br>
<br>
open import Data.Empty using (⊥)<br>
open import Data.Unit using (⊤ ; tt)<br>
<br>
open import Data.Product using (_×_ ; ∃)<br>
open import Data.Sum using (_⊎_ ; inj₁ ; inj₂)<br>
<br>
Indexed : Set → Set₁<br>
Indexed I = I → Set<br>
<br>
_▷_ : Set → Set → Set₁<br>
I ▷ O = Indexed I → Indexed O<br>
<br>
record _≃_ (A B : Set) : Set where<br>
field<br>
from : A → B<br>
to : B → A<br>
iso₁ : ∀ {x} → to (from x) ≡ x<br>
iso₂ : ∀ {x} → from (to x) ≡ x<br>
<br>
_∣_ : ∀ {A B} → Indexed A → Indexed B → Indexed (A ⊎ B)<br>
_∣_ ia _ (inj₁ x) = ia x<br>
_∣_ _ ib (inj₂ x) = ib x<br>
<br>
mutual<br>
data _▶_ : Set → Set → Set₁ where<br>
Z : ∀ {I O} → I ▶ O<br>
U : ∀ {I O} → I ▶ O<br>
I : ∀ {I O} → I → I ▶ O<br>
! : ∀ {I O} → O → I ▶ O<br>
_⊕_ : ∀ {I O} → I ▶ O → I ▶ O → I ▶ O<br>
_⊗_ : ∀ {I O} → I ▶ O → I ▶ O → I ▶ O<br>
_⊚_ : ∀ {I M O} → M ▶ O → I ▶ M → I ▶ O<br>
_↗_↘_ : ∀ {I I' O O'} → I' ▶ O' → (I' → I) → (O → O') → I ▶ O<br>
Fix : ∀ {I O} → (I ⊎ O) ▶ O → I ▶ O<br>
∑ : ∀ {I O} → {C : ⊥ ▶ ⊤} → (⟦ C ⟧ (λ _ → ⊤) tt → I ▶ O) → I ▶ O<br>
Iso : ∀ {I O} → (C : I ▶ O) → (D : I ▷ O) → ((r : Indexed I) → (o : O) → D r o ≃ ⟦ C ⟧ r o) → I ▶ O<br>
<br>
data μ {I O : Set} (F : (I ⊎ O) ▶ O) (r : Indexed I) (o : O) : Set where<br>
⟨_⟩ : ⟦ F ⟧ (r ∣ μ F r) o → μ F r o<br>
<br>
⟦_⟧ : ∀ {I O} → I ▶ O → I ▷ O<br>
⟦ Z ⟧ r o = ⊥<br>
⟦ U ⟧ r o = ⊤<br>
⟦ I i ⟧ r o = r i<br>
⟦ F ↗ f ↘ g ⟧ r o = ⟦ F ⟧ (r ∘ f) (g o)<br>
⟦ F ⊕ G ⟧ r o = ⟦ F ⟧ r o ⊎ ⟦ G ⟧ r o<br>
⟦ F ⊗ G ⟧ r o = ⟦ F ⟧ r o × ⟦ G ⟧ r o<br>
⟦ F ⊚ G ⟧ r o = ⟦ F ⟧ (⟦ G ⟧ r) o<br>
⟦ Fix F ⟧ r o = μ F r o<br>
⟦ ! o' ⟧ r o = o ≡ o'<br>
⟦ ∑ f ⟧ r o = ∃ (λ i → ⟦ f i ⟧ r o)<br>
⟦ Iso C D e ⟧ r o = D r o<br>
<br clear="all">
<div>
<div class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">
<div>
<div dir="ltr">--<br>
Martin Stone Davis<br>
<div><br>
Postal/Residential:<br>
</div>
<div style="margin-left:40px"><span>1223 Ferry St</span><span><span><br>
</span></span></div>
<div style="margin-left:40px"><span><span>Apt 5<br>
</span></span></div>
<div style="margin-left:40px"><span>Eugene, OR 97401</span><br>
</div>
Talk / <span></span>Text / Voicemail: <a href="tel:3106993578" value="+13106993578" target="_blank">
(310) 699-3578</a><br>
Electronic Mail: <a href="mailto:martin.stone.davis@gmail.com" target="_blank">martin.stone.davis@gmail.com</a>
<div>
<div>
<div><span></span></div>
</div>
</div>
</div>
</div>
<div dir="ltr"><span style="font-size:small">Website: </span><a href="http://martinstonedavis.com/" style="color:rgb(17,85,204);font-size:small" target="_blank">martinstonedavis.com</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</span>
<PRE>
This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please send it back to me, and immediately delete it.
Please do not use, copy or disclose the information contained in this
message or in any attachment. Any views or opinions expressed by the
author of this email do not necessarily reflect the views of the
University of Nottingham.
This message has been checked for viruses but the contents of an
attachment may still contain software viruses which could damage your
computer system, you are advised to perform your own checks. Email
communications with the University of Nottingham may be monitored as
permitted by UK legislation.
</PRE></body>
</html>