Thursday, 19 April 2018

Mastering Revision Control

This morning, browsing Twitter as one does, I came across this tweet:
I initially assumed that the tweet was meant satirically, but it seems it was not so. After a wee bit of discussion, someone asked me to explain why this is a really bad idea:
So I shall.

Alice and Bob are working together on the same software project. Each makes a copy of the files of the project in their local filestore, which these days tends to be on their own machine. These days, indeed, they tend to make a clone of the repository on their local system, and this is a good thing - but for the present argument it's a detail.

Alice makes changes in two files, foo.src and bar.src; she saves these locally, runs tests locally, checks they pass, and commits her changes to revision control. The continuous integration system pulls the commit, builds it, runs the tests, verifies they pass, and all's good.

Bob makes changes to two files, bar.src and ban.src; he saves locally, runs tests locally, checks they pass, and tries to commit to revision control. And of course he can't immediately because Alice has already changed bar.src, so he has to pull Alice's changes, do a merge, fix the resulting issues and rerun the tests.

Now, that's the game. That's what we all do when working on collaborative teams. We try not to work simultaneously on the same bit of the system; we try not to trample on other people's work; but it happens. So Bob only grumbles a bit.

But it's late in the evening, Bob's tired. It's time to knock off. What to do? Well, in any sane shop, he's working in a feature branch so he pushes his feature branch up to the server, and goes home. But in this shop, management has dictated that they will ignore the last thirty years of software practice and experience and do everything in master. So Bob commits his work in progress to his local clone of the repository, and goes home.

Morning dawns bright and early, and Bob's in work raring to go. He powers up his machine, and... nothing. His local hard disk has died. Doesn't matter, all his work's in... oh.

That's a day's work lost.

Meantime, Clarice is working in another part of the codebase, on a problem where the most efficient implementation isn't obvious. She builds an implementation, and it passes the tests, but she's not convinced it's optimal. So she commits her implementation to revision control. She then starts working on an alternative solution, completes it, and it passes all the tests, too. She wants to commit this to revision control, too, but management have dictated that everything shall be done in master, so she can't. One version or the other can be current.

So what does she do? Overwrite her first solution? Abandon her second solution?

Yes, of course she can commit her second over her first - the point of revision control is that you don't lose stuff - but in practice that means a decision is taken to prefer the second solution, because the nature of the growing edge of a software project is that a commit from several commits back on a branch is not going to be promoted to the head of the branch unless you have very serious breakage.

Any software development which cannot be wholly automated involves design decisions and uncertainty. The cost to the developer of being experimental - of trying one idea, seeing under what circumstances it works well, seeing under what it works poorly, and trying another - needs to be as low as possible. If management puts needless difficulty in the way, that's bad management.

Software development time is expensive. Practices which cause work to be lost are highly undesirable. It needs to be as easy as possible to make sure work is not lost.

Git - and other modern revision control systems - are the product of decades of hard won experience. What we've learned over those decade is that branching is good. Feature branches are especially good. They prevent trampling over other people's changes, and reduce stress and conflict in the team. They make it very easy to track which features are in the build. They make committing and pushing low-stress, low cost activities.

Of course it should be the responsibility of every developer to ensure all tests pass before merging a feature into develop, developers are human and sometimes things go wrong. We always need a branch which we know is production ready code, from which the production system can be rebuilt in case of failure. That's what, conventionally, the master branch is; and the whole point of having a develop branch is to have a branch into which all changes are merged, which can then be tested to demonstrate that it is production ready before merging into master.


Thursday, 12 April 2018

Mourning goose

The Goose That Laid the Golden Eggs,
illustrated by 
Milo Winter
The last thirty years have seen an extraordinary change in the technical substrate on which our culture is built. The World Wide Web, created in Europe in in 1989, made the Internet usable for non-technical people. Across the Web, the vast majority of servers run on Linux, an operating system written in Europe between 1991 and 1993, as do the vast majority of mobile phones, and many of the Internet's routers. Meantime, most Apple products - computers, phones and tablets - are built on the BSD operating system, as are many other Internet routers.

Facebook, the towering proprietary monolith of social media, was built on PHP, a web scripting language written in Canada by a European (strictly, a Greenlander), as are all Yahoo's and Wikipedia's web services. Twitter was built on Rails, a web framework written by a European working in the US.

What's key about all these critical products is that they are all open source: given away by their authors for free as a public good, a newly created common wealth for the whole human race. These gifts - because they are gifts, and critically valuable ones - have sometimes been made by corporations, and often by universities.

But nevertheless, the most important gifts have been made by individuals: people who have chosen, rather than get personally rich on the basis of their creative work, to make a gift to all of us. And as these gifts have been maintained, developed, improved and repaired over the years, a great deal of that work has itself been done by individual volunteers, seeking no reward but their reputation among their peers.

It is on these acts of unselfish generosity, these gifts, that the whole of the the modern economy is built; and that isn't accidental.

The World Wide Web was by no means the first distributed hypermedia system; it was the first to be widely adopted, precisely because it was the first that individuals and organisations could adopt without onerous costs and licence terms. Linux is now the dominant operating system on the planet not only because it's free, but mainly because the ease with which people can contribute fixes and new functionality allows it to develop, and fix vulnerabilities, faster than commercial alternatives.

Open source not only reduces the cost of business innovation, it also drives up quality and enables business to share the costs of maintaining key software assets. It is the goose that lays the golden eggs on which the modern economy is built.

And the European Commission is proposing to shoot it.

The proposed Copyright Directive - and in particular Article 13 - totally undermines the gift economy; it poses unaffordable costs and liabilities on code sharing repositories like SourceForge, GitHub, GitLab and others. These organisations will be forced to either withdraw or charge for their services. making it impossible for volunteers to freely share - to gift - their own work.

Meantime, Article 11 seeks to undermine another critical substrate of a free society, the free and voluntary sharing of ideas. The civil society discourse on public policy requires citizens to be able to freely access and reference the ideas of others in their own works, and to make their own works freely available to others to reference, comment upon and critique.

Of course, the European Commission isn't setting out to shoot the golden goose. It's setting out to protect the interests of the film, television, and fiction publishing industries. But seriously, is it better in the modern age to have films and no internet, or internet and no films? If our present copyright provisions meant the total elimination of Europe's cinema and television production sectors, would the total destruction of the infrastructure of the Internet be a price worth paying to save them? If our present copyright protections meant the elimination of journalism, would the destruction of civil society be a price worth paying to save it?

No, obviously not.

And cinema and television production are not greatly challenged; they're thriving and immensely profitable. Journalism is challenged, and is still adjusting to the Internet. But nevertheless, the solution to that is not - cannot be - to destroy either the Internet or civil society.

This is a directive that should not merely be reconsidered; it should be abandoned entirely.

The discussion we should be having, in an age in which the cost of reproduction of digital goods is essentially nil, is whether the copyright model which served reasonably well through the era of print serves any sort of public interest in the digital age.

Of course the creators of cultural artefacts deserve to be rewarded; of course journalism is necessary to a free society and must be supported. But copyright does not serve either purpose well. For every J K Rowling, there are a thousand authors of fiction who make at most a pittance; for every Paul McCartney, a thousand songwriters struggling to put petrol into the car to go to their next gig.

In journalism, the Daily Mail, a purveyor of gossip, malice and deceit, profits more from copyright than the Guardian, which supports serious political discussion and commentary, and funds critical investigative journalism such as the recent Cambridge Analytica scandal.

In the Hitchhikers' Guide to the Galaxy, Douglas Adams wrote a little parable for our times. The first settlers of Earth, he wrote, adopted the leaf as currency. But leaves were too plentiful; so in order to prop up the value of the leaf, they decided to burn down all the forests.

What the European Commission is proposing is to burn down the forest: to save the profits of the media industry by destroying the infrastructure of the Internet and of civil society. They must not be allowed to do this. Copyright is a tool of society, not its master; and if the tool has been made obsolete by more modern technology, it is time to discard it.

