On Methods of the Verification and Elaboration of Development Programs for Agricultural Territories

Nowadays, the methods of program-targeted management for the development of various socio-economic systems of complex structure, such as agricultural areas, have become ubiquitous. Therefore, the current tasks at hand are the verification of already created development programs and the development of “proper” programs for the development of such systems, by analogy with the verification and development of proper computer programs through advanced disciplines in theoretical programming. In this paper, in order to solve the problem of the verification of development programs for agricultural territories, a structural scheme of the program is first constructed, through which an axiomatic theory is created using the Hoare’s algorithmic logic system. The main problem in the construction of the axiomatic theory is the development of the axioms of the theory that reflect preconditions and effects of the implementation of meaningful actions indicated in the text of the development program. The verification of the development program corresponds to the provability check of some Hoare triplet, according to the initial and target conditions of the program. For the task of elaborating proper development programs, we describe the mechanism for constructing a domain model using the PDDL family description languages. The description of a specific model is purely declarative in nature and consists of descriptions of predicates and actions of the chosen subject area. In this paper, using the described model with the help of intelligent planners, including temporal planners such as OPTIC, we show how to automatically build solutions to the targets of development programs. Based on expert knowledge and industry standards, a model of an agricultural territory is constructed, a brief description of which is given in this work. The conducted experiments showed the effectiveness of the proposed approach for the development of proper development programs.


