Algorithms
Algorithms are mathematical formulae that are translatable into executable code.
There is a trivial and direct mapping to exectable computer code.
Transparently specified algorithms
The transparent example first shown is deliberately restrictive of the computer systems to prevent future administrations applying fiscal drag to benefits without coming back to the parliament and is a particularly good example of why sometimes speedbumps should not be dynamited.
Fiscal drag is the erosion of the real value by leaving thresholds unamended whilst inflation ravages the value.
Opaquely specified algorithms
The 2nd example was chosen because it is used by the developers of Catala - a code-as-law programming language in one of their code examples
If a particular system is to have a lot of algorithms consider using code-as-rule tools to develop it.
Eliminating speedbumps of this form
Using a langauge like Catala at the drafting stage would bring a number of benefits to technical systems:
- detection of inconsistencies in the law by the application of formal methods to the derived code
- ability to perform economic modelling on the impact of draft legislation prior to it becoming law
- generation of parts of production code. (Code as law systems cannot autogenerate working administrative systems, lots of non-legal things need to be built before a system that can invoke pre-compiled calculations can be deployed, including: authorisation and security, user interface and usability as well as scalability, deployability and general plumbing)
- generation of system and acceptance tests