<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.visual-prolog.com/index.php?action=history&amp;feed=atom&amp;title=Optimal_Set_of_Includes_Directives</id>
	<title>Optimal Set of Includes Directives - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.visual-prolog.com/index.php?action=history&amp;feed=atom&amp;title=Optimal_Set_of_Includes_Directives"/>
	<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;action=history"/>
	<updated>2026-04-12T05:11:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=4285&amp;oldid=prev</id>
		<title>Thomas Linder Puls: category</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=4285&amp;oldid=prev"/>
		<updated>2016-04-28T17:15:21Z</updated>

		<summary type="html">&lt;p&gt;category&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:15, 28 April 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l91&quot;&gt;Line 91:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 91:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;With the descriptions above the .pack file can contain &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives that are also in the corresponding .ph file.  We could choose the exclude such &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives.  But I think it is simpler to consider each structure file as a completely independent file.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;With the descriptions above the .pack file can contain &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives that are also in the corresponding .ph file.  We could choose the exclude such &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives.  But I think it is simpler to consider each structure file as a completely independent file.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[IDE]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Category:&lt;/ins&gt;IDE]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Thomas Linder Puls</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=3984&amp;oldid=prev</id>
		<title>Thomas Linder Puls: spelling</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=3984&amp;oldid=prev"/>
		<updated>2014-12-16T09:51:59Z</updated>

		<summary type="html">&lt;p&gt;spelling&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:51, 16 December 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l2&quot;&gt;Line 2:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* There is no way to detect whether &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives are superfluous.  Superfluous includes can result in longer and more frequent compilations and thus waste of programmer time.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* There is no way to detect whether &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives are superfluous.  Superfluous includes can result in longer and more frequent compilations and thus waste of programmer time.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* There is no way to detect whether the includes in a .ph file are &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;suffucient&lt;/del&gt;. Because .ph files are always included from a .pack file and that .pack file can provide includes lacked by the .ph file.  Consequently, bugs may rise when the .ph file is included from a new context.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* There is no way to detect whether the includes in a .ph file are &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sufficient&lt;/ins&gt;. Because .ph files are always included from a .pack file and that .pack file can provide includes lacked by the .ph file.  Consequently, bugs may rise when the .ph file is included from a new context.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To overcome these two problems we introduce the &amp;#039;&amp;#039;&amp;#039;Optimal Set of Include Directives&amp;#039;&amp;#039;&amp;#039;(called &amp;#039;&amp;#039;&amp;#039;OSID&amp;#039;&amp;#039;&amp;#039; in the sequel).  Intuitively the OSID for a certain file (.ph or .pack) is:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;To overcome these two problems we introduce the &amp;#039;&amp;#039;&amp;#039;Optimal Set of Include Directives&amp;#039;&amp;#039;&amp;#039;(called &amp;#039;&amp;#039;&amp;#039;OSID&amp;#039;&amp;#039;&amp;#039; in the sequel).  Intuitively the OSID for a certain file (.ph or .pack) is:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sufficent&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Sufficient&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::enough must be included to ensure that the file compiles.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;::enough must be included to ensure that the file compiles.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Self-contained/Robust&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:;Self-contained/Robust&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Optimal Set of Include Directives ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== Optimal Set of Include Directives ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Since this calculation of the OSID is made by the IDE, it seems &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;resonable &lt;/del&gt;to assume the package concept that the IDE maintains.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Since this calculation of the OSID is made by the IDE, it seems &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;reasonable &lt;/ins&gt;to assume the package concept that the IDE maintains.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The IDE should &amp;quot;think&amp;quot; of things in the following way (during calculation of OSID&amp;#039;s the IDE should report the mentioned anomalies):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The IDE should &amp;quot;think&amp;quot; of things in the following way (during calculation of OSID&amp;#039;s the IDE should report the mentioned anomalies):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l65&quot;&gt;Line 65:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 65:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Notice that if a scope does not have an exposing file then it can only be referenced from the owning file (or in normal terms the owning file is a .pack file and the scope is therefore private).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Notice that if a scope does not have an exposing file then it can only be referenced from the owning file (or in normal terms the owning file is a .pack file and the scope is therefore private).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Examplification &lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Exemplification &lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; includes &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; directly, and &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; contains the implementation of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;.  Furthermore, &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039; directly uses &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;If &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; includes &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; directly, and &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; contains the implementation of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;.  Furthermore, &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039; directly uses &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039;:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Thomas Linder Puls</name></author>
	</entry>
	<entry>
		<id>https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=3983&amp;oldid=prev</id>
		<title>Thomas Linder Puls: init</title>
		<link rel="alternate" type="text/html" href="https://wiki.visual-prolog.com/index.php?title=Optimal_Set_of_Includes_Directives&amp;diff=3983&amp;oldid=prev"/>
		<updated>2014-12-16T09:50:36Z</updated>

		<summary type="html">&lt;p&gt;init&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The current &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; support has two major problems:&lt;br /&gt;
