<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&nbsp;</div>
<div><br>
</div>
<div>Cont I O = Sigma S : O -&gt; Set. P : (o : O) -&gt; S o -&gt; I -&gt; 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>&nbsp;[JFP15],<a href="http://www.cs.nott.ac.uk/~psztxa/publ/ICont.pdf">http://www.cs.nott.ac.uk/~psztxa/publ/ICont.pdf</a>&nbsp;[LICS 09], which should have
 been cited btw.&nbsp;</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 &lt;<a href="mailto:martin.stone.davis@gmail.com">martin.stone.davis@gmail.com</a>&gt;<br>
<span style="font-weight:bold">Date: </span>Thursday, 7 January 2016 04:03<br>
<span style="font-weight:bold">To: </span>agda &lt;<a href="mailto:agda@lists.chalmers.se">agda@lists.chalmers.se</a>&gt;<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>
&nbsp; data μ {I O : Set} (F : (I ⊎ O) ▶ O) (r : Indexed I) (o : O) : Set where<br>
&nbsp;&nbsp;&nbsp; ⟨_⟩ : ⟦ 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>
&nbsp; open import Function using (_∘_)<br>
&nbsp; open import Relation.Binary.Core using (_≡_)<br>
<br>
&nbsp; open import Data.Empty using (⊥)<br>
&nbsp; open import Data.Unit using (⊤ ; tt)<br>
&nbsp; <br>
&nbsp; open import Data.Product using (_×_ ; ∃)<br>
&nbsp; open import Data.Sum using (_⊎_ ; inj₁ ; inj₂)<br>
&nbsp; <br>
&nbsp; Indexed : Set → Set₁<br>
&nbsp; Indexed I = I → Set<br>
<br>
&nbsp; _▷_ : Set → Set → Set₁<br>
&nbsp; I ▷ O = Indexed I → Indexed O<br>
<br>
&nbsp; record _≃_ (A B : Set) : Set where<br>
&nbsp;&nbsp;&nbsp; field<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; from : A → B<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to&nbsp;&nbsp; : B → A<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iso₁ : ∀ {x} → to (from x) ≡ x<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iso₂ : ∀ {x} → from (to x) ≡ x<br>
<br>
&nbsp; _∣_ : ∀ {A B} → Indexed A → Indexed B → Indexed (A ⊎ B)<br>
&nbsp; _∣_ ia _ (inj₁ x) = ia x<br>
&nbsp; _∣_ _ ib (inj₂ x) = ib x<br>
<br>
&nbsp; mutual<br>
&nbsp;&nbsp;&nbsp; data _▶_ : Set → Set → Set₁ where<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ∀ {I O} → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ∀ {I O} → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ∀ {I O} → I → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ∀ {I O} → O → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _⊕_&nbsp;&nbsp;&nbsp; : ∀ {I O}&nbsp;&nbsp; → I ▶ O → I ▶ O → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _⊗_&nbsp;&nbsp;&nbsp; : ∀ {I O}&nbsp;&nbsp; → I ▶ O → I ▶ O → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _⊚_&nbsp;&nbsp;&nbsp; : ∀ {I M O} → M ▶ O → I ▶ M → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; _↗_↘_&nbsp; : ∀ {I I' O O'} → I' ▶ O' → (I' → I) → (O → O') → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fix&nbsp;&nbsp;&nbsp; : ∀ {I O} → (I ⊎ O) ▶ O → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ∑&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : ∀ {I O} → {C : ⊥ ▶ ⊤} → (⟦ C ⟧ (λ _ → ⊤) tt → I ▶ O) → I ▶ O<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Iso&nbsp;&nbsp;&nbsp; : ∀ {I O} → (C : I ▶ O) → (D : I ▷ O) → ((r : Indexed I) → (o : O) → D r o ≃ ⟦ C ⟧ r o) → I ▶ O<br>
<br>
&nbsp;&nbsp;&nbsp; data μ {I O : Set} (F : (I ⊎ O) ▶ O) (r : Indexed I) (o : O) : Set where<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟨_⟩ : ⟦ F ⟧ (r ∣ μ F r) o → μ F r o<br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; ⟦_⟧ : ∀ {I O} → I ▶ O → I ▷ O<br>
&nbsp;&nbsp;&nbsp; ⟦ Z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ⊥<br>
&nbsp;&nbsp;&nbsp; ⟦ U&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ⊤<br>
&nbsp;&nbsp;&nbsp; ⟦ I i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = r i<br>
&nbsp;&nbsp;&nbsp; ⟦ F ↗ f ↘ g ⟧ r o = ⟦ F ⟧ (r ∘ f) (g o)<br>
&nbsp;&nbsp;&nbsp; ⟦ F ⊕ G&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ⟦ F ⟧ r o ⊎ ⟦ G ⟧ r o<br>
&nbsp;&nbsp;&nbsp; ⟦ F ⊗ G&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ⟦ F ⟧ r o × ⟦ G ⟧ r o<br>
&nbsp;&nbsp;&nbsp; ⟦ F ⊚ G&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ⟦ F ⟧ (⟦ G ⟧ r) o<br>
&nbsp;&nbsp;&nbsp; ⟦ Fix F&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = μ F r o<br>
&nbsp;&nbsp;&nbsp; ⟦ ! o'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = o ≡ o'<br>
&nbsp;&nbsp;&nbsp; ⟦ ∑ f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ⟧ r o = ∃ (λ i → ⟦ f i ⟧ r o)<br>
&nbsp;&nbsp;&nbsp; ⟦ 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="&#43;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:&nbsp;</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>