An Implementation of a Non-monotonic Logic in an Embedded Computer for a Motor-glider
Jos\'e Luis Vilchis Medina (LIS), Pierre Siegel (LIS), Vincent Risch, (LIS), Andrei Doncescu (LAAS)

TL;DR
This paper presents an embedded system implementation of non-monotonic reasoning using default logic to handle incomplete and contradictory information in autonomous motor-glider piloting, demonstrating decision-making under uncertainty.
Contribution
It introduces a practical implementation of non-monotonic reasoning in an embedded environment for autonomous flight decision support.
Findings
Successfully simulates pilot decision-making with contradictory data
Validates non-monotonic logic for real-time embedded applications
Operates efficiently within low-power embedded hardware
Abstract
In this article we present an implementation of non-monotonic reasoning in an embedded system. As a part of an autonomous motor-glider, it simulates piloting decisions of an airplane. A real pilot must take care not only about the information arising from the cockpit (airspeed, altitude, variometer, compass...) but also from outside the cabin. Throughout a flight, a pilot is constantly in communication with the control tower to follow orders, because there is an airspace regulation to respect. In addition, if the control tower sends orders while the pilot has an emergency, he may have to violate these orders and airspace regulations to solve his problem (e.g. emergency landing). On the other hand, climate changes constantly (wind, snow, hail..) and can affect the sensors. All these cases easily lead to contradictions. Switching to reasoning under uncertainty, a pilot must make decisions…
| Extensions | ||||||
|---|---|---|---|---|---|---|
| ✓ | ✓ | ✓ | ||||
| ✓ | ✓ | ✓ | ||||
| ✓ | ✓ | ✓ | ||||
| ✓ | ✓ | ✓ | ||||
| ✓ | ✓ | ✓ |
| Facts | Extensions | Instanced clauses | CPU | Lips |
|---|---|---|---|---|
| 7 | 13 | 115 | 95% | 114,131 |
| 5 | 13 | 113 | 98% | 117,176 |
| 4 | 10 | 112 | 97% | 130,098 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsFormal Methods in Verification · Real-Time Systems Scheduling · Logic, Reasoning, and Knowledge
An Implementation of a Non-monotonic Logic in an Embedded Computer for a Motor-glider
José Luis Vilchis Medina Pierre Siegel Vincent Risch Aix-Marseille Univ, Université de Toulon, CNRS, LIS
Marseille, France {joseluis.vilchismedina,pierre.siegel,vincent.risch}@lis-lab.fr LAAS-CNRS
Toulouse, France
Andrei Doncescu LAAS-CNRS
Toulouse, France [email protected]
Abstract
In this article we present an implementation of nonmonotonic reasoning in an embedded system. As a part of an autonomous motor-glider, it simulates piloting decisions of an airplane. A real pilot must take care not only about the information arising from the cockpit (airspeed, altitude, variometer, compass…) but also from outside the cabin. Throughout a flight, a pilot is constantly in communication with the control tower to follow orders, because there is an airspace regulation to respect. In addition, if the control tower sends orders while the pilot has an emergency, he may have to violate these orders and airspace regulations to solve his problem (e.g. emergency landing). On the other hand, climate changes constantly (wind, snow, hail…) and can affect the sensors. All these cases easily lead to contradictions. Switching to reasoning under uncertainty, a pilot must make decisions to carry out a flight. The objective of this implementation is to validate a nonmonotonic model which allows to solve the question of incomplete and contradictory information. We formalize the problem using default logic, a nonmonotonic logic which allows to find fixed-points in the face of contradictions. For the implementation, the Prolog language is used in an embedded computer running at 1 GHz single core with 512 Mb of RAM and 0.8 watts of energy consumption.
1 Introduction
In this article we present an implementation of the calculation of extensions of a default theory in an embedded computer . The practical case is about rules of piloting an airplane. This is a complex human activity in terms of management of the rules of legislation, control tower, environment, risks…A pilot needs to manage these rules, plus taking into account informations from the cockpit that changes every time. A cockpit is composed of six instruments such as airspeed, altimeter, compass, variometer, turn bank and artificial horizon. All this gives the states of the airplane to the pilot. In order to tackle the possible contradictions in these changing informations, we use default logic [9], a nonmonotonic way of reasoning which is a manner to represent the way of human reasoning [3, 6, 7]. Especially, default logic gains the benefits of an interpretive semantics [2, 5, 11]. The practical interest of this paper is to implement the computation of extensions of a default theory with minimum requirements of energy consumption and effective time of computation. One of the most studied logic programming language in theoretical and practical terms is Prolog [4, 12]. Logic programming is a programming paradigm which is based on facts and rules describing a problem in a particular domain. For this implementation Prolog is used. Prolog uses a kind of default assumption when treating negation: for instance, if a negative literal cannot be proved to be true, then it is assumed to be false. Prolog is based on a fragment of first-order logic (FOL) where rules are in the form of clauses: with as the head, the symbol as “if” and as the body. Facts are clauses without body: 111Prolog is based on Horn clauses. A Horn clause is a clause with at most one positive literal, this is a subset of FOL.. The motivation of this implementation is to have Prolog running in a microcomputer to be able to calculate extensions. Later, this can be incorporate in a mobile system such as a motor-glider to simulate the decisions of the pilot.
1.1 Classical Logic
Logic is a particular way of thinking, that focus on the formal principles of inference, and hence on consequences from given axioms. Formal systems, e.g., propositional, predicate, modal…logics are symbolic constructions in a particular language which allows to express different ways to deal with a conclusion [10]. The language of propositional logic is defined as the least set of expressions satisfying: (true) and (false) are formulas, and if and are formulas, so are (not A), (A and B), (A or B) and ( implies ). A proposition can be any sentences, e.g., “It’s a sunny day”, “Robert can pilot his airplane”. Propositional variables are denoted by a, b, c…The sentence “It’s a sunny day” could be represented by , and the other sentence “Robert can pilot his airplane” by . It can be composed to create complex sentences, e.g., “It’s a sunny day and Robert can pilot his airplane”, resulting: . First-Order Logic (FOL) or predicate logic is an extension of propositional logic that includes universal and existential quantifiers, respectively and , over individuals. Predicates are used to denote properties over individuals e.g. , , …As such, FOL is very expressive, and a very convenient way to formalize sentences. For instance, we can formalize the next sentence: “all airplanes land on wheels”, with the following rule:
[TABLE]
But we also know that some floatplanes are airplanes that do not land on wheels and some airplanes use skis to land on ice or snow. So, we have the following rules:
[TABLE]
[TABLE]
We can see that formalizations (1) and (3) are contradictory. This is because the inference in classical logic is monotonic. This property is very important in the world of mathematics, because it allows to describe lemmas previously demonstrated. But this property cannot be applied in situation where uncertain, incomplete information or exceptions have to be considered. In such situations, we would expect that by adding new information or set of formulas to a model, the set of consequences of this model might be reduced. Since the property of monotony is: then , the problem leads directly to the general representation of common sense reasoning. By moving to a nonmonotonic framework, we can carry out the principle of explosion and nevertheless reach a conclusion.
1.2 Default Logic
Default logic is one of the best known formalization for commonsense reasoning, founded by Raymond Reiter. This kind of formalization allows to infer arguments based on partial and/or contradictory information as premises [8]. A default theory is a pair , where is a set of defaults and is a set of formulas in FOL. A default is: , where are well-formed formulas. are the prerequisites, are the justifications and are the consequences. Where is a vector of (non-quantified) free variables. Intuitively a default means,“if is true, and there is no evidence that might be false, then can be true”. The use of defaults implies the generation of sets containing the consequences of these defaults. Such set are called extensions. An extension can be seen as a set of beliefs of acceptable alternatives. Formally, an extension of a default theory is a smallest fixed-point for which the following property holds: If is a default of , whose the prerequisite is in , and the negation of its justification is not in , then the consequent of is in [8].
Definition 1.1**.**
Let , an extension of is define:
- •
with:
- •
and,
- •
for ; ,
Here is the set of formulas derived from . A special case concerns normal default theories, having only defaults of the form: . The main characteristic of such default theories is that at least one extension is always guaranteed. The original version of the definition of an extension is difficult to compute in practice, since the condition assumes that is known, while is not yet calculated. In the case of normal defaults, we simply check that is an extension of by replacing by . Regarding the rules (1) and (3), we can generalize the sentence “all airplanes land on wheels” by “generally, airplanes land on wheels”. Having a default theory that is composed of , and a knowledge about airplanes: . Using , we can note that the prerequisite is true and the justification is inconsistent with , because of , then we can not conclude that floatplanes land on wheels. But we know that some floatplanes have wheels, formally, . With this a new information, the prerequisite of is true and the justification is consistent, then we can conclude that there are floatplanes that have wheels and land on wheels.
2 Embedded Computer
We use an embedded computer which is based on an ARM processor (Figure 1, embedded computer running Linux Debian). This microcomputer supports three serial protocols communications as SPI, I2C and UART, 40 digital input/output pins…Different sensors are connected to the microcomputer: a gyroscope which measures the rotations, an accelerometer that measures static and dynamic forces. Eventually, a magnetometer allows to estimate the direction by detecting the magnetic flux on earth. These three sensors can give all the information linked to a real cockpit. The embedded computer has an operating system (OS) based on Linux Debian. Running at 1 GHz single core CPU, 512 MB of RAM and an energy consumption of 0.8 Watts. Plus, SWI-prolog version 7.7.18 (32 bits) was installed into it.
An algorithm for calculating extensions of a default theory was implemented (Algorithm 1). This algorithm is coded in Prolog language and the compilation is done thanks to SWI-Prolog installed.
2.1 Routine of Computation
Facts and rules follow a particular syntax. This syntax represents a normal default with a weighting: . Where text could be a comment describing the clause, could be a real fact “hrd” or default “def”, and are the prerequisite and consequent respectively, and finally is a weighing as a priority. Real facts with no weighting are facts sampled at some moment and they are represented as following:
cl(“text”,hrd,[], glider(airspeed_low),[]).
cl(“text”,hrd,[], glider(pitch_stable),[]).
cl(“text”,hrd,[], glider(roll_stable),[]).
cl(“text”,hrd,[], glider(altimeter_low),[]).
cl(“text”,hrd,[], glider(variometer_zero),[]).
These facts are describing the states of an airplane, in our case a glider, having no inclination nor rotation, low airspeed and low altitude, and no vertical speed. We can assume here that the glider has no motion because of the states of the airplane. Due to limited space to write, we will take the following notation; for glider, for zero vertical speed, for no inclination, for no rotation, and for control tower authorization. In the same sense, defaults are represented as following:
cl(”,def,[g(var_zero),g(pch_stb),g(rll_stb),auth],pilot(motor),[]).
Consider a default representing , where the prerequisite is the information from the cockpit and authorization. In this example, if the context makes the default true and there are no contradictions with the conclusion, we jump to the conclusion: 222Due to the lack of space, we do not describe decision making combined with the weighting in this example.. This is intuitively the way our Prolog program finds the solutions. Our system manages 113 rules which are as follows:
2.2 Example and Results
Considering the facts , we consult our Prolog program to know if in this context, we could take-off…
[TABLE]
From Algorithm 1 programmed in Prolog, 5 different extensions are obtained. Table 1 summarizes the computed extensions with the defaults involved in each extension.
The formalization of defaults are shown in Table 2.
From the best extension we can choose is because it has the good combinations of the actions to reach the goal: take-off. Since the extension has: , the result is a straight flight that is not the goal, it would probably be a solution to be able to have more speed and later take-off. The extension has: , there is no movement on the glider because the engine is off.
The extension has: , same result as the previous extension, no movement because the engine is off. And finally, the extension has: , same result as the previous extension, no movement because the engine is off. To study the case where there are the maximum number of solutions, we change the facts and we obtain 13 extensions, Figure 3, with the same 113 rules. As additional information the computation of the extensions is taking 1.514 seconds.
As the facts change, the calculation time of the extensions, Table 3, will be variable. That is, if we have few facts, Prolog will make more logical inferences per second (Lips) to prove the consistency of the rules. However, if we have more facts, Prolog will make fewer inferences (Lips) to prove the rules.
3 Conclusion
We successfully installed “SWI-prolog version 7.7.18” in an embedded computer. Also nonmonotonic reasoning for piloting an airplane was implemented. Our embedded system is composed of sensors such as gyroscope, accelerometer, magnetometer, pressure sensor,…Data sensors are transformed into normal defaults in order to respect a specific syntax. We tackled the problem of incomplete and uncertain information by formalizing the rules of piloting using default logic. We get good results in terms of calculation time, thanks to the use of Horn clauses and normal defaults (Considering the restriction of the embedded computer such as the low energy consumption (0.8 Watts), running at 1 GHz ARM11 (single core) and 512 Mb of RAM). Eventually, we described an example in which 5 extensions are obtained. The model implemented has 113 defaults. We are currently working on the decision making part in order to have a control system based on queries in Prolog. In addition we can take advantage of the infinite loops of Prolog which is one of his most outstanding tools. This allows to compute the extensions all the time while embedded computer is on.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1]
- 2[2] J. Delgrande & T. Schaub (2003): On the relation between Reiter’s default logic and its (major) variants. Seventh European Conference on Symbolic and Quantitative Approaches to Reasoning with Uncertainty (ECSQARU) , 10.1007%2F 978-3-540-45062-737 . · doi ↗
- 3[3] J. Delgrande & T. Schaub (2005): Expressing Default Logic Variants in Default Logic. Journal of Logic and Computation , 10.1093/logcom/exi 021 . · doi ↗
- 4[4] Michael Kifer & Yanhong Annie Liu (2018): Morgan & Claypool, 10.1145/3191315 . · doi ↗
- 5[5] Kurt Konolige (1988): On the relation between default and autoepistemic logic. In: Artificial Intelligence , 35, pp. 343–382, 10.1016/0004-3702(88)90021-5 . · doi ↗
- 6[6] J. Mc Carthy (1980): Circumscription - A form of non-monotonic reasoning. Artificial intelligence 13:1-2, 10.1016/0004-3702(80)90011-9 . · doi ↗
- 7[7] J. Mc Carthy (1986): Applications of circumscription to formalizing common-sense knowledge. Artificial intelligence 28-1, 10.1016/0004-3702(86)90032-9 . · doi ↗
- 8[8] Raymond Reiter (1980): A logic for default reasoning . Artificial intelligence 13:1-2, 10.1016/0004-3702(80)90014-4 . · doi ↗
