British MPs are increasingly talking about the prospect of a second referendum to resolve the deadlock in Parliament over Theresa May's Brexit deal.
Holding a referendum requires an Act of Parliament. The most obvious way would be for the British Government to table a simple stand-alone Bill, as was the case for the 2016 referendum.
However, Theresa May has made clear she is firmly opposed to the idea.
An alternative route could be for MPs to try to amend another piece of relevant legislation.
In the case of the 2016 referendum, it took seven months to get the Bill through the UK Parliament - although in practice it could be done much more quickly.
The British Electoral Commission then has a statutory duty to assess the referendum question to ensure it is intelligible and free from bias - a process which would normally take up to 12 weeks, although again it could be shortened.
The legislation would specify the length of the referendum campaign.
All recent campaigns have lasted at least 10 weeks.
Overall, the British Institute for Government estimates the whole process could take up to five months.
On current plans, Britain is due to leave the EU on March 29, so it could not be completed by then.
Therefore, for a referendum to be held, the Government would have to go to Brussels to ask for an extension to the Article 50 withdrawal process - something the EU may or may not grant.
This is where it gets complicated.
Generally referendums offer a simple choice between two options - as in 2016 when it was Leave or Remain.
However, most British MPs accept that there would have to be at least three options - leave with Mrs May's Brexit deal, leave without a deal, or remain in the EU.
Various ideas have been floated.
One would be for voters to rank the options in order of preference.
If none of the options gained an overall majority of first preference votes, the one with the fewest votes would be eliminated and its second preference votes would be distributed among the other two.
Alternatively, voters could just be given one choice.
If none received an overall majority, the one with the fewest votes would again be eliminated, but under this scheme the other two options would then go forward to a final ballot a week later.
A third way could be to have a two-question ballot.
The first would ask if voters wanted to Leave or Remain.
The second would ask them to choose between a deal and a no-deal Brexit in the event that there is still a majority for Leave.
The Conservatives officially oppose a second referendum, arguing that voters made their views clear in 2016 and that another ballot would simply exacerbate the bitter divisions opened up by the Brexit debate.
However, a growing number of mainly Remain-supporting backbench Tory MPs are warming to the idea, believing it offers a way out of the current impasse.
The British Labour party says it wants a general election, but if that is not possible all options are on the table - including a second referendum.
Party leader Jeremy Corbyn, a longstanding Eurosceptic, has, however, shown little enthusiasm for the idea, while some of his supporters fear it could alienate traditional Labour voters in Leave-supporting areas.
The last 24 hours have shown that Theresa May’s Brexit deal is dead in the water.
She's failed to deliver any meaningful changes.
Rather than ploughing ahead and recklessly running down the clock, she needs to put her deal to a vote next week so Parliament can take back control— Jeremy Corbyn (@jeremycorbyn) December 14, 2018
However, he is facing a groundswell of support from within the party for another vote, including from many of the young Momentum activists who propelled him to the leadership and who are passionately opposed to Brexit.
Scotland's First Minister Nicola Sturgeon has said the SNP - which opposes Brexit - will back a second referendum in the Commons, although she angered some in her party who wanted to make their support conditional on a second referendum on Scottish independence.
PM has tried, credit to her for that, but, as expected, the EU is not open to renegotiation. It’s time to stop this pretence, bring the vote to Parliament and then, when the deal is rejected, seek to bring majority behind a second EU vote. Anything else now is just wasting time. https://t.co/a7qIpjtWgE— Nicola Sturgeon (@NicolaSturgeon) December 14, 2018
In the UK, not really. However in other countries, where referendums are more common, there is a history of giving voters a chance to think again.
In Ireland, for example, in 2009 voters supported ratification of the EU Lisbon Treaty, having rejected it at the first time of asking.
Similarly, in 2002, the Nice Treaty was accepted on the second occasion.