<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Unifying Framework for Semiring-Based Constraint Logic Programming With Negation</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jeroen P. Spaans</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jesse Heyninck</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Open Universiteit</institution>
          ,
          <country country="NL">The Netherlands</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Cape Town</institution>
          ,
          <country country="ZA">South Africa</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Extended abstract of a paper published at IJCAI 20251 [2]-Constraint Logic Programming (CLP) is a logic programming formalism used to solve problems requiring the consideration of constraints, like resource allocation and automated planning and scheduling. It has previously been extended in various directions, for example to support fuzzy constraint satisfaction, uncertainty, or negation, with diferent notions of semiring being used as a unifying abstraction for these generalizations. None of these extensions have studied clauses with negation allowed in the body. We investigate an extension of CLP which unifies many of these extensions and allows negation in the body. We provide semantics for such programs, using the framework of approximation fixpoint theory (AFT), and give a detailed overview of the impacts of properties of the semirings on the resulting semantics. As such, we provide a unifying framework that captures existing approaches and allows extending them with a more expressive language.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;semiring-based constraint logic programming</kwd>
        <kwd>negation</kwd>
        <kwd>approximation fixpoint theory</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Using classical answer set programming semantics to evaluate this program with the goal
schedule(HoursTask1, HoursTask2) returns false. Intuitively, this happens because no schedule
can complete the two tasks—totalling ten hours of work—in less than eight hours. Knowing that the two
tasks cannot both be completed in the time available, we may wish to optimize their partial completion
instead. One way to do this is to replace false and true with values in [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ] (where 1 represents complete
truth and 0 complete falsity), replace or with max, replace and with min, and replace HoursRequired
≤ HoursScheduled with HoursScheduled / HoursRequired.
      </p>
      <p>Our example demonstrated that CLP is limited to strict satisfaction or violation of constraints, and
that we require an alteration of this framework to solve problems of constraint optimization. The same
holds—for example—for problems involving fuzziness, uncertainty, or probability.</p>
      <p>
        Bistarelli et al. [
        <xref ref-type="bibr" rid="ref3 ref4 ref5">3, 4, 5</xref>
        ] proposed Semiring-based Constraint Logic Programming, a generalization of
CLP replacing the Boolean evaluation domain and the associated logical and and or connectives with
semirings—algebraic structures consisting of a set equipped with an additive operator for disjunction
and a multiplicative operator for conjunction—much like we did in our example. Since, many related
formalisms have likewise been extended to the semiring setting [
        <xref ref-type="bibr" rid="ref10 ref11 ref12 ref6 ref7 ref8 ref9">6, 7, 8, 9, 10, 11, 12</xref>
        ] to certain success.
Each of these works makes some assumptions about the semirings used, but what exactly those
assumptions are and how they relate is left implicit or has not been studied. Herein lies the first major
contribution of this work; we perform an analysis of the various families of semirings in relation to
semiring-based semantics for CLP, paying special attention to the orderings each family gives rise to.
      </p>
      <p>
        While some of the above-mentioned works permit negation, most do not, and a general analysis
of negation in the semiring setting is so far absent from the literature. Herein lies the second major
contribution of this work; a semiring-agnostic form of negation—based on negation in Gödel logics [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ],
and also used in the semiring-based formalism of Eiter and Kiesel [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]—is proposed and the efects of its
addition on the semantics of semiring-based constraint logic programming are studied. The addition of
negation gives us the expressive power to, for example, make the completion of a task in our scheduling
problem contingent on the absence of blocking factors by replacing lines 5 through 8 of our example
program with the following.
% A task is completed if enough time is scheduled
% and its completion is not blocked.
completed(Task, HoursScheduled)
:task(Task, HoursRequired),
HoursRequired ≤ HoursScheduled,
not blocked(Task).
      </p>
      <p>Notably, and as is to be expected, the addition of negation leads to nonmonotonicity of the immediate
consequence operator. To work around this problem we capture the new negation-permitting formalism
in Approximation Fixpoint Theory (ADT) [14], endowing it with AFT’s various semantics like
KripkeKleene, Well-founded, and Stable, which generalize the semantics of normal logic programs.</p>
      <p>
        Concretely, the contributions of this work come in five parts:
