Thanks @markstaples, this is a really good question!
I think there are two morphisms to consider here:
- is the code itself an equivalent (and potentially complete?) representation of the policy text?
- is the output of the code equivalent to the policy intent?
On 1) I’ve gone back and forth in my mind about this. I think that due to the language-specifics of OpenFisca, creating a clause-by-clause mapping from the policy text to code is inadvisable. It becomes unmanageable for sufficiently complex policies, where it actually reduces readability and transparency.
Rather, I think that an ‘approximately isomorphic’ mapping from policy to code is sufficient for readability, maintainability and transparency.
On 2) The important thing here is proving that the output of the code is equivalent to the policy intent, and this is ultimately what the OpenFisca test suite does. In fact, I think this is where OpenFisca really excels; in its ability to empirically demonstrate that, for given inputs, certain outputs are reached.
This is a really complex problem space! And I think this question really separates the various rules engines into their respective use-cases.