Giter Club home page Giter Club logo

Comments (7)

JacquesCarette avatar JacquesCarette commented on July 18, 2024 1

This is definitely about Agda's handling of 'irrelevant' (which I've run into quite a bit too). A discussion about it should happen on the Agda side (either Zulip or git issues) as that's where the experts are for that.

from agda-stdlib.

jamesmckinna avatar jamesmckinna commented on July 18, 2024

Further evidence towards the identification of Recomputable and Harrop:

Recomputable :  {a} (A : Set a)  Set a
Recomputable A = .A  A

_×-recompute_ : Recomputable A  Recomputable B  Recomputable (A × B)
(rA ×-recompute rB) p = rA (p .proj₁) , rB (p .proj₂)
-- NB this definition fails: (rA ×-recompute rB) (a , b) = rA a , rB b
-- Cannot pattern match against irrelevant argument of type A × B
-- when checking that the pattern a , b has type A × B

→-recompute : Recomputable B  Recomputable (A  B)
→-recompute rB f a = rB (f a)

∀-recompute : (B : A  Set b)  ((x : A)  Recomputable (B x))  Recomputable ((x : A)  B x)
∀-recompute B rB f a = rB a (f a)

Suggest that this become a focus of effort on reconciling (the) 'classical' fragment(s) of type theory with the ambient intuitionistic.

Or has this already been done somewhere (else) before?
Have now asked on the main Agda Zulip

Nisse's answer there has me needing to think a bit harder. Specifically, I don't think we can make a simple-minded identification of Recomputable and Harrop; rather they have the same/similar closure properties. But for any collection of 'base' types, the Harrop/negative fragment defined over them will satisfy all sorts of things (Recomputable, Decidable, Stable, ...) depending on the corresponding conditions on those base types. So this seems really to be more about 'induction over the negative fragment'.

from agda-stdlib.

jamesmckinna avatar jamesmckinna commented on July 18, 2024

But the main content of the issue: namely reconciling 'irrelevant' ⊥-elim and ⊥-elim, still stands. So at some point I'll turn the branch into a small(er)-scale PR, leaving the 'other' issue: what/where/how should we define Recomputable, and refactor the library to make use of this definition? So... further comments on the issue welcome towards such an eventual 'design'.

from agda-stdlib.

jamesmckinna avatar jamesmckinna commented on July 18, 2024

Proposal: replace the type of ⊥-elim with that of ⊥-elim-irr:

⊥-elim :  {w} {Whatever : Set w}  .⊥  Whatever
⊥-elim ()

Would this constitute a breaking change?

from agda-stdlib.

gallais avatar gallais commented on July 18, 2024

Would this constitute a breaking change?

Given that we don't have subtyping for functions whose domain is irrelevant (the following is rejected:

app : {A B : Set}  (.A  B)  (A  B)
app f = f

) then I'd say yes. It could break strange code that uses ⊥-elim partially applied.

from agda-stdlib.

JacquesCarette avatar JacquesCarette commented on July 18, 2024

Good point: I think that the proposal goes one step too far. Indeed it would only break rather strange code, but the debugging pain would be quite something!

from agda-stdlib.

jamesmckinna avatar jamesmckinna commented on July 18, 2024

Thanks to both. Indeed, errors arising from (some) partial applications of contradiction was one reason I introduced its friend contradictionᵒ in #2243 , and I won't pursue the more radical proposal on that PR ... or any other, until v3.0! But definitely keen to push on with what's already there. Please review!

from agda-stdlib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.