Tuesday, 10 April 2018

Yet another bid to centralise power

A bunch of unbelievable dunderheids calling themselves the 'Constitutional Reform Group' are proposing a new Act of Union. You can read it here. The group are remarkably coy about their membership, but rumour has it that they are, at least primarily, members of the House of Lords - which comes as no surprise to me (indeed, I'd hazard I could correctly guess the names of several members).

Long time readers of my blog will recall that I've written on the UK constitution, rather often:

  1. The West Lothian question, take two
  2. Parliamentary Questions
  3. Submission to the Smith Commission
  4. Scottish devolution, and socialism in one nation
  5. A breakfast any self-respecting dog would reject

Fortunately the committee have provided a feedback form through which you can give your opinion of their turgid bucket of foetid dingoes' kidneys, here. I strongly commend the idea you do so. For inspiration, my own contribution is below; do not copy it, as that is bad form, but feel free to riff melodically on some of these points.

I have very rarely read a more foolish or more incendiary document - this ranks surely alongside Jonathan Swift's Modest Proposal for offensiveness, but lacks the wit.

It is not possible to have a federal state in which one confederate can always outvote all others. If the United Kingdom is to become a federal state, then either England must be split into at least five separate units (Wessex, Sussex, Essex, Mercia, Northumbria, perhaps) or Scotland, Wales and Northern Ireland, put together, must be able to outvote England. Otherwise it isn't a confederation, it's an empire (which, under your committee's proposal, of course, it is).

It is not possible to have a democracy with appointed legislators. Not any appointed legislators at all. The United Kingdom, of course, never has been a democracy, but it is about time it became one.

It is not tolerable that a broad range of taxes be retained by the federal administration. The centre can have few functions and therefore has little expenditure; the overwhelming majority of revenue must be generated where it is needed - in the nations. It would be better to put all taxation powers with the nations and fund the federal government with subventions from them.

It is not possible to have a UK wide court system, because there is not a UK wide system of law. Nor is it desirable that there should be, unless, of course, England wishes to submit to the jurisdiction of Scots law. No? Didn't thinks so. Similarly, a UK wide civil service makes no sense.

If you want to cause civil war in these islands, I commend your proposed bill as a most excellent way to proceed. Otherwise, I suggest you bury it in the deepest cesspit you can find, and pray it never resurfaces.


Friday, 6 April 2018

Response to consultation on a new enterprise agency for the South of Scotland

1 Do you agree with our ambition outlined?

Yes

2 What would you like to see for the South of Scotland?

Locally owned businesses, rather than inward investment. The current problems at Pinney's just reprise the history of firms like Stelrads; investors from outside the region are attracted in with generous grants, stay for the good times, and pull out suddenly when times are tough. That isn't what we need.

What we need is to develop and grow a vibrant entrepreneurial culture locally. That means training in entrepreneurship, mentoring networks, and, ideally, if they can be found, local angels. It also means facilitating local business and tech meetups.

I'd personally like to see more high skill high wage businesses, like software and engineering, and less emphasis on low wage, insecure businesses like hospitality and tourism. As agriculture adapts to a low carbon economy, there are huge opportunities for disruptive new engineering products.

3 What are your ambitions for the future economic success of the South of Scotland?

Innovative engineering, especially around reducing fossil fuel use in agriculture and forestry.

A broad entrepreneurial culture, with school leavers and university graduates equipped with the skills and confidence to start their own businesses; supported by
  1. a mentoring network.
  2. A local angels/venture capital network, and a local business focussed bank after the German model.
  3. The ability to develop businesses where people want them, not where it's convenient to central planning.
In particular we need employment in villages, and employment flexible enough for people supplementing reduced agricultural incomes.

4 What are the strengths you would like to see the Agency build on?

As outlined, we're a dispersed region with significant opportunities in renewable energy, a highly educated workforce, and, in places, considerable self reliance.We also have land, although it is concentrated in few hands. Land-based businesses over the 20th century became heavily dependent on fossil fuels and that now has to change rapidly. That's a challenge, but it's also an opportunity. Southern Scotland has a history of agricultural innovation - for example, the milking machine was invented in Castle Douglas. We can respond to this challenge.

We lack confidence, finance, and entrepreneurial skills. We need to make up these deficits, and that's something an agency would be well placed to do. We also, relative to urban areas, lack informal opportunities for entrepreneurs to network, and that also needs to be addressed,

A local business bank would be a great asset, either as a strictly commercial business or as a mutual.

5 What are the economic challenges you would like to see the Agency address?

  1. Infrastructure, especially communications.
  2. Finance.
  3. Entrepreneurship training and mentoring.Research and development support.
  4. Networking, meetups, matchmaking.
  5. There is a problem with affordable housing for young people. If people are borrowed up to the hilt for housing, or paying a burdensome rent, the amount of risk they can afford to take on in business is sharply limited.
  6. Universal Basic Income would considerably de-risk business startup.

6 What currently works well in the South of Scotland?

Not a lot.

7 What would you add or take away from the potential activities that the Agency could carry out across the three areas:
a) drive forward the economy?:

While opportunities are great, we need to be aware of risks and challenges. Scottish agriculture is not equipped to compete at world market prices, and Brexit will mean widespread farm bankruptcies across the region with consequential bankruptcies among farm supply businesses and more widely.

The challenge for the rural economy over the next decade is to maintain people in their homes in the face of rapid change and stress. Challenges are opportunities, and there are considerable opportunities in the current situation. But we need to be clear that the requirement, before seeking to drive the economy forward, is to prevent its utter collapse.

b) sustain communities?:

The costs and models of rural transport are going to change considerably over the next decade, and the prospects are not easy to predict. Because the rural economy is relatively depressed and electric vehicles are new and expensive, it's unlikely that they will naturally propagate into the rural economy first; rather, they're likely to be in the towns.

There's a related issue that most remote rural areas have great opportunities for renewable electricity generation, but lack the grid connections to carry that power away. If it could be used locally to power transport and farm machinery, that's a triple benefit to the rural economy.

If we expand electric vehicle use rapidly and early in remote rural areas, that will cut the costs of rural transport very substantially, leading to much more sustainable communities; driverless, on demand electric taxis following the Google/Waymo model could have a very positive impact.

But without government intervention and considerable subsidy, neither will happen. The richer, urban economy will soak up these new products first, and remote rurals will get them only when that market becomes saturated. Instead it's likely that private rural transport will tend to depend largely on second hand diesel vehicles, because they're cheap to buy and reliable; but they will increasingly be more expensive to run. This further disadvantages rural areas with respect to urban.

Without affordable transport and access to affordable housing and land, the pattern of a populated landscape and vibrant village communities will be very hard to sustain.

c) capitalise on people and resources?:

We don't educate nearly enough in entrepreneurship or in civics. Young people leave education expecting to get a job, not start a business. They lack the skills and they lack the mentoring network.

A related problem is that most of our young people go away to distant universities, and, because of the cost of housing and the few opportunities for employment, few come back. Of those of my generation from Auchencairn who went to university and did not inherit farms, only two - myself and one other - came back.

Full disclosure, I started my first business in Auchencairn at the age of 21; it was a steep learning curve, but was supported by good mentoring from Scottish Enterprise for which I'm still grateful.

So: we need better education in entrepreneurship at all levels, a wide network of good, easily accessible mentoring, and affordable housing and business premises. The second and third of these are things the new agency can contribute greatly to.

With regard to resources, our primary resource after people is land and landscape. Landscape, as a marketable asset, derives from cultural aesthetics which are inevitably somewhat backward looking; people like to see (and to live in) a settled, patchwork landscape of mixed farming, woodlands and hills. They like to see in that landscape a broad diversity of wild flowers, birds, and other wildlife.

This is not from an agricultural point of the most efficient landscape. As pressure grows on farmers, we will see less employment, less varied agriculture, a less settled and less diverse landscape. Beef, lamb and cereal production will cease to be economic as we open up to world markets, increasing the reliance on dairy, and, probably, on cows kept indoors and fed silage.

