Applying Answer Set Programming with Fuzzy Membership Functions: a Case Study

arXiv cs.AI Papers

Summary

This paper presents a novel fuzzy-logic-based extension of Answer Set Programming (ASP) that integrates numerical information with qualitative reasoning using membership functions, demonstrated through a travel recommendation case study.

arXiv:2607.03550v1 Announce Type: new Abstract: Human reasoning often operates through qualitative concepts expressed by linguistic labels such as high, low, expensive, or cheap, whose interpretation depends on context and is usually vague, despite being rooted in numerical data. This paper explores a novel fuzzy-logic-based qualitative extension of Answer Set Programming (ASP) to bridge numerical information and qualitative reasoning. The underlying language, formally introduced in a separate work, provides a principled framework that avoids rigid thresholds and supports robust reasoning under vagueness. Focusing on a representative use case, we illustrate how the framework integrates numerically grounded inputs (such as outputs of machine learning models) with symbolic reasoning over qualitative labels. Key features, including learning-based membership functions and semantically enriched predicates, enable the combination of expert knowledge, contextual factors, and subjective interpretations within a unified declarative setting.
Original Article
View Cached Full Text

Cached at: 07/07/26, 04:35 AM

# Applying Answer Set Programming with Fuzzy Membership Functions: a Case Study
Source: [https://arxiv.org/html/2607.03550](https://arxiv.org/html/2607.03550)
11institutetext:DIMES Dept\., University of Calabria, 87036 Rende \(CS\), Italy\.
11email:\{luca\.ferragina,ilenia\.galati,lorena\.gullone,francesco\.scarcello\}@unical\.it###### Abstract

Human reasoning often operates through qualitative concepts expressed by linguistic labels such ashigh,low,expensive, orcheap, whose interpretation depends on context and is usually vague, despite being rooted in numerical data\. This paper explores a novel fuzzy\-logic\-based qualitative extension of Answer Set Programming \(ASP\) to bridge numerical information and qualitative reasoning\. The underlying language, formally introduced in a separate work, provides a principled framework that avoids rigid thresholds and supports robust reasoning under vagueness\.

Focusing on a representative use case, we illustrate how the framework integrates numerically grounded inputs \(such as outputs of machine learning models\) with symbolic reasoning over qualitative labels\. Key features, including learning\-based membership functions and semantically enriched predicates, enable the combination of expert knowledge, contextual factors, and subjective interpretations within a unified declarative setting\.

## 1Introduction

Recent advances in machine learning have significantly enhanced the ability to extract patterns from unstructured data\. However, despite their predictive accuracy, such systems often remain difficult to interpret and audit, particularly in applications where decisions must be traceable and grounded in explicit assumptions\. In contrast, symbolic reasoning frameworks offer transparency and formal rigor, but they typically struggle to capture the continuous, noisy, and context\-dependent nature of real\-world information\. This gap becomes especially evident when expert knowledge is expressed through qualitative notions \(e\.g\.,*high*,*low*,*severe*,*acceptable*\) that are inherently vague, even when derived from numerical measurements\. Traditional approaches often rely on rigid thresholds to map numerical values to qualitative categories, leading to brittle behavior in which small variations in input may cause abrupt and unintuitive changes in outcomes\.

Fuzzy logic offers a natural foundation to address this issue by enabling reasoning with graded truth values\. In this work, we build on a novel qualitative, label\-based fuzzy extension of Answer Set Programming \(ASP\), introduced in a companion paper, which explicitly couples linguistic labels with numerically grounded information through membership functions\. In this framework, predicates are enriched with sets of qualitative labels, and their truth degrees are constrained both by data\-driven membership functions \(for input predicates\) and by semantic compatibility conditions \(for derived predicates\), expressed through admissible truth profiles\. Let us illustrate this point through a rule extracted from a program in a travel recommendation scenario:

๐š›๐šŽ๐šŒ๐š˜๐š–๐š–๐šŽ๐š—๐šโ€‹\(X,C;affordable\)โ†๐šŒ๐š•๐š’๐šŽ๐š—๐š\(C\)โŠ™๐š™๐š›๐š’๐šŒ๐šŽ\(F,C;cheap\)โŠ™๐š๐š•๐š’๐š๐š‘๐š\(X,F\)โŠ™๐š‘๐š˜๐š๐šŽ๐š•\(X,H\)โŠ™๐š™๐š›๐š’๐šŒ๐šŽโ€‹\(H,C;cโ€‹hโ€‹eโ€‹aโ€‹p\)\\begin\{split\}\\mathtt\{recommend\}\(X,C;\\textit\{affordable\}\)\\leftarrow&\\mathtt\{client\}\(C\)\\ \\odot\\mathtt\{price\}\(F,C;cheap\)\\ \\odot\\\\ &\\mathtt\{flight\}\(X,F\)\\ \\odot\\mathtt\{hotel\}\(X,H\)\\odot\\\\ &\\mathtt\{price\}\(H,C;cheap\)\\end\{split\}
The predicaterecommendhas labelsinfeasibleandaffordable, whilepriceis described bycheap,medium, andexpensive\. The rule assigns toaffordablea degree bounded by the aggregation \(via a t\-normโŠ™\\odot, e\.g\.,โŠ™min\\odot\_\{\\min\}\) of the body, thus reflecting that affordability depends on both flight and hotel being sufficiently cheap\.

Note this notion is vague, and the mapping from actual money values to the degree ofcheapnessis provided by suitable membership functions associated with the predicateprice\. Such mapping can be determined by those studies that relate the actual perceived value of money for different individuals, typically depending on their annual income\. That is, the notion ofcheapis not universal, but depends on contextual and subjective factors:$โ€‹200\\mathdollar 200is a medium price for a rich customer, but it is very expensive for a low\-income customer\. Thus, in this fuzzy program, economic status is treated not as a passive filter but as a semantic dimension that adapts the concept definition\. In particular, the same travel package can therefore receive different graded valuations ofaffordabilityfrom different users\.

This example reflects a general setting where numerical information \(often produced by statistical or learning methods\) is integrated into a logical framework, allowing experts to express rules naturally while retaining control over graded outcomes\.

It is worthwhile noting that our language is a direct extension of classical, two\-valued ASP, and it naturally permits the definition and manipulation of crisp predicates and rules\. Whenever there are only crisp predicates, all fuzzy operators collapse to their classical counterparts, namely conjunction, disjunction, and negation, and we recover precisely Answer Sets semantics\.

The focus of this paper is on illustrating the practical effectiveness of this approach in a concrete setting, namely damage detection in the production line of screws, arising from a collaboration with an industrial partner\. In such environments, automated visual inspection systems produce numerical features \(such as defect size, shape irregularity, or color intensity\) derived from image processing and machine learning components\. These features must then be interpreted in qualitative terms that align with domain expertise, such as assessing whether a defect is*small*,*moderate*, or*severe*, and whether a screw is*repairable*or should be*discarded*\.

Our framework enables this transition by associating each qualitative label with a membership function that maps numerical observations to degrees of membership, thus preserving the inherent vagueness of the domain\. On top of these input predicates, higher\-level concepts are defined through declarative rules, while admissible truth profiles ensure that the resulting qualitative assessments remain semantically coherent\. This allows the system to detect inconsistencies when conflicting evidence arises, and to propagate partial information across related qualitative dimensions\.

We illustrate how this approach supports a full reasoning pipeline for quality control: from low\-level perception, through qualitative abstraction, to decision\-making actions such as*discard*,*rework*, or*accept*\. The example highlights how numerically grounded data and symbolic rules can be seamlessly integrated, yielding outcomes that are both flexible and aligned with domain\-specific interpretations\. While the formal properties of the language are proved in the companion work, this paper emphasizes its role in enabling a robust and expressive modeling of real\-world decision processes in a concrete use\-case\.

The main contributions of this paper are: \(i\) the instantiation of the proposed qualitative fuzzy ASP framework in a realistic industrial damage\-detection scenario, and \(ii\) the design and prototyping of a complete reasoning pipeline integrating data\-driven membership functions with rule\-based qualitative inference\.

## 2Related Works

The integration of uncertainty in rule\-based reasoning has evolved from quantitative extensions of logic programming to neuro\-symbolic approaches\. Early worksvan Emden \([1986](https://arxiv.org/html/2607.03550#bib.bib16)\)introduced attenuation factors, while Fuzzy Logic Programming \(FLP\)Vojtรกs \([2001](https://arxiv.org/html/2607.03550#bib.bib7)\); Ebrahim \([2001](https://arxiv.org/html/2607.03550#bib.bib18)\); Medinaet al\.\([2001](https://arxiv.org/html/2607.03550#bib.bib20)\); Achs and Kiss \([1995](https://arxiv.org/html/2607.03550#bib.bib17)\)adopted a truth\-functional view\. These ideas were later extended to structured formalisms such as Description Logics and Answer Set Programming \(ASP\)\.

Handling uncertainty with non\-monotonic negation has been studied in generalized logic programs\. Parametric Deductive Databases were extended inLoyer and Straccia \([2003](https://arxiv.org/html/2607.03550#bib.bib33),[2009](https://arxiv.org/html/2607.03550#bib.bib34)\)with approximate well\-founded semantics and lattice\-based frameworks\. In parallel, multi\-adjoint logic programming was enriched with non\-monotonic reasoningCornejoet al\.\([2018](https://arxiv.org/html/2607.03550#bib.bib35),[2020](https://arxiv.org/html/2607.03550#bib.bib36)\), providing expressive semantics and translations to simpler fragments\.

In fuzzy Description LogicsStraccia \([2001](https://arxiv.org/html/2607.03550#bib.bib28)\); Bobillo and Straccia \([2008](https://arxiv.org/html/2607.03550#bib.bib29)\); Lukasiewicz and Straccia \([2008](https://arxiv.org/html/2607.03550#bib.bib27)\), vagueness is modeled via membership functions while preserving decidability\. In ASP, fuzzy extensionsAlviano and Peรฑaloza \([2013](https://arxiv.org/html/2607.03550#bib.bib25)\); Janssenet al\.\([2009](https://arxiv.org/html/2607.03550#bib.bib26)\)generalize stable models using\[0,1\]\[0,1\]truth degrees\. CFASPJanssenet al\.\([2012](https://arxiv.org/html/2607.03550#bib.bib37)\)showed that many constructs can be reduced to a core language\. Further studies addressed negation and inconsistencyBlondeelet al\.\([2013](https://arxiv.org/html/2607.03550#bib.bib8)\); Van Nieuwenborghet al\.\([2006](https://arxiv.org/html/2607.03550#bib.bib9)\), introducing notions such as unfounded\-freeness\. Fuzzy Linguistic Logic ProgrammingLeet al\.\([2009](https://arxiv.org/html/2607.03550#bib.bib10)\)instead performs reasoning directly over linguistic terms\. More recently, fuzzy Datalog with existential rulesLanzingeret al\.\([2024](https://arxiv.org/html/2607.03550#bib.bib11)\)achieved high expressivity while retaining tractable data complexity\. Neuro\-symbolic AI complements these developments by combining learning and reasoning\.DeepProbLogManhaeveet al\.\([2021](https://arxiv.org/html/2607.03550#bib.bib21)\)andNeurASPYanget al\.\([2020](https://arxiv.org/html/2607.03550#bib.bib23)\), along withSLASHSkryaginet al\.\([2022](https://arxiv.org/html/2607.03550#bib.bib22)\), integrate neural outputs into probabilistic or ASP\-based reasoning, while Logic Tensor NetworksBadreddineet al\.\([2022](https://arxiv.org/html/2607.03550#bib.bib24)\)embed logical constraints into differentiable frameworks\. Note that all these approaches clarify, from different perspectives, how nonโ€‘monotonic reasoning, uncertainty management, and graded truth can coexist\. However, they do not consider membership functions and qualitative labels as main components of the semantics of programs, which includes dealing with the implicit constraints based on how membership functions of qualitative labels may coโ€‘vary\.

## 3Preliminaries

In this section, we introduce the core elements of our language, including its syntax, the fundamental components of its semantics, and the main algorithm underlying the inference process\.

### 3\.1Syntax ofFLASP

A programฮ \\PiinFLASPincludes a set๐’ž\\mathcal\{C\}of constants, a set of๐’ฑ\\mathcal\{V\}variables, and a set๐’ซ\\mathcal\{P\}of predicate symbols\. Constants and variables play the same role as in standard logic programming\. Predicates, however, are enriched with additional structure to capture linguistic terms and fuzzy information\.

As usual in Datalog, we distinguish two classes of predicate symbols in๐’ซ\\mathcal\{P\}:

- โ€ข*Input*\(or*extensional*, EDB\) predicates, whose truth degrees are given as inputs to the program;
- โ€ข*Derived*\(or*intensional*, IDB\) predicates, whose truth degrees are obtained by rule\-based inference within the program\.

We writepโ€‹\(๐ฑ;โ„“\)p\(\\mathbf\{x\};\\ell\)for the atom obtained frompp, an argument tuple๐ฑ\\mathbf\{x\}, and a labelโ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}, and we read its truth degree as the*degree of membership*of๐ฑ\\mathbf\{x\}in the fuzzy concept named byโ„“\\ell\. Each predicate symbolp\(k\)โˆˆ๐’ซp^\{\(k\)\}\\in\\mathcal\{P\}of aritykkis associated with a tripleโŸจฮ›p,Mp,ฮฃpโŸฉ\\langle\\Lambda\_\{p\},\\mathrm\{M\}\_\{p\},\\Sigma\_\{p\}\\rangle, whereฮ›p\\Lambda\_\{p\}is a finite set of*linguistic labels*describing the linguistic domain ofpp,Mp\\mathrm\{M\}\_\{p\}is a family of*membership functions*, andฮฃp\\Sigma\_\{p\}is a collection of*S\-norms*\.

For each labelโ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}, the setฮฃp\\Sigma\_\{p\}provides an associated S\-norm๐’ฎโ„“:\[0,1\]ร—\[0,1\]โ†’\[0,1\]\\mathcal\{S\}\_\{\\ell\}:\[0,1\]\\times\[0,1\]\\rightarrow\[0,1\], which satisfies commutativity, associativity, monotonicity, and the boundary condition๐’ฎโ„“โ€‹\(x,0\)=x\\mathcal\{S\}\_\{\\ell\}\(x,0\)=x\. Typical examples include the Gรถdel S\-norm, defined as๐’ฎmaxโ€‹\(x,y\)=maxโก\(x,y\)\\mathcal\{S\}\_\{\\max\}\(x,y\)=\\max\(x,y\), and the probabilistic sum, defined as๐’ฎprobโ€‹\(x,y\)=x\+yโˆ’xโ‹…y\\mathcal\{S\}\_\{\\mathrm\{prob\}\}\(x,y\)=x\+y\-x\\cdot y\. The S\-norm๐’ฎโ„“\\mathcal\{S\}\_\{\\ell\}aggregates the contributions to the truth/membership value for labelโ„“\\ellfrom the rules defining atoms over predicatepp, while membership functions are used to determine the degree to which a given value satisfies a linguistic label\.

#### Membership Functions\.

For an EDB predicatepp, the familyMp\\mathrm\{M\}\_\{p\}contains, for each labelโ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}, a membership functionฮผโ„“:๐ƒโ†’\[0,1\]\\mu\_\{\\ell\}:\\mathbf\{D\}\\rightarrow\[0,1\], where๐ƒ\\mathbf\{D\}denotes the cartesian product of the domains of the underlying variables\. Each functionฮผโ„“\\mu\_\{\\ell\}assigns to a tuple๐ฑโˆˆ๐ƒ\\mathbf\{x\}\\in\\mathbf\{D\}a degree of membership in the fuzzy set associated with the labelโ„“\\ell\. Membership functions are fixed*a priori*, for instance on the basis of domain expertise or by means of machine learning techniques applied to dataMedasaniet al\.\([1998](https://arxiv.org/html/2607.03550#bib.bib3)\)\. The resulting membership degreeฮผโ„“โ€‹\(๐ฑ\)\\mu\_\{\\ell\}\(\\mathbf\{x\}\)is interpreted in the standard fuzzy\-set\-theoretic sense:ฮผโ„“โ€‹\(๐ฑ\)=0\\mu\_\{\\ell\}\(\\mathbf\{x\}\)=0denotes non\-membership,ฮผโ„“โ€‹\(๐ฑ\)=1\\mu\_\{\\ell\}\(\\mathbf\{x\}\)=1denotes full membership, and intermediate values express partial membership \(see Figure[1](https://arxiv.org/html/2607.03550#S4.F1)\)\.

It is convenient to viewMp\\mathrm\{M\}\_\{p\}as a single functionMp:๐ƒโ†’\[0,1\]ฮ›p\\mathrm\{M\}\_\{p\}:\\mathbf\{D\}\\to\[0,1\]^\{\\Lambda\_\{p\}\}, where each component supplies the result for one label\. The set of all compatible label\-vectors,

ฮณp:=Mpโ€‹\(๐ƒ\)โІ\[0,1\]ฮ›p,\\gamma\_\{p\}\\;:=\\;\\mathrm\{M\}\_\{p\}\(\\mathbf\{D\}\)\\;\\subseteq\\;\[0,1\]^\{\\Lambda\_\{p\}\},is precisely the image ofMp\\mathrm\{M\}\_\{p\}, and plays for EDB predicates the same role as the admissible truth profile defined below for IDB predicates: it records which combinations of label\-truth degrees can actually occur\.

For a derived predicate IDBpp, we would like to compute membership values by means of program rules, according to the intended semantics of the program\. However, not every combination of truth values for the labels are logically meaningful, thus for IDB predicates we are interested in the membership\-values compatibility setฮณp\\gamma\_\{p\}\. With this respect, it is convenient to represent it in a parametric way, with respect to a parametertt, so thatฮณp\\gamma\_\{p\}is a mapping

ฮณp:\[ap,bp\]โ†’\[0,1\]ฮ›p,ฮณpโ€‹\(t\)=\(ฮณpโ€‹\(t\)โ„“\)โ„“โˆˆฮ›p,\\gamma\_\{p\}:\[a\_\{p\},b\_\{p\}\]\\to\[0,1\]^\{\\Lambda\_\{p\}\},\\qquad\\gamma\_\{p\}\(t\)=\\bigl\(\\gamma\_\{p\}\(t\)\_\{\\ell\}\\bigr\)\_\{\\ell\\in\\Lambda\_\{p\}\},where the*closed interval*\[ap,bp\]\[a\_\{p\},b\_\{p\}\]is the parametrization domain, andโˆ€tโˆˆ\[0,1\]\\forall t\\in\[0,1\],ฮณpโ€‹\(t\)=\(ฮณpโ€‹\(t\)โ„“\)โ„“โˆˆฮ›p\\gamma\_\{p\}\(t\)=\(\\gamma\_\{p\}\(t\)\_\{\\ell\}\)\_\{\\ell\\in\\Lambda\_\{p\}\}represents a coherent assignment of truth degrees to all labels ofpp\. Intuitively,ฮณp\\gamma\_\{p\}describes the intended semantic structure of the predicatepp: each labelโ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}corresponds to one dimension of the truth space, and the curveฮณp\\gamma\_\{p\}encodes how these labels may consistently co\-vary\.

#### Terms, literals, rules, programs\.

A*term*is either a constantcโˆˆ๐’žc\\in\\mathcal\{C\}or a variablexโˆˆ๐’ฑx\\in\\mathcal\{V\}\. A*fuzzy literal*is an expression of the formpโ€‹\(๐ฑ;โ„“\)p\(\\mathbf\{x\};\\ell\)orยฌ๐’ฉpโ€‹\(๐ฑ;โ„“\)\\neg\_\{\\scriptscriptstyle\\mathcal\{N\}\}p\(\\mathbf\{x\};\\ell\), wherepโˆˆ๐’ซp\\in\\mathcal\{P\}is a predicate symbol of aritykk,๐ฑ=\(x1,โ€ฆ,xk\)\\mathbf\{x\}=\(x\_\{1\},\\dots,x\_\{k\}\)is a tuple of terms, andโ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}is a linguistic label associated withpp\.111In the examples, we omit the label if there is only one label and it is irrelevant, for instance for crisp EDB predicates\.The former is referred to as a \(positive or*directed*\) atom, while the latter as a*negated*atom\. Formally, a negated atom is denoted as๐’ฉโ€‹\(p\)\\mathcal\{N\}\(p\)where๐’ฉ:\[0,1\]โ†’\[0,1\]\\mathcal\{N\}:\[0,1\]\\rightarrow\[0,1\]is a decreasing function that satisfies๐’ฉโ€‹\(0\)=1\\mathcal\{N\}\(0\)=1and๐’ฉโ€‹\(1\)=0\\mathcal\{N\}\(1\)=0\. Typical negator examples include theลukasiewicz Negator๐’ฉLโ€‹\(x\)=1โˆ’x\\mathcal\{N\}\_\{L\}\(x\)=1\-xand theGรถdel Negator๐’ฉGโ€‹\(x\)=1โ€‹ifโ€‹x=0\\mathcal\{N\}\_\{G\}\(x\)=1\\text\{ if \}x=0or๐’ฉGโ€‹\(x\)=0\\mathcal\{N\}\_\{G\}\(x\)=0otherwise\.

A*fuzzy Datalog rule*is an expression of the form

hโ†b1โŠ™๐’ฏโ‹ฏโŠ™๐’ฏbm,h\\leftarrow b\_\{1\}\\odot\_\{\\mathcal\{T\}\}\\cdots\\odot\_\{\\mathcal\{T\}\}b\_\{m\},where the headhhis a \(positive\) fuzzy atom and the body consists of a \(possibly empty\) conjunction of fuzzy literalsb1,โ€ฆ,bmb\_\{1\},\\dots,b\_\{m\}\. The operatorโŠ™๐’ฏ\\odot\_\{\\mathcal\{T\}\}denotes conjunction interpreted via some T\-norm๐’ฏ\\mathcal\{T\}\. Intuitively, the body specifies a set of conditions whose satisfaction contributes to the truth value of the head\.

For a rulerr, denote byHโ€‹\(r\)H\(r\)its head atom and byBโ€‹\(r\)B\(r\)the set of literals in its body whereB\+โ€‹\(r\)B^\{\+\}\(r\)andBโˆ’โ€‹\(r\)B^\{\-\}\(r\)denote, respectively, the sets of positive and of negated atoms occurring in the body ofrr\. Then, consider a \(ground\) atomhh, and denote byRhR\_\{h\}the set of rules havinghhas their head\.

We assume the existence of a reserved predicate๐‘๐‘œ๐‘›๐‘ ๐‘กโ€‹\(x;โ„“c\)\\mathit\{const\}\(x;\\ell\_\{c\}\), wherexxis some constant term\. It is used to encode constant truth values within rules and is equipped with the membership functionโ„“cโ€‹\(x\)=1\\ell\_\{c\}\(x\)=1, assigning truth value11to any given termxx\. We write๐‘๐‘œ๐‘›๐‘ ๐‘กโ€‹\(v;โ„“c\)\\mathit\{const\}\(v;\\ell\_\{c\}\)to inject the numeric truth valuevv\.

The logical conjunctionandis modeled by a T\-norm๐’ฏ:\[0,1\]ร—\[0,1\]โ†’\[0,1\]\\mathcal\{T\}:\[0,1\]\\times\[0,1\]\\rightarrow\[0,1\], which satisfies commutativity, associativity, monotonicity, and the boundary condition๐’ฏโ€‹\(x,1\)=x\\mathcal\{T\}\(x,1\)=x\. Commonly used examples include the Gรถdel T\-norm๐’ฏminโ€‹\(x,y\)=minโก\(x,y\)\\mathcal\{T\}\_\{\\min\}\(x,y\)=\\min\(x,y\), the product T\-norm๐’ฏprodโ€‹\(x,y\)=xโ‹…y\\mathcal\{T\}\_\{\\mathrm\{prod\}\}\(x,y\)=x\\cdot y, and the ลukasiewicz T\-norm๐’ฏLโ€‹\(x,y\)=maxโก\(0,x\+yโˆ’1\)\\mathcal\{T\}\_\{L\}\(x,y\)=\\max\(0,x\+y\-1\)\.

A*fuzzy \(Datalog\) program*ฮ \\Piis a finite set of rules\. A*fact*is a rule with empty body\. The*grounding*of a programฮ \\Piis obtained by replacing all variables occurring inฮ \\Piwith constants from the domain\. A program is said to be*ground*if it contains no variables\. The*Herbrand domain*HCH\_\{C\}of a programฮ \\Piis the set of all constants appearing inฮ \\Pi\. The*Herbrand base*โ„ฌฮ \\mathcal\{B\}\_\{\\Pi\}is the set of all ground fuzzy atoms that can be constructed from the predicate symbols in๐’ซ\\mathcal\{P\}and the constants inHCH\_\{C\}\.

### 3\.2Semantics

A*fuzzy interpretation*โ„\\mathcal\{I\}is a functionโ„:โ„ฌฮ โ†’\[0,1\]\\mathcal\{I\}:\\mathcal\{B\}\_\{\\Pi\}\\rightarrow\[0,1\]that assigns a truth degree to each ground atompโ€‹\(๐‚;โ„“\)p\(\\mathbf\{C\};\\ell\)in the Herbrand baseโ„ฌฮ \\mathcal\{B\}\_\{\\Pi\}\. The valueโ„โ€‹\(pโ€‹\(๐‚;โ„“\)\)\\mathcal\{I\}\\bigl\(p\(\\mathbf\{C\};\\ell\)\\bigr\)is interpreted as a truth degree of the atom with respect to the labelโ„“\\ell, or as a degree of membership to the fuzzy setโ„“\\ell\. As we discuss below, classical \(crisp\) atoms can be modeled as atoms with a membership function having binary values only\.

Denote bypโ€‹\(๐‚;โ‹…\)p\(\\mathbf\{C\};\\cdot\)the basic unlabeled version of any ground atom with over predicateppand with terms๐‚\\mathbf\{C\}\. By abusing notation, we simply refer to it as an atom\.

#### Membership functions\.

An interpretationโ„\\mathcal\{I\}is said to be*consistent*if, for every atompโ€‹\(๐‚;โ‹…\)p\(\\mathbf\{C\};\\cdot\), the truth values over its linguistic labels are compatible according toฮณ\\gamma, that is,

\(โ„โ€‹\(pโ€‹\(๐‚;โ„“\)\)\)โ„“โˆˆฮ›pโˆˆฮณp\\left\(\\ \\mathcal\{I\}\\bigl\(p\(\\mathbf\{C\};\\ell\)\\bigr\)\\ \\right\)\_\{\\ell\\in\\Lambda\_\{p\}\}\\in\\gamma\_\{p\}\(1\)
Equation \([1](https://arxiv.org/html/2607.03550#S3.E1)\) therefore requires that truth degrees ofpโ€‹\(๐‚,โ‹…\)p\(\\mathbf\{C\},\\cdot\)according toโ„\\mathcal\{I\}belong to the admissible regionฮณp\\gamma\_\{p\}\(or they are all zeroโ€”recall that๐ŸŽฮ›pโˆˆฮณ\\mathbf\{0\}^\{\\Lambda\_\{p\}\}\\in\\gamma, if this atom is false at all\)\. Note that we do not allow arbitrary and independent truth values to individual labels, because membership functions carry out semantic information\. Typically, e\.g\., it is impossible that an atom corresponding to some physical measure has a high membership value for both the label โ€œfastโ€ and the label โ€œslowโ€\.

In our language, however, the membership functions encoded inฮณ\\gammaplay a much more central role than mere consistency checking: they are directly involved in the inference process, since once a truth value for a predicateppis derived for a label, the profileฮณp\\gamma\_\{p\}can propagate consistent truth values to other labels \(line[1](https://arxiv.org/html/2607.03550#algorithm1)of Algorithm[1](https://arxiv.org/html/2607.03550#algorithm1)\)\. More precisely, ifโ„โ€‹\(pโ€‹\(๐‚;โ„“\)\)=v\\mathcal\{I\}\(p\(\\mathbf\{C\};\\ell\)\)=v, then the profileฮณp\\gamma\_\{p\}determines a set of admissible tuples in\[0,1\]ฮ›p\[0,1\]^\{\\Lambda\_\{p\}\}containingvvas the component forโ„“\\ell, and the inference step selects \(e\.g\., minimally\) a tuple๐ญโˆˆฮณp\\mathbf\{t\}\\in\\gamma\_\{p\}such that๐ญโ€‹\(โ„“\)โ‰ฅv\\mathbf\{t\}\(\\ell\)\\geq v, assigningโ„โ€‹\(pโ€‹\(๐‚;โ„“โ€ฒ\)\)โ‰ฅ๐ญโ€‹\(โ„“โ€ฒ\)\\mathcal\{I\}\(p\(\\mathbf\{C\};\\ell^\{\\prime\}\)\)\\geq\\mathbf\{t\}\(\\ell^\{\\prime\}\)for every other labelโ„“โ€ฒโˆˆฮ›p\\ell^\{\\prime\}\\in\\Lambda\_\{p\}\.

By this mechanism, partial evidence derived for a single label can be extended to a semantically coherent interpretation over all labels, preserving the intended qualitative relationships encoded inฮณp\\gamma\_\{p\}and avoiding arbitrary or inconsistent assignments\.

This feature can also be exploited to allow a single predicateppto exhibit both a fuzzy and a crisp behavior\. For instance,ppcan be equipped with two labels, e\.g\.,fuzzyandcrisp, each associated with a different membership function: a continuous increasing function \(e\.g\., linear or even the identity on\[0,1\]\[0,1\]\) forfuzzy, and a0\-11step function at a fixed cutoff value forcrisp\(see Figure[2](https://arxiv.org/html/2607.03550#S4.F2)\)\. In this setting, the labelfuzzyis used in the head of fuzzy rules to derive graded truth values, while theฮณ\\gamma\-propagation mechanism automatically induces a corresponding Boolean value forpโ€‹\(โ‹…;crisp\)p\(\\cdot;\\textit\{crisp\}\), which will be either11if the threshold degree exceeds the given cutoff, or0otherwise\.

By construction, the labelcrispthus exhibits a crisp behavior, which can be seamlessly used in subsequent \(standard ASP\) rule layers requiring Boolean semantics\. This pattern is indeed exploited in the program of Figures[3](https://arxiv.org/html/2607.03550#S4.F3),[4](https://arxiv.org/html/2607.03550#S4.F4)and[5](https://arxiv.org/html/2607.03550#S4.F5), where predicates such asdiscard,discount, andrepairare first derived fuzzily and then used within a purely crisp decision component, by means of their crisp \(binary valued\) labels\.

#### Models and Answer Sets\.

For a rulerr,โ„โ€‹\(Bโ€‹\(r\)\)\\mathcal\{I\}\(B\(r\)\)is obtained by applying the T\-norm๐’ฏr\\mathcal\{T\}\_\{r\}to the interpretationโ„โ€‹\(bi\)\\mathcal\{I\}\(b\_\{i\}\)of all literalsbiโˆˆBโ€‹\(r\)b\_\{i\}\\in B\(r\)\. Recall that๐’ฏr\\mathcal\{T\}\_\{r\}is associative and commutative\. Then,โ„โ€‹\(Rh\)\\mathcal\{I\}\(R\_\{h\}\)denotes the application of the co\-norm associated withhhto the interpretation of all body rules defininghh, that is,โ„\(Rh\)=๐’ฎh\{โ„\(B\(r\)โˆฃrโˆˆRh\}\\mathcal\{I\}\(R\_\{h\}\)=\\mathcal\{S\}\_\{h\}\\\{\\ \\mathcal\{I\}\(B\(r\)\\mid r\\in R\_\{h\}\\ \\\}\.

A*model*of a fuzzy programฮ \\Piis a consistent interpretationโ„\\mathcal\{I\}\(in the sense of Equation \([1](https://arxiv.org/html/2607.03550#S3.E1)\)\) such that all rules inฮ \\Piare satisfied\. That is, for each head atomhh, it holds that

โ„โ€‹\(h\)โ‰ฅโ„โ€‹\(Rh\)\\mathcal\{I\}\(h\)\\geq\\mathcal\{I\}\(R\_\{h\}\)\(2\)We writeโ„โŠงฮ \\mathcal\{I\}\\models\\Pito denote thatโ„\\mathcal\{I\}is a model ofฮ \\Pi\.

###### Definition 1\(Minimal model\)

An interpretationโ„\\mathcal\{I\}for a programฮ \\Piis said to be*minimal*w\.r\.t\. a given set of interpretationsWW, if there exists no other interpretationโ„โ€ฒโˆˆW\\mathcal\{I\}^\{\\prime\}\\in W\(โ„โ€ฒโ‰ โ„\\mathcal\{I\}^\{\\prime\}\\neq\\mathcal\{I\}\), such thatโ„โ€ฒโ€‹\(pยฏ\)โ‰คโ„โ€‹\(pยฏ\)\\mathcal\{I\}^\{\\prime\}\(\\bar\{p\}\)\\leq\\mathcal\{I\}\(\\bar\{p\}\), for every ground atompยฏ\\bar\{p\}\.

An interpretationโ„\\mathcal\{I\}is called a minimal model ofฮ \\Pi, if it is minimal w\.r\.t\. to the set of all models ofฮ \\Pi\.

It is easy to see that a program may have many minimal models, even infinitely many, or no model at all\. However, we are interested in those models that are maximally supported by the program rules\.

###### Definition 2\(Tight Interpretations\)

Letโ„\\mathcal\{I\}andโ„โ€ฒ\\mathcal\{I^\{\\prime\}\}be interpretations of a fuzzy programฮ \\Pi\. We say thatโ„\\mathcal\{I\}is*tight*w\.r\.t\.โ„โ€ฒ\\mathcal\{I^\{\\prime\}\}if, for every \(unlabeled\) atompโ€‹\(๐‚;โ‹…\)p\(\\mathbf\{C\};\\cdot\), there is a maximal set of critical labels, whose membership values are the lowest possible to satisfy their defining rules w\.r\.t\. the givenโ„โ€ฒ\\mathcal\{I^\{\\prime\}\}\. That is, for every such a labelโ„“โˆ—\\ell^\{\*\}, saidpยฏ=pโ€‹\(๐‚;โ„“โˆ—\)\\bar\{p\}=p\(\\mathbf\{C\};\\ell^\{\*\}\), we haveโ„โ€‹\(pยฏ\)=โ„โ€ฒโ€‹\(Rpยฏ\)\\mathcal\{I\}\(\\bar\{p\}\)=\\mathcal\{I^\{\\prime\}\}\(R\_\{\\bar\{p\}\}\)\. Ifโ„=โ„โ€ฒ\\mathcal\{I\}=\\mathcal\{I^\{\\prime\}\}, we just say it is a tight interpretation\.

Tight minimal models contain no superfluous truth information: decreasing the truth \(membership\) value of a label necessarily destroys model\-hood \(either by violating consistency or by failing to satisfy some rule\)\. They are maximally informative solutions compatible with both the rules of the program and the semantic constraints imposed byฮณ\\gamma\. If a program has a unique tight minimal model, that model is called the*least model*of the program\.

Given an interpretationโ„\\mathcal\{I\}of a fuzzy programฮ \\Pi, define the*reduct*ฮ โ„\\Pi^\{\\mathcal\{I\}\}ofฮ \\Piwith respect toโ„\\mathcal\{I\}as the set of rulesPโ€‹iโ„=\{rโ„โˆฃrโˆˆฮ \}Pi^\{\\mathcal\{I\}\}=\\\{\\,r^\{\\mathcal\{I\}\}\\mid r\\in\\Pi\\,\\\}, where each rulerโ„r^\{\\mathcal\{I\}\}is obtained fromrrby replacing every negated body atomยฌ๐’ฉb\\neg\_\{\\scriptscriptstyle\\mathcal\{N\}\}bwith a \(positive\) atomcโ€‹oโ€‹nโ€‹sโ€‹tโ€‹\(๐’ฉโ€‹\(โ„โ€‹\(b\)\);โ„“c\)const\(\\mathcal\{N\}\(\\mathcal\{I\}\(b\)\);\\ell\_\{c\}\)\. That is, we assume the truth values of negative literals are correct\. By construction,ฮ โ„\\Pi^\{\\mathcal\{I\}\}is a positive fuzzy program\.

###### Definition 3\(Fuzzy answer set\)

An interpretationโ„\\mathcal\{I\}is an*answer set*ofฮ \\Piifโ„\\mathcal\{I\}is a*tight minimal model*of the reductฮ โ„\\Pi^\{\\mathcal\{I\}\}\.

Input:Positive

ฮณ\\gamma\-monotonic fuzzy program

Output:Least model

โ„ณโˆ—\\mathcal\{M\}^\{\*\}\(orNoModel\)

1

2Construct the Herbrand base

โ„ฌฮ \\mathcal\{B\}\_\{\\Pi\};

3Initialize

โ„โ†โŠฅ\\mathcal\{I\}\\leftarrow\\bot;

4repeat

//Deterministic one\-step operatorT^\\widehat\{T\}

5foreach*grounded atompโ€‹\(๐‚;โ‹…\)p\(\\mathbf\{C\};\\cdot\)*do

//rule\-induced lower bounds

6foreach*โ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}*do

7

bโ„“โ†โ„โ€‹\(Rpโ€‹\(๐‚;โ„“\)\)b\_\{\\ell\}\\leftarrow\\mathcal\{I\}\(R\_\{p\(\\mathbf\{C\};\\ell\)\}\);

//unique tight propagation viaฮณp\\gamma\_\{p\}

8

Aโ†\{tโˆˆ\[ap,bp\]โˆฃฮณpโ€‹\(t\)โ„“โ‰ฅbโ„“โ€‹โˆ€โ„“โˆˆฮ›p\}A\\leftarrow\\\{\\,t\\in\[a\_\{p\},b\_\{p\}\]\\mid\\gamma\_\{p\}\(t\)\_\{\\ell\}\\geq b\_\{\\ell\}\\ \\forall\\ell\\in\\Lambda\_\{p\}\\,\\\};

9if*A=โˆ…A=\\emptyset*then

10return*NoModel*

11

ฮฑโ†minโกA\\alpha\\leftarrow\\min A;

12foreach*โ„“โˆˆฮ›p\\ell\\in\\Lambda\_\{p\}*do

13

โ„โ€ฒโ€‹\(pโ€‹\(๐‚;โ„“\)\)โ†ฮณpโ€‹\(ฮฑ\)โ„“\\mathcal\{I\}^\{\\prime\}\(p\(\\mathbf\{C\};\\ell\)\)\\leftarrow\\gamma\_\{p\}\(\\alpha\)\_\{\\ell\};

14

15

โ„โ†โ„โ€ฒ\\mathcal\{I\}\\leftarrow\\mathcal\{I\}^\{\\prime\};

16until*โ„โ€ฒ=โ„\\mathcal\{I\}^\{\\prime\}=\\mathcal\{I\}*;

return*โ„ณโˆ—โ†โ„\\mathcal\{M\}^\{\*\}\\leftarrow\\mathcal\{I\};*

Algorithm 1Fixpoint iteration\.Letโ„\\mathcal\{I\}be an interpretation for a programฮ \\Pi\. LetWโ„W\_\{\\mathcal\{I\}\}be the set of interpretationsโ„โ€ฒ\\mathcal\{I\}^\{\\prime\}that satisfy all rules according toโ„\\mathcal\{I\}, that is, for every atomhยฏ\\bar\{h\},โ„โ€ฒโ€‹\(hยฏ\)โ‰ฅโ„โ€‹\(Rhยฏ\)\\mathcal\{I\}^\{\\prime\}\(\\bar\{h\}\)\\geq\\mathcal\{I\}\(R\_\{\\bar\{h\}\}\)\.

We define the*immediate consequence operator*as the mappingTฮ :\[0,1\]โ„ฌฮ โ†’๐’ซโ€‹\(\[0,1\]โ„ฌฮ \)T\_\{\\Pi\}:\[0,1\]^\{\\mathcal\{B\}\_\{\\Pi\}\}\\rightarrow\\mathcal\{P\}\\bigl\(\[0,1\]^\{\\mathcal\{B\}\_\{\\Pi\}\}\\bigr\)such thatTฮ โ€‹\(โ„\)T\_\{\\Pi\}\(\\mathcal\{I\}\)is the set of the tight interpretations inWโ„W\_\{\\mathcal\{I\}\}that are minimal w\.r\.t\.Wโ„W\_\{\\mathcal\{I\}\}\. Moreover, for a set of interpretations๐ˆ\\mathcal\{\\mathbf\{I\}\}, defineTฮ โ€‹\(๐ˆ\)=\{Tฮ โ€‹\(I\)โˆฃโ„โˆˆโ„\}T\_\{\\Pi\}\(\\mathcal\{\\mathbf\{I\}\}\)=\\\{T\_\{\\Pi\}\(I\)\\mid\\mathcal\{I\}\\in\\mathcal\{\\mathbf\{\\mathcal\{I\}\}\}\\\}\.

###### Definition 4\(ฮณ\\gamma\-monotonic programs\)

A programฮ \\Piis called*ฮณ\\gamma\-monotonic*if, for each rulerโˆˆฮ r\\in\\Pithe component functionฮณpโ€‹\(t\)โ„“:\[ap,bp\]โ†’\[0,1\]\\gamma\_\{p\}\(t\)\_\{\\ell\}:\[a\_\{p\},b\_\{p\}\]\\to\[0,1\]relative to the predicateppand the linguistic labelโ„“\\ellthat appears inHโ€‹\(r\)H\(r\)is continuous and \(strictly\) increasing on\[ap,bp\]\[a\_\{p\},b\_\{p\}\]\.

It can be shown that theฮณ\\gamma\-monotonicity property of a programฮ \\Piguarantees the existence of a least model, which can be computed via Algorithm[1](https://arxiv.org/html/2607.03550#algorithm1)\. In contrast, non\-monotonic membership profiles may induce nondeterministic behavior, giving rise to multiple tight minimal models\.

Furthermore, as observed in other fuzzy logic\-based frameworksJanssenet al\.\([2012](https://arxiv.org/html/2607.03550#bib.bib37)\)even in the monotonic setting, the inference procedure may fail to terminate in a finite number of steps, due to a lack of convergence to the least model\. In the framework considered in this paper, however, this is not an issue because we restrict ourselves to a fragment that guarantees polynomial time evaluation \(for programs with stratified negation\)\.

## 4Case Study: Industrial Quality Control

In this section, we present a programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}for a case study arising from a collaboration with an industrial partner, aimed at analyzing images acquired from a screws production line\. The goal is threefold: \(i\) to detect the presence of damages, \(ii\) to assess their severity, and \(iii\) to determine the appropriate action for defective items\. As a benchmark, we rely on the well\-known MVTec datasetBergmannet al\.\([2021](https://arxiv.org/html/2607.03550#bib.bib42)\), which contains images of objects categorized as normal or defective, with various types of damages\.

The implemented system can be conceptually divided into two layers: the first, sub\-symbolic, is based on machine learning algorithms that provide the values for the membership functions of the input \(EDB\) predicates of the symbolic layer\. The latter, based on fuzzy reasoning, logically combines this information through the programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}, shown in Figures[3](https://arxiv.org/html/2607.03550#S4.F3),[4](https://arxiv.org/html/2607.03550#S4.F4), and[5](https://arxiv.org/html/2607.03550#S4.F5)\. to obtain the desired results according to the \(vague\) indications of domain experts\.

Note thatฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}has two modules: the first one, which defines the fuzzy predicates linked to the sub\-symbolic methods that process input images, identifies anomalous products and extracts relevant linguistic features describing the detected damages\. The second one consists of crisp rules that, based on the inferred qualitative descriptions, support decision\-making about the handling of defective items\. In fact, the proposed language allows us to seamlessly combine rules and predicates with fuzzy values with rules having crisp truth values, which behave exactly as in standard ASP programs\.

Each item is defined by a tuple\(X,I\)\(X,I\), where each instance ofXXis a unique identifier associated with an image tensorII\. The information is enriched by a neural\-generated anomaly heatmapHHlinked to the imageII\. The anomaly heatmapHHhighlights pixels corresponding to potential surface defects\. This is described by the two facts๐š˜๐š‹๐š“๐šŽ๐šŒ๐šโ€‹\(X,I\)\\mathtt\{object\}\(X,I\)and๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šขโ€‹\(I,H\)\\mathtt\{anomaly\}\(I,H\)\. Note that these facts are encoded by crisp predicates, indeed we omit linguistic labels in these predicates \(formally, we should use a dummy label, saytrue, with a binary membership function\)\.

The sub\-symbolic layer combines: \(i\) AE\-XADAngiulliet al\.\([2025](https://arxiv.org/html/2607.03550#bib.bib40)\), a recent explainable anomaly detection method based on autoencoders, and \(ii\) three instances of fuzzykk\-means clusteringNascimentoet al\.\([2000](https://arxiv.org/html/2607.03550#bib.bib41)\)\. The adoption of AE\-XAD is primarily motivated by its ability to produce interpretable anomaly heatmaps that highlight specific pixels corresponding to potential surface defects, providing localized and explainable visual evidence\. Furthermore, we rely on fuzzykk\-means to characterize each detected damage in terms of area dimension, shape eccentricity, color intensity, distance from the center of the image, and solidity\. The choice of a fuzzy clustering approach is crucial to manage the ambiguity of irregular shapes and physical defects\. Instead of forcing a rigid threshold, it provides graded truth degrees that naturally define the membership functions of the input EDB predicates \(area\_dimension,eccentricity,color\_intensity,distance, andsolidity\), preserving the vagueness of the domain\. The linguistic labels of these predicates are reported in the first block of Table[1](https://arxiv.org/html/2607.03550#S4.T1), and the corresponding membership functions are displayed in Figure[1](https://arxiv.org/html/2607.03550#S4.F1)\.

![Refer to caption](https://arxiv.org/html/2607.03550v1/area.png)

![Refer to caption](https://arxiv.org/html/2607.03550v1/eccentricity.png)

![Refer to caption](https://arxiv.org/html/2607.03550v1/intensity.png)

Figure 1:Membership functions of the predicatesarea\_dimension,eccentricity, andcolor\_intensity, obtained from sub\-simbolic components\.It is important to note that the raw truth degrees produced by sub\-symbolic components \(e\.g\., fuzzykk\-means\) may occasionally exhibit semantically unintuitive behaviors, such as assigning non\-zero degrees to bothsmallandlargewithout a clearly dominantmediumvalue, as observed for the predicatesarea\_dimension,eccentricity, andcolor\_intensityin the programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}\(see Figure[1](https://arxiv.org/html/2607.03550#S4.F1)\)\. Such phenomena are intrinsic to membership functions derived from machine learning systems\. However, as we show later, the symbolic fuzzy component of our framework is robust to these irregularities: by enforcing semantic constraints and leveraging well\-designed rules, it mitigates the imprecision of sub\-symbolic outputs, yielding more coherent, precise, and interpretable results\.

![Refer to caption](https://arxiv.org/html/2607.03550v1/discard.png)\(a\)Predicatesdiscardandrepair\.
![Refer to caption](https://arxiv.org/html/2607.03550v1/discount.png)\(b\)Predicatediscount\.
![Refer to caption](https://arxiv.org/html/2607.03550v1/severity.png)\(c\)Predicatesseverityanddefect\.

Figure 2:Membership functions for the predicatesdiscard,discount,repair, andseverity\. The predicatesdiscardandrepairare equipped with a simple fuzzy\-to\-crisp pattern, with a continuous label \(fuzzy\) and a corresponding Boolean label \(crisp\) obtained via a single cutoff\. The predicatediscountinstead adopts a multi\-threshold scheme, where three distinct step functions map the fuzzy degree to crisp decisions corresponding to different discount levels \(50% and 70%\)\. The predicatesseverityanddefectare entirely fuzzy \(no crisp labels\) withฮณ\\gamma\-monotonic truth profiles\.#### ฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}Rules\.

The symbolic layer ofฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}employs a set of rules to evaluate anomaly severity, classify defects, and determine the optimal handling strategy\. Initially, the framework assesses the overall severity of detected anomalies by evaluating their geometric and visual features, assigning, by means of the rules \([P1](https://arxiv.org/html/2607.03550#S4.Ex5)\) and \([P2](https://arxiv.org/html/2607.03550#S4.Ex6)\), high severity to anomalies with significant area, high eccentricity, or elevated color intensity, while classifying small, faint anomalies as low severity, through rule \([P3](https://arxiv.org/html/2607.03550#S4.Ex7)\)\. At the same level, the rules \([P4](https://arxiv.org/html/2607.03550#S4.Ex8)\), \([P5](https://arxiv.org/html/2607.03550#S4.Ex9)\), and \([3](https://arxiv.org/html/2607.03550#S4.Ex11)\) semantically distinguish between functional and aesthetic defects based on the physical traits of the screws\. Functional defects are typically characterized by low solidity or specific combinations of small size, low color intensity, and high distance from the center, whereas aesthetic damages are identified through high solidity, low distance, and medium color intensity\. In particular, note that the parts farthest from the center are precisely the head and the tip of the screw, whose possible absence in the image is clearly associated with defects that compromise the functionality of the screw under examination\.

Based on these inferred classifications and their corresponding truth degrees, the subsequent block of rules infers the appropriate handling actions\. Objects are flagged for discarding if they exhibit severe functional defects \(rules \([P7](https://arxiv.org/html/2607.03550#S4.Ex12)\) and \([P8](https://arxiv.org/html/2607.03550#S4.Ex13)\)\), or multiple critical aesthetic anomalies \(rule \([P9](https://arxiv.org/html/2607.03550#S4.Ex14)\)\)\. On the other hand, rule \([P10](https://arxiv.org/html/2607.03550#S4.Ex15)\) provides a recommendation for discounting of objects with high\-severity aesthetic damages\. Repair strategies, encoded in rules \([P11](https://arxiv.org/html/2607.03550#S4.Ex16)\) and \([P12](https://arxiv.org/html/2607.03550#S4.Ex17)\), are assigned based on the defect profile: internal repairs target minor aesthetic flaws lacking severe functional implications, while external repairs are reserved for minor functional defects requiring specialized processing\. That is, minor damages can be handled internally by the company, whereas more severe but still repairable damages must be delegated to specialized external companies\. Finally, items designated for external repair that do not meet the crisp discard criteria are automatically routed to an available repair company \(rule \([P13](https://arxiv.org/html/2607.03550#S4.Ex18)\)\) and the price of the items designated for discount is updated \(rules \([P14](https://arxiv.org/html/2607.03550#S4.Ex19)\), \([P15](https://arxiv.org/html/2607.03550#S4.Ex20)\), \([P16](https://arxiv.org/html/2607.03550#S4.Ex21)\)\)\.

We point out that these final rules behave precisely as in standard ASP, because all their body predicates use only binary \(crisp\) step membership functions, and thus will be either \(entirely\) true or \(entirely\) false in any interpretation of the program\. To see how this works, consider for instance the predicatediscard: the compatibilityฮณ\\gammaof membership functions \(see Figure[2](https://arxiv.org/html/2607.03550#S4.F2)\) implies that anyfuzzy\_levelvalue exceeding a certain threshold automatically sets the value11\(entirely true\) for the step membership function we have calledcrisp, which is then used in the subsequent rules \(e\.g\., rule \([P13](https://arxiv.org/html/2607.03550#S4.Ex18)\)\)\. The same happens for predicatesrepairanddiscount\.

Moreover, it is important to note that some rules ofฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}exhibit peculiar labels containing the symbolsโ‰ฅ\\geqandโ‰ค\\leq\. For example, in the rule \([P5](https://arxiv.org/html/2607.03550#S4.Ex9)\), the predicatecolor\_intensityis used with the labelโ‰คmโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m\\leq medium\. Intuitively, this expression extends the linguistic notion ofat least medium\. Formally, these labels are in fact additional membership functions that are usually obtained by combining other membership functions of the same predicate\. In the considered program, this combination is performed by means of the probabilistic sum operator, e\.g\.,p\(;โ‰ฅ๐‘š๐‘’๐‘‘๐‘–๐‘ข๐‘š\)=p\(;๐‘š๐‘’๐‘‘๐‘–๐‘ข๐‘š\)\+p\(;โ„Ž๐‘–๐‘”โ„Ž\)โˆ’p\(;๐‘š๐‘’๐‘‘๐‘–๐‘ข๐‘š\)โ‹…p\(;โ„Ž๐‘–๐‘”โ„Ž\)\\mathit\{p\}\(;\\geq\\mathit\{medium\}\)=\\mathit\{p\}\(;\\mathit\{medium\}\)\+\\mathit\{p\}\(;\\mathit\{high\}\)\-\\mathit\{p\}\(;\\mathit\{medium\}\)\\cdot\\mathit\{p\}\(;\\mathit\{high\}\)\.

Table 1:Corresponding set of labels for each predicate\.ฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}: Industrial Quality Control Program

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;hโ€‹iโ€‹gโ€‹h\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŠ๐š›๐šŽ๐šŠ\_๐š๐š’๐š–๐šŽ๐š—๐šœ๐š’๐š˜๐š—\(I,H;large\)โŠ™min๐šŽ๐šŒ๐šŒ๐šŽ๐š—๐š๐š›๐š’๐šŒ๐š’๐š๐šขโ€‹\(I,H;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\begin\{split\}\\mathtt\{severity\}\(X,H;high\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\odot\_\{\\min\}\\\\ &\\mathtt\{area\\\_dimension\}\(I,H;large\)\\odot\_\{\\min\}\\\\ &\\mathtt\{eccentricity\}\(I,H;high\)\\end\{split\}\(P1\)๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;hโ€‹iโ€‹gโ€‹h\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(I,H;โ‰ฅmedium\)โŠ™min๐šŽ๐šŒ๐šŒ๐šŽ๐š—๐š๐š›๐š’๐šŒ๐š’๐š๐šขโ€‹\(I,H;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\begin\{split\}\\mathtt\{severity\}\(X,H;high\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{color\\\_intensity\}\(I,H;\\geq medium\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{eccentricity\}\(I,H;high\)\\end\{split\}\(P2\)๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;lโ€‹oโ€‹w\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(I,H;โ‰คmedium\)โŠ™min๐šŠ๐š›๐šŽ๐šŠโ€‹\_โ€‹๐š๐š’๐š–๐šŽ๐š—๐šœ๐š’๐š˜๐š—โ€‹\(I,H;lโ€‹oโ€‹w\)\\displaystyle\\begin\{split\}\\mathtt\{severity\}\(X,H;low\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\ \\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{color\\\_intensity\}\(I,H;\\leq medium\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{area\\\_dimension\}\(I,H;low\)\\end\{split\}\(P3\)๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,fโ€‹uโ€‹nโ€‹cโ€‹tโ€‹iโ€‹oโ€‹nโ€‹aโ€‹l;hโ€‹iโ€‹gโ€‹h\)โ†๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŠ๐š›๐šŽ๐šŠ\_๐š๐š’๐š–๐šŽ๐š—๐šœ๐š’๐š˜๐š—\(I,H;small\)โŠ™min๐š๐š’๐šœ๐š๐šŠ๐š—๐šŒ๐šŽ\(I,H;high\)โŠ™min๐šŒ๐š˜๐š•๐š˜๐š›โ€‹\_โ€‹๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šขโ€‹\(I,H;lโ€‹oโ€‹w\)\\displaystyle\\begin\{split\}\\mathtt\{defect\}\(I,H,functional;high\)\\leftarrow&\\\>\\mathtt\{anomaly\}\(I,H\)\\odot\_\{\\min\}\\\\ &\\mathtt\{area\\\_dimension\}\(I,H;small\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{distance\}\(I,H;high\)\\odot\_\{\\min\}\\\\ &\\mathtt\{color\\\_intensity\}\(I,H;low\)\\end\{split\}\(P4\)๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,fโ€‹uโ€‹nโ€‹cโ€‹tโ€‹iโ€‹oโ€‹nโ€‹aโ€‹l;hโ€‹iโ€‹gโ€‹h\)โ†๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(I,H;โ‰คmedium\)โŠ™min๐šœ๐š˜๐š•๐š’๐š๐š’๐š๐šข\(I,H;low\)โŠ™min๐š๐š’๐šœ๐š๐šŠ๐š—๐šŒ๐šŽโ€‹\(I,H;mโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m\)\\displaystyle\\begin\{split\}\\mathtt\{defect\}\(I,H,functional;high\)\\leftarrow&\\\>\\mathtt\{anomaly\}\(I,H\)\\odot\_\{\\min\}\\\\ &\\mathtt\{color\\\_intensity\}\(I,H;\\leq medium\)\\odot\_\{\\min\}\\\\ &\\mathtt\{solidity\}\(I,H;low\)\\odot\_\{\\min\}\\\\ &\\mathtt\{distance\}\(I,H;medium\)\\end\{split\}\(P5\)๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,aโ€‹eโ€‹sโ€‹tโ€‹hโ€‹eโ€‹tโ€‹iโ€‹c;hโ€‹iโ€‹gโ€‹h\)โ†๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(I,H;medium\)โŠ™min๐šœ๐š˜๐š•๐š’๐š๐š’๐š๐šข\(I,H;high\)โŠ™min๐š๐š’๐šœ๐š๐šŠ๐š—๐šŒ๐šŽโ€‹\(I,H;lโ€‹oโ€‹w\)\\displaystyle\\begin\{split\}\\mathtt\{defect\}\(I,H,aesthetic;high\)\\leftarrow&\\\>\\mathtt\{anomaly\}\(I,H\)\\odot\_\{\\min\}\\\\ &\\mathtt\{color\\\_intensity\}\(I,H;medium\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{solidity\}\(I,H;high\)\\odot\_\{\\min\}\\\\ &\\mathtt\{distance\}\(I,H;low\)\\end\{split\}

Figure 3:The Fuzzy Datalog programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}\. Defect identification\.ฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}: Industrial Quality Control Program

๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H,functional;high\)โŠ™min๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;mโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m\)\\displaystyle\\begin\{split\}\\mathtt\{discard\}\(X;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H,functional;high\)\\odot\_\{\\min\}\\\\ &\\mathtt\{severity\}\(X,H;medium\)\\end\{split\}\(P7\)๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H,functional;medium\)โŠ™min๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\begin\{split\}\\mathtt\{discard\}\(X;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H,functional;medium\)\\odot\_\{\\min\}\\\\ &\\mathtt\{severity\}\(X,H;high\)\\end\{split\}\(P8\)๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H1\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H2\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H1,aesthetic;high\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H2,aesthetic;high\)โŠ™minH1โ‰ H2\\displaystyle\\begin\{split\}\\mathtt\{discard\}\(X;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\_\{1\}\)\\odot\_\{\\min\}\\\\ &\\mathtt\{anomaly\}\(I,H\_\{2\}\)\\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H\_\{1\},aesthetic;high\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H\_\{2\},aesthetic;high\)\\odot\_\{\\min\}\\\\ &H\_\{1\}\\neq H\_\{2\}\\end\{split\}\(P9\)๐š๐š’๐šœ๐šŒ๐š˜๐šž๐š—๐šโ€‹\(X;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H,aesthetic;high\)โŠ™min๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(X,H;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\begin\{split\}\\mathtt\{discount\}\(X;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H,aesthetic;high\)\\odot\_\{\\min\}\\\\ &\\mathtt\{severity\}\(X,H;high\)\\end\{split\}\(P10\)๐š›๐šŽ๐š™๐šŠ๐š’๐š›โ€‹\(X,sโ€‹eโ€‹lโ€‹f;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H,aesthetic;โ‰คmedium\)โŠ™minยฌล๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,fโ€‹uโ€‹nโ€‹cโ€‹tโ€‹iโ€‹oโ€‹nโ€‹aโ€‹l;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\begin\{split\}\\mathtt\{repair\}\(X,self;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H,aesthetic;\\leq medium\)\\ \\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{defect\}\(I,H,functional;high\)\\end\{split\}\(P11\)๐š›๐šŽ๐š™๐šŠ๐š’๐š›โ€‹\(X,eโ€‹xโ€‹tโ€‹eโ€‹rโ€‹nโ€‹aโ€‹l;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐šŠ๐š—๐š˜๐š–๐šŠ๐š•๐šข\(I,H\)โŠ™min๐š๐šŽ๐š๐šŽ๐šŒ๐š\(I,H,functional;low\)โŠ™minยฌล๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,aโ€‹eโ€‹sโ€‹tโ€‹hโ€‹eโ€‹tโ€‹iโ€‹c;lโ€‹oโ€‹w\)\\displaystyle\\begin\{split\}\\mathtt\{repair\}\(X,external;fuzzy\\\_level\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{anomaly\}\(I,H\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{defect\}\(I,H,functional;low\)\\ \\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{defect\}\(I,H,aesthetic;low\)\\end\{split\}\(P12\)

Figure 4:The Fuzzy Datalog programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}\. Fuzzy possible evaluation\.ฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}: Industrial Quality Control Program

๐šœ๐šŽ๐š—๐šโ€‹\(X,A\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐š›๐šŽ๐š™๐šŠ๐š’๐š›\(X,external;crisp\)โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;cโ€‹rโ€‹iโ€‹sโ€‹p\)โŠ™min๐šŠ๐šŸ๐šŠ๐š’๐š•๐šŠ๐š‹๐š•๐šŽโ€‹\_โ€‹๐šŒ๐š˜๐š–๐š™๐šŠ๐š—๐šขโ€‹\(A\)\\displaystyle\\begin\{split\}\\mathtt\{send\}\(X,A\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{repair\}\(X,external;crisp\)\\ \\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discard\}\(X;crisp\)\\odot\_\{\\min\}\\mathtt\{available\\\_company\}\(A\)\\end\{split\}\(P13\)๐šœ๐šŽ๐š•๐š•โ€‹\(X,P\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐š˜๐š›๐š’๐š๐š’๐š—๐šŠ๐š•\_๐š™๐š›๐š’๐šŒ๐šŽ\(X,P0\)โŠ™min๐š๐š’๐šœ๐šŒ๐š˜๐šž๐š—๐š\(X;disc50\)โŠ™minP=P0โˆ—0\.5โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;cโ€‹rโ€‹iโ€‹sโ€‹p\)\\displaystyle\\begin\{split\}\\mathtt\{sell\}\(X,P\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{original\\\_price\}\(X,P\_\{0\}\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{discount\}\(X;disc50\)\\ \\odot\_\{\\min\}P=P\_\{0\}\*0\.5\\ \\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discard\}\(X;crisp\)\\end\{split\}\(P14\)๐šœ๐šŽ๐š•๐š•โ€‹\(X,P\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐š˜๐š›๐š’๐š๐š’๐š—๐šŠ๐š•\_๐š™๐š›๐š’๐šŒ๐šŽ\(X,P0\)โŠ™min๐š๐š’๐šœ๐šŒ๐š˜๐šž๐š—๐š\(X;disc70\)โŠ™minP=P0โˆ—0\.7โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X;cโ€‹rโ€‹iโ€‹sโ€‹p\)\\displaystyle\\begin\{split\}\\mathtt\{sell\}\(X,P\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{original\\\_price\}\(X,P\_\{0\}\)\\ \\odot\_\{\\min\}\\\\ &\\mathtt\{discount\}\(X;disc70\)\\ \\odot\_\{\\min\}P=P\_\{0\}\*0\.7\\ \\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discard\}\(X;crisp\)\\end\{split\}\(P15\)๐šœ๐šŽ๐š•๐š•โ€‹\(X,P\)โ†๐š˜๐š‹๐š“๐šŽ๐šŒ๐š\(X,I\)โŠ™min๐š˜๐š›๐š’๐š๐š’๐š—๐šŠ๐š•\_๐š™๐š›๐š’๐šŒ๐šŽ\(X,P\)โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐š\(X;crisp\)โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐š˜๐šž๐š—๐š\(X;disc50\)โŠ™minยฌล๐š๐š’๐šœ๐šŒ๐š˜๐šž๐š—๐šโ€‹\(X;dโ€‹iโ€‹sโ€‹cโ€‹70\)\\displaystyle\\begin\{split\}\\mathtt\{sell\}\(X,P\)\\leftarrow&\\\>\\mathtt\{object\}\(X,I\)\\odot\_\{\\min\}\\mathtt\{original\\\_price\}\(X,P\)\\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discard\}\(X;crisp\)\\odot\_\{\\min\}\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discount\}\(X;disc50\)\\odot\_\{\\min\}\\\\ &\\neg\_\{\\scriptscriptstyle\\textit\{\\L \{\}\}\}\\mathtt\{discount\}\(X;disc70\)\\end\{split\}\(P16\)

Figure 5:The Fuzzy Datalog programฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}\. Crisp decision\.
### 4\.1Examples of Evaluation

In this section, we present the derivation for two specific instances \(displayed in Figure[6](https://arxiv.org/html/2607.03550#S4.F6)\)\. In this application we explicitly evaluate the t\-norm and s\-norm using themโ€‹iโ€‹nminandmโ€‹aโ€‹xmaxoperators respectively, for every clause in the extendedฮ cโ€‹oโ€‹nโ€‹tโ€‹rโ€‹oโ€‹l\\Pi\_\{control\}program\. Themโ€‹iโ€‹nminoperator ensures that when aggregating multiple conditions in a rule body \(e\.g\., determining if a defect is highly severe\), the resulting truth degree is strictly bounded by the weakest piece of evidence\. Conversely, themโ€‹aโ€‹xmaxoperator \(s\-norm\) guarantees that when multiple, independent rules derive the same concept for an item, the strongest available evidence dictates the final classification\. This prevents severe defects from being smoothed out or averaged down by less critical features\.

In real\-world scenarios, the transition between qualitative conceptsโ€”such as moving from a\(at least\) mediumto a\(at least\) highseverityโ€”is rarely abrupt\. We adopt a*smooth approach*, as shown in Figure[2\(c\)](https://arxiv.org/html/2607.03550#S4.F2.sf3), which provides continuous transitions for such notions\.

We define our admissible monotonic truth profilesฮณ\\gammaby mapping each ordered labelโ„“i\\ell\_\{i\}to a shifted logistic sigmoid\(Huybrechs and Trefethen,[2024](https://arxiv.org/html/2607.03550#bib.bib32)\):

fโ€‹\(t;k,ci\)=ฯƒโ€‹\(kโ€‹\(tโˆ’ci\)\)=11\+eโˆ’kโ€‹\(tโˆ’ci\)f\(t;k,c\_\{i\}\)=\\sigma\\big\(k\(t\-c\_\{i\}\)\\big\)=\\frac\{1\}\{1\+e^\{\-k\(t\-c\_\{i\}\)\}\}wherek\>0k\>0governs the steepness andciโˆˆ\(0,1\)c\_\{i\}\\in\(0,1\)determines the threshold center\. We fixk=20k=20, allowing the closed\-form inverse derivation of the parameter valuet=ci\+120โ€‹lnโก\(y1โˆ’y\)t=c\_\{i\}\+\\frac\{1\}\{20\}\\ln\\left\(\\frac\{y\}\{1\-y\}\\right\)\.

For a predicate likeseveritywith three ordinal labels \(๐‘™๐‘œ๐‘ค\\mathit\{low\},๐‘š๐‘’๐‘‘๐‘–๐‘ข๐‘š\\mathit\{medium\},โ„Ž๐‘–๐‘”โ„Ž\\mathit\{high\}\), the profile maps a curve to each threshold using monotonically increasing centersc1=0\.20c\_\{1\}=0\.20,c2=0\.50c\_\{2\}=0\.50, andc3=0\.80c\_\{3\}=0\.80:

ฮณ๐‘ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘–๐‘ก๐‘ฆโ€‹\(t\)=\(fโ€‹\(t;20,0\.20\),fโ€‹\(t;20,0\.50\),fโ€‹\(t;20,0\.80\)\)\\gamma\_\{\\mathit\{severity\}\}\(t\)=\\big\(f\(t;20,0\.20\),\\;f\(t;20,0\.50\),\\;f\(t;20,0\.80\)\\big\)
The final decision stage of the pipeline is modeled through the predicatesdiscard,discount, andrepair\.

As explained above, these predicates are equipped with linguistic labels that enable a transition from fuzzy evaluations to crisp behaviors by means of their associated membership functions depicted in Figure[2](https://arxiv.org/html/2607.03550#S4.F2)\. In more detail, the predicatesdiscardandrepairare defined with two labels,fuzzy\_levelandcrisp: the former is associated with a continuous increasing membership function \(in our case, linear in\[0,1\]\[0,1\]\), while the latter is defined via a step function with a cutoff, fixed in this example at0\.50\.5\. This means that a fuzzy degree assigned todiscard\(X;fuzzy\_level\)\(X;\\textit\{fuzzy\\\_level\}\)\(respectivelyrepair\(X;fuzzy\_level\)\(X;\\textit\{fuzzy\\\_level\}\)\) is turned into a crisp value fordiscard\(X;crisp\)\(X;\\textit\{crisp\}\)\(respectivelyrepair\(X;crisp\)\(X;\\textit\{crisp\}\)\), which is11if the degree is at least0\.50\.5, and0otherwise\.

The predicatediscountfollows a similar approach, but it is associated with two crisp labels corresponding to different discount levels, namelydisc50anddisc70\. Each of these labels is defined by a step membership function with thresholds set to0\.40\.4and0\.70\.7, respectively\. As a result, the fuzzy degree computed fordiscount\(X;fuzzy\_level\)\(X;\\textit\{fuzzy\\\_level\}\)is mapped, via theฮณ\\gamma\-propagation mechanism, to either crisp discount decision depending on which thresholds are exceeded\.

Note that the threshold values associated with the fuzzy\-to\-crisp predicates are meant to capture a specific decision policy and are application\-dependent design parameters\. Future work will investigate data\-driven approaches for automatically learning these thresholds, in addition to the shape and parameters of the underlying membership functions\.

![Refer to caption](https://arxiv.org/html/2607.03550v1/57.png)\(a\)Manipulated Front Anomaly\.
![Refer to caption](https://arxiv.org/html/2607.03550v1/97.png)\(b\)Two Scratch Anomalies\.

Figure 6:Two input examples with corresponding AE\-XAD anomaly explanations\.#### Instance 1: Manipulated Front Anomaly\.

LetX1X\_\{1\}be the item featuring a single manipulated front anomalyHH\(as seen in Figure[6\(a\)](https://arxiv.org/html/2607.03550#S4.F6.sf1)\)\. In this scenario, the geometric evaluation maps the defect to a functional anomaly\.

We focus the explicit derivation on theseveritypredicate to showcase the continuous latent inference\. First, we compute the required compound labels via probabilistic sum \(aโŠ•b=a\+bโˆ’aโ‹…ba\\oplus b=a\+b\-a\\cdot b\):

๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(X1,H;โ‰คmedium\)\\displaystyle\\mathtt\{color\\\_intensity\}\(X\_\{1\},H;\\leq medium\)=0\.998โŠ•0\.002=0\.998\\displaystyle=0\.998\\oplus 0\.002=0\.998๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(X1,H;โ‰ฅmedium\)\\displaystyle\\mathtt\{color\\\_intensity\}\(X\_\{1\},H;\\geq medium\)=0\.002โŠ•0\.000=0\.002\\displaystyle=0\.002\\oplus 0\.000=0\.002Next, we evaluate the lower bounds dictated by rules \([P1](https://arxiv.org/html/2607.03550#S4.Ex5)โ€“[P2](https://arxiv.org/html/2607.03550#S4.Ex6)\) using themin\\mint\-norm over the geometric memberships:

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(H;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\mathtt\{severity\}\(H;high\)โ†maxโก\(minโก\(0\.020,0\.074\),minโก\(0\.002,0\.074\)\)=0\.020โ€‹\([P1](https://arxiv.org/html/2607.03550#S4.Ex5),[P2](https://arxiv.org/html/2607.03550#S4.Ex6)\)\\displaystyle\\leftarrow\\max\\big\(\\min\(0\.020,0\.074\),\\min\(0\.002,0\.074\)\\big\)=0\.020\\qquad\\text\{\(\\ref\{rule:sev1\}, \\ref\{rule:sev2\}\)\}๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(H;lโ€‹oโ€‹w\)\\displaystyle\\mathtt\{severity\}\(H;low\)โ†minโก\(0\.998,0\.909\)=0\.909โ€‹\([P3](https://arxiv.org/html/2607.03550#S4.Ex7)\)\\displaystyle\\leftarrow\\min\(0\.998,0\.909\)=0\.909\\qquad\\text\{\(\\ref\{rule:sev3\}\)\}With the constraintsโ„Ž๐‘–๐‘”โ„Žโ‰ฅ0\.020\\mathit\{high\}\\geq 0\.020and๐‘™๐‘œ๐‘คโ‰ฅ0\.909\\mathit\{low\}\\geq 0\.909, we map the evaluations to the latent statettusing the inverse sigmoid\. The constraint onโ„Ž๐‘–๐‘”โ„Ž\\mathit\{high\}\(c3=0\.80c\_\{3\}=0\.80\) imposestโ‰ฅ0\.80\+0\.05โ€‹lnโก\(0\.020/0\.980\)=0\.605t\\geq 0\.80\+0\.05\\ln\(0\.020/0\.980\)=0\.605\. This is strictly greater than the requirement for๐‘™๐‘œ๐‘ค\\mathit\{low\}\(tโ‰ฅ0\.315t\\geq 0\.315\)\. Thus, substituting the strictest boundt=0\.605t=0\.605back into theฮณ๐‘ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘–๐‘ก๐‘ฆ\\gamma\_\{\\mathit\{severity\}\}profile provides the fully coherent semantic state

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(H;โ‹…\)โ€‹with labelsโ€‹\{lโ€‹oโ€‹w=0\.999,mโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m=0\.892,hโ€‹iโ€‹gโ€‹h=0\.020\}\.\\mathtt\{severity\}\(H;\\cdot\)\\mbox\{ with labels \}\\\{low=0\.999,\\;medium=0\.892,\\;high=0\.020\\\}\.
The framework successfully infers a strong๐‘š๐‘’๐‘‘๐‘–๐‘ข๐‘š\\mathit\{medium\}severity \(interpreted as โ€œat least mediumโ€ because these monotonic function encode a cumulative behavior\), despite the absence of an explicit rule, naturally bridging the gap between the๐‘™๐‘œ๐‘ค\\mathit\{low\}andโ„Ž๐‘–๐‘”โ„Ž\\mathit\{high\}evaluations\.

Processing the morphological variables through rules \([P4](https://arxiv.org/html/2607.03550#S4.Ex8)โ€“[P5](https://arxiv.org/html/2607.03550#S4.Ex9)\) yields a confident classification for a functional defect \(๐š๐šŽ๐š๐šŽ๐šŒ๐šโ€‹\(I,H,fโ€‹uโ€‹nโ€‹cโ€‹tโ€‹iโ€‹oโ€‹nโ€‹aโ€‹l;hโ€‹iโ€‹gโ€‹h\)=0\.909\\mathtt\{defect\}\(I,H,functional;high\)=0\.909\), primarily driven by the anomalyโ€™s localized area and its position at the objectโ€™s boundaries\.

๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐š\(X1;fuzzy\_level\)\)โ†min\(0\.909,0\.892\)=0\.892\\mathtt\{discard\}\(X\_\{1\};fuzzy\\\_level\)\)\\leftarrow\\min\(0\.909,0\.892\)=0\.892Because of the threshold profileฮณ๐‘‘๐‘–๐‘ ๐‘๐‘Ž๐‘Ÿ๐‘‘\\gamma\_\{\\mathit\{discard\}\}\(with cutoff0\.50\.5\), we get a definitive crisp action:discardโ€‹\(X1;๐‘๐‘Ÿ๐‘–๐‘ ๐‘\)=1\\mathrm\{discard\}\(X\_\{1\};\\mathit\{crisp\}\)=1\.

#### Instance 2: Two Scratch Anomalies \(Image[6\(b\)](https://arxiv.org/html/2607.03550#S4.F6.sf2)\)\.

LetX2X\_\{2\}be an item presenting two candidate anomaly regions identified by the sub\-symbolic layer, denoted asHAH\_\{A\}\(Component 1\) andHBH\_\{B\}\(Component 2\) \(Figure[6\(b\)](https://arxiv.org/html/2607.03550#S4.F6.sf2)\)\. We evaluate the severity profiles independently for both components\. ForHAH\_\{A\}, we compute the aggregated bounds via probabilistic sum \(๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(X2,HA;โ‰คmedium\)=0\.043โŠ•0\.953=0\.955\\mathtt\{color\\\_intensity\}\(X\_\{2\},H\_\{A\};\\leq medium\)=0\.043\\oplus 0\.953=0\.955\) and apply rules \([P1](https://arxiv.org/html/2607.03550#S4.Ex5)โ€“[P3](https://arxiv.org/html/2607.03550#S4.Ex7)\):

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HA;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\mathtt\{severity\}\(H\_\{A\};high\)โ†maxโก\(minโก\(0\.037,0\),minโก\(0\.953,0\)\)=0\.000\\displaystyle\\leftarrow\\max\\big\(\\min\(0\.037,0\),\\min\(0\.953,0\)\\big\)=0\.000๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HA;lโ€‹oโ€‹w\)\\displaystyle\\mathtt\{severity\}\(H\_\{A\};low\)โ†minโก\(0\.955,0\.264\)=0\.264\\displaystyle\\leftarrow\\min\(0\.955,0\.264\)=0\.264With boundshโ€‹iโ€‹gโ€‹hโ‰ฅ0high\\geq 0andlโ€‹oโ€‹wโ‰ฅ0\.264low\\geq 0\.264, the strictest latent state ist=0\.148t=0\.148\. Substituting this intoฮณ๐‘ ๐‘’๐‘ฃ๐‘’๐‘Ÿ๐‘–๐‘ก๐‘ฆ\\gamma\_\{\\mathit\{severity\}\}yields the following profile for the first component๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HA,โ‹…\)\\mathtt\{severity\}\(H\_\{A\},\\cdot\):\{lโ€‹oโ€‹w=0\.261,mโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m=0\.001,hโ€‹iโ€‹gโ€‹h=0\.000\}\\\{low=0\.261,\\;medium=0\.001,\\;high=0\.000\\\}\. Conversely, for the regionHBH\_\{B\}, the probabilistic sum yields๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(X2,HB;โ‰คmedium\)=0\.056โŠ•0\.938=0\.941\\mathtt\{color\\\_intensity\}\(X\_\{2\},H\_\{B\};\\leq medium\)=0\.056\\oplus 0\.938=0\.941and๐šŒ๐š˜๐š•๐š˜๐š›\_๐š’๐š—๐š๐šŽ๐š—๐šœ๐š’๐š๐šข\(X2,HB;โ‰ฅmedium\)=0\.938\\mathtt\{color\\\_intensity\}\(X\_\{2\},H\_\{B\};\\geq medium\)=0\.938\. Then,

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HB;hโ€‹iโ€‹gโ€‹h\)\\displaystyle\\mathtt\{severity\}\(H\_\{B\};high\)โ†maxโก\(minโก\(0\.038,0\.026\),minโก\(0\.938,0\.026\)\)=0\.026\\displaystyle\\leftarrow\\max\\big\(\\min\(0\.038,0\.026\),\\min\(0\.938,0\.026\)\\big\)=0\.026๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HB;lโ€‹oโ€‹w\)\\displaystyle\\mathtt\{severity\}\(H\_\{B\};low\)โ†minโก\(0\.941,0\.272\)=0\.272\\displaystyle\\leftarrow\\min\(0\.941,0\.272\)=0\.272Here, the constraint onhโ€‹iโ€‹gโ€‹hhighgoverns the latent inference, forcingtโ‰ฅ0\.80\+0\.05โ€‹lnโก\(0\.026/0\.974\)=0\.619t\\geq 0\.80\+0\.05\\ln\(0\.026/0\.974\)=0\.619\. The semantic state naturally bridges the evaluations:

๐šœ๐šŽ๐šŸ๐šŽ๐š›๐š’๐š๐šขโ€‹\(HB,โ‹…\)โ€‹with labelsโ€‹\{lโ€‹oโ€‹w=0\.999,mโ€‹eโ€‹dโ€‹iโ€‹uโ€‹m=0\.915,hโ€‹iโ€‹gโ€‹h=0\.026\}\.\\mathtt\{severity\}\(H\_\{B\},\\cdot\)\\mbox\{ with labels \}\\\{low=0\.999,\\;medium=0\.915,\\;high=0\.026\\\}\.
Aggregating the truth degrees across the previous rule set, and applying step\-function profileฮณ๐‘‘๐‘–๐‘ ๐‘๐‘Ž๐‘Ÿ๐‘‘\\gamma\_\{\\mathit\{discard\}\}yields๐š๐š’๐šœ๐šŒ๐šŠ๐š›๐šโ€‹\(X2;cโ€‹rโ€‹iโ€‹sโ€‹p\)=0\\mathtt\{discard\}\(X\_\{2\};crisp\)=0\. The framework safely avoids a false\-positive discard\.

Instead, the presence of a verified single aesthetic anomaly \(HBH\_\{B\}\) with a safely bounded severity enables the self\-repair policy\. Given the latent state ofHBH\_\{B\}, the cumulative label๐š๐šŽ๐š๐šŽ๐šŒ๐š\(HB,aesthetical;โ‰คmedium\)\\mathtt\{defect\}\(H\_\{B\},aesthetical;\\leq medium\)evaluates to1\.0001\.000\. Coupled with the ลukasiewicz negation of functional damages \(1โˆ’0\.023=0\.9771\-0\.023=0\.977\), we obtain:

๐š›๐šŽ๐š™๐šŠ๐š’๐š›โ€‹\(X2,sโ€‹eโ€‹lโ€‹f;fโ€‹uโ€‹zโ€‹zโ€‹yโ€‹\_โ€‹lโ€‹eโ€‹vโ€‹eโ€‹l\)โ†minโก\(1\.000,0\.977\)=0\.977\\mathtt\{repair\}\(X\_\{2\},self;fuzzy\\\_level\)\\leftarrow\\min\(1\.000,0\.977\)=0\.977Throughฮณ๐‘Ÿ๐‘’๐‘๐‘Ž๐‘–๐‘Ÿ\\gamma\_\{\\mathit\{repair\}\}, this yields๐š›๐šŽ๐š™๐šŠ๐š’๐š›โ€‹\(X2,sโ€‹eโ€‹lโ€‹f;cโ€‹rโ€‹iโ€‹sโ€‹p\)=1\\mathtt\{repair\}\(X\_\{2\},self;crisp\)=1\.

The neuro\-symbolic pipeline leverages declarative geometric semantics to route each item to the most appropriate and cost\-effective recovery procedure\. The examples are handled correctly: the first is discarded by the system due to a recognized functional defect, while the second is self\-repaired, as expected for scratch anomalies\.

The choice of t\-norm and s\-norm, however, strongly affects the final outcome\. As an example, in Instance 1, the product or the ลukasiewicz t\-norm would prevent the expected discard decision despite a clearly defective screw, as both degrade the truth of a conjunction as its conditions grow, unlikemin\. Analogously,maxretains only the strongest supporting rule, whereas additive s\-norms may turn several weak signals into a strong conclusion, which is undesirable in this quality control scenario\.

The propagation by means of theฮณ\\gammafunction highlights a fundamental theoretical advantage of our framework: the shift from continuous fuzzy reasoning to crisp operational decisions comes easily\. Instead of relying on external procedural scripts, ad\-hoc defuzzification algorithms, or hardcoded post\-processing rules, the binarization may be handled entirely within the logical semantics\. Ambiguous neural outputs are gracefully absorbed by the continuous logic, naturally ending into deterministic boolean actions without ever breaking the end\-to\-end logical pipeline\.

## 5Conclusion

In this paper, we presented a case study of recently introduced qualitative fuzzy extension of Answer Set Programming, where predicates are equipped with finite linguistic labels and membership functions\. The prototype leverages the structure of this language to combine a machine learning\-based component with a set of symbolic rules to detect and localize damages in images obtained from a production line of screws, and to provide decision\-making pattern for damaged items\. The illustrated examples reveal the capacity of our language to incorporate the extremely effective, although potentially noisy, predictions of machine learning models with the rigor of symbolic reasoning into a formal, declarative pipeline\. The association of data\-driven membership functions with linguistic labels allows domain experts to encode their knowledge naturally, capturing the inherent vagueness of qualitative concepts without sacrificing logical power\.

## References

- \[1\]ร\. Achs and A\. Kiss\(1995\)Fuzzy extension of datalog\.Acta Cybern\.12\(2\),pp\. 153โ€“166\.External Links:[Link](https://cyber.bibl.u-szeged.hu/index.php/actcybern/article/view/3454)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p1.1)\.
- \[2\]M\. Alviano and R\. Peรฑaloza\(2013\)Fuzzy answer sets approximations\.Theory Pract\. Log\. Program\.13\(4\-5\),pp\. 753โ€“767\.External Links:[Link](https://doi.org/10.1017/S1471068413000471),[Document](https://dx.doi.org/10.1017/S1471068413000471)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[3\]F\. Angiulli, F\. Fassetti, L\. Ferragina, and S\. Nisticรฒ\(2025\)Explaining anomalies through semi\-supervised autoencoders\.Array28,pp\. 100537\.External Links:[Link](https://doi.org/10.1016/j.array.2025.100537),[Document](https://dx.doi.org/10.1016/J.ARRAY.2025.100537)Cited by:[ยง4](https://arxiv.org/html/2607.03550#S4.p5.2)\.
- \[4\]S\. Badreddine, A\. S\. dโ€™Avila Garcez, L\. Serafini, and M\. Spranger\(2022\)Logic tensor networks\.Artif\. Intell\.303,pp\. 103649\.External Links:[Link](https://doi.org/10.1016/j.artint.2021.103649),[Document](https://dx.doi.org/10.1016/J.ARTINT.2021.103649)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[5\]P\. Bergmann, K\. Batzner, M\. Fauser, D\. Sattlegger, and C\. Steger\(2021\)The mvtec anomaly detection dataset: a comprehensive real\-world dataset for unsupervised anomaly detection\.International Journal of Computer Vision129\(4\),pp\. 1038โ€“1059\.Cited by:[ยง4](https://arxiv.org/html/2607.03550#S4.p1.1)\.
- \[6\]M\. Blondeel, S\. Schockaert, D\. Vermeir, and M\. De Cock\(2013\)Fuzzy answer set programming: an introduction\.InSoft Computing: State of the Art Theory and Novel Applications,R\. R\. Yager, A\. M\. Abbasov, M\. Z\. Reformat, and S\. N\. Shahbazova \(Eds\.\),Studies in Fuzziness and Soft Computing, Vol\.291,pp\. 209โ€“222\.External Links:[Link](https://doi.org/10.1007/978-3-642-34922-5%5C_15),[Document](https://dx.doi.org/10.1007/978-3-642-34922-5%5F15)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[7\]F\. Bobillo and U\. Straccia\(2008\)FuzzyDL: an expressive fuzzy description logic reasoner\.In2008 IEEE International Conference on Fuzzy Systems \(IEEE World Congress on Computational Intelligence\),pp\. 923โ€“930\.Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[8\]M\. E\. Cornejo, D\. Lobo, and J\. Medina\(2018\)Syntax and semantics of multi\-adjoint normal logic programming\.Fuzzy Sets Syst\.345,pp\. 41โ€“62\.External Links:[Link](https://doi.org/10.1016/j.fss.2017.12.009),[Document](https://dx.doi.org/10.1016/J.FSS.2017.12.009)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p2.1)\.
- \[9\]M\. E\. Cornejo, D\. Lobo, and J\. Medina\(2020\)Extended multi\-adjoint logic programming\.Fuzzy Sets Syst\.388,pp\. 124โ€“145\.External Links:[Link](https://doi.org/10.1016/j.fss.2019.03.016),[Document](https://dx.doi.org/10.1016/J.FSS.2019.03.016)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p2.1)\.
- \[10\]R\. Ebrahim\(2001\)Fuzzy logic programming\.Fuzzy Sets Syst\.117\(2\),pp\. 215โ€“230\.External Links:[Link](https://doi.org/10.1016/S0165-0114(98)00300-5),[Document](https://dx.doi.org/10.1016/S0165-0114%2898%2900300-5)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p1.1)\.
- \[11\]D\. Huybrechs and L\. N\. Trefethen\(2024\)Sigmoid functions, multiscale resolution of singularities, and hp\-mesh refinement\.Siam Review66\(4\),pp\. 683โ€“693\.Cited by:[ยง4\.1](https://arxiv.org/html/2607.03550#S4.SS1.p3.2)\.
- \[12\]J\. Janssen, S\. Schockaert, D\. Vermeir, and M\. De Cock\(2009\)General fuzzy answer set programs\.InInternational Workshop on Fuzzy Logic and Applications,pp\. 352โ€“359\.Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[13\]J\. Janssen, S\. Schockaert, D\. Vermeir, and M\. De Cock\(2012\)A core language for fuzzy answer set programming\.Int\. J\. Approx\. Reason\.53\(4\),pp\. 660โ€“692\.External Links:[Link](https://doi.org/10.1016/j.ijar.2012.01.005),[Document](https://dx.doi.org/10.1016/J.IJAR.2012.01.005)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1),[ยง3\.2](https://arxiv.org/html/2607.03550#S3.SS2.SSS0.Px2.p9.1)\.
- \[14\]M\. Lanzinger, S\. Sferrazza, P\. A\. Walega, and G\. Gottlob\(2024\)Fuzzy datalogโˆƒ\\existsover arbitrary t\-norms\.InLPAR 2024: Proceedings of 25th Conference on Logic for Programming, Artificial Intelligence and Reasoning, Port Louis, Mauritius, May 26\-31, 2024,N\. S\. Bjรธrner, M\. Heule, and A\. Voronkov \(Eds\.\),EPiC Series in Computing, Vol\.100,pp\. 426โ€“444\.External Links:[Link](https://doi.org/10.29007/cngw),[Document](https://dx.doi.org/10.29007/CNGW)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[15\]V\. H\. Le, F\. Liu, and D\. K\. Tran\(2009\)Fuzzy linguistic logic programming and its applications\.Theory Pract\. Log\. Program\.9\(3\),pp\. 309โ€“341\.External Links:[Link](https://doi.org/10.1017/S1471068409003779),[Document](https://dx.doi.org/10.1017/S1471068409003779)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[16\]Y\. Loyer and U\. Straccia\(2003\)The approximate well\-founded semantics for logic programs with uncertainty\.InMathematical Foundations of Computer Science 2003, 28th International Symposium, MFCS 2003, Bratislava, Slovakia, August 25\-29, 2003, Proceedings,B\. Rovan and P\. Vojtรกs \(Eds\.\),Lecture Notes in Computer Science,pp\. 541โ€“550\.External Links:[Link](https://doi.org/10.1007/978-3-540-45138-9%5C_48),[Document](https://dx.doi.org/10.1007/978-3-540-45138-9%5F48)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p2.1)\.
- \[17\]Y\. Loyer and U\. Straccia\(2009\)Approximate well\-founded semantics, query answering and generalized normal logic programs over lattices\.Ann\. Math\. Artif\. Intell\.55\(3\-4\),pp\. 389โ€“417\.External Links:[Link](https://doi.org/10.1007/s10472-008-9099-0),[Document](https://dx.doi.org/10.1007/S10472-008-9099-0)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p2.1)\.
- \[18\]T\. Lukasiewicz and U\. Straccia\(2008\)Managing uncertainty and vagueness in description logics for the semantic web\.Journal of Web Semantics6\(4\),pp\. 291โ€“308\.Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[19\]R\. Manhaeve, S\. Dumancic, A\. Kimmig, T\. Demeester, and L\. D\. Raedt\(2021\)Neural probabilistic logic programming in DeepProbLog\.Artificial Intelligence298,pp\. 103504\.External Links:[Link](https://doi.org/10.1016/j.artint.2021.103504),[Document](https://dx.doi.org/10.1016/J.ARTINT.2021.103504)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[20\]S\. Medasani, J\. Kim, and R\. Krishnapuram\(1998\)An overview of membership function generation techniques for pattern recognition\.Int\. J\. Approx\. Reason\.19\(3\-4\),pp\. 391โ€“417\.External Links:[Link](https://doi.org/10.1016/S0888-613X(98)10017-8),[Document](https://dx.doi.org/10.1016/S0888-613X%2898%2910017-8)Cited by:[ยง3\.1](https://arxiv.org/html/2607.03550#S3.SS1.SSS0.Px1.p1.11)\.
- \[21\]J\. Medina, M\. Ojeda\-Aciego, and P\. Vojtรกลก\(2001\)A procedural semantics for multi\-adjoint logic programming\.InPortuguese Conference on Artificial Intelligence,pp\. 290โ€“297\.Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p1.1)\.
- \[22\]S\. Nascimento, B\. Mirkin, and F\. Moura\-Pires\(2000\)A fuzzy clustering model of data and fuzzy c\-means\.InNinth IEEE International Conference on Fuzzy Systems\. FUZZ\-IEEE 2000 \(Cat\. No\. 00CH37063\),Vol\.1,pp\. 302โ€“307\.Cited by:[ยง4](https://arxiv.org/html/2607.03550#S4.p5.2)\.
- \[23\]A\. Skryagin, W\. Stammer, D\. Ochs, D\. S\. Dhami, and K\. Kersting\(2022\)Neural\-probabilistic answer set programming\.InProceedings of the 19th International Conference on Principles of Knowledge Representation and Reasoning, KR 2022, Haifa, Israel, July 31 \- August 5, 2022,G\. Kern\-Isberner, G\. Lakemeyer, and T\. Meyer \(Eds\.\),External Links:[Link](https://proceedings.kr.org/2022/48/)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[24\]U\. Straccia\(2001\)Reasoning within fuzzy description logics\.Journal of artificial intelligence research14,pp\. 137โ€“166\.Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[25\]M\. H\. van Emden\(1986\)Quantitative deduction and its fixpoint theory\.J\. Log\. Program\.3\(1\),pp\. 37โ€“53\.External Links:[Link](https://doi.org/10.1016/0743-1066(86)90003-8),[Document](https://dx.doi.org/10.1016/0743-1066%2886%2990003-8)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p1.1)\.
- \[26\]D\. Van Nieuwenborgh, M\. De Cock, and D\. Vermeir\(2006\)Fuzzy answer set programming\.InLogics in Artificial Intelligence, 10th European Conference, JELIA,M\. Fisher, W\. van der Hoek, B\. Konev, and A\. Lisitsa \(Eds\.\),Lecture Notes in Computer Science, Vol\.4160,pp\. 359โ€“372\.External Links:[Link](https://doi.org/10.1007/11853886%5C_30),[Document](https://dx.doi.org/10.1007/11853886%5F30)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.
- \[27\]P\. Vojtรกs\(2001\)Fuzzy logic programming\.Fuzzy Sets Syst\.124\(3\),pp\. 361โ€“370\.External Links:[Link](https://doi.org/10.1016/S0165-0114(01)00106-3),[Document](https://dx.doi.org/10.1016/S0165-0114%2801%2900106-3)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p1.1)\.
- \[28\]Z\. Yang, A\. Ishay, and J\. Lee\(2020\)NeurASP: embracing neural networks into answer set programming\.InProceedings of the Twenty\-Ninth International Joint Conference on Artificial Intelligence, IJCAI 2020,C\. Bessiere \(Ed\.\),pp\. 1755โ€“1762\.External Links:[Link](https://doi.org/10.24963/ijcai.2020/243),[Document](https://dx.doi.org/10.24963/IJCAI.2020/243)Cited by:[ยง2](https://arxiv.org/html/2607.03550#S2.p3.1)\.

Similar Articles

Program-as-Weights: A Programming Paradigm for Fuzzy Functions

Hugging Face Daily Papers

Program-as-Weights (PAW) introduces a programming paradigm where a 4B compiler translates natural-language specifications into compact neural artifacts executable by a 0.6B interpreter, achieving performance comparable to 32B models with drastically lower memory and inference cost.