Towards a Notion of Basis for Knowledge-Based Systems—Applications

: In the paradigm of Knowledge-Based Systems (KBS), the design of methods to simplify the reasoning leads to more efﬁcient processes. A point of view that provides valuable insights is the algebraic one. In this work, a notion of basis (and dimension) for Knowledge Bases in Propositional Logic associated with knowledge forgetting is introduced. It is based on ideas that come from the translation of such logic in (Computer) Algebra, particularly from the interpretation of variable forgetting . In this paper, the concept of weak base is deﬁned as a set of variables sufﬁcient to decide the consistency using variable forgetting. Several applications of weak bases are presented in order to show their usefulness in KBS reasoning and to justify their study and use in solving problems within this topic.


Introduction
The symbolic paradigm in Artificial Intelligence (AI) maintains a relevant role in the development and research of the discipline. Along with the development of sub-symbolic approaches, symbolic ones are regaining momentum, mainly because they facilitate the achievement of Explainability and Trust [1]. Within the paradigm, Knowledge-Based Systems (KBS), as for instance, the expert systems and, in particular, the Rule-Based Expert Systems (RBES), are especially suitable to reach such achievements.
Another characteristic of some types of KBS is the possibility of being interpretable in Computer Algebra [2][3][4][5][6][7], which provides a plus of reliability, due to the mathematical specification of its properties. In particular, it is possible to address the need for Knowledge-Based Systems (KBS) specialization in order to particularize their application or to specialize them for certain contexts, as well as for its subsequent refinement (e.g., [8]). This need also encompasses the need for specializing the knowledge before prototyping (see e.g., [9,10]). In this type of task, it is necessary both to formalize and verify the methods in order to preserve the trust in them, for instance in diagnosis [7] or in applications derived from algebraic-based reasoning methods [2].
The modularity enjoyed by logic-based representation can facilitate not only the specialization of the knowledge. It also aids verifying the derived methods, such as partitions [11], contextualizations [7,12], or customizations [12] of the knowledge, as well as providing efficient representations for reasoning [13]. The aforementioned methods can be designed using Computer Algebra Systems (CAS) when the logic is interpretable in Algebra. The use of CAS leads to practical problem-solving in the field of Engineering and Science (see e.g., [10,14]). Another advantage of interpretation in CAS is that once the methods have been designed and interpreted, the specific algebraic resources needed to From the definition itself, all conservative retractions of K on the same language are equivalent to [K, L ]. Thus, different syntactic representations (that is, axiomatizations) equivalent to [K, L ] can be obtained by applying different methods. Note also that the complete retraction is an infinite KB, and therefore an adequate (finite) equivalent KB is needed. Lastly, please note that [K, L ] = Form(L ) if and only if the conservative retraction and thus the K itself-is inconsistent.
Finding a finite axiomatization of [K, L ] is not straightforward, since there is not an evident syntactic separation in the formulas of K between L and the remainder of the language of K, {p}. In this case, it is not hard to prove that The aforementioned Location Strategy can be then rewritten as follows [2]: Given K and F ∈ Form(L ) with L ⊆ L, the question K|=F? is answered by carrying out two tasks:
As it has already been pointed out, the interest of the strategy lies in the fact that the second task has lower complexity than the direct question. This is due to the relatively small size of L (e.g., L can be the set of symbols of L occurring in the goal F), as long as the axiomatization obtained is acceptable. For example, in [24] authors use a forecasting system with around a quarter of a million formulas on a language with 94 variables. Although there exist 2 94 potential subsets of variables, in practice, only a few of them appear in the formula-goal or the deduction process. By reducing the KB to a conservative retraction on the language of the formula goal, we aim to reduce, in turn, the complexity of the inference process.

