## Archive for November, 2005

### From High-school algebra to University algebra

Friday, November 25th, 2005 by Thorsten

An equation like can be read as an equation over the natural numbers or as an isomorphism which hold in a category with the appropriate structure. The problem of solving equations over 1,+,x,^ in the natural numbers is called the High School Algebra problem and Tarski asked whether the equations we learn at school are complete. Roberto di Cosmo and others observed that this is closely related to isomorphisms in cartesian closed categories with + (I recommend Roberto’s very readable survey).

Wilkie showed that high school algebra is incomplete, the core of his counterexample is that we cannot show using the equations of High School Algebra that implies . I observed that this isomorphism is derivable using dependent types and exploiting and . This observation leads to formulating what I call university algebra which generalizes high school algebra by using and .

Here are some laws of university algebra:

• where is an isomorphism
• where is an isomorphism

When deriving isomorphisms we may use equalities of types which relies on equality of terms. We can read those as equations on natural numbers, every type corresponds to a number and
can be read as . I believe that unlike High School algebra, University Algebra is complete. Without 0 it may even be decidable, with 0 it isn’t because we can encode consistency of formulas of intuitionistic predicate logic in it.

### Roll your own induction principles

Friday, November 18th, 2005 by James Chapman

The other day I tried to write division on natural numbers in epigram. This function is not obviously structurally recursive so we cannot use the standard justification ‘<=rec ‘ to justify our recursive calls and also leave our function looking like the one we wanted to write in the first place. We can exhibit a view to do a custom case analysis that does the necessary subtraction for us yielding patterns of arguments to ‘plus’ (this is the Compare view from VFL). We can then exhibit another view to justify the recursive call on an argument to ‘plus’. I found a likely candidate in Edwin Brady’s thesis and Conor informed me that it first saw the light of day in a talk by James McKinna in 2002. It’s called ‘PlusRec’ and I don’t understand it.

### Using Proof to Reason about Errors in Ontology Construction

Thursday, November 17th, 2005 by Louise

I’ve written up the FP lunch stuff I spoke about 3? weeks ago as a Dream Group Blue Book note which I’ve also put on the web at Using Proof to Reason about Errors in Ontology Construction.

### Two PhDs and some obfuscated code

Friday, November 4th, 2005 by Wouter

Having visited Utrecht a few weeks ago, I felt that it was my turn to stand up and save James’s bacon. I mentioned two new PhD theses that are worth looking into.

Bastiaan Heeren recently defended his thesis Top Quality Type Error Messages. There are some fairly compelling examples of strange type errors that GHC can give to relatively innocent programs. Rather than fixing the order of unification, Bastiaan argues that the type checker should first collect all the necessary constraints and subsequently try to solve them. Type errors become more precise and can be scripted by users. A lot of the ideas have been implemented in the Helium compiler, which is definitely worth checking out.

Atze Dijkstra will be defending his thesis in a few weeks. He wrote a large incrementally developed type system for a rather large subset of Haskell. During the process of coding, he implemented several interesting tools. The Ruler tool is essentially a domain specific language for describing type systems. It allows different views of typing rules and incremental specification of complex type systems. The ruler tool itself generates both an attribute grammar implementation and specification of the type rules. Although there are no soundness checks, the tool itself works nicely enough and has actually been used to describe rather large type systems.

As an encore, I outlined Ulf Norell’s winning submission to the succ-zero-th Obfuscated Haskell contest.