⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@fmontesi
Copy link
Collaborator

This PR introduces notions of (single hole) syntactic contexts (HasContext) and congruence relations (Congruence), along with the standard notation c[t] for 'fill the hole in the context c with term t'.

The development of CCS is adapted accordingly and should hold for many other calculi. The idea actually comes from an ongoing development on the generalisation of sequent calculi and logics, but these require more concepts. Also, in the future, it might be interesting to study approaches similar to HasContext in semantics that use different kinds of contexts.

The PR also scopes the grind annotations in CCS.

@fmontesi fmontesi requested a review from chenson2018 as a code owner January 23, 2026 11:04
namespace Cslib

/-- An equivalence relation preserved by all contexts. -/
class Congruence (α : Sort*) [HasContext α] (r : α → α → Prop) extends IsEquiv α r where
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does α need to be a Sort here? This builds if you make it a Type, so I wondered if you did this just because you were extending IsEquiv.

If this can be in Type, the following is equivalent:

class Congruence (α : Type*) [HasContext α] (r : α → α → Prop) extends
  IsEquiv α r,
  is_congruence : CovariantClass (HasContext.Context α) α (·[·]) r

up to ordering of arguments, e.g.

instance bisimilarityCongruence :
    Congruence (Process Name Constant) (Bisimilarity (lts (defs := defs))) where
  is_congruence := ⟨by grind [Covariant, bisimilarity_is_congruence]⟩

works in CCS.BehaviouralTheory.

If we end up using this sort of thing in multiple places (i.e. here and @ctchou's #278), I'd prefer that we use the same naming like covariant : CovariantClass ... so that you get the constructor covariant.elim : Covariant ....

Copy link
Contributor

@ctchou ctchou Jan 24, 2026

Choose a reason for hiding this comment

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

In #278, I used the name right_cov, because one can also define a congruence that is both a left congruence and a right congruence (in which case there will be two covariant fields). Perhaps context_cov is a good name here.

@fmontesi
Copy link
Collaborator Author

fmontesi commented Jan 24, 2026 via email

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.

4 participants