1. A novel notion of model—considering all contributing clauses at once, and specific to the
semiringbased setting—is introduced and compared to the traditional notion of model which considers
each clause’s satisfaction separately.
2. The minimal model semantics based on these notions of model are then compared with the least
ifxpoint semantics based on an immediate consequence operator.
3. A generalized method for deriving orderings of semiring elements needed to define models and
least fixpoints—but also needed in the later application of approximation fixpoint theory—is
investigated and found to be a generalization of the method studied by Bistarelli et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
4. The application of a generalized notion of negation appearing at various points in the literature
to our semiring-based framework is studied.
5. Approximation fixpoint theory is applied to our immediate consequence operator—made
nonmonotonic by the addition of negation—to define Kripke-Kleene, and well-founded and other
stable semantics, studying both ultimate approximation and a novel approximator.
      </p>
      <p>
        This work studies semiring-based semantics for constraint logic programming with negation,
generalizing the approaches of [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and [15]. Computational complexity, implementations, and applying
AFT-based notions such as stratification [ 16], conditional independence [17] and non-determinism [18]
are left as future work.
      </p>
    </sec>
    <sec id="sec-2">
      <title>Acknowledgments</title>
      <p>Acknowledgments This work was partially supported by the project LogicLM: Combining Logic
Programs with Language Model with file number NGF.1609.241.010 of the research programme NGF AiNed
XS Europa 2024-1, is (partly) financed by the Dutch Research Council (NWO).</p>
    </sec>
    <sec id="sec-3">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.
[14] M. Denecker, V. Marek, M. Truszczynski, Approximations, Stable Operators, Well-Founded
Fixpoints And Applications In Nonmonotonic Reasoning, Logic-based Artificial Intelligence (2001).
doi:10.1007/978-1-4615-1567-8_6.
[15] M. A. Khamis, H. Q. Ngo, R. Pichler, D. Suciu, Y. R. Wang, Convergence of Datalog over (Pre-)</p>
      <p>Semirings., SIGMOD Rec. 52 (2023) 75–82. doi:10.1145/3604437.3604454.
[16] J. Vennekens, D. Gilis, M. Denecker, Splitting an operator: Algebraic modularity results for logics
with fixpoint semantics, CoRR cs.AI/0405002 (2004).
[17] J. Heyninck, An Algebraic Notion of Conditional Independence, and Its Application to Knowledge</p>
      <p>Representation (full version)., CoRR abs/2412.13712 (2024). doi:10.48550/ARXIV.2412.13712.
[18] J. Heyninck, O. Arieli, B. Bogaerts, Non-deterministic approximation fixpoint theory and its
application in disjunctive logic programming., Artif. Intell. 331 (2024) 104110. doi:10.1016/J.
ARTINT.2024.104110.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J.</given-names>
            <surname>Spaans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Heyninck</surname>
          </string-name>
          ,
          <article-title>A Unifying Framework for Semiring-Based Constraint Logic Programming With Negation (full version)</article-title>
          .,
          <source>CoRR abs/2507</source>
          .16067 (
          <year>2025</year>
          ). doi:
          <volume>10</volume>
          .48550/ARXIV.2507.16067.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>J.</given-names>
            <surname>Spaans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Heyninck</surname>
          </string-name>
          ,
          <article-title>A Unifying Framework for Semiring-Based Constraint Logic Programming With Negation</article-title>
          .,
          <source>in: Proceedings of the Thirty-Fourth International Joint Conference on Artificial Intelligence, IJCAI</source>
          <year>2025</year>
          , Montreal, Canada,
          <source>August 16-22</source>
          ,
          <year>2025</year>
          ,
          <year>2025</year>
          , pp.
          <fpage>2684</fpage>
          -
          <lpage>2692</lpage>
          . doi:
          <volume>10</volume>
          . 24963/IJCAI.
          <year>2025</year>
          /299.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <article-title>Semirings for Soft Constraint Solving and Programming</article-title>
          , volume
          <volume>2962</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2004</year>
          . doi:
          <volume>10</volume>
          .1007/B95712.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rossi</surname>
          </string-name>
          ,
          <article-title>Semiring-based constraint satisfaction and optimization</article-title>
          .,
          <source>J. ACM</source>
          <volume>44</volume>
          (
          <year>1997</year>
          )
          <fpage>201</fpage>
          -
          <lpage>236</lpage>
          . doi:
          <volume>10</volume>
          .1145/256303.256306.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>S.</given-names>
            <surname>Bistarelli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>U.</given-names>
            <surname>Montanari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Rossi</surname>
          </string-name>
          ,
          <article-title>Semiring-based contstraint logic programming: Syntax and semantics</article-title>
          .,
          <source>ACM Trans. Program. Lang. Syst</source>
          .
          <volume>23</volume>
          (
          <year>2001</year>
          )
          <fpage>1</fpage>
          -
          <lpage>29</lpage>
          . doi:
          <volume>10</volume>
          .1145/383721.383725.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>V.</given-names>
            <surname>Belle</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. D.</given-names>
            <surname>Raedt</surname>
          </string-name>
          ,
          <article-title>Semiring programming: A semantic framework for generalized sum product problems</article-title>
          .,
          <source>Int. J. Approx. Reason</source>
          .
          <volume>126</volume>
          (
          <year>2020</year>
          )
          <fpage>181</fpage>
          -
          <lpage>201</lpage>
          . doi:
          <volume>10</volume>
          .1016/J.IJAR.
          <year>2020</year>
          .
          <volume>08</volume>
          .001.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T.</given-names>
            <surname>Eiter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kiesel</surname>
          </string-name>
          , ASP():
          <article-title>Answer Set Programming with Algebraic Constraints.</article-title>
          ,
          <string-name>
            <given-names>Theory</given-names>
            <surname>Pract</surname>
          </string-name>
          . Log. Program.
          <volume>20</volume>
          (
          <year>2020</year>
          )
          <fpage>895</fpage>
          -
          <lpage>910</lpage>
          . doi:
          <volume>10</volume>
          .1017/S1471068420000393.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>T.</given-names>
            <surname>Eiter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Kiesel</surname>
          </string-name>
          ,
          <article-title>Weighted LARS for Quantitative Stream Reasoning</article-title>
          .,
          <source>in: ECAI 2020 - 24th European Conference on Artificial Intelligence</source>
          ,
          <volume>29</volume>
          <fpage>August</fpage>
          -8
          <source>September</source>
          <year>2020</year>
          , Santiago de Compostela, Spain,
          <source>August 29 - September 8, 2020 - Including 10th Conference on Prestigious Applications of Artificial Intelligence (PAIS</source>
          <year>2020</year>
          ),
          <year>2020</year>
          , pp.
          <fpage>729</fpage>
          -
          <lpage>736</lpage>
          . doi:
          <volume>10</volume>
          .3233/FAIA200160.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T. J.</given-names>
            <surname>Green</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Karvounarakis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Tannen</surname>
          </string-name>
          , Provenance semirings.,
          <source>in: Proceedings of the TwentySixth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems</source>
          , June 11-13,
          <year>2007</year>
          , Beijing, China,
          <year>2007</year>
          , pp.
          <fpage>31</fpage>
          -
          <lpage>40</lpage>
          . doi:
          <volume>10</volume>
          .1145/1265530.1265535.
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M. A.</given-names>
            <surname>Khamis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H. Q.</given-names>
            <surname>Ngo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Pichler</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Suciu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y. R.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <article-title>Convergence of datalog over (Pre-</article-title>
          )
          <string-name>
            <surname>Semirings</surname>
          </string-name>
          .,
          <source>J. ACM</source>
          <volume>71</volume>
          (
          <year>2024</year>
          ) 8:
          <fpage>1</fpage>
          -
          <lpage>8</lpage>
          :
          <fpage>55</fpage>
          . doi:
          <volume>10</volume>
          .1145/3643027.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kimmig</surname>
          </string-name>
          , G. V. den Broeck, L. D.
          <string-name>
            <surname>Raedt</surname>
          </string-name>
          ,
          <article-title>An Algebraic Prolog for Reasoning about Possible Worlds</article-title>
          .,
          <source>in: Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence</source>
          ,
          <source>AAAI</source>
          <year>2011</year>
          , San Francisco, California, USA,
          <year>August</year>
          7-
          <issue>11</issue>
          ,
          <year>2011</year>
          ,
          <year>2011</year>
          , pp.
          <fpage>209</fpage>
          -
          <lpage>214</lpage>
          . doi:
          <volume>10</volume>
          .1609/AAAI. V25I1.7852.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>A.</given-names>
            <surname>Kimmig</surname>
          </string-name>
          , G. V. den Broeck, L. D. Raedt,
          <article-title>Algebraic model counting</article-title>
          .,
          <source>J. Appl. Log</source>
          .
          <volume>22</volume>
          (
          <year>2017</year>
          )
          <fpage>46</fpage>
          -
          <lpage>62</lpage>
          . doi:
          <volume>10</volume>
          .1016/J.JAL.
          <year>2016</year>
          .
          <volume>11</volume>
          .031.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>K.</given-names>
            <surname>Gödel</surname>
          </string-name>
          , Zum intuitionistischen aussagenkalkül,
          <source>Anzeiger der Akademie der Wissenschaften in Wien</source>
          <volume>69</volume>
          (
          <year>1932</year>
          )
          <fpage>65</fpage>
          -
          <lpage>66</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>