by nayuki · 3y ago · 0 comments
This would solve many problems: The verbosity and ambiguity of human language (tax laws, tax calculation forms in English), the ability to inspect and independently verify calculations done by the state, the rent-seeking tax preparation software companies.
Here is my own feeble demonstration of the idea: https://www.nayuki.io/page/a-math-programming-view-of-canada...
Even if the state has its own online portal for you to review and adjust your tax return, I still want to see the full tax code be open source and runnable by the user.
1. It would not, the tax law remains the spec.
2. France does provide an executable encoding of the tax code, TFA is literally a compiler for that.
3. France started to do so circa 2016 (https://joinup.ec.europa.eu/collection/egovernment/document/...) after losing a FOIA-type case, though feelers had already been sent as a governmental agency (CAS) is at the root of OpenFisca (https://openfisca.org/), and by then the prime minister's data sharing and coordination office (etalab) had started using and contributing to it (https://openfisca.org/doc/manifest-history.html)
4. You can use OpenFisca to encode your own country's tax law, or lobby for your country to encode its tax law there (https://openfisca.org/en/packages/).
Unless you rewrite the law to make the code the spec. Indeed, code is probably a better medium for unambiguously communicating calculations.
> 2. France does provide an executable encoding of the tax code, TFA is literally a compiler for that.
But other countries might not do so.
> 4. You can use OpenFisca to encode your own country's tax law, or lobby for your country to encode its tax law there (https://openfisca.org/en/packages/).
This would be amazing!
Ambiguity and obfuscation are usually intentional. Legislators and individual citizens do not necessarily have the same interests. This is why omnibus bills exist.
Firstly the actual text of the law must be as legislated.
Secondly, law and most certainly tax law is necessarily nuanced in interpretation and the consequences for taxpayers and the government are material (to use a relatively simple and well-known British case, a machine-executable model would be unhelpful in determining whether Jaffa Cakes should be taxed for VAT as biscuits, or exempt as cakes. Then ask about chocolate chip cookies (zero rated) vs chocolate digestives (taxed!)). Stuff like this and more is argued about all the time.
You can have these definitions remain vague and still have an algorithm that is well defined over pre-labeled data. The purely mechanical steps based on arithmetic could (and should!) be defined as machine-parseable code or formulas.
In your example this is because someone argued that staple food should not be taxed. Right, what is staple food? Obviously they decided that biscuits were but not cake. Pandora box is opened as soon as you allow any special cases.
This document is the source of truth for tax calculations so it'll always give you the right answer.
Better than nothing though.
There's also the OpenFisca project (https://openfisca.org/en/) which is a Python framework for coding tax and benefit system - France being the most complete - which is used in many things, like a web app to see which benefits you might be eligible to (https://www.mesdroitssociaux.gouv.fr/accueil/) or the French National Assembly tool to compute the effects of changing tax law (https://socio-fiscal.leximpact.an.fr/).
They publish all the diagrams for income tax calculation, if you can decipher them. It takes a while but you get it right eventually.
This is how I built my income tax calculator and keep it updated.
It's a PDF that changes once in a while.