arXiv:2603.15317cs.CL2026-03中稿 · JURISIN 2026被引 2

用Python构建可灵活处理法律例外的推理框架,让非专业者也能轻松实现法律逻辑编程。

PYTHEN: A Flexible Framework for Legal Reasoning in Python

  • 基于Python语法,支持单条规则内同时表达‘全部满足’和‘任一满足’条件。
  • 通过any()与all()函数原生支持多条件组合与例外处理机制。
  • 适合法律AI开发者、研究人员及无逻辑编程背景的法律从业者使用。

本文提出PYTHEN,一种基于Python的可废止法律推理新框架。它旨在刻画法律论证中固有的可废止性,提供直观灵活的语法来表示法律规则、条件与例外。受PROLEG(基于Prolog的法律推理支持系统)启发,并遵循《Python之禅》哲学,PYTHEN利用Python内置的any()与all()函数,原生支持单条规则中同时包含合取(ALL)与析取(ANY)条件,以及更丰富的例外处理机制。本文详述了PYTHEN架构,对比分析其与PROLEG的差异,并探讨其在自动形式化及下一代法律AI系统开发中的潜力。通过连接符号推理与Python的广泛生态,PYTHEN致力于降低正式法律推理的技术门槛,使年轻研究者、法律科技开发者及非逻辑编程背景的专业人士均可参与。

原文摘要 · Abstract (English)

This paper introduces PYTHEN, a novel Python-based framework for defeasible legal reasoning. PYTHEN is designed to model the inherently defeasible nature of legal argumentation, providing a flexible and intuitive syntax for representing legal rules, conditions, and exceptions. Inspired by PROLEG (PROlog-based LEGal reasoning support system) and guided by the philosophy of The Zen of Python, PYTHEN leverages Python's built-in any() and all() functions to offer enhanced flexibility by natively supporting both conjunctive (ALL) and disjunctive (ANY) conditions within a single rule, as well as a more expressive exception-handling mechanism. This paper details the architecture of PYTHEN, provides a comparative analysis with PROLEG, and discusses its potential applications in autoformalization and the development of next-generation legal AI systems. By bridging the gap between symbolic reasoning and the accessibility of Python, PYTHEN aims to democratize formal legal reasoning for young researchers, legal tech developers, and professionals without extensive logic programming expertise. We position PYTHEN as a practical bridge between the powerful symbolic reasoning capabilities of logic programming and the rich, ubiquitous ecosystem of Python, making formal legal reasoning accessible to a broader range of developers and legal professionals.

法律AIPython符号推理

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。