Comments (6)
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.
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.
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.
from agda.
Proposed fix: forbid (even irrelevant) definitions in records to use irrelevant fields unless --irrelevant-projections
is on.
from agda.
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)
- `--lossy-unification` doesn't fall back to regular unification when instances are used HOT 2
- Latex backend/package bug: `! Package array Error: Empty preamble: 'l' used.` HOT 4
- Recursion with records HOT 1
- Failed to write interface /usr/share/Agda-stdlib/_build/2.6.4.3/agda/src/Data/Unit/Base.agdai. HOT 2
- fail in solving instance of `⊆-refl` in Agda 2.6.4.3 HOT 12
- with-abstraction regression HOT 6
- U+02B3 (MODIFIER SMALL LETTER R, aka superscript r) not available via \^r HOT 4
- Testsuite: heads up: with GHC 9.10, `throw` will print a callstack
- Agda >=2.6.3 hangs on conflicting record directives HOT 4
- Revert cyclic computation of ranges (and ban `mdo` from this code base) HOT 2
- Bad interaction between instance search and opaque HOT 6
- Normalization gives trivial `transp` HOT 1
- `--postfix-projections` do not make use of mixfix syntax HOT 1
- No warning about useless `{-# CATCHALL #-}` pragma
- HTML backend: inconsistent highlighting for macro names
- Internal error on pattern lambda with no clauses
- wrong type for unnamed record constructor
- Search for project root crashes when (parent) directory lacks permissions HOT 1
- quoteTerm loops on dependent copattern lambda HOT 3
- Caching loses reflection-generated pragmas
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agda.