&lt;br /&gt;
* There is no way to detect whether &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives are superfluous.  Superfluous includes can result in longer and more frequent compilations and thus waste of programmer time.&lt;br /&gt;
* There is no way to detect whether the includes in a .ph file are suffucient. Because .ph files are always included from a .pack file and that .pack file can provide includes lacked by the .ph file.  Consequently, bugs may rise when the .ph file is included from a new context.&lt;br /&gt;
&lt;br /&gt;
To overcome these two problems we introduce the &amp;#039;&amp;#039;&amp;#039;Optimal Set of Include Directives&amp;#039;&amp;#039;&amp;#039;(called &amp;#039;&amp;#039;&amp;#039;OSID&amp;#039;&amp;#039;&amp;#039; in the sequel).  Intuitively the OSID for a certain file (.ph or .pack) is:&lt;br /&gt;
&lt;br /&gt;
:;Sufficent&lt;br /&gt;
::enough must be included to ensure that the file compiles.&lt;br /&gt;
:;Self-contained/Robust&lt;br /&gt;
::If A is needed, then the file must &amp;#039;&amp;#039;itself&amp;#039;&amp;#039; &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; A. It is &amp;#039;&amp;#039;not&amp;#039;&amp;#039; sufficient to &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; B even though B includes A. Especially, it is necessary to ensure that .ph files are self-contained, so that the file compiles no matter which .pack file it is included from.&lt;br /&gt;
:;Minimal&lt;br /&gt;
::There should not be includes other than those needed to fulfill the two other requirements.&lt;br /&gt;
&lt;br /&gt;
It was the plan that the compiler should be able to issue warnings (or messages to the IDE), such that an optimal set of &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives could be calculated for each pack and ph file.&lt;br /&gt;
&lt;br /&gt;
But it seems better to move te calculation to the IDE, as described here.&lt;br /&gt;
&lt;br /&gt;
=== Strategy ===&lt;br /&gt;
&lt;br /&gt;
In brief we ensure that we can obtain the following information:&lt;br /&gt;
&lt;br /&gt;
* The file name in which each scope is defined/declared (already in browse info today).&lt;br /&gt;
* The scopes directly used by another scope (&amp;#039;&amp;#039;&amp;#039;new info&amp;#039;&amp;#039;&amp;#039;).&lt;br /&gt;
* The &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; structure (available to the IDE, but should rather be put in browse info).&lt;br /&gt;
&lt;br /&gt;
Based on this the &amp;#039;&amp;#039;&amp;#039;IDE&amp;#039;&amp;#039;&amp;#039; (rather than the compiler) can calculate and maintain the optimal set of &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives for each .ph and .pack file.&lt;br /&gt;
&lt;br /&gt;
Notice that it is necessary for the IDE not only to insert include statements, but also to remove them.  It might be a good idea mark both the start and the end of the &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives.&lt;br /&gt;
&lt;br /&gt;
=== Optimal Set of Include Directives ===&lt;br /&gt;
&lt;br /&gt;
Since this calculation of the OSID is made by the IDE, it seems resonable to assume the package concept that the IDE maintains.&lt;br /&gt;
&lt;br /&gt;
The IDE should &amp;quot;think&amp;quot; of things in the following way (during calculation of OSID&amp;#039;s the IDE should report the mentioned anomalies):&lt;br /&gt;
&lt;br /&gt;
:;Code files&lt;br /&gt;
::Files containing actual code (i.e. one or more scopes or a goal) are called &amp;#039;&amp;#039;code files&amp;#039;&amp;#039;.  Normally code files are .i, .cl and .pro files, but in this context we will not look at the extensions.&lt;br /&gt;
&lt;br /&gt;
:;Structure files&lt;br /&gt;
::Files containing &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives are called &amp;#039;&amp;#039;structure files&amp;#039;&amp;#039;.  Normally structure files are .pack and .ph files, but in this context we will not look at the extensions.&lt;br /&gt;
&lt;br /&gt;
::It is an anomaly if a file is both a code file and a structure file.&lt;br /&gt;
&lt;br /&gt;
:;Owned files&lt;br /&gt;
::A structure file &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; the code files it &amp;#039;&amp;#039;&amp;#039;directly&amp;#039;&amp;#039;&amp;#039; includes.&lt;br /&gt;
&lt;br /&gt;
::It is an anomaly if a code file is owned by two or more structure files.&lt;br /&gt;
&lt;br /&gt;
:;Owned scopes&lt;br /&gt;
::A structure file &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; the scopes in the files it owns.&lt;br /&gt;
&lt;br /&gt;
:;Exposed scopes&lt;br /&gt;
::If a structure file only owns interface definitions and class declarations (but no implementations or the goal).  Then the file exposes the scopes it owns.  Otherwise it exposes nothing.&lt;br /&gt;
&lt;br /&gt;
:;Exposing file&lt;br /&gt;
::The file that expose a cetain scope, is the exposing file of that scope.  (Since code files only have one owner, scopes only have at most one exposing file).  An exposing file can be included in other files (think of .ph files).&lt;br /&gt;
&lt;br /&gt;
:;Used scopes&lt;br /&gt;
::A structure file &amp;#039;&amp;#039;uses&amp;#039;&amp;#039; the scopes that are used &amp;#039;&amp;#039;&amp;#039;directly&amp;#039;&amp;#039;&amp;#039; by its owned scopes.&lt;br /&gt;
&lt;br /&gt;
:;OSID&lt;br /&gt;
::The &amp;#039;&amp;#039;Optimal Set of Include Directives&amp;#039;&amp;#039; for a structure file is the sum of the exposing files of the used scopes (excluding the file itself).&lt;br /&gt;
&lt;br /&gt;
Notice that if a scope does not have an exposing file then it can only be referenced from the owning file (or in normal terms the owning file is a .pack file and the scope is therefore private).&lt;br /&gt;
&lt;br /&gt;
=== Examplification ===&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; includes &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; directly, and &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; contains the implementation of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;.  Furthermore, &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039; directly uses &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;code file&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;structure file&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;aaa.pro&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; the implementation &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; owns an implementation therefore nothing is exposed&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039; uses &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039;, so the exposer of &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039; is in &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;OSID&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039; includes &amp;#039;&amp;#039;&amp;#039;aaa.cl&amp;#039;&amp;#039;&amp;#039; directly, and &amp;#039;&amp;#039;&amp;#039;aaa.cl&amp;#039;&amp;#039;&amp;#039; contains the declaration of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.cl&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;code file&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039; is a &amp;#039;&amp;#039;structure file&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;aaa.cl&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;owns&amp;#039;&amp;#039; the declaration of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;exposes&amp;#039;&amp;#039; the declaration of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* The &amp;#039;&amp;#039;exposer&amp;#039;&amp;#039; of &amp;#039;&amp;#039;&amp;#039;aaa&amp;#039;&amp;#039;&amp;#039; is &amp;#039;&amp;#039;&amp;#039;aaa.ph&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
If &amp;#039;&amp;#039;&amp;#039;bbb.ph&amp;#039;&amp;#039;&amp;#039; is the exposer of &amp;#039;&amp;#039;&amp;#039;bbb&amp;#039;&amp;#039;&amp;#039; then &amp;#039;&amp;#039;&amp;#039;bbb.ph&amp;#039;&amp;#039;&amp;#039; is in the &amp;#039;&amp;#039;OSID&amp;#039;&amp;#039; of &amp;#039;&amp;#039;&amp;#039;aaa.pack&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== Discussion ===&lt;br /&gt;
&lt;br /&gt;
With the descriptions above the .pack file can contain &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives that are also in the corresponding .ph file.  We could choose the exclude such &amp;lt;vp&amp;gt;#include&amp;lt;/vp&amp;gt; directives.  But I think it is simpler to consider each structure file as a completely independent file.&lt;br /&gt;
&lt;br /&gt;
[[IDE]]&lt;/div&gt;</summary>
		<author><name>Thomas Linder Puls</name></author>
	</entry>
</feed>