Skip to content

Commit

Permalink
SKK
Browse files Browse the repository at this point in the history
  • Loading branch information
smimram committed Oct 25, 2024
1 parent b5d0133 commit 1867b8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/lang.ml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ let rec has_fv x e =
| App (t, u) -> has_fv x t || has_fv x u
| Hole (t, a) -> has_fv x t || has_fv x a
| Meta { contents = Some t } -> has_fv x t
| Meta { contents = None } -> true
| Obj -> false
| _ -> error ~pos:e.pos "has_fv: handle %s" (to_string e)

Expand Down Expand Up @@ -187,7 +188,7 @@ let check_ps l a =
| App (t, u) -> mk (App (rewrite t, rewrite u))
| Hole (t, _) -> rewrite t
| Meta { contents = Some t } -> rewrite t
| _ -> failwith (Printf.sprintf "TODO: in rewrite handle %s" (to_string e))
| _ -> error ~pos:e.pos "TODO: in rewrite handle %s" (to_string e)
in
(* Orient identities on variables as rewriting rules and normalize l. *)
let rec aux rw = function
Expand Down
5 changes: 3 additions & 2 deletions src/test.cccatt
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ coh ap-K (a b : .) (x : a) (y : b) : ap b a (ap a (b -> a) (K a b) x) y = x

coh ap-comp (a b c : .) (f : a -> b) (g : b -> c) (x : a) : ap a c (comp a b c f g) x = ap b c g (ap a b f x)

# # I is derivable
# coh SKK (a : .) : ap _ _ (ap _ _ (S _ _ _) (K _ _)) (K _ _) = I a
# I is derivable
coh SKK (a b : .) : ap (a -> b -> a) (a -> a) (ap (a -> (b -> a) -> a) ((a -> b -> a) -> a -> a) (S a (b -> a) a) (K a (b -> a))) (K a b) = I a
coh SKK (a b : .) : ap _ _ (ap _ _ (S _ _ _) (K _ _)) (K _ b) = I a

## Church numerals with pi-types

Expand Down

0 comments on commit 1867b8c

Please sign in to comment.