<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.eiffelroom.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>eiffelroom - Ecma - Comments</title>
 <link>http://www.eiffelroom.com/tag/ecma</link>
 <description>Comments for &quot;Ecma&quot;</description>
 <language>en</language>
<item>
 <title>Exposing pre/postconditions of agent</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-316</link>
 <description>&lt;p&gt;I disagree with the point that opposes exposing the preconditions and postconditions of agents.  It seems to me like the only way to get complete specifications of higher order routines (somewhat related to higher order functions).  In simpler terms, the postcondition function of agents may be used in postconditions of routines that receive agents as parameters (directly or indirectly) to describe the work in terms of the given agent.&lt;/p&gt;

&lt;p&gt;If I bring the problem in a functional context, we can see what could be desirable for Eiffel.  I&#039;ll use a lisp-like syntax and presume a design by contract macro set to make my example.  Let specify the map function (for non-lispers: this function applies a given function to every elements of a list and returns a list containing the results).&lt;/p&gt;

&lt;p&gt;&lt;pre class=&quot;geshifilter&quot;&gt;(def-dbc-function (map f list)
  (require
    (not (null? f)))
  (deferred)
  (ensure
    (implies (not (null? list)) 
              (equal? result 
                      (cons (f (car list))
                            (map f (cdr list)))))
    (implies (null? list)
              (null? result))))&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;We can see a parallel with iterators in Eiffel.  The main problem is that we cannot specify a procedure like do_all as we did map since it applies a procedure object and we do not know what we may call the frame of the operation.  I think that&#039;s why no easy definition comes up for the postcondition feature of routines.&lt;/p&gt;

&lt;p&gt;The only alternative is to write the loop as the implementation and the specification and then freeze the implementation.  This is not quite convenient because there may be reasons to redefine it.&lt;/p&gt;

&lt;p&gt;Simon&lt;/p&gt;

</description>
 <pubDate>Thu, 02 Aug 2007 10:59:44 -0700</pubDate>
 <dc:creator>maverick</dc:creator>
 <guid isPermaLink="false">comment 316 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Agent Contracts</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-189</link>
 <description>&lt;p&gt;I agree that exposing and then explicitly checking pre/postconditions is not desirable, at least not as a general solution to agent contracts.  Here are some thoughts on a possible form of a solution.&lt;/p&gt;

&lt;p&gt;We have code that wants to call a feature that is bound at runtime.  We may statically specify the type of feature (query or function) and the number, order, and type of open arguments that this feature must have.&lt;/p&gt;

&lt;p&gt;However, we cannot statically guarantee to the client that binds a feature and gives it to our code anything more about those arguments.  Neither can we describe what we expect from the feature.&lt;/p&gt;

