## 1 Introduction  
According to many studies, up to half of the world's hydrocarbon reserves are concentrated in carbonate reservoirs [1, 2, 3]. Carbonate reservoirs, as a rule, are very complex in structure, and their behavior is difficult to predict due to the high heterogeneity. In the Republic of Tatarast (Russia), a high density of deposits concentrated in carbonate reservoirs is observed on the South Tatar arch and the Melekes depression. In these structures, in carbonate rocks, oil reserves amount to 35-40% of all proven reserves. However, recoverable reserves at the level of modern technologies are estimated at only 10-15% [4]. Carbonates are highly heterogeneous and show different pore systems (moldic, interparticle, intraframe, and microcracks), and oil in the pores is quite viscous [5]. Traditional oil production technologies used in siliciclastic reservoirs show low efficiency in carbonate rocks. At present, the oil recovery factor in the fields of the Republic of Tatarstan, localized in carbonate reservoir rocks, is very low and amounts to 0.15-0.25 [6]. One of the main reasons for the low efficiency is the insufficient knowledge of the pore space. This may lead to the incorrect accounting of these characteristics in the technologies of oil development from such formations. The type of pore space in a rock determines not only the ability to store and transport hydrocarbons, but also characterizes the elastic properties of the rock [7; 8]. Elastic properties in sedimentary rocks are affected not only by porosity but, more importantly, by the type and shape of the pores. Elastic wave velocities are a measure of the compressibility and stiffness of a rock. This, in turn, depends on the shape and number of pores [9; 10; 11; 12]. On the plots of porosity versus velocity, a clear inverse relationship is revealed: the higher the porosity, the lower the elastic properties. However, quite often, a large scatter of values is observed on the velocity-porosity plot [13; 14; 15]. An example of high dispersion of P-wave velocity vs. porosity is shown in Figure 1 for carbonates of Lower Carboniferous age, which are located in the South Tatar arch. This leads to large uncertainties in porosity calculations. The weak relationship between porosity and velocity is due to the ability of carbonates to contain a variety of shapes, sizes, and types of pores, which can both increase and decrease the elastic properties [14; 16]. Due to the wide variety of pore types, the pore space must be classified taking into account the structural features of the rocks and their petrophysical properties. One of the first who related structural characteristics and petrophysical properties in carbonates was [PERSON] [17; 18]. His classification focused on the evaluation of porosity. A detailed classification of the pore space was proposed by [PERSON] and [PERSON] [19]. It is based on the genesis of the pore space and is not related to the petrophysical properties of the rocks. The basic principle of this classification is to divide pores into two classes: pores associated with the rock structure and pores not associated with it. The first group incorporates intergranular and intercrystalline pores, which include caverns that were formed as a result of the dissolution of rock components (moldic) and intraform caverns. The pore space classification of carbonate rocks, which takes into account petrophysical properties, was proposed by [PERSON] [20]. Considering the results of laboratory studies of porosity, permeability, and capillary properties, as well as the description of the rock matrix, [PERSON] came to the conclusion that the most optimal is the division of void space into two main types: interparticle and vuggy porosity. Vuggy porosity, in turn, is divided into two classes depending on the connectivity of cavities with each other: (1) isolated  
Figure 1: P-wave velocity vs. porosity for carbonates located in the South Tatar arch. cavities connected only by interparticle pores and (2) interconnected cavities connected by channels and voids.