编程语言与软件工程2021arxiv.org
Catala:一种面向法律领域的编程语言
Catala: A Programming Language for the Law
进阶 · 约 60 分钟读完前置知识:程序语言设计基础、形式化方法基础、法律推理基础
导读
论文提出 Catala,一种面向法律领域的编程语言,试图把法律规则写成结构化、可执行或可验证的代码,以提升法条的精确性和机器可处理性。它属于法律形式化与立法语言工程化的尝试,而不是要完全替代司法判断。
HN 关注点:把法律变成代码是否可行、有多大风险:支持者看重精确与自动化,反对者担心语言模糊性、解释空间和选择性执法无法被形式化。
HN 评论精选
这几条评论里:支持 1 质疑 2 补充 1
质疑担心把法律代码化会加剧对字面措辞的僵化解释,主张保留人的解释空间。
看看今天大多数人写代码的方式,我觉得这个想法很可怕。我有时会想,是否回到古罗马式法律制度更好:最大化人的解释空间,而不是试图消除它。今天许多国家已经过于关注法律措辞而忽视意图。人们用对字词的僵硬执着把法律扭曲到任何有利于自己的方向,甚至以感觉不对的方式。我们可能陷入卡夫卡式处境。
applepple查看英文原文
Judging by how most people write code today, I find this idea terrifying. I sometimes wonder if it would be better if we went back to an ancient-Roman style legal system which maximizes the human interpretive element rather than attempts to remove it. It's already the case in many countries today that there is too much focus on the wording of the law and not enough on the intent. People try to use a rigid fixation on the importance of words to twist the law in any direction which benefits them, even in ways that don't feel right. We risk a Kafkaesque situation.
质疑认为法律/语言形式化受模糊性、默会知识和哲学限制,难以成功。
这类尝试已经很多(例如 Zarri 等人的 NKRL,也由 EU 资助,论文未提)。甚至有一些学会处理这些问题几十年(iaail.org)。法律与语言形式化只是问题之一。像许多先前尝试一样,这一尝试受制于人类语言的模糊性。模糊性不是缺点;正是它使高效沟通成为可能。为了有效沟通,我们需要大量关于环境的默会知识,来自文化和生活经验。如果像本方法一样试图形式化语言,就必须把这些知识细致入微地考虑进去(“上层本体”远远不够;Cyc 已做几十年仍未完成)。默会知识和对同一事物的道德评价还会随时间变化。还有 Sorites paradox 之类阻碍完全形式化。Gödel 或 Wittgenstein 的著作早已表明局限。
Rochus查看英文原文
There have been many such attempts (e.g. NKRL by Zarri et al., also funded by EU, not mentioned by the paper). There are even societies that have been dealing with such issues for many decades (e.g. http://www.iaail.org). The formalization of law and language is only one of the issues. Like many previous attempts, this one suffers from the fuzziness of human language. Fuzziness is not a drawback; it is what makes it possible to communicate efficiently in the first place. In order for us to communicate effectively, we need an enormous amount of tacit knowledge about our environment that our culture and life experience brings. If one tries to formalize the language, as in the present approach, one must also take this knowledge into account, down to the last detail (an "upper ontology" is by far not sufficient for this, and e.g. at https://en.wikipedia.org/wiki/Cyc they have been working on a complete formalization for decades and are far from finished). And the tacit knowledge and also the moral valuation of the same change over time. And there are things like https://en.wikipedia.org/wiki/Sorites_paradox which stand in the way of a complete formalization. And also works like those of Gödel or Wittgenstein showed the limits long ago.
支持正面看待该尝试,认为语法简洁易读,但名字与自然语言 Catalan 冲突。
很高兴看到有人尝试实现这个想法,我敢打赌这里大多数人都曾在某个时刻希望它存在。语法(上面加了行号)看起来干净简单。希望它足够像自然语言,让非技术人员第一眼不会跑掉。这大概不会明天就引发法律革命,但我希望它能成为未来立法走向语言精确和机器友好的缓慢改革起点。另外名字不好,因为那已经是一门广泛使用的自然语言的(本地)名称。
Y_Y查看英文原文
Awesome to see someone trying to implement this idea, which I bet most people here have wished existed at some point. 1 scope Section121SinglePerson: 2 rule requirements_ownership_met under condition 3 aggregate_periods_from_last_five_years of personal.property_ownership >=^ 730 day 4 consequence fulfilled Syntax (shown above with line numbers added) looks pretty clean and simple. Hopefully it is enough like natural language that non-techies wouldn't run away at first sight This probably won't cause a legal revolution tomorrow, but I hope it can be the start of a slow reform toward linguistic precision and machine-friendliness in legislation in the future. Also it's a bad name, since that's already the (local) name of a widely spoken natural language.
补充法律因选择性执法和边缘情况难以完全代码化,但可自动化行政、税务等例行规则。
法律,尤其是刑法,不能通过字节码表达,主要是因为实际执行的法律会根据社会效果被选择性执行。边缘情况、具体情形太多,无法用二值输出套用到某个情境。自动化平凡、行政性任务是有可能的,这个语言似乎正瞄准这类——税法之类——但最终我们可能会转向这样的法律:只说明税由某个算法计算,而算法发布在 GitHub 上。用软件比喻,我认为法律承担了太多职责,需要解耦一些东西。来源:我是法学生、软件工程师。
sdfhbdf查看英文原文
The reason why law, especially criminal, can't be expressed via bytecode is mostly because law in action is enforced selectively based on social effects. There are too many edge cases, circumstances and such to be able to with a binary output apply it to a situation. There is a possiblity of automating the mundane, the administrative tasks, which seems like this language is taking a shot at - tax law - or such, but probably in the end we will start transitioning to law that just mentions that the taxes are counted by an algorithm and the algorithm is published on GitHub. Using software metaphors, I think law has too much responsiblites and we need to decouple some stuff. Source: I am law student, software engineer.
相关资源
从这篇论文所有 HN 讨论帖的全部评论里整理出来的链接。
历次讨论
- 2021Hacker News 讨论帖232 分 · 126 评
同领域还值得读
Google 的软件工程(2017)
Software Engineering at Google (2017)
介绍了 Google 的软件工程实践,包括其单一代码库(monorepo)、几乎全部开发在主干进行而非分支、代码审查、构建系统 Blaze、协议缓冲区等工具与流程,并讨论了频繁重…
编程语言与软件工程2017 · 1,127 分 · 465 评 · 引用 15入门 · 约 45 分钟编辑精选Peter Naur:编程作为理论构建 (1985)
Peter Naur – Programming as Theory Building (1985)
Peter Naur 1985 年的经典论文《Programming as Theory Building》提出:编程的本质不是写代码或文档,而是在程序员头脑中构建对程序及其运行…
编程语言与软件工程2016 · 629 分 · 74 评入门 · 约 45 分钟编辑精选SciPy 1.0:Python 科学计算的基础算法
SciPy 1.0: fundamental algorithms for scientific computing in Python
这篇发表于 Nature Methods 的论文介绍了 SciPy 1.0——Python 科学计算生态的基石库,涵盖其核心算法模块(优化、积分、插值、线性代数等)、软件架构与社…
编程语言与软件工程2020 · 387 分 · 98 评入门 · 约 45 分钟编辑精选Lisp 的历史(1979)
History of Lisp (1979)
这是 Lisp 发明者 John McCarthy 于 1979 年为 HOPL(编程语言史)会议撰写的回顾文章,讲述 Lisp 的起源、设计动机与早期演进,文中也涉及 if 表…
编程语言与软件工程2018 · 352 分 · 44 评入门 · 约 45 分钟编辑精选使用 NumPy 进行数组编程
Array Programming with NumPy
这篇 Nature 文章介绍 NumPy 的数组编程模型及其在科学计算中的核心作用:以 ndarray 为中心,通过向量化操作让 Python 高效处理多维数组。
编程语言与软件工程2020 · 318 分 · 134 评入门 · 约 40 分钟编辑精选