Skip to content

Commit

Permalink
[WIP] add PER
Browse files Browse the repository at this point in the history
  • Loading branch information
Ailrun committed Jan 18, 2024
1 parent 1d7dadc commit 1a038f3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions theories/Core/Semantic/PER.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From Coq Require Import Relations.

From Mcltt Require Import Base.
From Mcltt Require Import Domain.
From Mcltt Require Import Readback.
From Mcltt Require Import Syntax.
From Mcltt Require Import System.

Notation "'Dom' a ≈ b ∈ R" := (R a b) (in custom judg at level 90, a custom domain, b custom domain, R constr).

Generalizable All Variables.

Definition per_bot : relation domain_ne := fun m n => (forall s, exists L, {{ Rne m in s ↘ L }} /\ {{ Rne n in s ↘ L }}).

Definition per_top : relation domain_nf := fun m n => (forall s, exists L, {{ Rnf m in s ↘ L }} /\ {{ Rnf n in s ↘ L }}).

Definition per_top_typ : relation domain := fun a b => (forall s, exists C, {{ Rtyp a in s ↘ C }} /\ {{ Rtyp b in s ↘ C }}).

Inductive per_nat : relation domain :=
| per_nat_zero : {{ Dom zero ≈ zero ∈ per_nat }}
| per_nat_succ :
`( {{ Dom m ≈ n ∈ per_nat }} ->
{{ Dom succ m ≈ succ n ∈ per_nat }} )
| per_nat_neut :
`( {{ Dom m ≈ n ∈ per_bot }} ->
{{ Dom ⇑ ℕ m ≈ ⇑ ℕ n ∈ per_nat }} )
.

Inductive per_ne : relation domain :=
| per_ne_neut :
`( {{ Dom m ≈ n ∈ per_bot }} ->
{{ Dom ⇑ a m ≈ ⇑ a' n ∈ per_ne }} )
.

0 comments on commit 1a038f3

Please sign in to comment.