Giter Site home page Giter Site logo

Comments (6)

dolio avatar dolio commented on June 27, 2024 1

BTW, this is inconsistent with cubical:

open import Cubical.Foundations.Prelude
open import Cubical.Data.Bool
open import Cubical.Data.Empty
open import Cubical.Data.Unit
open import Cubical.Relation.Nullary


variable
  A B : Type

record TSquash (A : Type) : Type where
  field .extract : Unit -> A

  .tflat : Unit -> A
  tflat x = extract x

open TSquash

emb : A -> TSquash A
emb a .extract _ = a

lemma₀ :  t  PathP (λ i  TSquash (notEq i)) t t
lemma₀ t i = transport (λ j  TSquash (notEq (i ∧ j))) t

lemma₁ : ¬ ( A  TSquash A -> A)
lemma₁ ext = not≢const (ext Bool f) sublemma where
  f = emb false

  sublemma : not (ext Bool f) ≡ ext Bool f
  sublemma = fromPathP λ i  ext (notEq i) (lemma₀ f i)

.ext : TSquash A -> A
ext t = tflat t _

.xplode : ⊥
xplode = lemma₁ (λ _  ext)

bad : ⊥
bad = e xplode where
  e : .⊥ -> ⊥
  e ()

from agda.

jamesmckinna avatar jamesmckinna commented on June 27, 2024 1

Would fixing this (via @andreasabel 's proposal, or otherwise) invalidate agda/agda-stdlib#2199 and/or agda/agda-stdlib#2243 ?
I would be good to know before I commit to doing any more work on either of those!

from agda.

dolio avatar dolio commented on June 27, 2024 1

My understanding is that the proposal is only to restrict definitions like:

.foo : ...
foo = ...

where foo itself is irrelevant. Not every definition that has irrelevance in the type. So it looks like your work there would be unaffected.

However, I don't know what a fix to the other example would entail. I guess even the most brute force option might be, 'you can't open (applied) record modules with irrelevant fields without --irrelevant-projections.' But that also doesn't affect your work, right?

from agda.

conal avatar conal commented on June 27, 2024

Zulip link.

from agda.

andreasabel avatar andreasabel commented on June 27, 2024

Proposed fix: forbid (even irrelevant) definitions in records to use irrelevant fields unless --irrelevant-projections is on.

from agda.

dolio avatar dolio commented on June 27, 2024

I'm not sure that's good enough due to #6359. E.G. you can do this:

open import Cubical.Foundations.Prelude
open import Cubical.Data.Bool
open import Cubical.Data.Empty
open import Cubical.Relation.Nullary

variable
  A B : Type

record TSquash (A : Type) : Type where
  constructor emb
  field .extract : A

lemma₀ :  t  PathP (λ i  TSquash (notEq i)) t t
lemma₀ t i = transport (λ j  TSquash (notEq (i ∧ j))) t

lemma₁ : ¬ ( A  TSquash A -> A)
lemma₁ ext = not≢const (ext Bool f) sublemma where
  f = emb false

  sublemma : not (ext Bool f) ≡ ext Bool f
  sublemma = fromPathP λ i  ext (notEq i) (lemma₀ f i)

lemma₂ : ¬ ( A  .A -> A)
lemma₂ f = lemma₁ λ A (emb x)  f A x

bad : ⊥
bad = e (lemma₂ λ A x  let open TSquash (emb x) in extract) where
  e : .⊥ -> ⊥
  e ()

Unless what you're talking about affects opening as well. This has no irrelevant definitions.

BTW, emb being a constructor is unnecessary, too.

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.