In France, income tax is computed from taxpayers' individual returns, using an algorithm that is authored, designed and maintained by the French Public Finances Directorate (DGFiP). This algorithm relies on a legacy custom language and compiler originally designed in 1990, which unlike French wine, did not age well with time. Owing to the shortcomings of the input language and the technical limitations of the compiler, the algorithm is proving harder and harder to maintain, relying on ad-hoc behaviors and workarounds to implement the most recent changes in tax law. Competence loss and aging code also mean that the system does not benefit from any modern compiler techniques that would increase confidence in the implementation. We overhaul this infrastructure and present Mlang, an open-source compiler toolchain whose goal is to replace the existing infrastructure. Mlang is based on a reverse-engineered formalization of the DGFiP's system, and has been thoroughly validated against the private DGFiP test suite. As such, Mlang has a formal semantics; eliminates previous handwritten workarounds in C; compiles to modern languages (Python); and enables a variety of instrumentations, providing deep insights about the essence of French income tax computation. The DGFiP is now officially transitioning to Mlang for their production system.
翻译:在法国,所得税是根据纳税人的个人回报来计算的,使用法国公共财政局(DGFIP)编制、设计和维持的算法。这种算法依靠1990年设计的传统习惯语言和编译器,与法国葡萄酒不同,它没有随着时间而老化。由于输入语言的缺陷和编译者的技术限制,这种算法越来越难维持,依靠特殊行为和变通方法来执行最新的税法变化。能力损失和老化代码还意味着该系统没有从任何现代编纂者技术中受益,而这种技术会增加人们对执行的信心。我们改造这一基础设施并展示了Mlang,这是一个开放源的编译器链,目的是取代现有的基础设施。Mlang基于对DGFIP系统进行反向改造的正规化,并且已经根据私人的DGFIP测试套件彻底验证了这种算法。Mlang具有正式的语义学;消除了以前在C中手写的工作;编译为现代语言(Python),现在能够正式地将各种工具转换为DGFS。