Many mainstream programming interfaces represent computation procedurally, as sequences of instructions, control-flow constructs, and explicit execution steps. However, several important classes of problems are more naturally described declaratively: one specifies the set of candidate states and the condition that makes a state valid. This paper formalizes a predicate-based abstraction for computation over state spaces. A computational problem is represented by a state space S and a predicate C: S -> {0,1}. Solutions are the states that satisfy the predicate, while execution is delegated to a realization strategy for evaluating, sampling, searching, or otherwise characterizing this solution set. We introduce a minimal semantic-preservation contract that distinguishes the problem specification from backend-specific evaluators and establishes when composed predicates preserve their meaning across realizations. The contribution is a unifying abstraction and preservation contract, rather than a new class of constraint problems or a claim that predicate evaluation is always efficient. Procedural algorithms, solvers, probabilistic methods, and quantum oracles are treated as possible realizations of the same semantic specification. The model is related to constraint satisfaction, satisfiability, logic programming, relational query processing, model checking, high-level quantum languages, and quantum intermediate representations. Its relevance to quantum computation follows from the fact that a Boolean predicate can be materialized, when finite and efficiently representable, as a reversible or phase oracle over computational basis states. This makes the abstraction a bridge between declarative problem specification and quantum-oriented execution without requiring the problem itself to be stated as a circuit.
翻译:许多主流编程接口以过程化方式描述计算,即通过指令序列、控制流结构和显式执行步骤来定义。然而,若干重要问题类别更适合以声明式方式加以描述:仅需指定候选状态集合及使状态有效的条件。本文形式化了一种基于谓词的抽象模型,用于处理状态空间上的计算。计算问题由状态空间S与谓词C:S→{0,1}共同表示。解是满足该谓词的状态,而执行过程则交由实现策略完成,该策略通过评估、采样、搜索或其他方式刻画解集的特征。我们引入了一种最小化的语义保持契约,它区分了问题规范与后端特定的求值器,并确立了当组合谓词跨不同实现时其含义得以保持的条件。本文的贡献在于提供了一种统一抽象与保持契约,而非提出一类新的约束问题或声称谓词求值总是高效的。过程化算法、求解器、概率方法以及量子黑箱均被视为同一语义规范的可能实现。该模型与约束满足、可满足性、逻辑编程、关系查询处理、模型检验、高级量子语言及量子中间表示均有联系。其与量子计算的相关性源于以下事实:当布尔谓词有限且可高效表示时,可作为计算基态上的可逆黑箱或相位黑箱予以物化。这使得该抽象成为连接声明式问题规范与量子导向执行之间的桥梁,而无需将问题本身表述为电路形式。