{"id":23989,"date":"2012-12-24T17:00:04","date_gmt":"2012-12-24T14:00:04","guid":{"rendered":"http:\/\/studentpmr.ru\/?p=23989"},"modified":"2012-12-24T17:00:04","modified_gmt":"2012-12-24T14:00:04","slug":"%d0%bc%d0%b5%d0%b4%d0%b8%d1%86%d0%b8%d0%bd%d1%81%d0%ba%d0%b0%d1%8f-%d0%b4%d0%b8%d0%b0%d0%b3%d0%bd%d0%be%d1%81%d1%82%d0%b8%d0%ba%d0%b0-%d0%bf%d0%b0%d1%86%d0%b8%d0%b5%d0%bd%d1%82%d0%be%d0%b2","status":"publish","type":"post","link":"https:\/\/studentpmr.ru\/?p=23989","title":{"rendered":"\u041c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043f\u0430\u0446\u0438\u0435\u043d\u0442\u043e\u0432"},"content":{"rendered":"<p>database<br \/>\n                 xpositive(symbol,symbol)<br \/>\n                 xnegative(symbol,symbol)<\/p>\n<p>predicates<\/p>\n<p>                 begin_analis<br \/>\n                 result<br \/>\n                 ask(symbol,symbol)<br \/>\n                 virus_is(symbol)<br \/>\n                 it_is(symbol)<br \/>\n                 positive(symbol,symbol)<br \/>\n                 negative(symbol,symbol)<br \/>\n                 remember(symbol,symbol,symbol)<br \/>\n                 clear_db<br \/>\n  <!--more--><br \/>\nclauses<br \/>\n            % User interface<br \/>\n            begin_analis :-<br \/>\n                 nl,write(&#171;***\u041c\u0435\u0434\u0438\u0446\u0438\u043d\u0441\u043a\u0430\u044f \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0430 \u043f\u0430\u0446\u0438\u0435\u043d\u0442\u043e\u0432***&#187;),<br \/>\n                 nl,write(&#171;\u041e\u0442\u0432\u0435\u0447\u0430\u0439\u0442\u0435 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0441\u0438\u0441\u0442\u0435\u043c\u044b y-\u0434\u0430, n-\u043d\u0435\u0442:&#187;),<br \/>\n                 nl,nl,<br \/>\n                 result,<br \/>\n                 write(&#171;\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043f\u0440\u043e\u0431\u0435\u043b.&#187;),nl,<br \/>\n                 exit.<br \/>\n            result :-<br \/>\n                 virus_is(X),!,nl,<br \/>\n                 write(&#171;\u0414\u0438\u0430\u0433\u043d\u043e\u0437: &#171;,X,&#187;.&#187;),nl,<br \/>\n                 clear_db.<br \/>\n            result :-<br \/>\n                 nl,write(&#171;\u0412\u0430\u0448\u0430 \u0431\u043e\u043b\u0435\u0437\u043d\u044c \u043d\u0435\u0438\u0437\u043b\u0435\u0447\u0438\u043c\u0430 &#171;),<br \/>\n                 clear_db.<\/p>\n<p>            ask(X,Y) :-<br \/>\n                write(X, &#187; &#171;, Y,&#187; ?&#187;),<br \/>\n                readln(Reply),<br \/>\n                remember(X,Y,Reply).<\/p>\n<p>            % Output mechanism<br \/>\n            positive(X,Y) :-<br \/>\n                  xpositive(X,Y),!.<br \/>\n            positive(X,Y) :-<br \/>\n                  not(negative(X,Y)),!,<br \/>\n                  ask(X,Y).<\/p>\n<p>            negative(X,Y) :-<br \/>\n                 xnegative(X,Y),!.<\/p>\n<p>            remember(X,Y,y) :-<br \/>\n                 asserta(xpositive(X,Y)).\t% \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430<br \/>\n            remember(X,Y,n) :-<br \/>\n                 asserta(xnegative(X,Y)),\t% \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0442\u0432\u0435\u0442\u0430<br \/>\n                 fail.<\/p>\n<p>            clear_db :-<br \/>\n                 retract(xpositive(_,_)),\t% \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432<br \/>\n                 fail.<br \/>\n            clear_db :-<br \/>\n                 retract(xnegative(_,_)),\t% \u0423\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043e\u0442\u0432\u0435\u0442\u043e\u0432<br \/>\n                 fail.<\/p>\n<p>            % Rules<br \/>\n            virus_is(&#171;\u041d\u0435 \u0431\u0435\u0441\u043f\u043e\u043a\u043e\u0439\u0442\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0439\u0434\u0435\u0442.&#187;) :-<br \/>\n                 it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f&#187;),<br \/>\n\t\t positive(&#171;&#187;,&#187;\u0432\u0430\u043c \u0432\u043e\u043e\u0431\u0449\u0435 \u043f\u043b\u043e\u0445\u043e&#187;),<br \/>\n                 positive(&#171;\u043d\u0430\u0431\u043b\u044e\u0434\u0430\u044e\u0442\u0441\u044f&#187;,&#187;\u0447\u0430\u0441\u0442\u044b\u0435 \u0433\u043e\u043b\u043e\u0432\u043d\u044b\u0435 \u0431\u043e\u043b\u0438 \u0438 \u0433\u043e\u043b\u043e\u0432\u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f&#187;),!.<\/p>\n<p>            virus_is(&#171;\u0422\u043e\u0433\u0434\u0430 \u043d\u0435 \u0431\u043e\u0439\u0442\u0435\u0441\u044c \u0438\u0434\u0438\u0442\u0435 \u0434\u043e\u043c\u043e\u0439 \u0438 \u0437\u0430\u0441\u0442\u0440\u0435\u043b\u0438\u0442\u0435\u0441\u044c. \u0417\u0430\u043e\u0434\u043d\u043e \u0438 \u0432\u0441\u0435\u0445 \u043e\u043a\u0440\u0443\u0436\u0430\u044e\u0449\u0438\u0445&#187;) :-<br \/>\n                 it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f&#187;),<br \/>\n\t\t positive(&#171;&#187;,&#187;\u0443 \u0432\u0430\u0441 \u043f\u043b\u043e\u0445\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c&#187;),!.<\/p>\n<p>            virus_is(&#171;\u0411\u0440\u043e\u0441\u0430\u0439\u0442\u0435 \u043a\u0443\u0440\u0438\u0442\u044c \u0438 \u043d\u0430\u0447\u0438\u043d\u0430\u0439\u0442\u0435 \u043f\u0438\u0442\u044c&#187;) :-<br \/>\n                 it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f&#187;),<br \/>\n                 positive(&#171;\u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u0436\u0435\u043b\u0443\u0434\u043a\u043e\u043c &#171;,&#187;&#187;),!.<\/p>\n<p>             virus_is(&#171;\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435\u0441\u044c \u043a \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0432\u0440\u0430\u0447\u0443 \u0430 \u043d\u0435 \u043a \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0435.&#187;):-<br \/>\n                 it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f&#187;),<br \/>\n                 positive(&#171;\u0413\u043e\u043b\u043e\u0432\u0430 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043b\u0430 \u0431\u043e\u043b\u0435\u0442\u044c&#187;,&#187;&#187;),<br \/>\n                 positive(&#171;\u0412\u044b \u0432\u043e\u043e\u0431\u0449\u0435 \u0443\u043f\u043e\u0442\u0440\u0435\u0431\u043b\u044f\u0435\u0442\u0435 \u043a\u0430\u043a\u0443\u044e \u043d\u0438\u0431\u0443\u0434\u044c \u043f\u0438\u0449\u0443&#187;,&#187;&#187;),<br \/>\n                 positive(&#171;\u041d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442&#187;,&#187;&#187;),!.<\/p>\n<p>             virus_is(&#171;\u0422\u043e\u0433\u0434\u0430 \u0438\u0434\u0438\u0442\u0435 \u0434\u043e\u043c\u043e\u0439&#187;) :-<br \/>\n                 it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f&#187;),<br \/>\n                 positive(&#171;\u0423 \u0432\u0430\u0441 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0437\u0430\u0440\u043f\u043b\u0430\u0442\u0430&#187;,&#187;&#187;),!.<\/p>\n<p>            it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u0432\u044b\u0441\u043e\u043a\u0430\u044f&#187;) :-<br \/>\n                 positive(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 &#171;,&#187;\u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f&#187;),!.<\/p>\n<p>            it_is(&#171;\u0422\u0435\u043c\u043f\u0435\u0440\u0430\u0442\u0443\u0440\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u0430\u044f&#187;) :-<br \/>\n                 positive(&#171;\u0423 \u0432\u0430\u0441 &#171;,&#187;\u0447\u0442\u043e \u0442\u043e \u0431\u043e\u043b\u0438\u0442&#187;),!.<\/p>\n<p>            goal<\/p>\n<p>                begin_analis.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>database xpositive(symbol,symbol) xnegative(symbol,symbol) predicates begin_analis result ask(symbol,symbol) virus_is(symbol) it_is(symbol) positive(symbol,symbol) negative(symbol,symbol) remember(symbol,symbol,symbol) clear_db<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"_links":{"self":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/23989"}],"collection":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=23989"}],"version-history":[{"count":0,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=\/wp\/v2\/posts\/23989\/revisions"}],"wp:attachment":[{"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=23989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=23989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/studentpmr.ru\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=23989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}