{"id":304582,"date":"2020-05-31T15:00:39","date_gmt":"2020-05-31T15:00:39","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=304582"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=304582","title":{"rendered":"\u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0443, \u0442\u0435\u043f\u0435\u0440\u044c \u0441 TLA+"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/464123\/\"><img decoding=\"async\" align=\"left\" height=\"30%\" width=\"30%\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e56\/0d4\/e39\/e560d4e396001f90a720264e3af9f563.gif\"> \u042f \u0443\u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043b RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/post\/316748\/\">\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e<\/a> \u0441\u0445\u0435\u043c\u0443. \u041d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. TLA+ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041f\u043e\u0443\u043f\u0440\u0430\u0436\u043d\u044f\u0432\u0448\u0438\u0441\u044c \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/waves\/blog\/462723\/\">\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043e\u043a<\/a> \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.<br \/>  <a name=\"habracut\"><\/a><br \/>  RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 NOR-\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (NOT OR). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 NOR.<\/p>\n<pre><code class=\"plaintext\">NOR(a,b,c) == c' = ~ (a \\\/ b) <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0440\u0438 \u0442\u043e\u0447\u043a\u0435 \u0432 \u0441\u0445\u0435\u043c\u0435, \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0441\u0438\u0433\u043d\u0430\u043b \u0432 \u0442\u043e\u0447\u043a\u0435 c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 NOT(OR(a,b)). \u041a\u043e\u0433\u0434\u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043c\u044b \u043f\u043e\u043a\u0430 \u043d\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u043c \u0434\u0432\u0430 NOR \u0432 \u043e\u0434\u0438\u043d RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440.<\/p>\n<pre><code class=\"plaintext\">RS == (\\\/ (NOR(r, q, p) \/\\ UNCHANGED q)        \\\/ (NOR(p, s, q) \/\\ UNCHANGED p)        \\\/ (NOR(r, q, p) \/\\ NOR(p, s, q)))       \/\\ UNCHANGED &lt;&lt;r,s&gt;&gt; <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u044f\u0432\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u0430 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0430\u044f \u043f\u0440\u0438\u0440\u043e\u0434\u0430 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c. \u041c\u043e\u0436\u0435\u0442 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0434\u0432\u0443\u0445 NOR \u0438\u043b\u0438 \u043e\u0431\u0430 \u0441\u0440\u0430\u0437\u0443. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u044b r \u0438 s \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f.<br \/>  RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043f\u043e\u0434\u0430\u0432\u0430\u0442\u044c \u0435\u043c\u0443 \u043d\u0430 \u0432\u0445\u043e\u0434 \u043e\u0431\u0430 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 r \u0438 s \u0440\u0430\u0432\u043d\u044b\u043c\u0438 TRUE. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0441\u0445\u0435\u043c\u0430, \u0432 \u0441\u043e\u0441\u0442\u0430\u0432\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u0443\u0435\u043c\u043e\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u044d\u0442\u043e\u043c\u0443 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044e. \u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0443\u0436\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0438\u0441\u044c. \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043b\u0438\u0431\u043e \u0432\u044b\u0431\u043e\u0440\u043e\u043c \u0442\u0430\u043a\u0442\u043e\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u043e\u0442\u044b \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0445\u0435\u043c\u0430\u0445, \u043b\u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u043e\u0439 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445.<\/p>\n<pre><code class=\"plaintext\">Change == \/\\ p = ~ (r \\\/ q)           \/\\ q = ~ (p \\\/ s)           \/\\ IF r = FALSE \/\\ s = FALSE              THEN \\\/ (r' = TRUE \/\\ s' = FALSE)                   \\\/ (r' = FALSE \/\\ s' = TRUE)               ELSE r' = FALSE \/\\ s' = FALSE           \/\\ UNCHANGED &lt;&lt;p,q&gt;&gt; <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u0432\u0435\u0434\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043f\u0435\u0440\u0435\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<pre><code class=\"plaintext\">Check == \/\\ oldp' = p          \/\\ oldq' = q          \/\\ stable' = (r = FALSE \/\\ s = FALSE) <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u0444\u043e\u0440\u043c\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u0438\u043a\u0430\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430.<\/p>\n<pre><code class=\"plaintext\">Next == Check \/\\ (RS \\\/ Change) <\/code><\/pre>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0441\u0442\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0442\u0430\u043a \u0436\u0435 \u043d\u0435\u043f\u0440\u043e\u0442\u0438\u0432\u043e\u0440\u0435\u0447\u0438\u0432\u043e\u0441\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043e\u0432 \u0432 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u043c \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 \u2014 \u0447\u0442\u043e \u043e\u0431\u0430 \u0432\u044b\u0445\u043e\u0434\u0430 \u043d\u0435 \u043c\u043e\u0433\u0443\u0442 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 TRUE (\u0432 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043f\u0440\u0430\u0432\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0430 \u043d\u0430 \u0434\u0440\u0443\u0433\u043e\u0439).<\/p>\n<pre><code class=\"plaintext\">OutputOk == p \/= TRUE \\\/ q \/= TRUE <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u043d\u044b\u0439 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442<\/p>\n<pre><code class=\"plaintext\">Invariant == \/\\ (r = FALSE \\\/ s = FALSE)              \/\\ (stable =&gt; oldq = q \/\\ oldp = p)              \/\\ OutputOk <\/code><\/pre>\n<p>  \u0415\u0449\u0435 \u043e\u0434\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u043e\u0434\u043d\u0430\u043a\u043e, \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u2014 \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0432 \u0442\u0440\u0438\u0433\u0433\u0435\u0440\u0435 \u0440\u0430\u043d\u043e \u0438\u043b\u0438 \u043f\u043e\u0437\u0434\u043d\u043e \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0442\u044c\u0441\u044f.<\/p>\n<pre><code class=\"plaintext\">RSok == \/\\ [] (r = TRUE ~&gt; q = TRUE)         \/\\ [] (s = TRUE ~&gt; p = TRUE) <\/code><\/pre>\n<p>  &quot;<b>r ~&gt; q<\/b>&quot; \u2014 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0441\u0430\u0445\u0430\u0440 \u0434\u043b\u044f &quot;<b>r =&gt; &lt;&gt; q<\/b>&quot;.<br \/>  &quot;<b>=&gt;<\/b>&quot; \u2014 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00ab\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u00bb.<br \/>  &quot;<b>&lt;&gt;<\/b>&quot; \u2014 \u0442\u0435\u043c\u043f\u043e\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00ab\u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c\u00bb.<br \/>  &quot;<b>[]<\/b>&quot; \u2014 \u0442\u0435\u043c\u043f\u043e\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u00ab\u0432\u0441\u0435\u0433\u0434\u0430\u00bb.<br \/>  \u0422\u0435\u043c\u043f\u043e\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0437\u0430\u043f\u0440\u0435\u0449\u0435\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0432 PROPERTY (\u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438).<br \/>  \u0421 \u043d\u0430\u0448\u0438\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c RSok \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u2014 \u043e\u043d\u043e \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f! \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 RS \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432\u0448\u0438\u0441\u044c \u043c\u043e\u0436\u0435\u0442 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0432 \u0433\u0440\u0430\u0444\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 \u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0442\u043b\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043d\u0430\u0448\u0435\u0439 \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438, \u043c\u043e\u0436\u0435\u0442 \u043a\u0440\u0443\u0442\u0438\u0442\u044c\u0441\u044f \u0432\u0435\u0447\u043d\u043e. \u042d\u0442\u0443 \u043f\u0435\u0442\u043b\u044e \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u0431\u0440\u0430\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u043f\u0440\u0435\u0434\u0443\u0441\u043b\u043e\u0432\u0438\u044f \u043d\u0430 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u0435<\/p>\n<pre><code class=\"plaintext\">RS == (\\\/ ((p \/= ~ (r \\\/ q)) \/\\ NOR(r, q, p) \/\\ UNCHANGED q)        \\\/ ((q \/= ~ (p \\\/ s)) \/\\ NOR(p, s, q) \/\\ UNCHANGED p)        \\\/ (((p \/= ~ (r \\\/ q)) \/\\ (q \/= ~ (p \\\/ s)) \/\\ NOR(r, q, p) \/\\ NOR(p, s, q)))       \/\\ UNCHANGED &lt;&lt;r,s&gt;&gt; <\/code><\/pre>\n<p>  \u041d\u043e \u0434\u0435\u043b\u043e \u043e\u0431\u0441\u0442\u043e\u0438\u0442 \u0445\u0443\u0436\u0435 \u2014 \u0435\u0441\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0442\u0435\u043c\u043f\u043e\u0440\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0434\u0435\u043b\u0438, TLA+ \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0442\u043b\u044e \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u00ab\u043a\u043e\u043c\u043f\u043e\u0437\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u0438\u00bb \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u2014 \u0435\u0441\u043b\u0438 \u043c\u044b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043c\u043e\u0434\u0435\u043b\u044c \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u043e\u0434\u043d\u043e\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0431\u0435\u0437 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043d\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043d\u0438\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u043d\u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043d\u044b \u043a \u043d\u0430\u043b\u0438\u0447\u0438\u044e \u043f\u0435\u0442\u0435\u043b\u044c.<br \/>  \u0427\u0442\u043e \u0431\u044b \u0441 \u044d\u0442\u0438\u043c \u043a\u0430\u043a-\u0442\u043e \u0436\u0438\u0442\u044c, TLA+ \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u00ab\u0441\u043f\u0440\u0430\u0432\u0435\u0434\u043b\u0438\u0432\u043e\u0441\u0442\u044c\u00bb (fairness) \u2014 \u0435\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u043e\u043d \u043a\u043e\u0433\u0434\u0430-\u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442.<\/p>\n<pre><code class=\"plaintext\">vars == &lt;&lt;r,s,p,q, stable, oldp, oldq&gt;&gt; Spec == Init \/\\ [][Next]_vars \/\\ WF_vars(Next) <\/code><\/pre>\n<p>  Fairness \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043a\u043b\u0438\u043d\u0430\u043d\u0438\u0435\u043c <b>WF_vars(Next)<\/b><\/p>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0444\u0430\u0439\u043b rs.tla<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u0421\u043a\u0440\u044b\u0442\u044b\u0439 \u0442\u0435\u043a\u0441\u0442<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"plaintext\">--------------------------------- MODULE rs ---------------------------------  VARIABLES r,s,p,q, stable, oldp, oldq  vars == &lt;&lt;r,s,p,q, stable, oldp, oldq&gt;&gt;  NOR(a,b,c) == c' = ~ (a \\\/ b)  Init == \/\\ r = FALSE         \/\\ s = FALSE         \/\\ p = TRUE         \/\\ q = FALSE         \/\\ stable = FALSE         \/\\ oldp = p         \/\\ oldq = q  RS == (\\\/ (NOR(r, q, p) \/\\ UNCHANGED q)        \\\/ (NOR(p, s, q) \/\\ UNCHANGED p)        \\\/ (NOR(r, q, p) \/\\ NOR(p, s, q)))       \/\\ UNCHANGED &lt;&lt;r,s&gt;&gt;  Check == \/\\ oldp' = p          \/\\ oldq' = q          \/\\ stable' = (r = FALSE \/\\ s = FALSE)  Change == \/\\ p = ~ (r \\\/ q)           \/\\ q = ~ (p \\\/ s)           \/\\ IF r = FALSE \/\\ s = FALSE              THEN \\\/ (r' = TRUE \/\\ s' = FALSE)                   \\\/ (r' = FALSE \/\\ s' = TRUE)               ELSE r' = FALSE \/\\ s' = FALSE           \/\\ UNCHANGED &lt;&lt;p,q&gt;&gt;  Next == Check \/\\ (RS \\\/ Change)  OutputOk == p \/= TRUE \\\/ q \/= TRUE  Invariant == \/\\ (r = FALSE \\\/ s = FALSE)              \/\\ (stable =&gt; oldq = q \/\\ oldp = p)              \/\\ OutputOk   Spec == Init \/\\ [][Next]_vars \/\\ WF_vars(Next) RSok == \/\\ [] (r ~&gt; q)         \/\\ [] (s ~&gt; p)  ================================================================================= <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u043e\u0434\u0435\u043b\u0438 rs.cfg<\/p>\n<pre><code class=\"plaintext\">SPECIFICATION Spec PROPERTY RSok INVARIANT Invariant <\/code><\/pre>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u043e\u0434\u0435\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <b>tlc2 rs.tla<\/b> \u0438\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043c\u043e\u0434\u0435\u043b\u0438 \u0432 \u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u043e\u043b\u043e\u0447\u043a\u0435 <b>tla-toolbox<\/b>.<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/464123\/\"> https:\/\/habr.com\/ru\/post\/464123\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/464123\/\"><img decoding=\"async\" align=\"left\" height=\"30%\" width=\"30%\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/post_images\/e56\/0d4\/e39\/e560d4e396001f90a720264e3af9f563.gif\"> \u042f \u0443\u0436\u0435 \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043b RS-\u0442\u0440\u0438\u0433\u0433\u0435\u0440 \u043a\u0430\u043a \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e <a href=\"https:\/\/habr.com\/ru\/post\/316748\/\">\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u0443\u044e<\/a> \u0441\u0445\u0435\u043c\u0443. \u041d\u043e \u0432 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0442\u0430\u043a\u0438\u0445 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u043d\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c. TLA+ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0438\u0441\u0442\u0435\u043c. \u041f\u043e\u0443\u043f\u0440\u0430\u0436\u043d\u044f\u0432\u0448\u0438\u0441\u044c \u0432 <a href=\"https:\/\/habr.com\/ru\/company\/waves\/blog\/462723\/\">\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u043b\u043e\u043c\u043e\u043a<\/a> \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e, \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u044d\u0442\u043e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0438 \u0434\u043b\u044f \u0431\u043e\u043b\u0435\u0435 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-304582","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=304582"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/304582\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=304582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=304582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=304582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}