Start of topic | Skip to actions

Notes for March 21

Clarification regarding type checking a lambda term

Note for our type_checker function, which takes an untyped lambda calculus term and constructs a typed lambda calculus term, indicating that the untyped expression types correctly. The question was raised by Dan, how can we push a variable's type onto the environment during an abstraction - this requires type inference if the input expr is truly untyped. We must assume that the untyped expr provides us with the type of the lambda's variable. Type inference is too much work.

Cast notes

Even though cast is a built in function that we need for certain tricks, we don't have to use that version. We can roll our own casts, for specific pairs. Cast can be defined inductively for any two types, but not necessarily for all types, without using the low level Obj.magic.

type ('a:'(OCamlType), 'b) eq = Eq of let a in unit : ('(a), '(a)) eq;;

Now we can define a castE function that will return a function that will cast a variable of type '(a) to '(b).

castE :: A a,b. ('(a), '(b)) eq -> '(a) -> '(b)

The function is defined as:

let rec castE .|a, b| (x:('(a), '(b)) eq) : '(a) -> '(b) =
   match x as ('(a1), '(b1)) eq in '(a1) -> '(b1) with
     | Eq .|c| _ -> (fun x -> x);;

Since concoqtion knows that Eq contains two elements of the same type, this is possible. a1 and b1 are both substituted by c in the Eq branch. This, conceptually, is refl_eq on the Concoqtion level, rather than on the Coq level.

Note from Walid: CAST IS NOT EQUAL TO MAGIC OR THE IDENTITY FUNCTION! WE DO NOT USE MAGIC HERE!

Project ideas

  • Joseph: Hopes to develop an interpreter using only Coq terms, then emitting Concoqtion code
  • Dan and Jun: Sorting algorithms on sized lists, along with proving sortedness on lists using dependent types
  • Angela and Cherif: Improved matrix libraries, including proven sizing information, guaranteeing memory layout orientation for multidimensional arrays (row-first, etc.) (Emir's suggestion), improved sparse matrix representations (Joseph's suggestion). Can they write an FFT while providing size information? Maybe focus on the speed of FFT as a more constrained problem.

End of topic
Skip to actions | Back to top
Creative Commons LicenseThis work is licensed under a Creative Commons Attribution 2.5 License. Please follow our citation guidelines.