Forgetting
As Y. Moinard quoted in [25], the problem of variable forgetting in propositional logic was already raised by G. Boole in 1854. From there, it was studied both in both Mathematical Logic and in the logic-based AI itself (see e.g., [18,[26][27][28][29] as well as [30] for the related problem of formula-variable independence). Variable forgetting (see [31] for a recent survey) is a widely studied technique in AI that has been used, among other applications, to update or refine (logical, rule-based or CSP) programs [25,32,33] (including Answer Set Programming [34,35]). The interest in variable forgetting techniques is not limited to classical (monotonous) logic. It also received attention in the field of non-monotonous reasoning. In the (epistemic) modal logics for (multi)agency, the technique is useful to represent knowledge-based games and nonmonotonic reasoning [18,29,36]. Besides, when reasoning under inconsistency, the use of variable forgetting allows weakening the KB to obtain consistent subKBs (by eliminating the variables involved in the inconsistency) [37]. Moreover, it is also useful for KB merging [38].
This article is based on the idea that when the forgetting process is carried out by progressively simplifying the language, the variables involved in forgetting could provide valuable information about the KB itself. The step-by-step process of variable forgetting allows removing one variable without losing the original knowledge that will be expressible in the reduced language. Our idea focuses mainly on consistent KBs. Also, it is possible to use variable forgetting techniques in inconsistency reasoning, for which there is also an extensive literature [39][40][41].
A problem related to the above-mentioned is how to decide which sub-languages would be the most suitable for computing the corresponding conservative retraction. It could be useful to know the relationship the variables of these sub-languages have, mainly if they are sufficient to ensure the reasoning completeness. In other words, if [K, L ] only depends on L , how is the semantic relationship among variables of L (in the models of K)? For example, is any variable redundant when deciding the entailment? What is the relationship with the consistency decision cost? Let us stop for a moment and discuss how ideas from Algebra could be used within this context.

Algebraic Insights for Forgetting
In [2], the authors exploit an algebraic inspiration of the process of forgetting variables in the case of classical propositional logic. Thinking of variables as if they were dimensions, that paper shows that variable forgetting can be interpreted as a projection of the algebraic variety, which represents the set of models of the starting KB. In this way, the consistency decision process would consist of projecting until reaching dimension 0, that is, no variable, reducing itself to a subset of { , ⊥}.
Continuing with the analogy, one could think of translating the idea of the Krull dimension to the context of KB in Propositional Logic. That is, estimating the length of the sequences where K K means that K |= K but K |= K . Nevertheless, if one aims adapting the same idea to the forgetting variable paradigm, several changes should be made. The first and most important is that in order to minimize the cost of automated reasoning, one should search for minimum length sequences with the structure shown in the Expression 1, where K i is obtained from K i+1 by one variable forgetting step. The fundamental reason is that the computational cost of each step is relevant (e.g., for solving SAT problems using variable forgetting). This problem will be studied in Section 6.

Aim and Structure of the Paper
The paper aims introducing the idea of weak bases as a tool to reduce the complexity of reasoning tasks, preserving correctness and completeness. The notion is inspired by the idea of projection in Algebraic Geometry, by identifying it with that of variable forgetting (Section 5). Some properties and applications will be also shown. The structure of the paper is as follows. The next section introduces the preliminaries used along the paper. It introduces the variable forgetting operators, as well as the associated operations to work with KBs. In Section 3, we show how the variable forgetting is used for SAT solving using saturation. In Section 4, a variable forgetting operator is introduced to be used in the examples. The concept of weak basis is introduced in Section 6 as minimal variable sets deciding the consistency of the KB (by variable forgetting). Finally, the last two sections present applications of weak bases and related and future work.

Propositional Logic
A propositional language is a finite set L = {p 1 , . . . , p n } of propositional symbols (also called propositional variables). The set of formulas Form(L) is built up in the usual way, that is, by using the standard connectives ¬, ∧, ∨, → and ( denotes the constant true, and ⊥ is ¬ ). Given two formulas F, G and p ∈ L, we denote F{p/G} the formula obtained after replacing every occurrence of p in F by the formula G.
A formula F is called reduced if F ∈ { , ⊥} or neither nor ⊥ appear in F. The set of reduced formulas is denoted by Form r (L).
In this paper, a KB is a finite set of formulas. The language of K is denoted by L(K) (i.e. the set of variables used in K).
An interpretation (or valuation) v is a function v : L → {0, 1}. It is denoted by val(L) the set of valuations on L. It is said that v ∈ val(L) is a model of F ∈ Form(L) , v |= F if it makes F true in the usual classical truth functional way. Analogously, it is said that v is a model of K (v |= K) if v is a model of every formula in K. The set of models of F is denoted by Mod(F) (resp. Mod(K) denotes the set of models of K).
A formula F (or a knowledge base K) is consistent if it exhibits at least one model. It is Both notions can be naturally generalized to KB instead of formulas, preserving the same notation. It is said that K and K are equivalent, K ≡ K, if K |= K and K |= K. The same notation will also be used for the equivalence with (and between) formulas. The notation K K will also be used when K |= K , and K K if K |= K but K |= K.
σ(F) = F if ⊥, do not occur in F.

Conservative Retractions
Definition 2. Let K, K be two KBs. It is said that K is a conservative extension of K (or K is a conservative retraction of K) if it is an extension verifying that every consequence of K expressed in the language L(K ) is already consequence of K , The second definition means that K extends K but no new knowledge expressed by means of L(K ) is entailed by K.

Complete Retraction Operator
The complete conservative retraction of Definition 1 can be understood as a map  The complete retraction operator for p is defined as: To make some proofs more readable, the following notation is used. Given L 0 ⊆ L, [K, L 0 ] is also denoted by K L 0 . Likewise, given F ∈ Form(L), F L 0 will be a formula equivalent to a conservative retraction of {F} to L 0 (that is, [{F}, L 0 ]).
Working with the conservative retraction provided by the complete operator has, on the one hand, the disadvantage that the KB obtained is infinite and it does not provide at first a finite equivalent KB. However, on the other hand, it has the advantage that managing all the consequences of the conservative retraction simplifies the demonstration of results of characterization of the entailment restricted to subsets of variables. To address the difficulty, the notion of variable forgetting operator is introduced in [2]. The idea is to adopt an algebraic poitn of view of the problem of knowledge restriction, and thus to be able to design new methods for computing conservative retraction.

Variable Forgetting Operators
In [2], a method for computing conservative retractions by means forgetting operators is presented. We generalize in this section some results of that paper to other operators. The operators that are of the type: The operators considered in this section are of the type The idea lies in to replace the complete operators be others which can be computed in practice (actually, which give a finite presentation of the result).

Definition 4.
It is said that two operators δ 1 and δ 2 are equivalent when they compute equivalent formulas, that is, We are interested in these operators useful for computing conservative retractions.

1.
Any two f.o. for p are equivalent.

2.
The forgetting operators are symmetric and sound.

Remark 3.
Without loss of generality, it will be assumed that f.o. only return reduced formulas, since the simplification operator of Remark 1 can be used, considering the operator σ • δ p instead of δ p .
The following lemma is useful as a characterization of f.o. Although it is proved in [28] for a particular forgetting operator, the result is valid for all f.o. (since they are equivalent).
Lemma 2 (Lifting Lemma [2]). Let v : L \ {p} → {0, 1} be a valuation, F, G ∈ Form(L) and δ p a f.o. for p. The following conditions are equivalent: There exists a valuationv : The extension of f.o. to be applied to KBs is defined as follows: is extended to an operator on KBs, The following result is from [2]. It shows how a conservative retraction (the result of forgetting one single variable) can be obtained.
Thus, Lifting Lemma is also valid for the operator δ p [.] Example 2. Consider K 0 from Example 1 and L = {q, r}. Given a f.o. for p, it has that , and therefore it has an extension which is a model of K 0 , for examplev = v ∪ {(p, 0)} . However, the countermodel of K 0 given by v = {{(q, 0), (r, 1)} has not any extension model of K 0 .

Saturation
Suppose from now on a f.o. is fixed for each variable of the language L, (it will also simply write ∆ if the language is fixed).

Definition 8.
The process of successively applying the operators δ p [·] (in some order) for all the propositional variables p ∈ L(K) will be called saturation of K. It is denoted the result by sat ∆ (K).
Please note that sat ∆ (K) ⊆ {⊥, }, since only reduced formulas are produced; Thus, the result does not depend on the order of applications of operators. Moreover, since forgetting operators are sound, so if K is consistent then necessarily sat ∆ (K) = { }.
Therefore the use of f.o. not only provide a method for computing conservative retractions, but also provides an algorithmic solution of (not necessarily clausal) SAT problems (hence for the entailment problem).
The operator δ p [.] can be extended for linear ordered (l.o) variable sets (Or on L(K), to induce an ordered application of f.o.) Q ⊆ L, q 1 < · · · < q k as the operator If we dispense with making an order explicit, the operator is well-defined module logical equivalence. That is, any two orders on Q produce equivalent KBs. This is true since for each p, q ∈ L, from Proposition 1 it follows that (both are equivalent to [K, L \ {p, q}]). Thus, given Q = {q 1 , . . . , q k } ⊂ L, the operator δ Q (without explicit order) is a well defined modulo logical equivalence. Thus, it holds A useful feature of the use of conservative retractions is that it allows reducing the problem in a way that only variables of the goal formula are considered, forgetting the rest of variables. Such property is called the Location Principle (the second property of the following result). Proposition 2.

1.
If Location principle: so there exists no extension of v L\Q to the full language that models ¬F. Since v itself extends v L\Q , then v |= F is satisfied.

Canonical Forgetting Operator
This section defines an o.f. that can be used in the examples.

Definition 9 ([2]
). The canonical forgetting operator for p is defined as where σ is the simplification operator defined in Remark 1 and It is straightforward to see (by Lifting Lemma) that δ 0 p is a forgetting operator for p, and therefore, it is equivalent to any other one.

Remark 4.
If no specific f.o. is mentioned, the canonical one will be used in the examples provided throughout the article. An implementation in Haskell of this operator can be found in https://github.com/DanielRodCha/SAT-canonical.
so any valuation over q, r can be extended to a model of {F, G} (by Lifting Lemma). Using the Haskell implementation: > c a n o n i c a l " p " ( Impl ( Atom " p " ) ( Atom " q " ) ) ( Impl ( Conj ( Atom " p " ) ( Atom " r " ) ) ( Neg ( Atom " q " ) ) ) > True Example 4. The canonical f.o. allows computing formula retraction. For example, let be Therefore the formula q → r also can be used as F Q . By using Haskell implementation of canonical f.o.:

Semantic (Krull) Dimension for Knowledge Bases
The notion of dimension is ubiquitous in Mathematics and its applications (e.g., Computer Science). The idea is to estimate how complex is the stratification of a KB based on forgetting. It bears some resemblance to the Krull dimension on Algebraic Geometry, but since the motivation is different, it is necessary to modify the idea. In order to motivate the need for modification, let us examine how the straight translation would be: is a chain of maximum length. The reason is that if K K then Mod(K ) ⊂ Mod(K) (proper subset) so |Mod(K )| < |Mod(K)|. Therefore, any sequence of KBs would have a maximum length of 3, because |Mod( )| = 4 and |Mod(K)| = 1.
The Krull dimension for KB is not useful for our pourposes since it only estimates the number of countermodels of K. Proposition 3. Let K be consistent. Then Since in each step, the number of models is reduced in one unit, the sequence is of maximum length. Therefore dim k (K) = m = 2 |L(K)| − |Mod(K)| Therefore, the Krull dimension so defined would be semantic in nature, and it does not gather the idea of understanding the relationship among variables within a deductive process. We concern here in estimating how many basic conservative retractions (computed using δ p ) are necessary to decide consistency. This idea would correspond to a chain induced by f.o. in each step and with a minimum length, in order to optimize the number of operations.

Dimension and Weak Basis
As it was already mentioned, although all the ordered applications of f.o. associated with variables of a set Q produce equivalent theories, their syntactic representations may differ. Therefore, it may happen that with some order we detect consistency (the KB resulting is { }) or inconsistency (the formula ⊥ appears) before completing the saturation procedure, or that it could have been done better-with fewer variable forgetting stepsif we had chosen another order on the variables. Minimum sets that decide the consistency should be analysed. Let us see first an illustrative example.

Example 6.
Consider the variable set Q = {p, t} for the KB Using the Haskell implementation discussed in Remark 4, it is checked that and lastly, by applying δ 0 t , δ 0 t [δ 0 p [K]] = { } Therefore, if we apply the operators according to the order t < p, it would produce the answer consistent in only one retraction step (it only needs to apply δ t [.])), whereas the order p < t needs to use the two f.o. to obtain the answer.
The above example illustrates the issue of how to find a minimal set of variables such that through the (ordered) application of the corresponding f.o., consistency of the KB is decided. It will use f.o. other than the complete ones, since the latter have no algorithmic interest (it handles infinite sets).
When δ c Q [K] is inconsistent (and therefore also K), ⊥ has to appear in it since it contains all the consequences. Therefore with a single application, inconsistency would be detected. On the other hand, in order to decide the consistency, it is necessary to check whether it is equivalent to , and therefore it would require checking that all the formulas of the complete retraction are tautologies.
Let p 1 < q 2 < · · · < p d be a linear order (l.o.) on Q. In order to specify application order of forgetting operator, the application of the operator according to < will be denoted by δ Q,< [K], i.e., The notion of weak basis is that of a minimal set of variables that decides the consistency of K by executing its associated set of f.o. in some order Definition 11. Let K be a KB, Q ⊆ L(K) and ∆ = {δ p : p ∈ L(K)} a family of f.o. It is said that Q is a weak basis with respect to ∆ (a ∆-w.b.) for K if Q decides K and none of its proper subsets does. 4.
The ∆-dimension of K is defined as dim ∆ (K) := min{|Q| : Q is a weak basis for K with respect to ∆} If the family ∆ is fixed, any reference of it in the notation will be omitted.

Example 7.
Consider K e , the KB from Example 6.
• The set {p, t} decides K e . However it is not a w.b. because the set {t} also decides K.
The set {p, q} is a w.b. but not a basis.
By completeness of forgetting operators (Theorem 1) weak bases exist. From the same theorem, a characterization of consistency using w.b. can be proved: Proof. Suppose K is inconsistent. Since the language L(K) itself decides K, then there exists a minimal subset satisfying the same property, i.e., a w.b. The other implication is consequence of Theorem 1.
In the Github repository mentioned in Remark 4 an implementation of the algorithm to find all weak bases is also provided. It will be used later in some examples.

Estimating the Number of Variable Forgetting Steps to Decide the Entailment
An interesting property is that if a variable p reduces knowledge in the following sense The following result shows that if the application of a f.o. effectively reduces the represented knowledge, then it only reduces the number of f.o. needed to produce the answer in one unit.

Proposition 5. If p reduces K then
Let Q 0 be a basis for δ p [K] (so p / ∈ Q 0 ). Then the set Q 0 ∪ {p} decides K, but its size is less than the ∆-dimension, which is a contradiction.
We are already in a position to demonstrate that the Delta-dimension satisfies the idea that was discussed in Section 5. Corollary 1. Let K be a consistent KB. dim ∆ (K) is the minimun lenght of the sequences K 0 = { } w K 1 w · · · w K n = K where K w K means that K is the result of applying a f.o. to K (i < n).

Proof. Any linear ordered set
decides K, thus the ∆-dimension is the shortest of such kind of chains.
The study of the (in)consistency tests associated with an operator is useful to obtain lower levels of complexity, for example for SAT solvers (see e.g., [42]). In our framework, and thinking about the decision of consistency through f.o., the saturation process itself induces an algorithm (Algorithm 1), which stops under two situations: when it obtains ⊥ or ends up reducing all to { }.
Regarding the problem of K |= F? (with K consistent) employing the saturation of K ∪ {¬F}, the consistency case would be the worst in time complexity because it needs to forget all the variables. Therefore, the ∆-dimension could be a lower bound of the number of applications of f.o. in worst-case complexity, since in the process of saturation of K ∪ {¬F}, K itself is reduced to { }. Thus, the number of forgetting operators to be applied, t ∆ (K), satisfies Likewise, it is possible to estimate, from the dimension, a lower bound of the number t ∆ (K) of f.o. to be applied for any saturation-based algoriTheorem it can be selected an extensionv ∈ val(L) verifying thatv |= K. Therefore, it can be defined a map Taking logarithm, and since |Q| = dim ∆ (K); what the theorem proves.
It is worth noting that the dimension is related to the minimum number of f.o. applications needed to answer the question of (in)consistency, thus it is not just a pure semantic notion. For instance, if there is F ∈ K unsatisfiable (or the whole KB is) but ⊥ / ∈ K, then dim ∆ (K) ≥ 1, since it must apply at least one f.o.

Entailment and Weak Basis
The idea behind the w.b. is to decide whether K |= F as efficiently as possible using a minimum set of f.o., which already decides K itself (as is needed to retract it to { }). This idea is also inspired by the following result, which shows a necessary condition for entailment based on a conservative retraction of the goal formula, a much simpler computation as it avoids using the KB itself. Proposition 6. Let K be consistent and Q a w.b. for K.
The previous proposition may be interpreted as that a KB does not provide specific information about the relationship among the variables outside the w.b., since every entailed formula does not contain such information (as F L\Q is a tautology).
Please note that the above result is only a necessary condition. For example, for K = {p} and F = ¬p the only weak basis is {p}. It F = ¬p, then Proof. Assume this is not true, K |= F. Then K ∪ {¬F} is consistent. Then there exists Q 0 ⊆ L be a variable set which decides K ∪ {¬F}, i.e., is contained in that set). Therefore there exists Q ⊆ Q 0 a w.b. for K. Then Which is a contradiction, because ⊥ ∈ δ Q [K ∪ {¬F}] by hypothesis.
Although having all the weak bases may be useful, the cost of computing all of them can be higher since the task involves the repeated application of retraction operators on (sub)knowledge bases. For example, it is easy to see that a 3-SAT instance composed of n clauses that do not share variables, has 3 n weak bases. Therefore, it can be concluded that its computation is worthwhile when the KB remains without revisions for an acceptable amount of time (this way, the weak basis could be reused) and for medium-sized Expert Systems (as [5,7]). However, it is possible to use weaker conditions in specific cases. The next section is devoted to show several case studies.

