Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add disjointness reasoning for BbML #260

Merged
merged 23 commits into from
Jan 21, 2025
Merged

Conversation

NeilKleistGao
Copy link
Member

@NeilKleistGao NeilKleistGao commented Jan 8, 2025

  • Track outer regions for disjointness reasoning
  • Support outer variables for functions polymorphic types
  • Fix some pretty-print bugs
  • Fix negative type elaboration
  • Refactor type variable collection logic
  • Fix some missing cases

This PR is still being prepared, e.g., containing redundant code. Such problems will be addressed after the main problems are discussed in the meeting.

@LPTK
Copy link
Contributor

LPTK commented Jan 13, 2025

BTW, since you are modifying the way forall types are printed. Why not print them like in the source? Eg [A, B, outer C] -> ...

@NeilKleistGao NeilKleistGao marked this pull request as ready for review January 13, 2025 07:53
@NeilKleistGao NeilKleistGao requested a review from LPTK January 20, 2025 02:49

fun f: ([A] -> ([B] -> A | B -> B | A) -> A) -> ([A] -> ([B] -> A | B -> B | A) -> A)
f
//│ Type: (['A] -> (['B] -> ('A ∨ 'B) ->{⊥} 'B ∨ 'A) ->{⊥} 'A) ->{⊥} ['A] -> (['B] -> ('A ∨ 'B) ->{⊥} 'B ∨ 'A) ->{⊥} 'A
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we please use | and & rather than and ?

Copy link
Contributor

Choose a reason for hiding this comment

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

This can be done in a future PR, though.

Comment on lines +98 to +100
val state = new VarState()
state.upperBounds = ctx.getRegEnv :: Nil
state.lowerBounds = ctx.getRegEnv :: Nil
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder what's the point of creating a new TV that's equivalent to an underlying type ctx.getRegEnv. I see freshEnv is only used in instantiate. Why can't instantiate substitute simple types for variables? Instead of just variables for variables?

Copy link
Contributor

@LPTK LPTK left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

I've left some comments that can be addressed later. Let's merge this now!

@LPTK LPTK merged commit c26c656 into hkust-taco:hkmc2 Jan 21, 2025
1 check passed
@LPTK LPTK deleted the outer🌌 branch January 21, 2025 03:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants