By Steven Brocklehurst
BBC Scotland news
Kathryn Howden and Andy Clark in the Last Witch, part of the Edinburgh International Festival
A play about the last woman in Scotland to be killed for witchcraft would not appear to fit with the Enlightenment theme of this year's Edinburgh International Festival.
Festival Director Jonathan Mills said the Last Witch, by Scottish writer Rona Munro, was an example of "endarkenment".
While 18th century Scotland led Europe in science and reason, there still remained an attachment to pagan and supernatural ideas.
The play explores the case of Janet Horne, who was killed in Dornoch, a coastal town in the north west Highlands, in 1727.
The facts are scant, even her name is one often given to witches in Scottish folklore.
She had a daughter who was supposedly born with a deformed hand.
It was claimed that Janet rode her daughter like a pony and the deformities were what remained of hooves.
On being led to the fire where she would be burned, she is said to have held out her hands and said: "that's a bonny warming".
From such fragments, Munro has written a tale that imagines the circumstances in which a woman could be condemned to death for witchcraft.
Dominic Hill, artistic director of the Traverse Theatre where the play is staged, said prosecutions for witchcraft should have been referred to the high authorities in the church and law, which were based in Edinburgh.
He said: "That did not happen in this case. For some reason, the local sheriff convicted and executed her the next day.
"So Rona has asked the question 'why was it never referred to Edinburgh?'
"She turned it into a very personal story between the sheriff and Janet Horne."
He added: "In the play the sheriff is sexually attracted to Janet and they have a relationship.
"Because of his own sense of guilt and shame he has her executed."
Mr Hill said witchcraft was often used as a form of attack on women who were seen to be sexually "non-traditional" in activities and outlook.
In the play the sheriff argues he could not possibility be attracted to the woman in a natural way and therefore she must have "charmed" him in some way.
"It is interesting the way men in this play express a fear of the woman and the way she sexually arouses them," he said.
Mr Hill rejected the idea that it was a "feminist" play.
He said: "It is a play by a woman in which women play a central part. But at the core it is about attitudes to gender and sexuality."
The Scottish Enlightenment, characterised by an outpouring of intellectual and scientific accomplishments, is often said to have begun when Francis Hutcheson took up the chair of philosophy at the University of Glasgow in 1729.
The Witchcraft Act, which allowed Janet Horne to be given the death penalty, was finally repealed in 1736.
It had not been a capital offence in England since the previous century.
The Dornoch case, which came decades after the previous witch burning, was one of the last in Europe in which someone was condemned to death for witchcraft.
Mr Hill said: "In 1727 in Edinburgh they were founding the Royal Bank of Scotland, while 300 miles away they were burning witches."
He said the beliefs of Scotland's pagan and Celtic past came to be seen as old-fashioned, irrational and unenlightened in age of reason.
People no longer believed in the power of the supernatural.
But Mr Hill said there will always be matters we do not understand.
"There is an idea that something was lost," he said.
"The Enlightenment was a great thing. The age of rationality put-paid to things you can't explain and maybe something was lost in that process. "
The world premiere of The Last Witch is Sunday 23 August.
It runs at the Royal Lyceum Theatre until Saturday.