" /> Ezra's Research: January 2011 Archives

« October 2010 | Main | February 2011 »

January 16, 2011

Much Ado About Parentheses

For a bit of light bedtime reading, I'm going through Raymond Smullyan's book First-Order Logic. It's a proper math book, not one of his popular fantasias like The Lady or the Tiger, and it was first published in 1968.

One of the things that strikes me is how mired in mechanics it is. He defines propositional formulae, as you might expect, as formed from variables, negations, and parenthesized binary connectives, and then he is at pains to point out that every proposition uniquely decomposes as either a variable, a negation, or a parenthesized binary connective. He cites proofs from Church and Kleene.

I spent ages going back and forth trying to decide what the difference between the definition and the lemma was, or to see what the supposed proof obligation was here.

Finally it dawned on me that he sees his formulae as essentially strings of symbols, rather than terms per se, and so the "uniqueness of decomposition" was essentially saying that there is a unique way to parse these symbol-strings as terms. To my modern eyes, it never occurred to me that the definition itself would be interpreted as anything but a definition about terms, or trees.

He goes on to note that, whereas his definition provided for connectives formed as, for example, (X /\ Y), they could have been defined as (X) /\ (Y). Three pages are spent on all this fuss over parentheses, and the equivalence between their different placements! When I didn't even see the parentheses as objects in the first place—they were just notation. How times have changed, for the better.

January 14, 2011

Compiling regex-posix in Haskell for Windows

WIth a coworker, I just had a problem with a fresh installation of Haskell Platform on Windows, for which we couldn't find a ready fix online. Here's what happened on how we fixed it, in hopes of helping others work around it.

The package regex-posix-0.94.2, which was installed as part of haskell-platform-2010.2.0.0, had a bug in its installation script where it didn't properly locate a dependent library (the libregex package) and so it would fail to link when it was loaded.

Mailing list traffic identified that this was the core problem, and it sounded well understood, so that a fix ought to have been made, although it wasn't obvious; I was able to see that regex-posix had a newer version, 0.94.4, and while unable to find a changelog for that package, I conjectured that this might have the fix. So I upgraded the regex-posix package, as follows:

cabal install regex-posix-0.94.4

Apparently, the cabal upgrade regex-posix command might have had the same effect.

Then we had to reinstall the packages that depended on it, which we were able to determine using the

ghc-pkg dot

output. In our case, the reinstall commands were as follows:

cabal install --reinstall test-framework
cabal install --reinstall test-framework-hunit
cabal install --reinstall test-framework-quickcheck2

It seems that, until we did this, these packages still depended on the old versions. Oddly, when we ran cabal install --reinstall regex-compat, it kept its dependency on the old regex-posix, even though regex-compat's .cabal file didn't have a version limitation barring the new version. Anyone know what's up with that?

Seemingly Haskell Platform should be point-released with a dependency on the newer regex-posix. I shall have to talk to Haskell Platform folks about whether this is the right thing.

Update Two further mailing-list posting about this: from Sept 2010 and Nov 2010.