While writing the documentation yesterday, I found bugs that would have been fatal for the project. Details are below. It has me rethinking my goals in terms of a timeline for Qeditas. It's probably safe to say that the network will likely not be up and running anytime soon.
Before describing the bugs, allow me to note that I have updated the current version of the technical documentation:
http://qeditas.org/qeditastechdoc.pdfAlso note that I stopped merging from the dev branch to the master branch in September. If you want to keep up to date with what progress has been made, watch the dev branch:
http://qeditas.org/gitweb/?p=qeditas.git;a=log;h=refs/heads/devMy intention is to start merging from the dev branch into the master branch when the code base is reasonably stable.
Now, let me describe the bugs. This is in the mathdata module, in the file mathdata.ml. The documentation is Section 6.7 of the linked pdf above. One of the functions is tmtpshift, which should shift type variables (in de Bruijn representation). Here is how the code looked before yesterday:
let rec tmtpshift i j m =
term_count_check ();
match m with
| DB(k) when k < i -> DB(k)
| DB(k) -> DB(k+j)
| Ap(m1,m2) -> Ap(tmtpshift i j m1,tmtpshift i j m2)
| Lam(a1,m1) -> Lam(a1,tmtpshift i j m1)
| Imp(m1,m2) -> Imp(tmtpshift i j m1,tmtpshift i j m2)
| All(a1,m1) -> All(a1,tmtpshift i j m1)
| TTpAp(m1,a1) -> TTpAp(tmtpshift i j m1,tpshift i j a1)
| TTpLam(m1) -> TTpLam(tmtpshift (i+1) j m1)
| TTpAll(m1) -> TTpAll(tmtpshift (i+1) j m1)
| _ -> m
Here i and j are integers and m is a term.
There are two serious problems here. Firstly, the function should shift type variables, not term variables. Hence the first two cases handling DB (de Bruijn term variables) should not be included at all. The effect of including them was that the function would shift both type variables and term variables. Secondly, the type variables in the type argument "a1" of the Lam and All binder cases should have been shifted using tpshift. Since tpshift was not called on these arguments, type variables in these types would not have been shifted.
It's likely that either of these problems could have been exploited to prove false (an inconsistency), making the system useless as a library of formalized mathematics.
The corrected current version is as follows:
let rec tmtpshift i j m =
term_count_check ();
match m with
| Ap(m1,m2) -> Ap(tmtpshift i j m1,tmtpshift i j m2)
| Lam(a1,m1) -> Lam(tpshift i j a1,tmtpshift i j m1)
| Imp(m1,m2) -> Imp(tmtpshift i j m1,tmtpshift i j m2)
| All(a1,m1) -> All(tpshift i j a1,tmtpshift i j m1)
| TTpAp(m1,a1) -> TTpAp(tmtpshift i j m1,tpshift i j a1)
| TTpLam(m1) -> TTpLam(tmtpshift (i+1) j m1)
| TTpAll(m1) -> TTpAll(tmtpshift (i+1) j m1)
| _ -> m
While much of the code in mathdata was ported from Egal, I was responsible for introducing these errors when I added support for type variables in Qeditas. It's clear that I copied the function tmsubst and failed to make some intended modifications.
The fact that there were bugs in a fundamental part of the code base has given me pause. I do not know what timeline makes sense, but it's clear to me that Qeditas should not be launched until there has been a thorough code review.