Musing

Trusted Timestamps & Provenance of when Students Did their Work

Edited: because I failed to proof read.

In this article we will take a quick look at how we can use Trusted Timestamps to better establish the provenance of student (coding) assignments.

The Problem

I often assess the attainment of learning outcomes using ‘coding projects’. The coding projects I design are styled as:

  • openbook: Students are free to use any resources to help them complete the project;

  • takehome: Students are free to do the project in places that suit them best (the lab or at home);

Moodle Musing Scales, Grades, Marks, and Advanced Grading.

Terminology

When I was introduced to the grading/marking process, I was told about a difference between grades and marks:

  • Grades: Are the result of completing a module/course;

  • Marks: Are the result of completing a summative assessment within a module;

Within Moodle grades are marks and marks are grades, within this musing I will not be using them interchangeably.

Scales

We give value to outcomes by mapping results to a ‘scale’. Although these scales are percentage points in the range $[0,100]$, we often use a more limited scale that maps to discrete percentage ponits.

Faking Linear Variable Usage

I have been thinking, again, about way’s in which one can encode linear variable usage in EDSLs.

One cannot state usage on things that one cannot bind.

We can encode EDSLs using intrinsically well-typed EDLS that, at the type-level, gives all terms a type type and carries around the local typing context. Bound variables are represented using De Bruijn indices encoded as existential quantification over a type-level context.

Synthesised or Checked?

A classic example in the world of dependently typed programming is that of presenting the STLC (and extensions) as well-typed EDSLs.

The STLC as an Idris EDSL.

Below we give a simple example of the STLC with Booleans.

data Ty = TyBool | TyFunc Ty Ty

data STLC : (ctxt : List Ty)
         -> (type : Ty)
                 -> Type
  where
    Var : Elem type ctxt -> STLC ctxt type

    Func : (body : STLC (type_param :: ctxt)                    type_body)
                -> STLC                ctxt  (TyFunc type_param type_body)

    App : (func  : STLC ctxt (TyFunc type_param type_body))
       -> (param : STLC ctxt         type_param)
                -> STLC ctxt                    type_body

    B : (b : Bool) -> STLC ctxt TyBool

STLC is intrinsically well-typed in that, at the type-level, all terms are given a type type and has the local typing context. Within STLC, bound variables are represented using De Bruijn indices encoded as existential quantification over a type-level context.

Defining Intrinsically Typed Data Structures

When reading foundational texts such as PLFA, TAPL, and Software Foundations the learner is often presented with Simply-Typed Lambda Calculi that supports both products and sums. When translating these calculi to dependently typed languages in an intrinsically typed way as we do with Idris & Agda, how we might approach supporting other data structures such as tuples, records and variants is not precisely clear. In fact Software Foundations does give an idea on how to do so but let us explore how we may choose to represent such structures in Idris/Agda.

Programming with Holes

Traditionally, computer programs must be complete when presented to the compiler. Typed Holes (also known as meta variables) are an important tool when programming that supports computing with incomplete programs in which holes (the things we do not know) are a core aspect of the language (and tooling) design. Specifically, if you have used dependently typed languages such as Idris and Agda you will have encountered holes before. Typed Holes in Idris allow us to inspect the local typing context from where the hole was placed. This allows us to see what information is directly available when looking to fill the hole. Further, computing the type of the typed hole also tells us the type of thing we need to insert.

The Last Step

Every so often I like to reread notable books on /Programming Language Theory/ (PLT). Namely, one should read:

With these books each presents a treatment of PLT either: mechanised using Agda or Coq; presented purely theoretically in LaTeX; or a mixture of theory and practice.

Of particular interest to myself is the presentation using Agda. Dependent types allow us to present formal descriptions of our programs together with their practical constructions.

Mutual Avoidance

Sometimes dependent types push you towards mutually defined data structures: I try to avoid them where I can. For me, this occurrs when you need a helper data type where a container is not suitable expressive at the type level to capture the inductive case. When this happens you can index your helper data structure with the signature of the top type. This helps remove the need for a mutual definition, that is turn the call graph edge from undirected to directed.

Decidably Uninformative

Dependently typed theorem proving is about using the power of dependent types to provide guarantees over various properties of software programs and mathematical constructs. In dependently typed programming we use dependent types to construct and better reason about the properties of our software programs.

While the former requires that we construct proofs, the latter requires that we construct a usable system. In this post I want to discuss how proving and construction can get in the way of each other and that when programming with dependent types we must recognise and tread carefully the fine line between theorem proving and programming.

Well-Typed Expressions lead to Well-Typed Well-Scoped Programs

Let us consider the /Well-Typed Interpreter/ (WTI), a well known application of dependent types to ensure that our program’s are not only well-typed but also well-scoped w.r.t. variables. To be specific the WTI details not how program’s are correct but /expressions/. When dealing with program’s we will have a top-level expression that may depend on globally declared expressions.

In this post I will describe a Razor, detailing how with a little thought we can use the concept of the WTI to described /Well-Typed Programs/.

1 2 Next →