The German tax system works this way. German authorities specify the rules in a DSL and e.g. https://www.elster.de is generated from them where you can fill out all the tax forms (also e.g. companies). Stuff that they already know can be pre-filled.
Sure it would be great if that was Open Source, but it does its job this way as well?