<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3829342</guid>
        <pubDate>Sun, 26 Apr 2020 21:49:27 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3829342</link>
        <description><![CDATA[swf: В прологе с заглавной буквы пишутся только свободные переменные. <br>
Если очень хочется написать с заглавной, то строка берётся в двойные кавычки, символ - в апострофы.<br>
<br>
Я убрала заглавные. Константы в прологе начинаются со строчной буквы.<br>
<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">domains</div><div class="code_line">s=string</div><div class="code_line">m=symbol</div><div class="code_line">&nbsp;</div><div class="code_line">predicates</div><div class="code_line">nondeterm Metal(m,s)</div><div class="code_line">nondeterm UnMetal(m,s)</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;</div><div class="code_line">clauses</div><div class="code_line">Metal(m,hidrargirum).</div><div class="code_line">Metal(m,ferum).</div><div class="code_line">Metal(m,aluminium).</div><div class="code_line">Metal(m,titan).</div><div class="code_line">Metal(m,cuprum).</div><div class="code_line">Metal(m,uranium).</div><div class="code_line">Metal(m,franziy).</div><div class="code_line">Metal(m,zinck).</div><div class="code_line">Metal(m,kaliy).</div><div class="code_line">Metal(m,rubidiy).</div><div class="code_line">Metal(m,aurum).</div><div class="code_line">Metal(m,argentum).</div><div class="code_line">Metal(m,magniy).</div><div class="code_line">Metal(m,calciy).</div><div class="code_line">Metal(m,cesium).</div><div class="code_line">Metal(m,radon).</div><div class="code_line">Metal(m,wolfram).</div><div class="code_line">Metal(m,nicel). </div><div class="code_line">&nbsp;</div><div class="code_line">UnMetal(u,silicium).</div><div class="code_line">UnMetal(u,oxygen).</div><div class="code_line">UnMetal(u,hydrogen).</div><div class="code_line">UnMetal(u,phosphorus).</div><div class="code_line">UnMetal(u,sulfur).</div><div class="code_line">UnMetal(u,borum).</div><div class="code_line">UnMetal(u,carbon).</div><div class="code_line">UnMetal(u,chlor).</div><div class="code_line">UnMetal(u,selen).</div><div class="code_line">UnMetal(u,arsen).</div><div class="code_line">UnMetal(u,bromium).</div><div class="code_line">UnMetal(u,iodum).</div><div class="code_line">UnMetal(u,argentum).</div><div class="code_line">UnMetal(u,helium).</div><div class="code_line">UnMetal(u,ftor).</div><div class="code_line">UnMetal(u,krypton).</div><div class="code_line">UnMetal(u,xenon).</div><div class="code_line">UnMetal(u,radon).</div><div class="code_line">UnMetal(u,neon).</div><div class="code_line">&nbsp;</div><div class="code_line">Goal</div><div class="code_line">write(&quot;Metals are&quot;), nl, Metal(_,X),write(X),nl, readchar(_),fail.</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script> <br>
<br>
<span class="tag-color tag-color-named" data-value="mergepost" style="color: mergepost"><span class='tag-size' data-value='7' style='font-size:7pt;'>Добавлено <time class="tag-mergetime" datetime="2020-04-27T00:50:15+03:00">26.04.20, 21:50</time></span></span><br>
Если нужно напечатать и металлы, и неметаллы, то ставим такую цель<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">Goal</div><div class="code_line">write(&quot;Metals are&quot;), nl, Metal(_,X),write(X),nl, readchar(_),fail;</div><div class="code_line">nl,write(&quot;Unmetals are&quot;),nl,UnMetal(_,X),write(X),nl, readchar(_),fail.</div></ol></div></div></div></div>]]></description>
        <author>swf</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3754508</guid>
        <pubDate>Sun, 24 Dec 2017 15:54:11 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3754508</link>
        <description><![CDATA[Vesper: Не понял две вещи. Во-первых, почему у Metal и UnMetal первая переменная не связывается вообще. Не проще ли было писать &quot;Metal(Hydrargyrum).&quot; и всё? Тогда вывести все металлы можно было бы запросом Metal(X), без всяких извращений. И во-вторых, что должен возвращать предикат Nabor? У него ни одной истины в описании.]]></description>
        <author>Vesper</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740944</guid>
        <pubDate>Wed, 20 Sep 2017 12:17:05 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740944</link>
        <description><![CDATA[amk: А в прологе строки разве в кавычки не берутся?]]></description>
        <author>amk</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740518</guid>
        <pubDate>Mon, 18 Sep 2017 01:29:13 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740518</link>
        <description><![CDATA[Славян: А&#33;, пардон. Я увидел вначале, что он объявлен металлом, а более позднее переобъявление не углядел. :oops:]]></description>
        <author>Славян</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740514</guid>
        <pubDate>Sun, 17 Sep 2017 19:24:35 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740514</link>
        <description><![CDATA[Евгений228: <div class='tag-quote'><a class='tag-quote-link' href='https://forum.sources.ru/index.php?showtopic=411310&view=findpost&p=3740513'><span class='tag-quote-prefix'>Цитата</span></a> <span class='tag-quote__quote-info'>Славян &#064; <time class="tag-quote__quoted-time" datetime="2017-09-17T19:03:21+00:00">17.09.17, 19:03</time></span><div class='quote '>А когда это радон стал металлом? :blink:</div></div><br>
Если что UnMetal это Не металы]]></description>
        <author>Евгений228</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740513</guid>
        <pubDate>Sun, 17 Sep 2017 19:03:21 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740513</link>
        <description><![CDATA[Славян: А когда это радон стал металлом? :blink:]]></description>
        <author>Славян</author>
        <category>Prolog</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740509</guid>
        <pubDate>Sun, 17 Sep 2017 18:17:01 +0000</pubDate>
        <title>Помогите пожалуйста найти ошибку)(Prolog)</title>
        <link>https://forum.sources.ru/index.php?showtopic=411310&amp;view=findpost&amp;p=3740509</link>
        <description><![CDATA[Евгений228: <span class='tag-size' data-value='14' style='font-size:14pt;'>Нужно что бы пролог вывел просто все названия металов,<br>
в столбик, но выбивает ошибку что не использованые предложения&#33;</span><br>
-----------------------------------------------<br>
domains<br>
S=String<br>
M=Symbol<br>
predicates<br>
nondeterm Metal(M,S)<br>
nondeterm UnMetal(M,S)<br>
nondeterm Nabor(M,M)<br>
<br>
<br>
clauses<br>
Metal(M,Hidrargirum).<br>
Metal(M,Ferum).<br>
Metal(M,Aluminium).<br>
Metal(M,Titan).<br>
Metal(M,Cuprum).<br>
Metal(M,Uranium).<br>
Metal(M,Franziy).<br>
Metal(M,Zinck).<br>
Metal(M,Kaliy).<br>
Metal(M,Rubidiy).<br>
Metal(M,Aurum).<br>
Metal(M,Argentum).<br>
Metal(M,Magniy).<br>
Metal(M,Calciy).<br>
Metal(M,Cesium).<br>
Metal(M,Radon).<br>
Metal(M,Wolfram).<br>
Metal(M,Nicel).<br>
<br>
UnMetal(U,Silicium).<br>
UnMetal(U,Oxygen).<br>
UnMetal(U,Hydrogen).<br>
UnMetal(U,Phosphorus).<br>
UnMetal(U,Sulfur).<br>
UnMetal(U,Borum).<br>
UnMetal(U,Carbon).<br>
UnMetal(U,Chlor).<br>
UnMetal(U,Selen).<br>
UnMetal(U,Arsen).<br>
UnMetal(U,Bromium).<br>
UnMetal(U,Iodum).<br>
UnMetal(U,Argentum).<br>
UnMetal(U,Helium).<br>
UnMetal(U,Ftor).<br>
UnMetal(U,Krypton).<br>
UnMetal(U,Xenon).<br>
UnMetal(U,Radon).<br>
UnMetal(U,Neon).<br>
<br>
Nabor(X,Y):- <br>
Metal(M,X),UnMetal(U,Y),nl,fail.<br>
<br>
Goal<br>
Nabor(X,Y).<br>
/*write(&quot;Metals are: &quot;,Metal,&quot;Un Metals are&quot;,UnMetal).*/]]></description>
        <author>Евгений228</author>
        <category>Prolog</category>
      </item>
	
      </channel>
      </rss>
	