If we are to protect a settled landscape, we need ways to subsidise small farms. I believe that moving from a per-hectare model of agricultural subsidy to a welfare model - preferably a universal basic income model - together with opportunities for part-time employment, would encourage a settled, more diverse landscape, which would in turn bring benefits to tourism.

8 What would you prioritise as the key areas of activity for the Agency?

  1. Building mentoring networks.Facilitating meetups/informal business networking.
  2. Encouraging entrepreneurship education, including on-going education for existing business owners.
  3. Providing/gatekeeping access to local angels.
  4. Encouraging the establishment of a regional business-oriented bank.
Politicians like inward investment because it provides sudden, relatively large job creation which they can take credit for. This is a snare and a delusion. As the south of Scotland has seen repeatedly over the past century, inward investors become outward divestors at the first sign of trouble. The agency should NOT support inward investment.

9 What specific things could the Agency do to help you, your business, your sector or your community?


  1. My business? Better broadband; business networking.
  2. My sector? Better broadband; business networking.
  3. My community? Affordable housing. The average income is about £21,000, the minimum house price is about £200,000, the two don't meet.

10 What could the Agency do outwith its boundaries working with other local authorities or with agencies like Highlands and Islands Enterprise to support specific projects which benefit the South of Scotland and with national agencies?

East to west travel across southern Scotland is not facilitated by either the road or rail network, and consequently there is not much communication between Dumfries and Galloway in the west, and the Borders in the east; rather, Galloway tends to face Ayrshire and Glasgow, where the Borders tend to face the Lothians and Edinburgh. It does not therefore seem to me that, despite the similar challenges, it will be easy for one agency to service all these regions.

In particular an agency headquartered in the Borders will find it hard to service Galloway, while one based in Dumfries will find it hard to service Berwickshire; sadly, one based in Langholm would find it hard to service anywhere at all.

In Scotland we over-centralise everything; Dumfries and Galloway, considered as a unit, is larger both in area and in population than one sixth of the independent nations of the world. On average across Europe, local government units are one twentieth the size they are in Scotland. I do not believe this can continue; I believe the democratic deficit must mean that we will soon see the break up of these monstrous local government divisions.

Nevertheless, there is a clear geographic divide running to the east of Moffat and Langholm, Without major new roads infrastructure, despite the similarities in economic challenge, it is not useful to see the whole of southern Scotland as one unit. While I think Dumfries and Galloway council is an oversized and anti-democratic anachronism, an economic development agency for the south-west would make sense.

11 Which option, either from the list above or your own suggestion, do you think offers the best way to ensure the Agency is accessible to all across the South of Scotland?

Of the options listed I would go with the first: 'the Agency could have minimal physical presence with its services delivered digitally across the area', supplemented by local, probably part time, networking and mentoring staff dispersed across the region.

There is no location which could reasonably serve as a 'headquarters' for the whole of southern Scotland, because there is effectively no transport infrastructure between east and west.

12 Which criteria should be used in reaching a decision about the location of the Agency?

Don't locate it. That is a snare and a delusion. A centre in Dumfries could service the southwest, but not the Borders. One in the Selkirk/Melrose area could service the Borders, but not the southwest.

Obviously in my personal interest it would be better in Dumfries than in Melrose, but that's exactly the point; getting bogged down in squabbles about location doesn't help, and whichever location were chosen, unless the Scottish Government is prepared to invest in a Stranraer to Melrose motorway, the side of the country not chosen will feel discriminated against.

Board meetings and other central functions should rotate across the whole area, rather than being centrally located; staff should be dispersed.

13 If you were to use the services of this Agency, what factors are important to you in terms of reaching it?

Digital delivery is still problematic across much of rural Scotland: broadband speeds are laughably poor - I'm currently seeing 0.9 Mbits/sec download and 0.3 upload, and I run an Internet business!

Without better broadband performance digital delivery alone will not service remote rural areas.
So until we have the broadband we've been promised for the past twenty years, the agency would need to work on an 'account manager' model, with dispersed, locally based, probably part-time account managers regularly visiting their client businesses, probably as part of a mentoring/support scheme.

14 What sort of people should be on the Board of the Agency and what sorts of skills and expertise should they have?

A board widely drawn from experienced local business people - not politicians nor career public servants.

15 We know that young people are less likely to stay in or move to the South of Scotland than they are other parts of the country. Do you have any comments on things the Agency could do to meet the interests of children and young people?

We need homes for them to come back to after university, and opportunities to create their own employment in the form of flexible, low-commitment business premises. Ideally we need either universal basic income or an enhanced enterprise allowance to de-risk at least the initial three years.

We need opportunities for part time employment so that people not able to make a sufficient income from a nascent business can supplement it.

But most of all we need housing. And the housing we need has to be affordable in perpetuity, so either we need sufficient council housing of sufficient quality to be both available and attractive to potential entrepreneurs, or else we need to make the Rural Housing Burden actually work.


19 Do you have any other thoughts on powers that the Agency will need?

There will be a great deal of pressure for the agency to intervene in situations like Pinney's. Pinney's is a tragedy, but it's one that is an inevitable consequence of businesses being owned from outwith the region, and of Brexit. We will see more instances of this over the coming years, and they could easily soak up all the resources of the proposed agency for years to come.

Furthermore, paying bribes to businesses based furth of Scotland to keep open businesses in Scotland, even if it preserves employment in Scotland, is poor use of Scottish government money.

The agency needs to have the independence to be able to resist political pressure to intervene in saving failing businesses. This isn't to say that the agency might not back a management buy-out, or some other scheme which brought ownership of a facility back into the region, provided that the facility was viable as a business or could reasonably be expected to be brought into a condition in which it was.

I don't think the agency should have the power to invest directly in businesses; I think that it should seek to encourage and support a network of angels, or a local venture capital group, and a regional commercial bank.

20 Is there anything else you wish to say about the operation of the Agency?

Keep it lightweight, keep it dispersed, don't spend money on fancy headquarters of large central staff.

Saturday, 24 March 2018

On HOOP, and hope.

Ok, let's talk about Hands Off Our Parliament, and the lessons to be learned. Firstly, huge congratulations to the organisers!

Secondly, we can pull out a big crowd in Edinburgh at short notice on a weekday afternoon. That shows there's a huge appetite to get the Yes movement rolling again.

Thirdly, the average age was about 60. That's not surprising - it was in working hours, many folk with day jobs couldn't be there. But it proves that the idea the old aren't keen on independence is havers.

Fourthly, folk came a long way. I left Auchencairn at 8:00; the friends I met at #HOOP were from Ayrshire, Galloway, Lanarkshire and highland Perthshire. I heard a bunch of folk had come down from Orkney, although I didn't meet them. Folk were very committed: the weather turned out good, but the weather forecast wasn't primising and I left home in condensing fog.

Fifthly, the leadership of the Yes movement won't lead. The only SNP figure I saw was Tommy Sheppard (who did speak); I didn't see any of the leadership of the Independence Convention and I know for a fact Robin McAlpine of Common Weal wasn't there. Full disclosure, when Tommy Sheppard was announced, because sound wasn't good in the wind, I thought they'd said Tommy Sheridan and was actually walking out before I realised I was wrong! My apologies, comrade Sheppard.

Of course there may have been people there I didn't see. It was a big event, and in my current state of very frail mental health I'm not good at recognising people. But if the folk who should be leading this movement really were notable only by their absence, this isn't good.

Worse still, as far as I can see, no significant figure from the SNP, the Greens, the Independence Convention or even Radical Independence has commented on or tweeted about the event either yesterday while it was happening, or this morning in retrospect. No solidarity, no congratulations, no encouragement. Not even criticism. And I think we need to be saying this to our leadership: shit, or get off the pot.

