Giter Site home page Giter Site logo

Comments (2)

andreasabel avatar andreasabel commented on September 24, 2024

Default irrelevance in Agda is "nested", that means, entering an irrelevant position only promotes irrelevant hypotheses in the current context to relevant ones, but does not allow you to use new irrelevant that enter the context.
E.g., this is rejected:

record Squash (A : Set) : Set where
  constructor squash
  field .squashed : A

postulate
  irrelevant : (A : Set)  .A  Set

foo : Set  Set
foo A = irrelevant (Squash A  A) (λ (squash x)  x)

Variable x is declared irrelevant, so it cannot be used here

You can get this with --irrelevant-projections, which in effect makes irrelevant "flat":

foo : Set  Set
foo A = irrelevant (Squash A  A) (λ s  squashed s)

Having said that, Agda does seem inconsequential in that

  1. it internally converts top into failing-top through the record-pattern translation, but
  2. rejects failing-top when written by the user.

Evidence for fact 1 is that the following snipped is accepted by Agda:

postulate
  A : Set
  a : A
  s : Squash A

T : Squash A  Set
T (squash _) = A

test : T s
test = a

Agda reduces T s to A by virtue of its internal representation of T that translated away the match against squash.

However, adding a check that failing-top is ok would maybe a bit cumbersome. We would have to check that the projection could be eliminated by doing a match on the lhs instead, not involving no-eta-equality records.

from agda.

jamesmckinna avatar jamesmckinna commented on September 24, 2024

Ha! Interesting... many thanks for the feedback, and for the hint that in the presence of eta, failing-top should be OK... but sadly (for me in certain other settings), not for me/users themselves to define.

As for using --irrelevant-projections, that's not going to fly for stdlib modules I/we might otherwise STRONGLY wish to mark as --safe... oh well.

from agda.

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.