INTRODUCTION
Among the numerous meanings of the word "program," the explanatory dictionaries of the Russian language distinguish three of those: (1) a summary of the work or activity (for example, a radio or television program, a concert program, etc.); (2) an activity plan, a set of actions and measures for the implementation of goals, the formulation of which is also often part of the program (for example, a political party program, a 500-day program, an academic discipline program); (3) a computer program, which is a record of an algorithm in some formal language for solving a certain set of problems.
Development programs (DPs) for territories, naturally, are not programs for computers, but are developed in such detail that the meaning of the word "program" in them contains clear traits of both the 2nd and 3rd meanings from the list above. Therefore, for their verification and development, it seems natural to apply appropriate methods developed in theoretical programming for computer programs.
This paper proposes an approach to the application of the provability check of theorems in one of the algorithmic Hoare logics [1] for verifying territorial DPs, as well as the description of the domain model in PDDL (Planning Domain Definition Language) [2] and the use of programs of temporal planners [3] to obtain a sequence of actions for achieving the desired state of the territory, on the basis of which the necessary proper DP is easily constructed.
1. DP VERIFICATION Any DP considers a territory as an object of management that needs to be transferred from a given initial state S 0 to some target state S k over k periods of time (months, quarters, years). The state of the territory is modeled by a finite list of parameters P = p 1 , p 2 , …, p n , such as "phosphorus content in soil," "nitrogen content in soil," "soil moisture," "the number of processing mechanisms," "the amount of existing financial resources for development," etc. The states of the territory related to the end of a certain time period are identified. The territory state S t at the end of the period t in DP is described by a set of real numbers P t = , where are specific values of the parameters p 1 , p 2 , …, p n , respectively.
For each DP, a set of basic actions E = {e 1 , …, e s }, often called measures, is indicated, the implementation of which in each period of time should lead to a change in the state of the territory. Executions of an action e i in different periods of time may differ from each other in intensity, which depends, for example, on the allocated funds for the execution of this action in a given period of time. The operator e i (a 1 , a 2 , …, a k ) denotes the execution of the action e i with the attributes a 1 , a 2 , …, a k . In a DP, events at any time can be carried out either sequentially or in parallel with each other.
Let us introduce the concept of an executable program.
(1) Any operator e i (a 1 , a 2 , …, a k ) is an executable program.
(2) If and are executable programs, then and are also executable programs. Substantially, means the sequential execution of programs and , and is the parallel execution of programs and . For example, the executable program ((e 1 (a 1 ) e 2 (a 2 )); (e 3 (a 3 ) e 4 (a 4 )) corresponds to the parallel execution of operators e 1 (a 1 ) and e 2 (a 2 ), followed by the parallel execution of operators e 3 (a 3 ) and e 4 (a 4 ).
A review of the many territorial development programs has shown that the structure of each territorial DP can be represented as a scheme S: where the part corresponds to the structure of the time period , , is the state of the territory at the beginning of the period , Р t is the state of the territory at the end of the period , is an executable program. The specification of the state Р t will be understood as its description in some formalized language L. Let and are formulas of the language L, and is an executable program. We will say that a statement is true if, whenever prior to executing the formula is true, after the execution of this program the formula is true.
Thus, the correctness check for the territorial DP consists in verifying the validity of the following statements: , t = 1, …, k. And the validity of the statements will be understood as the provability of these assertions in a certain theory T, which corresponds to a DP and is based on a certain algorithmic logic.
As a specification language for the theory T, we choose formulas of the form (1) where are the variables corresponding to the parameters, and are some arithmetic expressions.
Correctly constructed expressions of the theory T are expressions of the form , where the formulas and have the form (1).
The axioms of the theory T are expressions of the form (2) where are variables corresponding to the parameters, are arbitrary values of the parameters , is a change in the parameter after executing the operator , j = 1, …, m. Note that if all attributes of the operator are specified, then each is some real number (positive or negative). 1 2 , , , Linear order axioms are also axioms of the theory T. The rules for deriving the theory T. R1: R2: R3: R4: Here, the symbol " " means implication, the symbol " " is logical deducibility, the symbol " " is an operation on formulas of the form (1), calculated by the rule: if enters , enters , enters , then --enters the formula .
No other subformulas enter the formula . Note that in the scheme S the specifications of the states Р t are formulas of the form (1), in which all expressions are real numbers, and in executable programs the attributes of all their comprising operators are given. It is not difficult to show that the problem of determining the provability of triples , in the theory T is effectively solvable. Note that the construction of the set of axioms of the theory T is the most informative and time-consuming step in the construction of the theory T, which is created to verify the correctness of a DP. Obviously, they should reflect opinions of experts on the development of territories, be consistent with the statistics, and comply with a specific methodology for processing resources for sustainable territorial development [4].

ELABORATION OF A DP
For the elaboration of a DP for agricultural territories, we propose to create in the PDDL language a model of this territory, consisting of a set of predicates and actions corresponding to certain methods of processing various territorial development resources, and to use "intelligent planning" algorithms for the constructed model, that is, algorithms of searching for sequences of actions whose implementation will transfer the initial state of the territory into the target state.

PDDL (Planning Domain Definition Language)
The PDDL language [5] is a language for describing domains and planning tasks, which appeared in response to the need for a single, universal language for all planners. PDDL inherited the basic structure and syntax from one of its predecessors, the STRIPS (Stanford Research Institute Problem Solver) language [6], which was created to solve a specific robot control problem. PDDL is descriptive, contains no algorithms as such, and offers a standard for presenting compact and simple models for specifying domains and planning tasks.

Model Description in PDDL
A model in PDDL is always presented in two files: a domain file and a problem file. The domain file contains a description of the subject area as a whole: descriptions of the types of existing objects, descriptions of constants, descriptions of predicates (properties), and descriptions of actions used in this area. The problem file contains a specific formulation of a planning task: a description of specific interacting objects and the initial and target states of the system being modeled. Separating a domain description from a problem description allows many users to use a model of the same domain in solving their development plans.
The domain file contains all possible predicates and actions that are needed to describe the system. Predicates are described in the standard naming form, where the name of the predicate is followed by its arguments and their types. After the description of the predicates, the domain file contains a block describing the actions. The description of each of the actions consists of three main parts: parameters of the action, the precondition for the execution of the action, and the effect of the execution of the action. Parameters contain local variable names with their types indicated; the precondition contains an expression of predicates and logical connectives and must be true for the action to be feasible; the effect contains predicates connected by the connective "and," which will become true after executing the action.
It should be noted that PDDL is constantly evolving, expanding its expressive means of describing models. Currently there is a fairly large number of planners that are able to interpret the models defined in PDDL. Among them are SGPlan, TFD, LPD, VHPOP, HSP, CTP, POPF, OPTIC, COLIN, and FastDownward [7][8][9]. For our purposes, the OPTIC temporal scheduler [10], developed to extend the PDDL2.1 language [11], turned out to be the most convenient and productive, and so it was used to carry out our experiments with models.
Let us present the format for describing a simple and temporal actions in PDDL2.1, respectively. (:action <action name> :parameters ( <action parameter list> ) :precondition (and ( <condition> ) ) /* condition to be met when action starts :effect (and ( <predicate> ) … ) ) /* end of action (:durative-action <action name> :parameters ( <action parameter list> ) :duration ( <action duration> ) :condition (and (at start ( <condition> ) ) /* condition to be met when action starts (over all ( <condition> ) ) /* condition to be met during execution of action (at end ( <condition> ) ) /* condition to be met when action ends ) /* end of conditions :effect (and (at start ( <predicate> ) ) … (at end ( <predicate> ) ) ) /* end of effects ) /* end of action Further, as a simple example, let us present a fragment of an experimental model of an agricultural farm.
The "to-sowPlot" action is temporal ("durative-action") and requires its execution duration to be indicated using in this case a simple numerical function "time-to-sow-crop ?c," which means how long the process of sowing culture "?c" is. This action is executed if at the beginning ("at start") the plot "?p" is not sown, the farm has seeds of the type "?s," the plot has the necessary moisture, seeds of the type "?s" are intended for cultivating "c" ("it-for ?s ?c"), and the soil of the plot contains the essential nutrients "P," "N," and "K" and does not contain the pollutants "plSalinity," "plHeavyMetals," and "plOil" constantly ("over all"). As a result of completing the action ("at end"), the plot "?p" will be sown with seeds of the type "?s," and "THE-FARM" will no longer have seeds of this type. At the end of the action, the value of the expression "(increase (total-elapsed-time) ?duration)," equal to the action execution time, is added to the numerical value of the function "total-elapsed-time," which controls the total execution time of the target sequence of actions.
We note a certain similarity in the format of the description of actions in PDDL and the type of axioms in the theory T, which is built for a specific development program in its verification. With the help of the described constructions of the PDDL2.1 language, we managed to elaborate a development model for agricultural territories, which is briefly described below.
From the point of view of planning algorithms in standard PDDL, two types of solution search are available: from the initial state to the target state and from the target state to the initial one. In the first case, if there are several ways to achieve the goal, the shortest way according to the established metric will be returned (if not specified, then according to the number of actions). The second type of search (backward search) is available in PDDL due to the structure of the language itself, namely, its actions. Forward search processes actions in the specified order (first applying the precondition and then the effect), while the backward search sort of swaps the effect and the precondition.

Development Programs for Agricultural Territories
The current classification of the land fund of the Russian Federation distinguishes the following categories of land suitability [12]: I, arable lands; II, lands suitable mainly for haymaking; III, pasture lands, after improvement may be suitable for other agricultural purposes; IV, lands suitable for agricultural purposes after drastic land reclamation; V, lands poorly suitable for agricultural purposes; VI, lands unsuitable for agricultural purposes; VII, disturbed lands. The reason for identifying suitability categories is the qualitative condition of the land and the possibility of using it as main agricultural grounds. In some cases, depending on economic and other factors, existing use of lands may not correspond to their intended suitability. For example, arable lands, if they are located near settlements or livestock farms, can be used for planting perennial fruit trees or creating long-standing cultivated hayfields and pastures.
We briefly describe the development model of the territories of the first three types. Experts in agriculture and territorial development were involved in the development of an adequate model, and industry standards of the Ministry of Agriculture of the Russian Federation OST 10 294-2002-OST 10 297-2002 were taken into account. Below, we will assume that the territory we are studying consists of separate plots.
Let us describe the contents of the domain file of the "Agricultural Territory" model. Parameters and predicates: (1) Ecological factors of the plot, which are necessary for normal growth and development of plants, crop formation and its quality, prevention of land degradation (acidification, salinization, overstocking, erosion, deflation, depletion of organic matter and available plant nutrients, pollution by harmful substances, etc.).
(2) Factors of the plot that meet the needs of crops, taking into account their biological characteristics regarding nutrients (N, P, K, Ca, Mg, S, microelements), water, air, heat, and phytosanitary and environmental-toxicological conditions.
Preconditions: certain needs of the agricultural plot in mineral fertilizers, chemical ameliorants, pesticides, and other agrochemicals, as well as organic fertilizers, equipment, and machinery.
Effects: higher soil fertility. Action group 2: Measures for the rehabilitation of agricultural lands contaminated with heavy metals, pesticides, radioactive substances, and other toxicants.
Preconditions: contamination of an agricultural plot, availability of appropriate equipment and machinery; Effects: normalization of the ecological state of the soil. Action group 3: Measures for the optimal placement of agricultural crops, the formation of crop rotation arrays, the identification of unproductive lands, and the transformation of arable lands into less intensive types of agricultural lands.
Action group 4: Technological actions of crop cultivation, taking into account the prevailing weather and economic conditions, mineral nutrition of plants, phytosanitary survey of crops, stocks of productive moisture, and soil density during the growing season.
Effects: improving the quality and yield of crops, reducing the cost of their production, and preventing environmental pollution by means of chemicalization.
Description of the problem file of the "Agricultural Territory" model. It describes the set of land plots that make up the territory and their initial characteristics, including the composition of the soil, the proximity of markets, the proximity of clean water sources, etc.
In addition, this file indicates the target development indicators of the territory: (1) Improving the quality of plots.
Here, the quality of a plot is a complex characteristic of a plot in terms of its fertility and productive capacity, calculated on the basis of standard characteristics of the land (particle size distribution, erosion, salinization, excessive moisture, stoniness, etc.).
(2) The planned economic benefits of agricultural production in the area. Our experiments carried out using the constructed "Agricultural Territory" model and the OPTIC planner developed at King's College London showed that the described approach for creating DPs can be successfully applied in both agricultural companies and specific territorial and economic clusters.