---
title: Logic of Here-and-There with Constraints
url: https://www.emergentmind.com/topics/logic-of-here-and-there-with-constraints
type: topic
---

# Logic of Here-and-There with Constraints

Searching arXiv for the cited HT and constraint-related papers to ground the encyclopedia entry in current arXiv records.
The logic of Here-and-There with constraints denotes a family of formalisms that preserve the two-world semantics of Here-and-There (HT) while enriching the atomic layer with constraint-bearing expressions. In standard first-order HT, formulas are interpreted in an intuitionistic Kripke structure with exactly two worlds \(h\) and \(t\), a constant individual domain, and persistence from \(h\) to \(t\); implication and negation are evaluated across both worlds, whereas conjunction, disjunction, and quantifiers are evaluated pointwise in each world [2601.03848]. This places HT strictly between intuitionistic and classical logic: it is weaker than classical logic, for example not validating \(A\vee\neg A\), and stronger than intuitionistic logic, validating \(\neg A\vee\neg\neg A\) [2601.03848]. Constraint extensions retain this semantic core and use it as the monotonic basis for equilibrium logic, strong equivalence, and answer set programming (ASP) [2111.06366][2502.04302].

## 1. Semantic foundations of HT and its constraint-oriented reading

In first-order HT, the syntax is the ordinary first-order language with terms, predicates, connectives \(\wedge,\vee,\rightarrow,\neg\), and quantifiers \(\forall,\exists\). A model has two worlds \(h\le t\), a constant domain \(D\), and persistent predicate interpretations \(I_h(P)\subseteq I_t(P)\). Satisfaction at a world \(w\in\{h,t\}\) is classical for atoms, conjunction, disjunction, and quantifiers, while implication is evaluated by checking all accessible worlds:
\[
\mathcal M,w \models A\rightarrow B
\iff
\forall v\ge w,\ (\mathcal M,v\models A \Rightarrow \mathcal M,v\models B).
\]
Negation is defined as \(A\rightarrow\bot\), with \(\bot\) false in both worlds [2601.03848].

The propositional presentation used in equilibrium logic and ASP is equivalent in spirit. An HT-interpretation is a pair \(\langle H,T\rangle\) with \(H\subseteq T\), where \(H\) is “here” and \(T\) is “there”. Total interpretations satisfy \(H=T\), and classical satisfaction is recovered by restricting attention to total interpretations [2111.06366]. This total/non-total distinction is the semantic mechanism that later supports equilibrium models and stable models.

Constraint-oriented readings of HT rely on the fact that the non-classicality of the logic is concentrated in implication and negation. The atomic layer can therefore be specialized in multiple ways without changing the two-world discipline. This is explicit in the first-order prover architecture for HT, where terms and predicates are “completely standard first-order,” and HT-specific behavior is encoded “almost entirely” in special rules for \(\neg\), special rules for \(\rightarrow\), and the HOS/SQHT axioms of the intuitionistic embedding [2601.03848]. A plausible implication is that constraint extensions can often reuse the same equilibrium-theoretic spine while replacing only the semantics of atoms.

## 2. Constraint vocabularies and their formal realizations

The literature does not use a single notion of “constraint.” In HT-based work, the term ranges from ASP integrity constraints to arithmetic comparisons, semiring-valued inequalities, abstract theory atoms, and temporal or metric restrictions. The common feature is that each of these is made part of the atomic or rule-level language while leaving the HT evaluation of implication, negation, and minimality intact.

| Formulation | Characteristic construct | Representative source |
|---|---|---|
| ASP integrity constraints | \(\bot \leftarrow B\) or \((B\rightarrow\bot)\) | [2111.06366] |
| Arithmetic comparisons | \(t_1 \prec t_2\), \(\prec\in\{=,\neq,<,>,\leq,\geq\}\) | [2108.03187] |
| Algebraic constraints | \(k \sim_{\mathcal R} \alpha\) | [2008.04008] |
| Theory atoms in CASP | structured/compositional theory atoms \(\mathcal A_T\) | [2502.04302] |
| Metric-temporal constraints | \(^{i}x\), bounded \(\mathsf U_n,\mathsf R_n,\mathsf S_n,\mathsf T_n\) | [2008.02038][2507.13958] |