Sixthly, if we're going to do this again on a weekday, a day when Holyrood is in session would be better. We need to be able to lobby our MSPs; we need to show the strength of our support to MSPs; and we need to make it easier for MSPs to join in.

Seventhly, I am certain that it is vital that things like this are not allowed to become party political. Tribalism will kill us. If the Independence Convention won't lead, we need something similar that will.

China Central TV conducting an interview at HOOP
Eighth, we cannot rely on the mainstream media to get our message out to the public. Neither of Scotland's broadcasters seem to have reported the event at all. The National, of course, had good coverage, and the Scotsman had reasonable coverage, but the Herald and Daily Record both played down the event reporting the turnout as 'hundreds'. The Herald in particular focussed on 'noisy' Yes Bikers and alleged anti-BBC chanting. China Central Television apparently gave us coverage, but I doubt much of the Scottish electorate watches that!

Ninth, it was great to see Welsh dragons and Catalan esteladas among the cloud of saltires; I also saw a Palestinian flag. I didn't see anyone else with an EU flag, although I had one; but many people had EU stars on their saltires. I would personally have liked to have seen a Kurdish flag (although I don't know what one even looks like), and it would be good to build solidarity with other small European nations. It's important to make it clear to onlookers and to the media that we're an internationalist, and not a narrowly nationalist, movement.

But dae a wheen o Saltires no luik braw?

Tenth, many folk had dressed for the occasion, which really helped make it feel like a carnival. My gratitude to all of you who did! Indeed, all the news outlets which reported the event at all did use good pictures, showing that the effort of those who dressed up or brought good placards and flags was not wasted. If we cannot get our message across in the words that journalists write, we can still influence through the pictured they use.

Eleventh, yes, of course there was no trouble. That's not who we are. #Yes is positive, #Yes is creative, Yes can turn anything into a party. Let's be proud of that and stay that way!

Finally, thanks again to the organisers. We needed this. We need to be spontaneous. We need to push our self-appointed leaders to lead or get out of the way.

Thursday, 8 March 2018

Now is the time

Betty Hutton playing Pearl White in The Perils of Pauline (1947)
There's a trope in early Hollywood: a girl, bound to railway tracks, an oncoming train. That's the situation we're in now: Brexit is the oncoming train, and our Scotland, our Bella Caledonia, is bound to the tracks.

But with what are are we bound? With chains? No: with caution, with timidity. Folk are saying that is isn't certain that with one bound we'll be free. They're right, of course. Folk are saying if she tries to bound free, and fails, we cannae try again for a generation.

Folk - Peter Arnott - are saying, there's no need to worry. We can just let Brexit crash over us. It will cut the non-existent chains, the chains of our timidity, and when it's passed, without any effort on our part, we'll be free. Sans arms, sans legs, but free. And what did we care about Scotland's arms and legs anyway?

Let us be clear what Brexit means to Scotland.

Absent the close trading relationship with Europe, the UK will need very quickly to agree trading relationships with other big, rich markets, and actually there are very few. India and China are big, but not rich; Canada, Australia, New Zealand rich but not big. So the Tories are going to have to do a deal with Trump's United States. They'll need it quick. And they aren't great negotiators.

What does the USA want to sell us? Well, it does want to sell us food, produced to much lower standards than we've been used to. It wants to sell us 'Scotch Whisky' and 'Cornish Pasties', made in Illinois and Nebraska. But most of all it wants to sell us "healthcare". The Tories will not be averse to this: many of them have existing links to healthcare companies. Selling off the health service will not mean just selling off the English health service; the trade treaty will not be between England and the USA, but between the UK and the USA. So that's our health service gone. For ever. Independence after Brexit won't bring it back.

But what did we care about Scotland's health service anyway?

But then, there's the economy. Scotland used to be big on manufacturing. It used, especially, to be big on marine engineering. Not any more. Scotland proudly boasts the world's first floating wind farm - owned and installed by Norwegians using turbines from Germany on towers from Spain. Margaret Thatcher closed down most of our industry for her 'leaner, fitter Britain', and it's never recovered. What manufacturing we have left depends significantly on just-in-time relationships with European partners; and those are going to be savaged by Brexit.

Margaret Thatcher's big idea was that we switch from manufacturing into 'services'; by which she chiefly meant financial services. Well, that's OK, Scotland has always been big on financial services, too! We have the Bank of Scotland, and the Royal Bank of... oh, wait...

Seriously, we do still have some good financial services organisations. But with Brexit, they will lose their 'passporting rights' to Europe, which will take away a big chunk of their market at a stroke.

And the one thing that no-one is talking about is this: less than three years from today, every consignment of goods leaving the UK and every consignment of goods arriving in the UK is going to have to go through customs. Where is the customs infrastructure to handle that? When will it be built? Do you think the current British government is competent to build it, in under three years? Aye, right.

You've seen what happens to the shelves in our supermarkets after one day of snow. Imagine what they'll be like after a month of chaos at the ports. Never mind, let them eat fish.

As a communist, obviously I believe that wealth should be shared equally - and obviously, that means equally across the globe. It is not just that workers in Scotland are paid more than workers in Mumbai or Shenzhen. In the long run that does have to change. But after Brexit, workers in Britain, outside the protective barriers of the EU, will be competing directly against workers in Mumbai and Shenzhen. We're no longer better educated. We no longer have better infrastructure. There is nothing, in a free market, to maintain our historical differentials. If we demand to be paid more, businesses will just move the jobs. Outside the EU, there's nothing to stop them.

But what did we care about Scotland's economy, anyway?

And while there is a degree of justice in this, the sudden, drastic fall in incomes and loss of jobs will be very hard for us in Britain.

Scotland cannot be protected from this. The Scottish Government cannot tax more to maintain public services, if its tax base has collapsed. Brexit means the end not only of our health service, but also of our welfare state. We're going to face a decade of economic collapse - probably two. Civil dissent will be met with repression. In those circumstances, secessionism is just another form of civil dissent, like trades unionism, to be crushed. We saw it in Scotland in the 1980s, we see it today in Catalunya.

I don't know whether you are old enough to have campaigned in the 1979 referendum, or lived through the industrial conflict of the 1980s. I am; I did. Thatcher's government was as hostile to nationalism as to the left. I believe the isolated, xenophobic, bankrupt Britain we face post-Brexit will be far more repressive than Thatcher ever was. Such a regime won't tolerate any further independence referenda. If we do not achieve independence before Brexit, we will not achieve it in the lifetime of anyone now living.

But what did we care about Scotland's civic freedoms, anyway?

Rewind. Cut.

It doesn't have to be like this.

We can have another referendum.

Now.

Yes, it's true that we don't currently have a lead in the polls. We didn't in 2012, when we started the independence referendum campaign. We didn't in 1979, when we started the devolution campaign. In each case, we swung the polls more than 15% over the course of the campaign.

Yes, of course it's true that there's no guarantee we can do that again. But we don't have to. We're already much higher in the polls than we were in 2012, and the trend is positive.

All Scotland needs to bound free, to avoid the train, to keep her arms and legs, her health service, her economy, her labour differentials, her civic freedoms, is confidence. Courage and confidence. Yes, of course it's true that it isn't certain we can do it. We need to have a long campaign, because we didn't keep the Yes Movement going after the 2014 defeat. The Yes Movement isn't like a political party with a permanent membership system and secretariat. But we know from experience that given a long campaign, Yes is a formidable electoral machine.

And seriously, what are you going to say to your starving daughter as you hug her close to try to protect her from the damp and chill of a Scottish winter without fuel, and she asks you "what did you do to try to save Scotland from this?"

Are you really going to say "well, it looked hard, so we didn't try." Really?

Really really?

Nothing comes to those who wait. If we don't forge the future, the future will go to those who are forging it while we wait. The Brexiteers are forging the future. We may not like the future they're forging, but they're doing it very effectively. The climate change deniers are forging the future. The far right are forging the future. They're not waiting. It's their future we will get if we wait.

