JSON Schema is the de facto standard for describing the structure of JSON documents. Reasoning about JSON Schema inclusion -- whether every instance satisfying a schema S1 also satisfies a schema S2 -- is a key building block for a variety of tasks, including version and API compatibility checks, schema refactoring tools, and large-scale schema corpus analysis. Existing approaches fall into two families: rule-based algorithms that are efficient but incomplete and witness generation-based algorithms that are complete but oftentimes extremely slow. This paper introduces a new approach that reconciles the efficiency of rule-based procedures with the completeness of the witness-generation technique, by enriching the latter with a specialized form of normalization. This refutational normalization paves the way for use-cases that are too hard for current tools. Our experiments with real-world and synthetic schemas show that the refutational normalization greatly advances the state-of-the-art in JSON Schema inclusion checking.
翻译:JSON Schema 是描述 JSON 文档结构的事实标准。对 JSON Schema 包含关系(即每个满足模式 S1 的实例是否也满足模式 S2)进行推理,是版本与 API 兼容性检查、模式重构工具以及大规模模式语料分析等多种任务的关键构建模块。现有方法可分为两类:基于规则的高效但不完备算法,以及基于见证生成但完备却通常极度缓慢的算法。本文提出一种新方法,通过为见证生成技术引入一种特殊形式的归约,将基于规则过程的高效性与见证生成技术的完备性统一起来。这种反驳归约为当前工具难以处理的用例铺平了道路。我们在真实与合成模式上的实验表明,反驳归约极大地推进了 JSON Schema 包含关系判定的现有技术水平。