Encoding and Reasoning About Arrays in Set Theory

📅 2025-08-15
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Existing set-theoretic automated reasoning tools—such as {log}—lack native support for arrays, limiting their applicability to programs involving mixed data structures. Method: We propose encoding arrays as functions represented by sets of ordered pairs, thereby reducing array reasoning to pure set-theoretic reasoning. To formalize this, we define a decidable fragment of set theory extended with function and array semantics, and implement its solver using constraint logic programming. Contribution/Results: This work introduces the first unified formalization and automated reasoning framework for arrays, sets, and relations within {log}, overcoming the prior decidability barrier posed by array constructs. Experimental evaluation demonstrates that our approach effectively encodes and solves programs featuring nontrivial array operations—including indexing, update, and length constraints—thereby substantially enhancing {log}’s capability to reason about heterogeneous data structures.

Technology Category

Application Category

📝 Abstract
We encode arrays as functions which, in turn, are encoded as sets of ordered pairs. The set cardinality of each of these functions coincides with the length of the array it is representing. Then we define a fragment of set theory that is used to give the specifications of a non-trivial class of programs with arrays. In this way, array reasoning becomes set reasoning. Furthermore, a decision procedure for this fragment is also provided and implemented as part of the {log} (read 'setlog') tool. {log} is a constraint logic programming language and satisfiability solver where sets and binary relations are first-class citizens. The tool already implements a few decision procedures for different fragments of set theory. In this way, arrays are seamlessly integrated into {log} thus allowing users to reason about sets, functions and arrays all in the same language and with the same solver. The decision procedure presented in this paper is an extension of decision procedures defined in earlier works not supporting arrays.
Problem

Research questions and friction points this paper is trying to address.

Encode arrays as sets for set theory reasoning
Define set theory fragment for array program specifications
Extend decision procedure in {log} to support arrays
Innovation

Methods, ideas, or system contributions that make the work stand out.

Encode arrays as sets of ordered pairs
Define set theory fragment for array specifications
Extend {log} tool with array decision procedure
🔎 Similar Papers
No similar papers found.