Skip to content

Commit

Permalink
Elaboration.
Browse files Browse the repository at this point in the history
  • Loading branch information
smimram committed Oct 24, 2024
1 parent 1ee4485 commit 8fde9f3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/debug.cccatt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
coh I (a : .) : a → a
# coh I (a : .) : a → a

coh ap (a b : .) (t : a → b) (u : a) : b

Expand Down
2 changes: 1 addition & 1 deletion src/lang.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let rec to_string e =
| App (t, u) -> Printf.sprintf "%s %s" (to_string t) (to_string u)
| Pi (x, a, t) -> Printf.sprintf "(%s : %s) => %s" x (to_string a) (to_string t)
| Obj -> "."
| Hom (a, b) -> Printf.sprintf "(%s -> %s)" (to_string a) (to_string b)
| Hom (a, b) -> Printf.sprintf "(%s %s)" (to_string a) (to_string b)
| Prod (a, b) -> Printf.sprintf "(%s × %s)" (to_string a) (to_string b)
| Id (a, t, u) ->
let a =
Expand Down
4 changes: 2 additions & 2 deletions src/test.cccatt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ let id (a : .) (x : a) := ap a a (I a) x

## Testing holes

# let id' (a : .) (x : a) := ap _ _ (I _) x
let id' (a : .) (x : a) := ap _ _ (I _) x

# let ap' (a b : .) (x : a) (f : a -> b) := ap _ _ f x
let ap' (a b : .) (x : a) (f : a -> b) := ap _ _ f x

## Testing identities

Expand Down
2 changes: 2 additions & 0 deletions src/value.ml
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,10 @@ let rec unify k t t' =
| Type, Type -> ()
| Meta { value = Some t; _ }, t' -> unify k t t'
| t, Meta { value = Some t'; _ } -> unify k t t'
| Meta m, Meta m' when m == m' -> ()
| Meta m, t
| t, Meta m ->
assert (not (List.memq m (metavariables t)));
(* printf "... ?%d becomes %s\n" m.id (to_string t); *)
m.value <- Some t
| _ -> raise Unification

0 comments on commit 8fde9f3

Please sign in to comment.