In ASP’s core HT analysis, an integrity constraint is simply a rule with empty head, syntactically \(\leftarrow l_1\wedge\dots\wedge l_n\), and semantically \((l_1\wedge\dots\wedge l_n)\to\bot\) [2111.06366]. In that setting, “constraints” are filters on equilibrium models rather than special background-theory atoms.

In “Here and There with Arithmetic,” the constraint layer consists of comparison atoms between integer or precomputed terms. The comparison symbols \(=,\neq,<,>,\leq,\geq\) are treated as built-in predicate constants with fixed interpretation, and arithmetic is incorporated through a two-sorted first-order language with integer function symbols \(+,-,\times\) and axioms for all true arithmetical sentences [2108.03187]. The paper explicitly describes these comparison atoms as constraints because their truth is fixed by the intended arithmetic structure rather than freely assigned.

In ASP(AC) and FO Weighted HT Logic, constraints compare semiring values produced by weighted formulas. The canonical form is
\[
k \sim_{\mathcal R} \alpha,
\]
where \(\alpha\) is a weighted formula over a semiring \(\mathcal R\), and \(\sim\) is a comparison relation such as \(\leq,<,\geq,>,=\) [2008.04008][2109.08281]. This turns weighted calculations into first-class atoms in rules and formulas.

In the clingo-oriented CASP framework, the constraint side is abstracted as a theory \(\mathcal T=\langle \mathcal A_T, Sat, \overline{\cdot}\rangle\), later refined to structured and compositional theories with theory variables, domains, and denotations \(\den_\mathcal{T}\) [2502.04302]. Constraint atoms are not hard-coded to arithmetic; they may denote any theory whose atoms admit locality, complement, and satisfiability conditions.

In the temporal case, constraints are indexed over time. Metric temporal HT uses bounded operators such as \(\mathsf U_n\), \(\mathsf R_n\), \(\mathsf S_n\), and \(\mathsf T_n\) over bounded discrete time [2008.02038]. Constraint Temporal HT introduces temporal terms \(^{i}x\), partial valuations \(v:\mathcal X\to \mathcal D\cup\{u\}\), and solution relations \([c]\subseteq \mathcal D_u^n\) for temporal constraint atoms \(c(^{o_1}x_1,\dots,^{o_n}x_n)\) [2507.13958].

A common misconception is that “HT with constraints” names a single formalism. The literature instead contains a family of related systems whose shared invariant is the HT/equilibrium semantics, not a unique atomic language.

## 3. Equilibrium logic, stable models, and equivalence under constraints

HT is the monotonic core of equilibrium logic. In the propositional ASP setting, a total interpretation \(\langle T,T\rangle\) is an equilibrium model of a theory \(\Gamma\) iff \(\langle T,T\rangle\models\Gamma\) and there is no \(H\subset T\) such that \(\langle H,T\rangle\models\Gamma\). Stable models of a program are precisely equilibrium models of its HT translation [2111.06366]. This is the basis for the familiar claim that strong equivalence of programs is characterized by equivalence in HT.

Constraint extensions preserve this scheme. In the abstract CASP setting, strong equivalence between T-programs is characterized by equivalence in the logic of Here-and-There with constraints, \(\mathcal{HT}_C\), under explicit assumptions on the underlying theory and external atoms [2502.04302]. There, an \(\mathcal{HT}_C\)-interpretation is a pair \(\langle h,t\rangle\) of partial valuations with \(h\subseteq t\), and a total equilibrium model \(\langle t,t\rangle\) is minimal with respect to the “here” valuation.

The general countermodel theory of equivalence extends beyond strong equivalence. For propositional and quantified HT, there-closed HT-countermodels characterize uniform equivalence even for infinite theories, and the paper develops corresponding notions of equivalence interpretations and relativized hyperequivalence [1006.3021]. This is significant because earlier characterizations via maximal non-total HT-models are not adequate for infinite settings. The framework also lifts to quantified HT, which is directly relevant when constraints are expressed by first-order or non-ground vocabularies.

