# On the Semantics of Hybrid ASP Systems Based on Clingo
## 6 Discussion and Related Work
### White Box Orientation  
In this second group of approaches, constraints are incorporated as first-class citizens inside the logic programming formalism, so their semantics are no longer external or abstract but are captured in an extended definition of answer sets. Examples of this orientation are a family of approaches [25; 26; 27] based on the incorporation of intensional or non-Herbrand functions in ASP. This line was initiated in [25] with the introduction of partial intensional functions in Quantified Equilibrium Logic, something that was later extended to sets and aggregates in [28]. This approach is very expressive as it provides full first-order semantics for arbitrary first-order formulas dealing with equality, functions, sets, and aggregates, but no implementation has followed from these definitions so far. Extending ASP with intensional functions was also considered in [29] and later on gave rise to the language \(ASP\{f\}\)[26]. These semantics were proven in [30] to be a particular case of [25] for a syntactic fragment where function nesting is restricted but had the advantage of allowing implementation with the system \(\texttt{clingo}\{f\}\)[31]. In these approaches, the treatment of functions is closer to the defined external atoms in the current paper: that is, functions can be undefined, and they can be used in rule heads to derive their value. However, in general, these semantics are more general in the sense that defined functions can also be used in rule bodies without the requirement of converting them into external. Another strongly related approach based on intensional functions is ASP(MT) [27], whose main difference with respect to [25] is that partial functions are not allowed (functions are always assigned a value). Again, Ref. [30] explains the relation between the two formalisms in detail and establishes a correspondence for a syntactic fragment where functions are not nested. Another approach that can be classified as a white box system is s(CASP) [32], which is more aligned with the tradition of Constraint Logic Programming (CLP) inherited from Prolog. s(CASP) is a top-down query-based CASP system where constraint atoms may only occur unnegated in rule bodies. Here, constraints are defined in terms of predefined (usually arithmetic) operations performed on regular logic program variables, whose values are assumed to be just numeric elements in the Herbrand domain. This means that the definition of constraints only makes sense at a non-ground level. The semantics in CLP systems is normally defined in operational terms, and constraints are stored and solved on the fly during the goal-directed execution of rules. Comparison to AMT is difficult since constraints are represented in a substantially different manner: in AMT, they constitute external atoms that can be treated at the ground level (at least from the logic program perspective), whereas in s(CASP), constraints are always defined in terms of first-order variables. One difference that can be mentioned is that since logical variables cannot be undefined, s(CASP) does not produce results in which functions have no assigned value. Finally, another approach that proposes a full, white-box treatment of constraints is \(ASP(\mathcal{AC})\), recently introduced by [33]. \(ASP(\mathcal{AC})\) relies on an extension of the logic HT to deal with hybrid logic programs. Here, the orientation is the opposite of the previous approaches in this subsection. Rather than incorporating new operations in a first-order logical language, the logical connectives are generalized as particular cases of more general operations on weighted formulas over semi-rings. This means that, for instance, logical conjunction \(\wedge\) becomes just one more possible operation that can be combined with others, such as addition or multiplication (depending on the underlying semi-ring). This provides a very expressive and powerful formalism but at the price of a more complex semantic and the requirement of a semi-ring structure.