Case Studies and Applications
This section aims to illustrate the results and applications of weak bases with examples and case studies. Please note that for some of the examples it could be necessary to use more sophisticated f.o. than δ 0 p , due to the size of the KB. In [2] authors show some experimental advantages of such an operator. The one introduced in the mentioned paper uses the well-known translation of propositional formulas to polynomials on characteristics 2.

Case Study 1: Weak Basis and Contexts
A case of use where w.b. are useful is some cases in context-based reasoning. An approach to specify a context is based on determining which set of variables c ⊆ L provides non-trivial information on this. That is, they are relevant variables for representing the state in this context (for example, those which represent signals/perceptions received by the agent). Thus, a context is identified with a sublanguage c of L, and a state of this is will be specified by the truth value on that sublanguage.

Definition 13. It is said that K is sound for a context c if c is contained in a weak basis of K.
The idea is that it can reason in the context using retraction with respect to a w.b. that we already know optimizes reasoning with the K itself. Thus, it is worth getting the corresponding conservative retraction since it is often expected to be reused. Formally: Theorem 4. Let K be sound for c, and let Q be a w.b. with c ⊆ Q. Let F ∈ Form(c) [By Theorem 1, because δ Q [.] is a saturation here] Therefore, K Q , being Q a variable set that decides K and c ⊆ Q, is useful to reason in the context. Selecting a w.b. ensures the minimization of the reasoning process. However, when c ⊆ Q, c ∪ Q can be selected as it also decides K (because Q itself already does).