&lt;p&gt;So, we can currently write that we want the following entity:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;to_call: &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+PROCEDURE&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;PROCEDURE&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;TARGET_TYPE, &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+TUPLE&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;TUPLE&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;argument_1: TYPE_1; ...&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;But, perhaps we want to write something more like&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;to_call: agent_interface prototype&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;(using &#039;agent_interface&#039; as a keyword) for a feature `prototype&#039; defined as:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;prototype&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;argument_1: TYPE_1; ...&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- Defines the contract of an agent&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;require&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;precondition_1: ...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #000060;&quot;&gt;agent_interface&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;ensure&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;precondition_2: ...&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;The assignment&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;to_call := &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; implementation&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;would require the feature `implementation&#039; to effect `prototype&#039; as if `prototype&#039; were a feature inherited as deferred. That is, `implementation&#039; would have to &lt;ul&gt;
    &lt;li&gt; Be a procedure with arguments that conform to the arguments of `prototype&#039; (as is currently required)&lt;/li&gt;
    &lt;li&gt; Use assertion extensions (that is, &#039;require else&#039; and &#039;ensure then&#039;)&lt;/li&gt;
    &lt;li&gt; Have a combined precondition and combined postcondition (like a redeclaration of a feature)&lt;/li&gt;
&lt;/ul&gt;

&lt;/p&gt;

&lt;p&gt;Additionally, I think there are some more details such as feature calls with `Current&#039; as the target probably cannot or should not be allowed in the assertions of the interface.&lt;/p&gt;

&lt;p&gt;An example following the previously provided DRAWABLE/SHAPE example:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;to_do: agent_interface draw_shape&lt;br /&gt;
&lt;br /&gt;
draw_shape&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;drawable: DRAWABLE; a_shape: SHAPE&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- Draw a shape on the given target.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;require&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a_shape_not_void: a_shape /= &lt;span style=&quot;color: #800080;&quot;&gt;Void&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #603000;&quot;&gt;visible&lt;/span&gt;: drawable.&lt;span style=&quot;color: #000060;&quot;&gt;is_visible&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;deferred&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
usage:&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp;drawable: DRAWABLE&lt;br /&gt;
&amp;nbsp; &amp;nbsp;a_tower: SHAPE&lt;br /&gt;
&amp;nbsp; &amp;nbsp;...&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #000060;&quot;&gt;to_do&lt;/span&gt; := &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#123;&lt;/span&gt;DRAWABLE&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#125;&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;draw&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;to_do.&lt;span style=&quot;color: #000060;&quot;&gt;call&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;drawable, a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;EDIT: corrected example usage&lt;/p&gt;

</description>
 <pubDate>Thu, 12 Apr 2007 05:52:43 -0700</pubDate>
 <dc:creator>harrah</dc:creator>
 <guid isPermaLink="false">comment 189 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>removing dynamic postconditions mitigates the problem but...</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-188</link>
 <description>&lt;p&gt;You can escape old and state issues by not having postconditions in the ROUTINE interface. There&#039;s no use case I can think of for checking postcondition explicitly at runtime (a failed postcondition can only be a bug), while there&#039;s a use case for checking some preconditions as part of establishing the client fulfills its side of the contract and takes remedial action otherwise.&lt;/p&gt;

&lt;p&gt;Although even there is does get a bit fuzzy in that the only preconditions a client should be entitled to check is the preconditions which are part of the _static_ agent interface, for instance let&#039;s say we have a classic Eiffel pattern:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;deferred&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;class&lt;/span&gt; DRAWABLE&lt;br /&gt;
&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;feature&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; is_visible: &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+BOOLEAN&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;BOOLEAN&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;is&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- Is drawable target ready to receive instructions?&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;deferred&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; draw &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;a_shape: SHAPE&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;is&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- Draw a shape on some target.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;require&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;a_shape_not_void: a_shape /= &lt;span style=&quot;color: #800080;&quot;&gt;Void&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #603000;&quot;&gt;visible&lt;/span&gt;: is_visible&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;deferred&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;which you would use as such:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;drawable: DRAWABLE&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;if&lt;/span&gt; drawable.&lt;span style=&quot;color: #000060;&quot;&gt;is_visible&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;drawable.&lt;span style=&quot;color: #000060;&quot;&gt;draw&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;In agentified Eiffel the same pattern becomes:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;drawable: &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+ROUTINE&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;ROUTINE&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+ANY&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;ANY&lt;/span&gt;&lt;/a&gt;, &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+TUPLE&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;TUPLE&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;SHAPE&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- (1) generic preconditions checking&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;if&lt;/span&gt; drawable.&lt;span style=&quot;color: #000060;&quot;&gt;preconditions_holds&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; drawable.&lt;span style=&quot;color: #000060;&quot;&gt;call&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- or (2) tagged preconditions checking&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;if&lt;/span&gt; drawable.&lt;span style=&quot;color: #000060;&quot;&gt;precondition_holds&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0080A0;&quot;&gt;&amp;quot;is_visible&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; drawable.&lt;span style=&quot;color: #000060;&quot;&gt;call&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#91;&lt;/span&gt;a_tower&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;    Both patterns suffer from problems. (1) is checking too much, leaking debug code into non-debug execution flow. This illustrate the major drawback of exposing preconditions, it leaks the internal programming language plumbing inside the program. I think it has been a great strength of Eiffel to have fairly limited reflection facilities, so that you don&#039;t have &amp;quot;bits of compilers&amp;quot; leaking into programs, both conceptually and as part of the runtime footprint. This stuff is moving in the wrong direction.&lt;/p&gt;

&lt;p&gt;(2) suffers a variant of the same problem, in that while semantically equivalent to the classic Eiffel pattern, it has also leaked compiler stuff into runtime, with some drawbacks for example the tag is a string, so there will be no compilation time error if is_visible is renamed etc, or if there&#039;s a typo in the first place, and the compiler cannot, or painfully, dead code away the &#039;debug&#039; contracts that are always true in a correct program (and that damage extend to all routines with the same signature that are agent targets, and their descendants!). Also code analysis or automated verification becomes a harder problem.&lt;/p&gt;

</description>
 <pubDate>Wed, 11 Apr 2007 04:23:32 -0700</pubDate>
 <dc:creator>nenieorg</dc:creator>
 <guid isPermaLink="false">comment 188 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>I think its not only about</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-179</link>
 <description>&lt;p&gt;I think its not only about the preservation. If you ask a routine whether a postcondition is satisfied, wich prestate and which poststate are you referring to? What is the meaning of `r.preconditions_hold ([1,2,3])&#039;? Does it ask whether some past execution satisfied the postcondition, the last one, or maybe a hypthesized one?&lt;/p&gt;

&lt;p&gt;I am not completely clear on it either, but at the moment the only thing that makes sense to me is to ask either:&lt;/p&gt;

&lt;p&gt;1) Given this set of arguments, this prestate and this poststate, does the postcondition hold?&lt;/p&gt;

&lt;p&gt;2) For the last execution of this agent, did the postcondition hold?&lt;/p&gt;

&lt;p&gt;I think 1) is very tricky to implement. (What is a prestate and what is a poststate?) 2) is easier to implement, in fact it can be as simple as a variable. But in the end I am not sure about its usefulness, after all if the last execution failed I would have noticed because an exception was thrown. Btw, for 2) you don&#039;t need arguments either.&lt;/p&gt;

&lt;p&gt;Andreas&lt;/p&gt;

</description>
 <pubDate>Mon, 02 Apr 2007 06:13:46 -0700</pubDate>
 <dc:creator>aleitner</dc:creator>
 <guid isPermaLink="false">comment 179 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Transmitting old values</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-178</link>
 <description>&lt;p&gt;As usual, I answered too quickly, before thinking.&lt;/p&gt;

&lt;p&gt;I now see that preservation of old values across the call might be tricky (or not possible, for an implementation in Eiffel code). Colin Adams&lt;/p&gt;

</description>
 <pubDate>Mon, 02 Apr 2007 02:16:51 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 178 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Calling the implementation</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-177</link>
 <description>&lt;p&gt;By &amp;quot;calling the implementation&amp;quot;, do you mean the implementation of the body or of the postcondition code?&lt;/p&gt;

&lt;p&gt;I don&#039;t see where the difficulty lies. It works in workbench mode.&lt;/p&gt;

&lt;p&gt;Colin Adams&lt;/p&gt;

</description>
 <pubDate>Mon, 02 Apr 2007 02:02:26 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 177 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Maybe I am missing</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-176</link>
 <description>&lt;p&gt;Maybe I am missing something, but I still don&#039;t see how `postcondition_holds&#039; can be implemented without calling the actual implementation? Or should the postcondition just be evaluated on the current state + arguments? If so, how can a `postcondition_holds&#039; ever ealuate to True for a postcondition like `count = old count + 1&#039;?&lt;/p&gt;

</description>
 <pubDate>Mon, 02 Apr 2007 01:32:17 -0700</pubDate>
 <dc:creator>aleitner</dc:creator>
 <guid isPermaLink="false">comment 176 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>ECMA process</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-174</link>
 <description>&lt;p&gt;Anyone can join the process as long as you are part of either a company/institution that is an ECMA member. The minutes and various proposals are currently only accessible by the ECMA members. As far as I know, the committee is free to decide whatever it wants regarding the publication of the various documents used (minutes, drafts, ...).&lt;/p&gt;

</description>
 <pubDate>Sun, 01 Apr 2007 10:36:16 -0700</pubDate>
 <dc:creator>manus_eiffel</dc:creator>
 <guid isPermaLink="false">comment 174 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Relevance</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/mixing_unicode_and_latin_1_class_texts#comment-173</link>
 <description>&lt;p&gt;The main benefit for homogeneous clusters is simpler heuristics - there is no possibility of confusing Latin-1 with UTF-8.&lt;/p&gt;

&lt;p&gt;If you can&#039;t eliminate the possibility of one or another, I know of know way to disambiguate them, in general.&lt;/p&gt;

&lt;p&gt;Of course, there are lots of cases where it is easier to see which of the two is meant. But in other cases, not.&lt;/p&gt;

&lt;p&gt;So, starting from the case where the file is pure ASCII. Did the author intend it to be treated as Latin-1 or UTF-8?&lt;/p&gt;

&lt;p&gt;In this case, it doesn&#039;t matter (the only possibility is the type of manifest string constants, but these are defined to be of type STRING).&lt;/p&gt;

&lt;p&gt;But all we have to do is to mutate one character in a string literal, and immediately (if we choose the mutation carefully), the case becomes undecidable.&lt;/p&gt;

&lt;p&gt;Colin Adams&lt;/p&gt;

</description>
 <pubDate>Sun, 01 Apr 2007 10:29:33 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 173 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Closed standard design process</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-172</link>
 <description>&lt;p&gt;I&#039;ll let Manu (the ECMA Eiffel committe convener) answer this question about the way ECMA works. I for one would prefer a more open process, and feel lucky to be part of this committee.&lt;/p&gt;

</description>
 <pubDate>Sun, 01 Apr 2007 02:42:42 -0700</pubDate>
 <dc:creator>ericb</dc:creator>
 <guid isPermaLink="false">comment 172 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Avoiding re-inventing the wheel</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-171</link>
 <description>&lt;p&gt;How is one supposed to know what the ECMA committee have and have-not considered? This is one of the chief points from my article &lt;a href=&quot;http://www.eiffelroom.com/blog/colin_adams/learning_from_the_w3c_process&quot;&gt;Learning from the W3C process&lt;/a&gt;. Colin Adams&lt;/p&gt;

</description>
 <pubDate>Sun, 01 Apr 2007 00:16:58 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 171 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Tags</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-170</link>
 <description>&lt;p&gt;Thanks for the correction, and the April Fool&#039;s joke.&lt;/p&gt;

&lt;p&gt;But I think that with my tags proposal, implementation should be fairly straight-forward, I would have thought (this was the point of the posting).  (It also has the advantage that in most cases you will be able to write lighter-weight code, by just testing a particular precondition, when you know most hold from the context). Colin Adams&lt;/p&gt;

</description>
 <pubDate>Sun, 01 Apr 2007 00:13:59 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 170 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Nothing new that the ECMA committee didn&#039;t know</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/correctness_conditions_2_for_calling_an_agent#comment-169</link>
 <description>&lt;p&gt;When you wrote:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;no_empty_strings: &lt;span style=&quot;color: #800080;&quot;&gt;Result&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;for_all&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+STRING&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;STRING&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#125;&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;is_empty&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I guess you meant:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;no_empty_strings: &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;not&lt;/span&gt; &lt;span style=&quot;color: #800080;&quot;&gt;Result&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;there_exists&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#123;&lt;/span&gt;&lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+STRING&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;STRING&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#125;&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;is_empty&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;Note that it would have been less confusing to write:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;no_empty_strings: &lt;span style=&quot;color: #800080;&quot;&gt;Result&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;for_all&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;s: &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+STRING&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;STRING&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;: &lt;a href=&quot;http://www.google.com/search?q=site%3Ahttp%3A%2F%2Fdocs.eiffel.com%2Feiffelstudio%2Flibraries+BOOLEAN&amp;btnI=I%27m+Feeling+Lucky&quot;&gt;&lt;span style=&quot;color: #800000&quot;&gt;BOOLEAN&lt;/span&gt;&lt;/a&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;do&lt;/span&gt; &lt;span style=&quot;color: #800080;&quot;&gt;Result&lt;/span&gt; := &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;not&lt;/span&gt; s.&lt;span style=&quot;color: #000060;&quot;&gt;is_empty&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;end&lt;/span&gt;&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;! ;-)&lt;/p&gt;

&lt;p&gt;Also, if routines `precondition&#039; and `postcondition&#039; (currently specified in ISE&#039;s ROUTINE class) were implemented, your proposal is not very different from the currently intended (but not explicitly specified, because not implemented) behavior:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;call &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;a_args: &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;like&lt;/span&gt; operands&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span style=&quot;color: #008000; font-style: italic;&quot;&gt;-- Call `Current&#039; passing `a_args&#039; as actual arguments.&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;require&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;valid_operands: valid_operands &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;args&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;preconditions_hold: precondition &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;a_args&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;ensure&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;postconditions_hold: postcondition &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;a_args&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;I think that the problem we are facing is not really how to specify things correctly (using tags or not), but rather how to implement it. I&#039;m sure that if ISE knew how to implement their `precondition&#039; and `postcondition&#039; routines in ROUTINE then `call&#039; would be properly specified with these contracts. For example even today you can write:&lt;/p&gt;

&lt;p&gt;&lt;div class=&quot;geshifilter eiffel&quot; style=&quot;font-family: monospace;&quot;&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;agent&lt;/span&gt; y&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span style=&quot;color: #000060;&quot;&gt;precondition&lt;/span&gt; &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;l_args&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span style=&quot;color: #0600FF; font-weight: bold;&quot;&gt;then&lt;/span&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;y &lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#40;&lt;/span&gt;l_arg1, l_arg2&lt;span style=&quot;color: #FF0000;&quot;&gt;&amp;#41;&lt;/span&gt;&lt;/div&gt;&lt;/p&gt;

&lt;p&gt;but because `precondition&#039; is not implemented and always returns True, this is useless.&lt;/p&gt;

</description>
 <pubDate>Sat, 31 Mar 2007 23:58:30 -0700</pubDate>
 <dc:creator>ericb</dc:creator>
 <guid isPermaLink="false">comment 169 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Is this relevant?</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/mixing_unicode_and_latin_1_class_texts#comment-165</link>
 <description>&lt;p&gt;The source code will be using plain text file (i.e. sequence of character codes that are between 0 and 255), UTF-8 or any other Unicode encoding. Once you have the encoding then the semantics is properly defined.&lt;/p&gt;

&lt;p&gt;Of course if one library author is using Unicode characters beyond 255, the user of that library will be forced to use a Unicode encoding for his source code, but is this relevant to the project specification? I don&#039;t think so.&lt;/p&gt;

</description>
 <pubDate>Fri, 30 Mar 2007 10:12:00 -0700</pubDate>
 <dc:creator>manus_eiffel</dc:creator>
 <guid isPermaLink="false">comment 165 at http://www.eiffelroom.com</guid>
</item>
<item>
 <title>Heuristics</title>
 <link>http://www.eiffelroom.com/blog/colin_adams/mixing_unicode_and_latin_1_class_texts#comment-164</link>
 <description>&lt;p&gt;See also &lt;a href=&quot;http://eiffelsoftware.origo.ethz.ch/index.php/Heuristics_for_detecting_class_text_encoding&quot;&gt;Heuristics for detecting class text encoding&lt;/a&gt;. Colin Adams&lt;/p&gt;

</description>
 <pubDate>Fri, 30 Mar 2007 10:07:50 -0700</pubDate>
 <dc:creator>colin-adams</dc:creator>
 <guid isPermaLink="false">comment 164 at http://www.eiffelroom.com</guid>
</item>
</channel>
</rss>
