Skip to main content
QUICK REVIEW

[论文解读] Not Elimination and Witness Generation for JSON Schema

Mohamed Amine Baazizi, Dario Colazzo|arXiv (Cornell University)|Apr 30, 2021
Adversarial Robustness in Machine Learning参考文献 3被引用 5
一句话总结

本文提出了一种用于 JSON Schema 的代数框架,支持否定消除与实例生成——这是模式推理中的关键问题。通过引入一个最小核心代数并扩展其运算符以处理否定与递归,作者提供了首个形式化算法,用于消除否定并为非空模式生成有效的 JSON 实例,从而解决了除 uniqueItems 关键字外完整语言的可满足性与包含性问题。

ABSTRACT

JSON Schema is an evolving standard for the description of families of JSON documents. JSON Schema is a logical language, based on a set of assertions that describe features of the JSON value under analysis and on logical or structural combinators for these assertions. As for any logical language, problems like satisfaction, not-elimination, schema satisfiability, schema inclusion and equivalence, as well as witness generation, have both theoretical and practical interest. While satisfaction is trivial, all other problems are quite difficult, due to the combined presence of negation, recursion, and complex assertions in JSON Schema. To make things even more complex and interesting, JSON Schema is not algebraic, since we have both syntactic and semantic interactions between different keywords in the same schema object. With such motivations, we present in this paper an algebraic characterization of JSON Schema, obtained by adding opportune operators, and by mirroring existing ones. We present then algebra-based approaches for dealing with not-elimination and witness generation problems, which play a central role as they lead to solutions for the other mentioned complex problems.

研究动机与目标

  • 为解决 JSON Schema 缺乏形式化代数基础的问题,其非代数性源于语法与语义关键字之间的交互。
  • 解决否定消除问题——即确定是否可以在不损失表达能力的前提下从模式中移除否定。
  • 开发一种实例生成算法,为非空模式生成有效的 JSON 实例,从而支持模式可满足性与包含性检查。
  • 形式化并实现一种处理否定、递归与复杂断言的解决方案,这些特性已知会增加推理复杂度。
  • 为实际数据驱动应用中的模式等价性、包含性与一致性推理提供基础。

提出的方法

  • 基于一组最小化的 JSON Schema 断言与组合子定义核心代数,确保无运算符可由其他运算符定义。
  • 通过原语运算符丰富核心代数,以表达无法通过非否定方式捕获的断言补集。
  • 设计一种否定消除算法,利用增强代数将模式重写为无否定的等价形式。
  • 开发一种递归实例生成算法,按模式组的轮次进行处理,通过跟踪变量状态(空、开放、已填充)确保通过最小不动点收敛实现终止。
  • 利用单调性与有限状态追踪证明实例生成的终止性,尤其针对对象与数组类型。
  • 基于类型分组与变量状态构建实例生成过程,对递归与嵌套结构进行详细处理。

实验结果

研究问题

  • RQ1是否可以对所有 JSON Schema 表达式消除否定而不损失表达能力?若不能,哪些构造必须依赖否定?
  • RQ2如何为完整 JSON Schema 语言(仅排除 uniqueItems)定义一种形式化、算法化的实例生成过程?
  • RQ3何种代数结构能够捕捉 JSON Schema 的非代数特性,如关键字交互与语法约束?
  • RQ4如何将模式可满足性与包含性问题归约为实例生成与否定消除?
  • RQ5在 JSON Schema 的递归模式推理中,可提供哪些形式化保证(如终止性、正确性)?

主要发现

  • 本文证明,否定无法对所有 JSON Schema 构造消除,识别出其补集必须依赖否定的特定断言。
  • 提出一种扩展代数,包含原语运算符以表达缺失的补集,从而支持完整的否定消除算法。
  • 实例生成被形式化定义并证明通过最小不动点论证实现终止,确保所有非空模式(除涉及 uniqueItems 者外)的正确性。
  • 该方法将模式可满足性与包含性问题归约为实例生成与否定消除,为推理提供统一基础。
  • 该方法具有形式化基础并面向实现,目前正开发基于 Java 的原型系统。
  • 该方法在模式归一化方面优于先前工作,后者在 23,480 个真实世界模式中有 21,859 个因不支持递归与否定而失败。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。