feat: classes for inference systems and logical equivalence#398
feat: classes for inference systems and logical equivalence#398
Conversation
chenson2018
left a comment
There was a problem hiding this comment.
Just some nitpicks, I haven't properly thought about the big picture here yet.
| class HasHContext (α : Type u) (β : Type v) where | ||
| /-- The type of contexts. -/ | ||
| Context : Sort* | ||
| Context : Type* |
There was a problem hiding this comment.
We should be consistent within a single declaration of Type* versus explicit universes. I'd write
| class HasHContext (α : Type u) (β : Type v) where | |
| /-- The type of contexts. -/ | |
| Context : Sort* | |
| Context : Type* | |
| class HasHContext (α β : Type*) where | |
| /-- The type of contexts. -/ | |
| Context : Type* |
|
|
||
| /-- Logical equivalence for HML propositions. -/ | ||
| @[scoped grind =] | ||
| def Proposition.Equiv {State : Type u} {Label : Type v} (a b : Proposition Label) : Prop := |
There was a problem hiding this comment.
I get the impression that part of fixing the performance issues in LTS can start with being more strict about Prop-valued def used with grind. I don't quite understand all the new changes around defeq and reducibility, but it seems in general things like this should be a structure or irreducible.
| induction ctx | ||
| <;> simp only [Proposition.Context.fill, Proposition.denotation] | ||
| <;> grind |
There was a problem hiding this comment.
It's okay to write
| induction ctx | |
| <;> simp only [Proposition.Context.fill, Proposition.denotation] | |
| <;> grind | |
| induction ctx <;> simp [Proposition.Context.fill, Proposition.denotation] <;> grind |
because grind is considered a tactic permissible to follow the flexible simp. (Though it's not clear to me what is missing that grind won't close this on its own)
| state : State | ||
|
|
||
| /-- Fills a judgemental context with a proposition. -/ | ||
| def Satisfies.Context.fill (c : Satisfies.Context State Label) (φ : Proposition Label) : |
There was a problem hiding this comment.
As a reminder, you can use where with def as well.
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:
⇓notation for derivations and the associated notion of Derivability.LogicalEquivalences. We formalise a logical equivalence as a congruence on propositions that preserves validity under any judgemental context.Depends on #393 for the new context fill notation.