Skip to content

Separate ".(IsOne φ)→A" and "Partial φ A" - #6026

Closed
plt-amy wants to merge 4 commits into
masterfrom
aliao/partial-not-pi
Closed

plt-amy wants to merge 4 commits into
masterfrom
aliao/partial-not-pi

Conversation

@plt-amy

@plt-amy plt-amy commented Aug 15, 2022

Copy link
Copy Markdown
Contributor

Fixes #6015. The finiteness information was moved to the Annotation type, so that we can print "finite Πs" differently from ordinary Π — The rest of Dom never makes it to the abstract syntax, so I smuggle it in the ArgInfo.

@plt-amy plt-amy added type: bug Issues and pull requests about actual bugs cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp labels Aug 15, 2022
@plt-amy plt-amy added this to the 2.6.3 milestone Aug 15, 2022
@plt-amy plt-amy self-assigned this Aug 15, 2022
@plt-amy

plt-amy commented Aug 16, 2022

Copy link
Copy Markdown
Contributor Author

Surprisingly, I know what's going on with CI; Its GHC is linked against icu-69 but msys2 installs icu-71, so the symbols have the wrong version suffix:

$ https://mirror.ufro.cl/msys2/msys/x86_64/icu-71.1-2-x86_64.pkg.tar.zst
$ tar xvf icu-*
$ objdump -t usr/bin/msys-icu*  | grep ucnv_getMaxChar
[  7](sec  9)(fl 0x00)(ty    0)(scl   2) (nx 0) 0x00000000000004c4 __imp_ucnv_getMaxCharSize_71

@andreasabel

Copy link
Copy Markdown
Member

@Mergifyio rebase

@mergify

mergify Bot commented Aug 16, 2022

Copy link
Copy Markdown

rebase

✅ Branch has been successfully rebased

@andreasabel
andreasabel force-pushed the aliao/partial-not-pi branch from 65e1996 to c996ce1 Compare August 16, 2022 18:12
@andreasabel

Copy link
Copy Markdown
Member

Rebaseing this onto master to get updated CI to run again.