Independence is not the key political issue of our age. Global warming is more important. Social justice is more important. Ecocide is more important. Peace is more important. Independence is important in as much as it helps towards those goals. But independence, like social justice, like an end to war, like a habitable planet, will not come if we wait. We must forge these things. This is no time for quietism. It is time for action.

Now is the time.

Tuesday, 12 December 2017

On Catalunya, and Freedom

I don't know much about Catalunya. I've never been there; I have no friends from there. I've read, obviously, books coming out of the experience of the Spanish Civil War - George Orwell, Laurie Lee, and anarcho-syndicalist texts: Murray Bookchin, Robert Alexander and others. But that's all a long time ago; and my interest was in political theory and in how you build a good society, not particularly in the place itself. I don't know much about Catalunya.

But that is beside the point. The point, in Catalunya now, is the right of people in a place to define themselves as a community and a polis, and to achieve self determination for that polis. Chapter One, Article One of the Charter of the United Nations - which all members have signed up to - asserts the right to self determination. So does Article One of the International Covenant on Civil and Political Rights, of which Spain is also a signatory. It is a basic, fundamental right.

And it is a right we in Scotland claim. It is core to our Claim of Right. It is core to our right to choose whether we wish Scotland to become a nation again.

In Catalunya, at this moment, four people are in prison for peacefully asserting this right. They are:

Jordi Cuixart i Navarro is a civil society activist, not a politician. He leads a cultural organisation, Omnium Cultural, which promotes the Catalan language. He is, effectively, equivalent to the chair of An Comunn Gàidhealach. He's accused of organising passive resistance to the attempts by the Guardia Civil - the Spanish national police - to destroy the infrastructure for the first of October referendum on Catalan independence.

His address in prison is:
Jordi Cuixart i Navarro
Centro Penitenciario
Madrid V
Ctra. M-609, km 3,5
28791 Soto del Real
Madrid, Spain
Jordi Sanchez Picanyol is President of the Assemblea Nacional Catalana, which might be seen as roughly equivalent to the Scottish Independence Convention; so again, although he is a political activist, he's not a party politician. His closest Scottish equivalent might be Leslie Riddoch. Like Jordi Cuixart, he's accused of organising passive resistance to the attempts by the Guardia Civil to destroy the infrastructure for the referendum.

His address in prison is:
Jordi Sànchez Picanyol
Centro Penitenciario
Madrid V
Ctra. M-609, km 3,5
28791 Soto del Real
Madrid, Spain
Oriel Junqueras i Vies is a historian by profession, but he's an elected politician and serves as Vice-President of the Government of Catalonia; his nearest Scottish equivalent might be John Swinney. He leads the Republican Left party in the Catalan Parliament, and led the 'Yes Coalition' campaign in the last parliamentary elections - so he's also a bit like Blair Jenkins. He's accused of  rebelliousness and sedition for responsibility for the unilateral declaration of Catalan independence.

His address in prison is:
Oriol Junqueras i Vies
Centro Penitenciario
Madrid VII
Ctra. M-241, km 5.750
28595 Estremera
Madrid, Spain
Joachim Forn Chiariello is a lawyer turned liberal politician. He leads the Convergència Democràtica de Catalunya party, and is Minister of the Interior in the Catalan Government. In Scottish terms he's somewhere between Willie Rennie and Michael Matheson. He's in prison largely because his ministry was responsible for the Mossos d'Esquadra, the Catalan regional police (equivalent to Police Scotland) and for the Catalan firefighters, who together defended voters from the violence of the Guardia Civil on the first of October.

His address in prison is:
Joaquim Forn Chiariello
Centro Penitenciario
Madrid VII
Ctra. M-241, km 5.750
28595 Estremera
Madrid, Spain
So, four men. None of them revolutionaries. None of them have espoused violence. Each serving in roles which are quite familiar in Scotland. And each, imprisoned for doing so.

If the Westminster Government sent the Metropolitan Police to smash up the baby boxes that the Scottish Government are distributing, wouldn't you hope that someone in Scottish civil society - Jonathon Shafi, perhaps, or Lesley Riddoch - would organise a peaceful demonstration to prevent them?

If the Holyrood parliament votes to organise a second independence referendum, and, if that referendum returns a strong 'Yes' vote, votes again to declare Scotland independent, wouldn't you hope that the Scottish Government would act on that mandate?

Of course you would.

And let's put to bed the claim that the referendum was 'illegal'. The right to self determination is guaranteed by binding international agreements to which Spain is a voluntary signatory. Therefore it is legal in Spain to vote for self determination. Self determination cannot be legally protected if all the means to express self determination are forbidden. The referendum cannot have been illegal. As Spain claims that its national law trumps Catalunya's regional law, so international law trumps Spain's national law.

I don't know much about Catalunya. I don't know whether Catalunya should be independent. That's none of my business; it's for the people of Catalunya to decide. But I do know this: if Scotland will not stand in solidarity with the Catalans, if we will not stand up to assert Catalunya's right to self determination, why should anyone stand up for ours?

Libertat Presos Politics. They aren't just Catalunya's political prisoners; they're also ours.

Saturday, 2 December 2017

Wildwood: Development

[What follows is the text of the 'Development' chapter - chapter five - of my thesis as it existed in June 1988, when I lost access to the machine on which the work was done. This is an unfinished chapter of an unfinished thesis; I am posting it because people have expressed interest in the explanation game. This is the last form of this chapter, but it isn't the end of my thinking on the matter, and if I were rewriting it now I would add further moves to the set to allow the agents to argue not just about assumptions, but about the merit of the authorities from whom rules of inference are drawn. 

A modern implementation would also, of course, have access to the semantic web in order to draw in additional sources of knowledge beyond that stored in a local knowledge base.]

Development

Explanation is a social behaviour

Games are social behaviours which can be modelled

Explanation can be viewed as a game playing activity

One of the models we frequently use in real life situations where a decision has to be made on the the basis of uncertain or conflicting evidence is the dialectic model. In this, one authority proposes a decision, giving an argument which supports it; another authority brings forward objections to the argument, and may propose an alternative decision. This method may continue recursively until there is no further argument which can be advanced.

This is the model which underlies both academic and parliamentary debate, and the proceedings of the law courts. The model supports a ‘decision support’ conception of the Expert System’s role, in addition to a ‘decision making’ one; in the decision support conception, the user is placed in a position analogous to that of a jury, considering the arguments presented by the advocates and making a decision on the basis of them.

We can view this dialectic approach to decision making as a game, with a fixed set of legitimate moves.

Hintikka’s game theoretic logic

This approach seems very promising. It may tie in with game-theoretic logics such as those of Ehrenfeucht [Ehrenfeucht 61] and Hintikka [Hintikka & Kulas, 83 and passim]. Of course, these logics were strictly monotonic. Problem areas where monotonic logics are adequate are of limited interest, and unlikely to give rise to interesting problems of explanation; but it should be possible to develop a provable semantics for a non-montonic extension. The decision procedure for a game-theoretic logic should not raise any particular difficulties; the ‘games’ are zero sum, under complete information.

However, the adoption of a game theoretic explanation mechanism does not commit us to adopting a game theoretic logic; so (although interesting) this line will be pursued only if it proves easy.

The object of an explanation game

If explanation is to be seen as a game, what is to be its objective? If we were to take a positivist approach, we might say that the purpose of explanation was to convey understanding; then the game would be a co-operative one, with the objective of both players being to achieve this end.
But seeing we have rejected this position, the objective of an explanation must be to persuade.

Furthermore, if we accept the argument advanced in Chapter 3 above that explanation is hegemonistic, the explanee must be seen to have an objective in resisting explanation. So now we have a clear idea of what the objective of an explanation game will be: the explainer will win, if the explainee is brought to a point of no longer being able to produce a rational1 reason for resisting the explanation. Otherwise, if when all the supporting arguments the explainer can bring to bear have been advanced the explanee is still unconvinced, the explainee has won.

Legitimate moves in an explanation game