Arithmetic HT provides a narrower proof-theoretic route. It shows that if equivalence between the translations \(\tau^*\Pi_1\) and \(\tau^*\Pi_2\) can be proved in HTA, then the original mini-GRINGO programs are strongly equivalent; for regular rules, the same holds with the simplified translation \(\nu\) [2108.03187]. This is a sound method for proving strong equivalence with arithmetic, but the system is explicitly incomplete.

## 4. Proof theory, embeddings, and automated reasoning

The first dedicated theorem proving framework for first-order HT is based on a native sequent calculus, LHT, and an axiomatic embedding of HT into intuitionistic logic [2601.03848]. LHT uses sequents \(\Gamma\vdash\Delta\), two axioms, standard-style quantifier rules, special implication rules, and a large block of negation rules. A formula \(F\) is valid in HT iff there is a sequent proof of \(\vdash F\) in LHT, and all propositional rules as well as the quantifier rules with Eigenvariable condition are invertible [2601.03848]. The special treatment of \(\neg\) and \(\rightarrow\) is precisely what makes the calculus HT-specific.

The alternative embedding views HT as intuitionistic logic plus two axiom schemas:
\[
G \rightarrow (G \rightarrow H) \rightarrow \neg H
\qquad\text{and}\qquad
\exists x\,(G \rightarrow \forall x\,G),
\]
usually referred to as HOS and SQHT [2601.03848]. In implementation, full instantiation is impractical, so the paper uses a restricted instantiation regime over the predicates appearing in the target formula. The paper reports that it found no evidence that this optimized axiomatization is incomplete for propositional HT, but states that for first-order HT it is likely incomplete [2601.03848].

Four provers are implemented: the native sequent prover **leanHaT**, and three axiomatic provers **ihat-seq**, **ihat-tab**, and **ihat-con**, all in compact Prolog [2601.03848]. On the ILTP benchmark library, with 10s CPU timeout per problem, leanHaT solves 378 HT-problems and 31 refutations of HT-invalid formulas; ihat-seq solves 154 HT-problems and 0 refutations; ihat-tab solves 209 HT-problems and 0 refutations; ihat-con solves 300 HT-problems and 0 refutations [2601.03848]. The paper explicitly notes that it does not directly implement constraints, but also states that the architecture is highly relevant for “HT + constraints” because HT-specific reasoning is isolated from the rest of first-order reasoning. This suggests a modular integration point for theory solvers.

For infinitary formulas, the proof-theoretic landscape is different. “Proving Infinitary Formulas” shows that validity of infinitary HT-formulas can be justified by finite proofs in finitary systems such as \(\mathbf{HHT}\), \(\mathbf{HHT}^2\), and \(\mathbf{HHT}^2+\mathrm{DCA}\) [1608.01626]. Since non-ground ASP with aggregates or infinite domains often translates into infinitary HT formulas, this provides a finitary meta-theory for strong equivalence arguments that involve constraints and infinite conjunctions or disjunctions.

## 5. Arithmetic, algebraic, quantitative, and temporal extensions

Arithmetic HT, ASP(AC), and temporal HT with constraints represent three distinct but structurally compatible extension lines.

In HTA, mini-GRINGO rules are translated into a two-sorted first-order language with generic and integer variables, arithmetic function symbols \(+,-,\times\), built-in comparison symbols, and a proof system consisting of intuitionistic logic plus the Hosoi axiom, order axioms for precomputed terms, all true ground comparison facts, and all true arithmetical sentences [2108.03187]. This makes arithmetic constraints part of the logic rather than external annotations. Typical strong-equivalence arguments then use arithmetic facts such as totality of \(\leq\) or commutativity of \(+\) inside HTA derivations.