Comment thread src/full/Agda/Syntax/Common.hs Outdated
{ annLock :: Lock
-- ^ Fitch-style dependent right adjoints.
-- See Modal Dependent Type Theory and Dependent Right Adjoints, arXiv:1804.05236.
, annFinite :: !Bool

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read you right, the reason to move this from Dom to ArgInfo was to have it also in the abstract syntax. Currently, the abstract syntax has no Dom, but:

data TypedBinding
  = TBind Range TacticAttr (List1 (NamedArg Binder)) Type
  | ...

Would it make sense to turn the TacticAttr field to a record containing also the Finite flag? I am a bit worried about blowing up ArgInfo unnecessarily, because it is part of every argument and binder. A unused field there would increase the memory footprint a bit (maybe quite a bit?). If possible, I'd appreciate a more economic placement.

(More radically, refactoring the abstract syntax to have Dom would also be thinkable...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right: the finiteness annotation has to be present in the abstract syntax to differentiate the pretty-printed normal forms of Partial φ A and .(IsOne φ) → A.

I don't think the size of ArgInfo has been significantly affected, though: annFinite is part of the Annotation type, which was already pointed to by ArgInfo before, and since the field isn't strict, it doesn't get unboxed (though maybe it should be made strict/unboxed?)

data ArgInfo = ArgInfo
  { argInfoHiding        :: Hiding
  , argInfoModality      :: Modality
  , argInfoOrigin        :: Origin
  , argInfoFreeVariables :: FreeVariables
  , argInfoAnnotation    :: Annotation
    -- ^ Sometimes we want a different kind of binder/pi-type, without it
    --   supporting any of the @Modality@ interface.
  } deriving (Data, Eq, Ord, Show)

Nonetheless I think it makes sense to store it next to the TacticAttr, since arguments in elimination spines shouldn't particularly care about the finiteness of the function they're being applied to.

@plt-amy
plt-amy force-pushed the aliao/partial-not-pi branch 2 times, most recently from a45d680 to 1841722 Compare September 5, 2022 20:06
@plt-amy
plt-amy requested a review from andreasabel September 5, 2022 21:02
Comment on lines -139 to -141
toAbstract (Dom{domInfo = i,unDom = x, domTactic = tac}, name) = do
toAbstract (Dom{domInfo = i, domIsFinite = isfin, unDom = x, domTactic = tac}, name) = do
dom <- toAbstract x
return $ mkTBind noRange (singleton $ unnamedArg i $ mkBinder_ name) dom

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyone know why this discards the tactic attribute?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh.. it's because it's coming from the reflected syntax, and reflection can't make pis with tactic annotations. I guess that makes sense: should we remove the binding for tac, or throw an __IMPOSSIBLE_VERBOSE__ when it's set, or something? Strictly speaking it's impossible for isFinite to be True, here, too

@plt-amy
plt-amy marked this pull request as draft September 5, 2022 22:02
@plt-amy

plt-amy commented Sep 24, 2022

Copy link
Copy Markdown
Contributor Author

@Mergifyio rebase

@mergify

mergify Bot commented Sep 24, 2022

Copy link
Copy Markdown

rebase

❌ Base branch update has failed

Details

Git reported the following error:

Rebasing (1/5)
error: could not apply c7e84f782... Separate ".(IsOne φ)→A" and "Partial φ A"
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply c7e84f782... Separate ".(IsOne φ)→A" and "Partial φ A"
Auto-merging src/full/Agda/TypeChecking/Serialise/Instances/Internal.hs
Auto-merging src/full/Agda/TypeChecking/Rules/LHS.hs
Auto-merging src/full/Agda/TypeChecking/Reduce.hs
Auto-merging src/full/Agda/TypeChecking/Primitive/Cubical.hs
Auto-merging src/full/Agda/TypeChecking/Monad/Base.hs
Auto-merging src/full/Agda/TypeChecking/MetaVars.hs
Auto-merging src/full/Agda/Syntax/Internal/Names.hs
Auto-merging src/full/Agda/Syntax/Internal.hs
Auto-merging src/full/Agda/Syntax/Common.hs
CONFLICT (content): Merge conflict in src/full/Agda/Syntax/Common.hs

err-code: 57A15

@plt-amy
plt-amy marked this pull request as ready for review September 24, 2022 19:29
@plt-amy

plt-amy commented Sep 24, 2022

Copy link
Copy Markdown
Contributor Author

Heck here's hoping there's an outlet on the plane

@plt-amy
plt-amy force-pushed the aliao/partial-not-pi branch from 3e494dc to d0da68e Compare September 27, 2022 16:07
@plt-amy
plt-amy marked this pull request as draft September 27, 2022 16:29
@plt-amy

plt-amy commented Sep 27, 2022

Copy link
Copy Markdown
Contributor Author

Marking this a draft again because literally two days after my github account was cleared of its wrongful ban from actions they've gone and banned me again.

@plt-amy
plt-amy force-pushed the aliao/partial-not-pi branch from d0da68e to 2d006f4 Compare September 30, 2022 16:49
@andreasabel

Copy link
Copy Markdown
Member

Marking this a draft again because literally two days after my github account was cleared of its wrongful ban from actions they've gone and banned me again.

Oh what is that? Never heard of such. Are there any pointers to read up on this?

Currently, the actions don't run on this PR. :-(

@plt-amy

plt-amy commented Sep 30, 2022 •

Copy link
Copy Markdown
Contributor Author

At this point I've been banned from actions for >3 weeks 😔 After 18 days, I got this message from support:

Sometimes our abuse detection systems flag accounts which require manual review. I've just reviewed your account and confirmed that it should not have had Actions restrictions placed on it.

I've updated the settings on your account, so GitHub Actions should be back to normal the next time you sign.

That was a week ago. For 2 days after they answered me, actions was working, but spotty -- my runs would get cancelled after ~2 minutes unless I was staring at the logs. That's when I marked this PR "ready for review" and made the comment about flying. (side note: my plane did not have a power socket, so moot anyway).

image

Two days after they unbanned me I got flagged again! Now actions doesn't run on any of my PRs, commits, or any commit at all to repositories I own. I thought rebasing using mergify might trick them into running but no: #6053

@andreasabel

andreasabel commented Sep 30, 2022 •

Copy link
Copy Markdown
Member

Maybe you are too productive, costing them too much CI time. :-D

If you want to make a secondary github account, I can add it to the agda community.

@andreasabel

Copy link
Copy Markdown
Member

@Mergifyio rebase

Fixes #6015. The finiteness information was moved to the Annotation
type, so that we can print "finite Πs" differently from ordinary Π.
@mergify

mergify Bot commented Oct 5, 2022

Copy link
Copy Markdown

rebase

✅ Branch has been successfully rebased

@plt-amy
plt-amy force-pushed the aliao/partial-not-pi branch from 2d006f4 to 4e2b114 Compare October 5, 2022 16:15
@andreasabel

andreasabel commented Oct 5, 2022 •

Copy link
Copy Markdown
Member

Ok, it does not help if I rebase this with Mergify, the rebase it is still attributed to you. I'll try to open a PR in my name instead.

P.S.: Or it is simply because GitHub Actions are down. From https://www.githubstatus.com/:

  • We continue to see recovery and have added capacity to speed recovery time. We still expect to see slower than normal Actions job runs and webhook deliveries.
    Oct 05, 2022 - 16:12 UTC
  • Actions is experiencing degraded performance. We are continuing to investigate.
    Oct 05, 2022 - 15:04 UTC

@plt-amy

plt-amy commented Oct 5, 2022

Copy link
Copy Markdown
Contributor Author

Gonna close this PR in favour of #6159, then

@plt-amy plt-amy closed this Oct 5, 2022
@plt-amy
plt-amy deleted the aliao/partial-not-pi branch October 27, 2022 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cubical Cubical Agda paraphernalia: Paths, Glue, partial elements, hcomp, transp type: bug Issues and pull requests about actual bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pi types and Partial types should not be considered inter-convertible

2 participants