A possible set of legitimate moves in an explanation game might be:

PRESENT

Present a case, supported by an argument, which may include one or more assumptions.
Generally, in a non-monotonic system, we are dealing with incomplete information (and, indeed, this is generally the case in ‘real life’). Consequently, any conclusion is likely to be based upon one or more unsupported assumptions.
[starting move]

DOUBT

Challenge one or more of the assumptions.
[basic response to PRESENT, REBUT or COUNTER-EXAMPLE]

DOUBT-IRRELEVANT

Claim that, even if the assumption were false, it would make no difference to the decision.
[blocking response to DOUBT]

ASSUMPTION-PROBABLE

Claim that the assumption is probable based on prior experience, or, for example, statistical data.
[weaker response to DOUBT]

REBUT

This is essentially the same as PRESENT, but of an argument based on the opposite assumption to that challenged in the preceding DOUBT.
[response to a PASS following a DOUBT]

COUNTER-EXAMPLE

Present a known case similar to the current one, where the predicate of the assumption which has been challenged holds the opposite value.
[response to ASSUMPTION-PROBABLE]

PASS

A null move in response to any other move. Forces the other player to move. In some sense this might be seen as equivalent to saying ‘so what?’: the opponent has made a move, but there is nothing further which the player wants to advance at this stage. This move is inherently dangerous, since the game ends when the two players pass in successive moves.
[weakest response to anything]

Implementing a game theoretic approach to explanation

Playing the explanation game

The game playing algorithm required to implement an explanation system need not be sophisticated; indeed, it must not be too sophisticated, at least as a game player. Consider: a good game playing algorithm looks ahead to calculate what the probable responses to the moves it makes will be. If it sees that one possible move leads to a dead end, it will not make that move.
But in generating an explanation, we need to explore any path whose conclusion is not immediately obvious. So either the game-playing algorithm should not look ahead more than, perhaps, one ply; or else, if it does so, then when it sees a closed path it should print out a message something of the form:
Critic: Oh yes, I can see that even if the assumption that Carol hasTwoLegs is false it does not affect the assumption that Carol canSwim.
Initially, however, I propose to implement a game-playing algorithm which simply makes the strongest move available to the player, based on a scoring scheme which does not look ahead. The game will proceed something like tennis; the player who last made a PRESENT or REBUT move will have the initiative, the ‘serve’, as it were, and need only defend to win. The other player must try to break this serve, by forcing a DOUBT… PASS sequence, which allows a REBUT play.

Dialectic explanation: the two-player game

With this schema, we can mechanise a dialectic about a case. The game is played by the machine against itself; ‘agents’ in the machine play moves in turn until both sequentially pass, or until the user interrupts. Each move produces a natural language statement on the display Ideally, the user could interrupt at any time, either to request further justification for a move or to halt the process.

As a (simple) example of what might be produced, here is some sample output from a very crude prototype system2:

User: (← Carol Explain CanSwin)
Consultant: What is the value of CanSwim for Carol?
User: Don’t know
Consultant: I found that CanSwim was true of Carol by Default using the following assumptions:
I assumed that CanSwim was true of Carol
My reasons are
CanSwim is true of most Mammals;
Carol is a Mammal;
Therefore it is probable that CanSwim is true of Carol.
Critic: The assumption that CanSwim is true of Carol is unsafe:
Henry is also of type(s) (Person) but CanSwim is false of Henry.

This example, which is from a system considerably less developed than the ideas given above, shows ‘Consultant’ PRESENTing a case based on a single assumption, and ‘Critic’ responding with a COUNTER-EXAMPLE – a move which would not be legal under the scheme given. However, this should give some indication of how the idea might be implemented.

The simple model described above has not achieved all we want, however. The machine, in the form of the agent ‘Consultant’ has attempted to explain to itself, wearing its ‘Critic’ hat. The user’s role has simply been that of passive observer. The first enhancement would be to give the user control of the ‘Critic’; but because the user cannot have the same view of the knowledge base as the machine, the ‘Critic’ will have to guide the user, firstly by showing the user the legal moves available, and secondly by finding supplementary information to support these moves.

Explanation as conversation – a three player game

A better design still might be to allow the machine to carry on its dialogue as before, but to allow the user to interrupt and challenge either of the agents. It seems probable that the most interesting moves the user could make would be DOUBT, and also COUNTER-EXAMPLE, where the user could present an example case not previously known to the machine. Now the user can sit back and watch, if the conversation brings out points which seem relevant; but equally, the user can intervene to steer the conversation.

These ideas have, needless to say, yet to be implemented.

1‘Rational’, here, is of course a fix. In an explanation situation involving two human beings, the explainee might continue to resist even if there is no rational reason for doing so. This situation would be non-deterministic, though, and too difficult for me to deal with.

2This is output from Wildwood version Arden, my experimental prototype object based inference mechanism. The game-playing model is different from (a predecessor of) the one given above.

Friday, 1 December 2017

Before Wildwood: the Arboretum engine

(this piece was written as an email in a response to a question by Chas Emerick about whether it is possible to explain inference to ordinary people. It describes the Arboretum engine, which started me thinking about how you make a computable logic which people can understand.)

Right, let's try to set this out in some sensible detail. I'll start by giving you the bones of the story, and then move on to talk about the things you're actually interested in. I'm copying Peter Mott in so he can correct any misrememberings of mine (I have long term severe depression, and it really messes with your memory).

I did a minor course in logic and metaphysics when I was an undergrad. When I graduated in 1986, my logic tutor, Peter Mott, who was entirely deaf, was invited to join an AI project - the "Alvey DHSS Large Demonstrator" essentially as the formal logic input to the process. He invited me to join him as his research associate, mainly I think because having been in his seminars for two years I was pretty fluent at discussing technicalities of logic in sign language, and could interpret for him. I was never the world's most brilliant logician, but I could more or less do it.

Peter was certainly responsible for the logic of the "D-Engine", and I think wrote the first prototype in Acornsoft Lisp himself. The D-Engine logic is a Popperian propositional logic, and the goal of the engine at any stage is to seek to falsify what it currently believes. Again I think it was Peter's insight that this would map naturally onto a systematic practice for interviewing domain experts, but, being deaf, he couldn't develop this interviewing practice himself.

A rule in D-Engine logic is naturally a tree, which we called a "D-Tree". It nodes are propositions "coloured" with truth values, and edges essentially represent "unless" relationships. Because D-Engine logic naturally argues from the general to the particular, it's possible to recover extremely good natural language explanations of decisions from simple boilerplate fragments on the nodes.

There's a paper explaining all this: Mott, P. & Brooke, S. A Graphical Inference Mechanism. Expert Systems, May 1987. vol. 4. No. 2 pp. 106-117

(Golly. I've just - for the first time ever - done a google search for that paper, to see it it was online anywhere. It isn't, but it's cited in lots of places - including by Marc Eisenstadt! I'm pleasantly suprised).