ASP(AC) generalizes the atomic layer more radically. Weighted formulas are interpreted over semirings \(\mathcal R=(R,\oplus,\otimes,e_\oplus,e_\otimes)\), and unweighted formulas are embedded as multiplicative identity \(e_\otimes\) when true and additive identity \(e_\oplus\) when false [2008.04008]. Algebraic constraints \(k\sim_{\mathcal R}\alpha\) then appear in rule bodies and heads. This framework subsumes many ASP constructs, including aggregates, choice constraints, arithmetic operators, and provenance-oriented computations [2008.04008]. In the related quantitative-and-stream framework, FO Weighted HT Logic and Weighted LARS are used to unify constraints, quantitative reasoning, and streaming/temporal aspects through HT and Weighted Logic [2109.08281].

Temporal extensions retain the two-world semantics but index it over traces. In metric temporal HT, an HT-trace is a sequence \(\langle \mathbf H,\mathbf T\rangle\) with \(H_i\subseteq T_i\) at every time point, and metric operators are bounded by integers or the trace length \(\ell\) [2008.02038]. The logic supports \(\previous\), next, bounded until/release, and their past counterparts, as well as interval operators. Metric formulas can be translated into ordinary temporal formulas over the same alphabet, and also into a poly-size temporal theory with fresh atoms for closure subformulas [2008.02038].

Constraint Temporal HT goes one step further by combining THT and HTC directly. It introduces temporal terms \(^{i}x\), partial valuations over \(\mathcal D\cup\{u\}\), strict and non-strict solution relations for temporal constraint atoms, and temporal equilibrium models defined by minimization of the entire “here”-trace [2507.13958]. The paper proves that this temporal constraint logic is a conservative extension of both HTC and THT, and gives a Kamp-style translation into quantified HT with evaluable functions [2507.13958]. A plausible implication is that temporal ASP with numeric fluents can be given a genuinely equilibrium-theoretic semantics without reducing time or constraints to purely propositional encodings at the foundational level.

## 6. Scope, limitations, and open directions

Several limitations are explicit in the literature. The first-order HT provers based on restricted HOS/SQHT axioms are likely incomplete for first-order HT, even though the restricted embedding is experimentally very effective [2601.03848]. HTA is also incomplete as a theory of strong equivalence for the full mini-GRINGO language; the paper provides a counterexample and suggests that stronger principles such as induction or additional quantifier axioms may be needed [2108.03187].

Computational limits are similarly clear. ASP(AC) is undecidable in general. For variable-free programs over efficiently encodable semirings, model checking and strong equivalence are co-NP-complete, and answer set existence is \(\Sigma^p_2\)-complete; for safe non-ground programs, satisfiability and strong equivalence are undecidable in general, while safe programs without value invention in constraints, with domain-restricted head constraints and computable semirings, yield decidable SAT and SE [2008.04008]. In the abstract CASP setting, satisfiability and strong equivalence are both undecidable in general; relative to a theory satisfiability oracle \(\mathsf O\), satisfiability is in \(\mathsf{NP}^{\mathsf O}\) and strong equivalence is in \(\mathsf{coNP}^{\mathsf O}\), while polynomial-time decidable theories give NP-complete satisfiability and coNP-complete strong equivalence [2502.04302].

Temporal work also imposes semantic bounds. Metric temporal ASP is developed over bounded discrete time specifically to remain compatible with ASP-style grounding and solving; it does not address continuous-time metric temporal logic [2008.02038]. Constraint Temporal HT is parametric in the constraint system and already covers linear arithmetic, but its role is still foundational: it establishes the temporal equilibrium logic with constraints rather than a mature solver ecosystem [2507.13958].

These limitations reveal a stable structural pattern. HT with constraints is not one logic but a modular research program: a two-world monotonic core, an equilibrium selection principle, and an extensible atomic theory layer. The papers collectively show that this pattern supports integrity constraints, arithmetic, semiring computations, abstract external theories, metric time, and temporal numeric fluents, while preserving the central model-theoretic use of HT for strong equivalence and stable-model semantics [2502.04302][2507.13958].

Source: https://www.emergentmind.com/topics/logic-of-here-and-there-with-constraints