Case Study 2: Knowledge Bases with Disjoint Weak Basis
The particular case in which the KB has some disjoint w.b. is one in which the reasoning process is drastically shortened in some cases. Theorem 5. Let K be consistent and F be a formula such that var(F) ∩ Q = ∅ for some Q w.b. of K K |= F ⇐⇒ F is a tautology Proof. If K |= F then by Proposition 2 (2) [K, var(F)] |= F holds.
In this case we have that: According to Theorem 5, only formulas that share variables with all the w.b. should be specifically handled, since for the others it is sufficient to check whether it is a tautology. Such checking is relatively simple to verify since the goal formulas are usually significantly smaller and with much fewer variables than the full KB (as it usually happens in the tell-ask paradigm of expert systems).

Example 8.
The following example uses a KB composed of Horn clauses. Although no specific f.o. will be used for this case, more efficient f.o. than the canonical ones can be used, for example, those designed for implications in [43]. Let By using the program: 1 > w e a k B a s i s k 2 [ [ " t " , " s " , " r " ] , [ " t " , " s " , " q " ] , [ " t " , " p " , " q " , " r " ] , 3 [ " t " , " p " , " s " ] ] Therefore • Q 1 = {t, s, r} and [K, Given a formula, it is interesting to check a priori whether var(F) intersects each w.b. For example, for F = p → q it has K |= F since var(F) ∩ Q 1 = ∅ but F is not a tautology.
It is possible to reformulate the proof of Theorem 5 in order to obtain a significant result on the conservative retraction to a w.b. which is disjoint with others.  K has the following w.b.: Since Q 1 ∩ Q 5 = ∅, the reasoning can be simplified in some cases. For example, let F = p → t. It verifies F Q 5 = F and [K, Q 5 ] = (since Q 1 ∩ Q 5 = ∅). Thus, K |= F. Example 10. The w.b. of K e (Example 6) are: Let us see some properties:

•
Note that for each w.b. there is another w.b. that is disjoint with this one, thus Thus, it can apply Proposition 7: -If K |= F for F ∈ Form({p, q, r, s, t}) not tautology, then var(F) ∩ Q i = ∅ for any i. -It has that K e is sound for the context c 1 = {r, s} ⊆ Q 3 . Let us consider G = s → r, and H = t → r ∧ s * G is not entailed by K e , since var(G) ∩ Q 4 = ∅ (that is, G Q 4 = G is not a tautology whilst [K, Q 4 ] ≡ ). * Since H Q 1 = t → s and [K, Q 1 ] = , then K |= H. The KB is sound for the context c = {p, q, r} ⊆ Q 1 . Let F ∈ Form(c). Then, by Theorem 4 but, since K Q 1 ≡ by Theorem 7 it has that K |= F iff ⊥ ∈ δ Q 1 [¬F]. It is therefore sufficient to check whether the formula δ Q 1 [¬F] is inconsistent.

Case Study 3: Knowledge Harnessing and Weak Basis
The work [44] introduces the notion of Knowledge Harnessing (KH). The problem of KH poses how to extract valid information about a specific context from conflicting or uncertain information received by a system (or agent). With this aim, forgetting variable operators are used to both characterize the problem from the logical point of view and provide a theoretical solution as an acceptance-rejection problem. Definition 14 ([44]).
Let K be a KB, F be a formula and L 0 ⊆ L a sublanguage. It is said that F contains harnessed L 0 -knowledge with respect to K, (notation: K |= L 0 F) if the following two conditions hold The following result is from [44] Proposition 8 ([44]). The following properties hold for harnessed knowledge: 1.
If K |= F then K |= L 0 F for any L 0 2.
K |= L 0 F if and only if [K, L 0 ] |= F L 0 Theorem 6. Let F be satisfiable. The following conditions are equivalent: Proof.
(1) =⇒ (2): Which implies that L \ L 0 does not decide K. Then, reasoning as in the above theorem, L \ L 0 has non-empty intersection with all w.b. of K.

Case Study 4: Checking Knowledge Bases Partitions Are Conservative Retractions
A strategy to reduce the complexity (both in size and language) of a KB is to partition it a posteriori in order to address specific use cases. The problem will be that we must ensure that it is a conservative retraction, to preserve the knowledge represented in the KB concerning the use case. One option would be to choose the sub-languages for use cases/contexts that are w.b. This will be illustrated with an example.
The KB shown in Figure 1, A, has been taken from [11]. The w.b. of K have been computed with the help of the implementation above referred. They are listed in Figure 2.
In [11], the authors obtain three subKBs A 1 , A 2 , A 3 . Their languages can be used for computing conservative retractions. In [2] it is proved that ¬on_boiler ⇒ ¬steam co f f ee ∨ teabag  Therefore, with the ideas introduced in this paper we can certify the completeness (and soundness) of the partitions made by the authors. In general terms, it is not necessary for computing all w.b. unless it is required for some kind of global analysis of the KB. A weak basis can be selected, for each use case (and the variables involved in this) that can be considered as context for the machine (for making teabag, coffee and water, respectively), see Figure 3.

Case Study 5: Checking Preserving Consistency by Extension with the Assistance of Weak Bases
Although the idea of w.b. is not originally intended to address the SAT problem (included the non-clausal case), it can be useful for some related issues. One of these is to analyze consistency preservation by adding new formulas when a w.b. is available.
The idea is as follows: Suppose that K is the consistent partial KB that we have in a stage to build the final KB, and that we have a w.b. Q for K. The aim is to add new knowledge represented by a formula F, obtaining K 1 = K ∪ {F}.
It would be necessary to study whether the set that is w.b. preserves such property on the expanded KB K 1 = K ∪ {F}. Let us see that when the w.b. is not preserved, then F brings quality information to the system, in the sense that it discards some K models, expressed with variables not belonging to the old w.b. Theorem 7. Let Q be a w.b. of K and F ∈ Form(L) be a consistent formula. If δ Q [K + {F}] ≡ { } then there exists a (non tautological) G ∈ Form(L \ Q) such that: The fact (1) is trivial for such an formula G. of (2): Consider v ∈ val(L \ Q) such that v |= ¬G. Since Q is a w.b. of K, then there existsv ∈ val(L) which is an extension of v satisfyingv |= K. Thereforev |= K + ¬G, then it is consistent.
In summary, the above result allows for the analysis of all cases when new information is added to a KB:

Materials and Methods
The software can be found in the following GitHub repository https://github.com/ DanielRodCha/SAT-canonical.

Conclusions and Future Work
An analysis has been done on the variable sets (weak bases) that allows to facilitate the reasoning with KB, preserving completeness. The idea of weak bases represents a computational-logic view of algebraic projection, inspired by the geometrical view of the operation variable forgetting shown in a previous work of the authors [2]. In particular: • The present work is inspired by the aforementioned vision to transfer the idea of the Krull dimension from Algebraic Geometry. • The study of weak bases also allowed introducing a concept of dimension associated with variable forgetting. • The dimension allows finding bounds for the complexity of saturation-based algorithms (with respect to the number of variable forgetting operations).
• The usefulness of weak bases has been shown in several use cases: contextual reasoning, KBs with distinct weak bases, some conditions equivalent to entailment, and consistency preserving under extensions of KB, among others. • The distribution of w.b. has been related to the informative languages, in the case of Knowledge Harnessing (Case Study 3). • Its usefulness has been proved in several general use cases (not necessarily composed by clauses, since the operators work on any formula).
The work is mainly focused on foundations. Complexity issues on variable forgetting in propositional logic have been studied in considerable depth due to its relationship with the SAT problem. (see e.g., [28,45]). Experimental results can be found in [2]. The size of the forgetting result is exponential in worst case so specific strategies have to be designed [46]. However, most works are focused on KB with bounded syntactic complexity (e.g., Horn clauses). In contrast to such works, our approach does not presuppose any syntactic limitation; it applies to any propositional formulas. The conservative retraction is a robust knowledge reduction preserving all the knowledge that is expressible in the reduced language. Our approach focuses on sublanguages that are w.b. Thus, the knowledge preservation drives the selection of the sublanguage, which differentiates our work from other solutions. An example is the already cited [11]. Its authors start from a preset family of sublanguages, being the goal formula also expressed in one of these. Therefore, they only need to detect whether other sublanguages provide information about the goal formula, information that is transferred using bridge variables. Our approach starts without these constraints, and conservative extensions keep all knowledge in the corresponding sublanguage. Therefore, our approach applies to the partitioning of KB as in the mentioned work, without prefixing sub-languages. This way an inadequate selection of them is avoided. Moreover, although a sub-language was prefixed, the use of w.b. would allow obtaining conservative retractions for the associated contexts.
In [37], the relation between consistent subKBs of an inconsistent KB is studied, by applying variable forgetting to enable a version of consequence based on maximal consistent subsets. In our approach, w.b. are interesting in the case of consistent K, since the approach is focused on entailment in KBs. It is assumed that when using a w.b. the inconsistency of the KB is detected, the knowledge base is no longer used and the repair process is moved on, for which several tools exist (see e.g., [47,48]). In sum, the notion of w.b. is mainly introduced for reasoning with consistent KB's. Future work will address the issue of inconsistent KBs. It has already been described that an objection to our proposal could be that the computing of all w.b. can be expensive. Rather the idea is to build weak bases for particular variable sets (for example, contexts where the system/agent will work) or to compute w.b. when the KB remains stable. Moreover, the most interesting case is building the knowledge base at the same time as its w.b. (Case Study of Section 7.5). One of the future work goals is the development of a methodology achieving this, within the Knowledge Engineering paradigm.
Another limitation may be that although the language is reduced, the formulas obtained could be syntactically more complex (or larger). This does not happen in practice when f.o. that are more sophisticated than the canonical ones, are used (e.g., those introduced in [2]). These have not been used in this work in order to keep, as far as possible, the paper self-contained. In practice, language reduction makes entailment problems relatively simpler. Even the saturation based solver of that paper can be used to solve complex (not necessarily clausal) instances of SAT (included clausal instances from SAT competitions) [2].
A future research line is to study the role that w.b. can play in distributed RBES. The idea would be based on to use of w.b. for distributing both the knowledge and the reasoning. In this way, the control strategies, suitable for distributed environments for Knowledge-based systems, could be enriched [49].