I built the second prototype, Arboretum, in Interlisp on Xerox 1108 Dandelion and 1186 Daybreak machines, and that was the one that was used in the project; we demonstrated that it was possible to automate decision making on a piece of legislation (eligibility for widows' allowance), and, critically, to automatically generate letters to claimants which claimants could understand.

At the end of the project, Peter and I and a number of others of Peter's ex-students spun out a company to try to commercialise D-Engine logic. As (again) Peter was deaf, and as he intended to continue as a lecturer, he chose not to head up the company, and I was elected Chief Exec; I was also the technical lead. We knew we couldn't commercialise our work on the Xerox workstations, because they were way too specialist and expensive to sell into industry. I had a look at Windows, which was at version 2 at that stage, and it was just a horrible mess. We couldn't afford Macintosh (and, in any case, the M68000 Macs of those days were really not very powerful); so we decided to write the new version on Acorn Archimedes ARM machines, on the basis that I already had one. The plan was always to port it to UN*X later.

There was a good Lisp compiler for the Archimedes machines, but it was Portable Standard Lisp which was going out of favour (Common Lisp had just been standardised). It suffered from another problem which was for us more serious: the garbage collector moved things in memory, and the Archimedes window manager held fixed pointers to things; so, while I did a lot of work on this and got somewhere, the solution wasn't going to be portable.

So we decided to rewrite the system in C (which at that stage none of us knew). We also decided to do something else ambitious: we decided that because our new version - called KnacqTools for "Knowledge Acquisition Tools" - would require a graphics workstation, and such machines were then uncommon in industry and expensive, we should compile the knowledge once elicited down to run on one of a number of rule engines that were then available for PCs; and we decided that these rule language compilers should be pluggable.

We got the Archimedes version of KnacqTools feature complete and working well within a year. We demonstrated it to Acorn, who gave us two of the UN*X (BSD 4.3) version of their ARM workstations, called R260. On these we ported KnacqTools to OSF-Motif, which was the then-dominant window manager for X11. We got this feature complete in not very long, and it looked extremely impressive - so impressive that NCR gave us UN*X workstations with the intention that they would adopt KnacqTools as a product. However, the OSF-Motif version suffered from persistent memory leaks which we never fully resolved.

But in the meantime the company was in financial trouble. We'd started without capital and had funded the company organically by doing consulting. Members of the team wanted me to concentrate on product development, but I was also the person who could do the sort of consulting work which brought in money. And in the winter of 1981-2, recession hit the UK economy and our customers stopped spending on experimental AI projects.

If I knew then what I know now, the company could have been saved. What we needed was an angel, and we actually had a very good story to tell to angels. Our customers included Courtaulds - for whom one of our systems ran a critical chemical plant - Ford Motor Company, Bull, De La Rue, and a number of other industrial big players. We had a very impressive product, which was very close to finished. And we were teaching successful courses on the adoption of artificial intelligence into industry. But I didn't know about angels and I didn't have the contacts, so the company went down.

OK, that's the background: onwards!

Over a period of about three years I taught three-day courses on knowledge acquisition to around a hundred people mainly drawn from industry and the civil service - I can't remember why we didn't do more with financial services, which would have been an obvious market, but it's a fact we didn't. In teaching knowledge acquisition I obviously also taught an understanding of representing and structuring knowledge. The people I taught it to were mostly degree educated, and many were extremely senior people - ranging from senior engineers in charge of industrial plant, to executives evaluating future technologies for their companies. But they weren't by any means universally people with advanced maths skills or any previous experience of formal logic. These courses were generally very successful, and at the end of them participants typically could build working systems to make decisions in a domain of knowledge.

What made this possible was the very simple logical schema: ask the domain expert to choose the question to be answered, the proposition whose truth value was to be determined:

This person satisfies the conditions for widows' benefit

Ask them what the default value of the proposition is - in this case, 'false', most people aren't eligible for widows' benefit.

We would notate this as follows:

        Satisfies conditions for Widows' Benefit -

So OK, you ask the expert, what's the first thing you can think of which would make you change your mind, make you think a given person was eligible?

If they were a widow.

And if they were a widow, would they then be eligible?

No, their husband's national insurance contributions would have to have been up to date

And if their husband's national insurance contributions were up to date, would they then be eligible?

No.

We can now extend the graph:

        Satisfies conditions for Widows' Benefit -
                            |
                            |
                         Widow -
                            |
                            |
               Husband's contributions OK -

So, given they are a widow, and their husbands contributions were up to date, what's the first thing you can think of which would make you change your mind?

If they were under pension age when bereaved.

And if they were under pension age when bereaved, would they then be eligible?

Yes.

We now have a condition which overturns our original assumption that the person isn't eligible, and we notate it thus:

        Satisfies conditions for Widows' Benefit -
                            |
                            |
                         Widow -
                            |
                            |
               Husband's contributions OK -
                            |
                            |
                   Under pension age +

Is there any further condition that would change your mind and lead you to conclude that they were not eligible?

No.

So that closes one path and we recurse back up:

OK, so we've got someone who is a widow and whose husband's contributions were OK, but was not under pension age when bereaved. Is there anything else that would make you think they satisfied the conditions for widows benefit?

Yes, if their husband wasn't entitled to a retirement pension they would be eligible.

        Satisfies conditions for Widows' Benefit -
                            |
                            |
                         Widow -
                            |
                            |
               Husband's contributions OK -
                         /     \
                        /       \
       Under pension age +     Husband not entitled to retirement pension +

Again, you probe for further conditions; if there are none, you close the path, and recurse back.

OK, so we've got someone who is a widow and whose husband's contributions were OK, but was not under pension age when bereaved, and their husband was entitled to a retirement pension. Is there anything else that would make you think they satisfied the conditions for widows benefit?

No.

Again, we've nowhere further to go from this node, so we recurse back up:

OK, so we've got someone who is a widow but whose husband's contributions were not OK. Is there anything else at all which would make you think they satisfied the conditions for widows benefit?

No.

Again recurse back up:

OK, so we've got someone who is not a widow. Is there anything else at all which would make you think they satisfied the conditions for widows benefit?

No.

And so we can close this tree: it's complete. As you can see, this is a very simple procedure: the interviewer always knows what the next question to ask is, and the answers can be systematically recorded. So it's very easy to teach, and people easily understand how this process maps on to real world decision making. There may still be some things which aren't completely clear - for example, what is entailed by 'Husbands contributions OK'? But we can use that as the start of a new tree and repeat the process. We had special notepads printed with a triangular grid to make drawing trees easier, but that was mainly sales collateral; essentially anyone who can ask questions and scribble on paper can conduct one of these interviews.

So, again, I didn't have the original idea, that was down to Peter. But I did develop the interviewing practice, and I was the person who mainly delivered the courses on it.

The nature of logic is that you can operate on it with logic. A logical formalism can be translated into another logical formalism with similar (or lesser) expressivity, so it was trivial to translate D-Trees into production rules which would run on a conventional backward chaining production rule engine. I'd also argue, from experience, that D-Trees are easier for non-logicians to understand than production rules, since a non-specialist can assess whether a D-Tree has complete coverage of an area of domain knowledge, whereas it's much harder to assess whether a corpus of production rules does.

So to come back to your original question, yes, I know from experience that you can enable 'ordinary people' to understand inference, provided you can find a simple enough expression of it. Of course the D-Engine logic wasn't as sophisticated as a first-order predicate logic, and certainly wasn't as sophisticated as a constraint propagation logic, but I don't believe those are insuperable issues. You can't expect 'ordinary people' to understand dense code or complex formalisms; upside down 'A's and back turned 'E's, and all the various hooks of set notation, quickly alienate those who are not mathematically inclined. But all inference is the systematic performance of a limited number of individually simple legal moves, like chess; and 'ordinary people' can understand chess, even if many are (like me) not very good at it.

Thursday, 23 November 2017

Coffeeneuring

Myself in Ae forest on our second ride.
I went out for a ride with my old friend Andrew Crooks back in September, when I was - and partly because I was - still deep in depression. I rode into Castle Douglas to Gareth Montgomerie's shop, where I met up with Andrew, and we rode down to Tongland, out to Twynholm, over to Kirkcudbright, and back by Loch Fergus. We stopped for cake and coffee in the very excellent Earth's Crust bakery, and that's when Andrew broached the idea of Coffeeneuring.

There's this challenge, he said, on an American blog: ride to seven different coffee shops (and drink coffee) in six weeks, starting in October and ending in November.

So we did.

Myself and Andrew near New Abbey
The first day of the challenge was the Friday the 13th October, an auspicious date - so of course we had to start then. It was a wild, blustering day with sharp showers blowing down a stiff westerly (that will become a theme). We met up at Beeswing, and rode out by the beautiful road down to New Abbey; from there we took wee backroads up to Cargenbridge, and joined the Old Military Road back to Beeswing. We had coffee and cake at Loch Arthur farm shop, which was as always excellent.

We started our second ride, on the 22nd, from Andrew's house in Dumfries, riding through the town mainly on the old railway cycle path, and thence up to Ae Forest - a 10Km climb which could have been a fair old grind, but for yet another sturdy south-westerly which fairly lifted us up the hill. We did a wee bit of zooming around the forest on green-graded single track, had an excellent cake and coffee in the Ae Forest Cafe, and then... zoomed back down the long hill into Dumfries, our speed limited only by the westering sun glaring in our eyes.

For our third - Hallowe'en - ride we again met at Gareth's shop (and again I rode in), with the intention of riding out to the Cream of Galloway ice cream factory near Gatehouse of Fleet. Again the wind was westerly, and again it was driving rain before it. We rode down to Kirkcudbright by the Loch Fergus road, and thence out via Nunmill towards Borgue. But the wind was near gale, and the rain became more intense; after a brief discussion we decided to turn back to Mulberries in Kirkcudbright, and there had soup and coffee. We rode back via Tongland. It was an enjoyable but quite tough day - what I particularly remember about it was that Andrew (who is always faster than me uphill) was also faster down. That felt an injustice!

Pete White, in impossibly bling
retro-reflective jacket, buys coffee
in the unknown coffee shop. 
I was in Edinburgh on the weekend of the 5th November, staying at my sister's; and, on the Sunday, went for a ride with my friend Pete White. We had planned a tour of the reservoirs up in the Pentlands, but it was a cracking day, and so instead we rode out of Edinburgh by the Innocent Railway path, and took the coast road fast out to North Berwick. In North Berwick we got a cairry-oot coffee and cake from a wee cafe I've totally failed to identify from Google maps; and then rode up to the train station where we got a train back into Waverley. Riding back to my sister's from the station I made a sentimental detour to the Edinburgh Bicycle Co-op, one of my favourite shops.

That counted as my fourth Coffeeneuring trip; by agreement Andrew was also doing one that weekend. However, later that week I rode into Castle Douglas for Gareth to fit new non-slick tubeless tyres to the Slate, and I snuck in a coffee and cake at Streetlights Cafe, putting me one ride ahead. I rode home by the old iron-age road over the ridge by Dungairy, a long climb on mud and gravel. The new tyres made the bike feel quite different - assured and surefooted in conditions in which it had previously been decidedly sketchy.

The three mile dirt road descent from Dungairy to Culnaightrie was a complete blast.

From the start of the Coffeeneuring challenge Andrew and I had talked about doing a Roof of the World ride at some point if the weather allowed, but the weather didn't really allow and on the 13th of November, riding from Andrew's house, we decided to do the Birthplace of the Bicycle instead; Andrew promised me an interesting climb on the way home - one we've often talked about in the past, but I hadn't yet ridden.

Where the first ever pedal powered bicycle was built
It was actually a beautiful day, but cold; on the north slope of one of the first hills we encountered a patch of ice which completely covered the road for about twenty metres, and from there on our descending was a little more tentative than it would otherwise have been. But we had a good ride up Nithsdale and before too long came to the birthplace itself, where we stopped to make the customary obeisances.

Then on into Penpont for coffee in a surprisingly busy wee cafe, and back. Andrew led us across to the east side of the dale, crossing the A76 at Closeburn, onto wee back roads that were new to me.

Approaching the top of the Loch Ettrick climb - yes, it is
uphill, dammit!
Andrew is lots faster than me anyway, but on hills he's notoriously quite a lot faster. So when we came to the junction at the bottom of the "interesting" climb, he stopped for a comfort break and I went ahead. I was very pleased with myself with how far I'd got before he caught me, but the photograph he took of me near the top doesn't look at all dramatic.

However, we topped out at Loch Ettrick, high above Ae Forest, and Andrew promised me ten miles of continuous descent. It wasn't quite continuous, but pretty close to it, and apart from one huge tipper truck which wasn't taking any prisoners, it was quite a blast.

That made my sixth qualifying ride, but only Andrew's fifth.

For the next, which I number as 7.1, we met up at Mossdale on the 20th and rode up by the Raider's Road to the Otter Pool, where we enjoyed an al fresco coffee with some buns I'd bought in Castle Douglas on the way up. It was a soft, damp day with continuous fairly light rain, but not dreadfully cold; still, it wasn't weather we wanted to sit around in for too long. We'd had a plan to stop at the cafe at Clatteringshaws, but it was closed for the winter. We discussed the route back, and Andrew liked the idea of the loch shore to get us out of the wind (although it wasn't that severe).

Al fresco at the Otter Pool
So we made the glorious descent into New Galloway, where we actually could have bought a coffee at the CatStrand; but we agreed that if we stopped in our wet clothes we'd quickly get cold, so we rode on at good speed down the west shore of Loch Ken. The autumn colours were glorious, and in the shelter of the hill and the forest the loch was almost still. Burns tumbled down the hillside in wild spate. We got back to the cars at Mossdale with - for me, anyway - mixed feelings. We were droukit. It was cold. Dry clothes were delightful (although I'd carelessly forgotten dry socks). But it had been a magical ride, on largely empty roads (as, to be fair, all these rides have been), amid all the spectacular scenery of Galloway's high country.

Today's ride - 7.2 - completed the set. We met in Kirkcudbright on a day of westerly gales, although by 11:00 when we started the rain was almost through. Andrew had concern about his back tyre, which had lost a lot of air with a spectacular hiss in the car on the way over, and which neither of our mini-pumps could get hard; but, after checking he had a spare inner tube, he decided to set off anyway. Our aim, again, was the Ice Cream Factory, which as well as ice cream makes good coffee and spectacular cakes.

It's a mistake to start a ride with someone who's a much better grimpeur by going uphill, but given the wind I wanted to stay in shelter as much as possible on the way out, and get down onto the coast to take advantage of the wind on the way back. I controlled my competitiveness and didn't burn my legs on the first long climb, and, despite the weather, we had a remarkably swift and enjoyable ride out to Rainton.

Is there anybody there? said the traveller,
knocking at the moonlit door...
Sadly, the cafe was shut. We discussed alternatives, and decided to return to Kirkcudbright. I asked Andrew whether I thought his tyre would cope with an unmetalled section, intending to take the shore path from Sandgreen round to Carrick. He thought it would, but when we got down to Sandgreen felt it was just too risky. So we doubled back round to Knockbrex on the metalled road, and took a wee sentimental detour down to Carrick just because.

Then, with the sun beginning to shine and the wind behind us, we were whisked up the coast, past Knockbrex, passed the Isles of Fleet, past the Coo Palace, past Kirkanders Borgue, and up the long hill to Borgue village, at good speed. We did stop a couple of times because the views out to the Isle of Whithorn and the Isle of Man were just so good!

In Borgue I had to stop to take off my jacket and change to fingerless gloves; despite a benselling wind the sun had become warm. And then swiftly on, past the Brighouse turn, down through Senwick to the Doon and Nunmill, and up the river to Kirkcudbright. We obviously couldn't go to Mulberries again, because we'd already bagged it; and Harbour Lights and Solway Tide were closed for the winter. But the Belfry Cafe was open, and we had soup, scones and coffee to finish up.

Eight rides - actually slightly more than eight over the period, because I've done another couple which didn't involve coffee and thus don't count - averaging around thirty miles/fifty Km, longest not more than fifty miles/eighty Km. None of them epic. All but one in company and in good company. All but the one I rode alone probably faster than I ride alone.

They haven't, by themselves, cured depression - it isn't yet, completely, cured, although it's greatly better. But they've certainly contributed. And one thing I realise that this simple, light hearted challenge has done for me - aided by my friends - is that it's given me an excuse to take time off to ride just for the pleasure of riding, of enjoying the weather and the views and the roads and most of all the company.

Myself and Andrew at Clatteringshaws - with coffee!
And the coffee, of course. Let's not forget the coffee.

More pictures here.


Creative Commons Licence
The fool on the hill by Simon Brooke is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License