Skip to content

feat: Tagged InferenceSystem#518

Merged
fmontesi merged 24 commits into
mainfrom
cll-fragments
Apr 25, 2026
Merged

feat: Tagged InferenceSystem#518
fmontesi merged 24 commits into
mainfrom
cll-fragments

Conversation

@fmontesi
Copy link
Copy Markdown
Collaborator

Adds a tagged version of InferenceSystem, so that multiple inference systems for the same type can be instantiated and distinguished by means of a tag. Usage is exemplified with the multiplicative fragment of classical linear logic.

fmontesi and others added 15 commits April 17, 2026 14:57
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
is a derivable value.
-/
class InferenceSystem (α : Type u) where
class InferenceSystem (S : Type) (α : Type*) where
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

is there a reason this isn't S : Type*

Copy link
Copy Markdown
Collaborator Author

@fmontesi fmontesi Apr 24, 2026

Choose a reason for hiding this comment

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

That's what it was originally, but it gave me type errors, I don't clearly remember where (maybe DerivationsIn).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

okay, it does seem very restrictive to have it Type 0 — can you fix it with explicit universes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh, actually, I tried again and it worked now. It must've been something weird with a previous version.

Thanks for catching this.

@fmontesi fmontesi enabled auto-merge April 24, 2026 13:38
Copy link
Copy Markdown
Collaborator

@chenson2018 chenson2018 left a comment

Choose a reason for hiding this comment

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

Just a few style questions/suggestions.

Comment thread Cslib/Logics/LinearLogic/CLL/MLL.lean Outdated
derivation (a : α) : Sort v

/-- Default tag for inference system instances. `⇓a` is short for `Default⇓a`. -/
inductive InferenceSystem.Default
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It took me a moment to understand why this was an empty inductive. I feel like I have more often seen something like

def InferenceSystem.Default := Unit

in these situations. I think this is functionally identical, but maybe easier to understand the intent for the next person like me who was confused.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My purpose was to do the simplest possible thing, which is an empty type.

What's the point of making Default inhabited?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It doesn't matter that it's inhabited, you could use Empty just as easily. My point is that it doesn't really matter: we could pick any existing type and say that by convention this represents the default.

So I'd personally find def InferenceSystem.Default := Empty the more readable exact equivalent I suppose. Maybe a short comment is warranted in either case.

Comment thread Cslib/Logics/LinearLogic/CLL/MLL.lean Outdated
Comment thread Cslib/Logics/LinearLogic/CLL/MLL.lean Outdated
Comment thread Cslib/Logics/LinearLogic/CLL/MLL.lean Outdated
Comment thread Cslib/Logics/LinearLogic/CLL/MLL.lean Outdated
fmontesi and others added 6 commits April 24, 2026 20:15
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Co-authored-by: Chris Henson <46805207+chenson2018@users.noreply.github.com>
Copy link
Copy Markdown
Collaborator

@chenson2018 chenson2018 left a comment

Choose a reason for hiding this comment

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

Approving, as my last comment about InferenceSystem.Default seems fine either way, maybe a matter of personal taste.

@fmontesi fmontesi added this pull request to the merge queue Apr 24, 2026
@chenson2018 chenson2018 removed this pull request from the merge queue due to a manual request Apr 24, 2026
@chenson2018
Copy link
Copy Markdown
Collaborator

(I removed from the auto merge so you can decide what you prefer writing, and maybe leave a comment.)

@fmontesi
Copy link
Copy Markdown
Collaborator Author

Thanks. I've made it an opaque alias for Empty, which should be equivalent to my original.

@fmontesi fmontesi added this pull request to the merge queue Apr 25, 2026
Merged via the queue into main with commit b81a06e Apr 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants