Skip to content

feat: classes for inference systems and logical equivalence#398

Open
fmontesi wants to merge 20 commits intomainfrom
logic-classes
Open

feat: classes for inference systems and logical equivalence#398
fmontesi wants to merge 20 commits intomainfrom
logic-classes

Conversation

@fmontesi
Copy link
Collaborator

@fmontesi fmontesi commented Mar 4, 2026

This PR is the beginning of work for formalising general concepts about logic in CSLib, in order to streamline the development of logics. A major challenge is that judgements, proof systems, and semantics can be very different across logics, so we cannot assume any particular shapes for them.
To address this, this PR introduces:

  • A class for inference systems, which gives access to the notation for derivations and the associated notion of Derivability.
  • A class of heterogeneous contexts (HasHContext), which allows for defining contexts that, when filled with a value of type T, yield something of a different type than T. This is useful for formalising judgemental contexts: a context with a hole that can be filled with a proposition, resulting in a judgement.
  • A class for LogicalEquivalences. We formalise a logical equivalence as a congruence on propositions that preserves validity under any judgemental context.
  • Instances of these concepts for HML and CLL, which serve as examples of very different structures.

Depends on #393 for the new context fill notation.

@fmontesi fmontesi added the logic label Mar 4, 2026
Copy link
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 some nitpicks, I haven't properly thought about the big picture here yet.

@fmontesi fmontesi marked this pull request as ready for review March 5, 2026 14:31
@fmontesi fmontesi requested a review from chenson2018 March 5, 2026 14:31
@fmontesi
Copy link
Collaborator Author

fmontesi commented Mar 6, 2026

Should be ok now, but we should merge #393 first.

@chenson2018
Copy link
Collaborator

Should be ok now, but we should merge #393 first.

I have approved 393 and will take a look at your most recent comments/changes tomorrow.

@chenson2018
Copy link
Collaborator

Holding off approval until the documentation issue mentioned at #CSLib > `Context.fill` notation @ 💬 is resolved, but this all seems fine to me.

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.

2 participants