<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>Sarah Thompson&apos;s Lab Notebook</title>
  <link>http://labnotes.livejournal.com/</link>
  <description>Sarah Thompson&apos;s Lab Notebook - LiveJournal.com</description>
  <lastBuildDate>Tue, 22 Jul 2003 15:32:45 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>labnotes</lj:journal>
  <lj:journalid>1199730</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/6066494/1199730</url>
    <title>Sarah Thompson&apos;s Lab Notebook</title>
    <link>http://labnotes.livejournal.com/</link>
    <width>100</width>
    <height>90</height>
  </image>

<item>
  <guid isPermaLink='true'>http://labnotes.livejournal.com/1509.html</guid>
  <pubDate>Tue, 22 Jul 2003 15:32:45 GMT</pubDate>
  <title>Representing cyclic data structures in Haskell</title>
  <link>http://labnotes.livejournal.com/1509.html</link>
  <description>Here are some notes relating to a recent thread on haskell-cafe, started by yours-truly with this question:&lt;br /&gt;&lt;br /&gt;------------------------&lt;br /&gt;What is the best way to represent cyclic data structures in Haskell?&lt;br /&gt;&lt;br /&gt;Lists are trivial. Trees are trivial. But what if the thing you&apos;re trying to represent is shaped like an electronic circuit, with a (possibly large) number of nodes connected by multiple arrows to other nodes? In an imperative language like C++, I&apos;d probably just model the circuit directly, with objects representing nodes and pointers representing links between nodes. A good way to model this in Haskell is less obvious, however.&lt;br /&gt;&lt;br /&gt;A simplistic approach would be to represent such a structure as a list of nodes, where each node contained a list of other connected nodes. Containing the actual nodes within the sub-lists probably isn&apos;t feasible -- some kind of reference would be necessary in order to get around chicken-and-egg problems with instantiating the data structure. But, in this case, it&apos;s not so easy to see how one could &apos;walk&apos; the structure efficiently, because moving from node to node would involve quite horrible (possibly slow) lookups. In C++, I&apos;d simply follow a pointer, which would be an extremely fast operation.&lt;br /&gt;&lt;br /&gt;I would also need to implement efficient indexes into the data structure -- flat searching will be too slow for non-trivial amounts of data. In C++, I&apos;d implement one or more external (probably STL-based) indexes that point into the main data structure.&lt;br /&gt;&lt;br /&gt;How do people typically solve this problem at the moment? I know a few people out there have written hardware compilers in Haskell and similar languages, so there should be some experience of this in the community. I can probably work something out soon enough, but reinventing the wheel is never a great idea.&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;Here is a potted series of responses, some of which are definitely worth following up in more detail:&lt;br /&gt;&lt;br /&gt;&lt;a name=&quot;cutid1&quot;&gt;&lt;/a&gt;&lt;br /&gt;------------------------&lt;br /&gt;Hi Sarah,&lt;br /&gt;&lt;br /&gt;Representing cyclic structures is indeed somewhat tricky in a pure functional language.  The obvious representation (representing the link structure implicitly in an algebraic data type) doesn&apos;t work, because you can&apos;t obvserve cycles.&lt;br /&gt;&lt;br /&gt;I recommend checking out two pieces of work in this area:&lt;br /&gt;&lt;br /&gt;1.  Martin Erwig&apos;s work on inductive representations of graphs:&lt;br /&gt;&lt;br /&gt;  Inductive Graphs and Functional Graph Algorithms, Martin Erwig&lt;br /&gt;  Journal of Functional Programming Vol. 11, No. 5, 467-492, 2001&lt;br /&gt;&lt;br /&gt;available from:&lt;br /&gt;&lt;br /&gt;  &lt;a href=&quot;http://cs.oregonstate.edu/~erwig/papers/abstracts.html#JFP01&quot;&gt;http://cs.oregonstate.edu/~erwig/papers/abstracts.html#JFP01&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2.  Koen Claessen and David Sands&apos; work on observable sharing:&lt;br /&gt;&lt;br /&gt;  Observable Sharing for Functional Circuit Description,&lt;br /&gt;Koen Claessen, David Sands, published at ASIAN &apos;99, in Phuket, Thailand&lt;br /&gt;&lt;br /&gt;available from:&lt;br /&gt;&lt;br /&gt;  &lt;a href=&quot;http://www.math.chalmers.se/~koen/Papers/obs-shar.ps&quot;&gt;http://www.math.chalmers.se/~koen/Papers/obs-shar.ps&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Hope that helps,&lt;br /&gt;&lt;br /&gt;    -Antony&lt;br /&gt;&lt;br /&gt;-- &lt;br /&gt;Antony Courtney&lt;br /&gt;Grad. Student, Dept. of Computer Science, Yale University&lt;br /&gt;antony@apocalypse.org          &lt;a href=&quot;http://www.apocalypse.org/pub/u/antony&quot;&gt;http://www.apocalypse.org/pub/u/antony&lt;/a&gt; &lt;br /&gt;------------------------&lt;br /&gt;Lazy evaluation means that you can embed nodes directly in a cyclic structure, even though that would appear to create an indefinite regression.  In order to detect cycles, one might add a node identifier.  Here&apos;s a simple example:&lt;br /&gt;&lt;br /&gt;[[&lt;br /&gt;-- spike-cyclicstructure.hs&lt;br /&gt;&lt;br /&gt;data Node = Node { nodeid :: String, adjacent :: [Node] }&lt;br /&gt;&lt;br /&gt;instance Eq Node where n1 == n2 = nodeid n1 == nodeid n2&lt;br /&gt;&lt;br /&gt;instance Show Node where show = nodeid&lt;br /&gt;&lt;br /&gt;findPaths :: Node -&amp;gt; Node -&amp;gt; [[Node]]&lt;br /&gt;findPaths fromNode toNode = map reverse $ findPaths1 [] fromNode toNode&lt;br /&gt;&lt;br /&gt;findPaths1 :: [Node] -&amp;gt; Node -&amp;gt; Node -&amp;gt; [[Node]]&lt;br /&gt;findPaths1 beenThere fromNode toNode&lt;br /&gt;    | fromNode == toNode = [fromNode:beenThere]&lt;br /&gt;    | otherwise = concat [ findPaths1 (fromNode:beenThere) nextNode toNode&lt;br /&gt;                         | nextNode &amp;lt;- adjacent fromNode&lt;br /&gt;                         , not ( nextNode `elem` beenThere ) ]&lt;br /&gt;&lt;br /&gt;n1 = Node &quot;n1&quot; [n2,n3,n4]&lt;br /&gt;n2 = Node &quot;n2&quot; [n1,n3,n4]&lt;br /&gt;n3 = Node &quot;n3&quot; [n1,n2]&lt;br /&gt;n4 = Node &quot;n4&quot; [n1,n2]&lt;br /&gt;&lt;br /&gt;test1 = findPaths n1 n2 -- [[n1,n2],[n1,n3,n2],[n1,n4,n2]]&lt;br /&gt;test2 = findPaths n1 n3 -- [[n1,n2,n3],[n1,n3],[n1,n4,n2,n3]]&lt;br /&gt;]]&lt;br /&gt;&lt;br /&gt;One (crude) way to think about this is that a mention of a value in haskell behaves in some ways like a pointer to that value in (say) C.&lt;br /&gt;&lt;br /&gt;If you don&apos;t want to assign unique identifiers by hand, you could use a state transformer monad to generate them for you.&lt;br /&gt;&lt;br /&gt;#g&lt;br /&gt;--&lt;br /&gt;Graham Klyne&lt;br /&gt;&amp;lt;gk@ninebynine.org&amp;gt;&lt;br /&gt;PGP: 0FAA 69FF C083 000B A2E9  A131 01B9 1C7A DBCA CB5E&lt;br /&gt;------------------------&lt;br /&gt;You _might_ find some useful ideas in&lt;br /&gt;&lt;br /&gt;Franklyn Turbak and J. B. Wells.  Cycle Therapy: A Prescription for Fold and&lt;br /&gt;Unfold on Regular Trees.  Third International Conference on Principles and&lt;br /&gt;Practice of Declarative Programming. ACM, 2001.&lt;br /&gt;&lt;a href=&quot;http://cs.wellesley.edu/~fturbak/pubs/ppdp01.html&quot;&gt;http://cs.wellesley.edu/~fturbak/pubs/ppdp01.html&lt;/a&gt;&lt;br /&gt;&lt;a href=&quot;http://cs.wellesley.edu/~fturbak/pubs/index.html&quot;&gt;http://cs.wellesley.edu/~fturbak/pubs/index.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Stefan Kahrs. Unlimp: Uniqueness as a leitmotiv for implementation. In M.&lt;br /&gt;Bruynooghe and M. Wirsing, editors, Proc. Programming Language Implementation&lt;br /&gt;and Logic Programming, Lecture Notes in Computer Science 631, 115--129, 1992.&lt;br /&gt;&lt;a href=&quot;http://citeseer.nj.nec.com/kahrs92unlimp.html&quot;&gt;http://citeseer.nj.nec.com/kahrs92unlimp.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Chris Milton&lt;br /&gt;(busy processing MILSTRIPs in Perl)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;=====&lt;br /&gt;Christopher Milton&lt;br /&gt;cmiltonperl@yahoo.com&lt;br /&gt;??????????????????????????&lt;br /&gt;--Matsuo Bashou&lt;br /&gt;------------------------&lt;br /&gt;G&apos;day all.&lt;br /&gt;&lt;br /&gt;On Mon, Jul 07, 2003 at 04:04:17PM +0100, Sarah Thompson wrote:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; I would also need to implement efficient indexes into the data structure &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; -- flat searching will be too slow for non-trivial amounts of data. In &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; C++, I&apos;d implement one or more external (probably STL-based) indexes &lt;br /&gt;&amp;gt;&amp;gt;&amp;gt; &amp;gt; that point into the main data structure.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I replied:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt; The direct Haskell equivalent is to use Refs; either IORefs or&lt;br /&gt;&amp;gt;&amp;gt; STRefs.  (I&apos;d personally use IORefs, but that&apos;s because I like&lt;br /&gt;&amp;gt;&amp;gt; having IO around.)  Dereferencing an IORef is a constant-time&lt;br /&gt;&amp;gt;&amp;gt; operation, just like chasing a pointer in C.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I forgot to give an example. &lt;br /&gt;&lt;br /&gt;Suppose you want some kind of electronic circuit, as you suggested.&lt;br /&gt;Abstractly, you want something like this:&lt;br /&gt;&lt;br /&gt;	data Node&lt;br /&gt;	  = Node NodeState [Component]&lt;br /&gt;&lt;br /&gt;	data Component&lt;br /&gt;	  = Resistor ResistorCharacteristics Node Node&lt;br /&gt;	  | Transistor TransistorCharacteristics Node Node Node&lt;br /&gt;	  | {- etc -}&lt;br /&gt;&lt;br /&gt;You can make this indirect in introducing refs:&lt;br /&gt;&lt;br /&gt;	type NodeRef = IORef Node&lt;br /&gt;	type ComponentRef = IORef Component&lt;br /&gt;&lt;br /&gt;	data Node&lt;br /&gt;	  = Node NodeState [ComponentRef]&lt;br /&gt;&lt;br /&gt;	data Component&lt;br /&gt;	  = Resistor ResistorCharacteristics NodeRef NodeRef&lt;br /&gt;	  | Transistor TransistorCharacteristics NodeRef NodeRef NodeRef&lt;br /&gt;&lt;br /&gt;The data structures are mutable:&lt;br /&gt;&lt;br /&gt;	getNodeState :: NodeRef -&amp;gt; IO NodeState&lt;br /&gt;	getNodeState node&lt;br /&gt;	  = do	Node state _ &amp;lt;- readIORef node&lt;br /&gt;		return state&lt;br /&gt;&lt;br /&gt;	setNodeState :: NodeRef -&amp;gt; NodeState -&amp;gt; IO ()&lt;br /&gt;	setNodeState node state&lt;br /&gt;	  = do	modifyIORef (\Node _ cs -&amp;gt; Node state cs) node&lt;br /&gt;&lt;br /&gt;and it&apos;s straightforward to construct an index into the middle&lt;br /&gt;somewhere:&lt;br /&gt;&lt;br /&gt;	type NamedNodeIndex = FiniteMap String NodeRef&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;Andrew Bromage&lt;br /&gt;------------------------&lt;br /&gt;Hi Sarah,&lt;br /&gt;&lt;br /&gt;On Mon, 2003-07-07 at 16:04, Sarah Thompson wrote:&lt;br /&gt;&lt;br /&gt;&amp;gt;&amp;gt; What is the best way to represent cyclic data structures in Haskell?&lt;br /&gt;&amp;gt;&amp;gt; &lt;br /&gt;&amp;gt;&amp;gt; Lists are trivial. Trees are trivial. But what if the thing you&apos;re &lt;br /&gt;&amp;gt;&amp;gt; trying to represent is shaped like an electronic circuit, ...&lt;br /&gt;&amp;gt;&amp;gt; ...&lt;br /&gt;&amp;gt;&amp;gt; How do people typically solve this problem at the moment? I know a few &lt;br /&gt;&amp;gt;&amp;gt; people out there have written hardware compilers in Haskell and similar &lt;br /&gt;&amp;gt;&amp;gt; languages, ...&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You&apos;re right, this is a longstanding problem!&lt;br /&gt;&lt;br /&gt;I&apos;ve experimented with several solutions to it in Hydra, a pure&lt;br /&gt;functional hardware description language whose aims include preserving&lt;br /&gt;referential transparency, and also keeping within a natural functional&lt;br /&gt;style.  My view is that if you have to resort to encoding a C-style&lt;br /&gt;solution in a functional language, then you might as well use C instead.&lt;br /&gt;&lt;br /&gt;Anyway, there are several papers on Hydra that are relevant.  The first&lt;br /&gt;solution, described in a paper from 1988, is to build the circular&lt;br /&gt;graphs in the obvious way and then to use a pointer-equality predicate&lt;br /&gt;to traverse the graphs safely.  Of course, this makes the hardware&lt;br /&gt;description language impure, it breaks referential transparency, and it&lt;br /&gt;has other drawbacks.  You can find that paper on my web page, but it was&lt;br /&gt;written before Haskell appeared, and it uses an older functional&lt;br /&gt;language with different syntax.&lt;br /&gt;&lt;br /&gt;I wrote a paper about the problem in 1992,&lt;br /&gt;www.dcs.gla.ac.uk/~jtod/papers/1992-Netlist/  This paper discusses the&lt;br /&gt;problems with the pointer-equality solution and introduces naming as a&lt;br /&gt;pure alternative.  The idea of naming is to give unique labels to some&lt;br /&gt;of the nodes, so that you can build the circular graph in the usual way,&lt;br /&gt;and you can also traverse the graph safely.  This is a pure functional&lt;br /&gt;solution, and it has a lot of advantages over adjacency lists, but it&lt;br /&gt;does require that the labels are introduced correctly.  The best way to&lt;br /&gt;put the labels in is by a transformation.&lt;br /&gt;&lt;br /&gt;Currently, Hydra uses an automated transformation implemented with&lt;br /&gt;Template Haskell to introduce the names.  I think this is the ideal&lt;br /&gt;solution: it results in a very clean notation for specifying the&lt;br /&gt;circuit, and it supports traversal of the graph, yet it preserves simple&lt;br /&gt;equational reasoning and all the supporting algorithms are in a pure&lt;br /&gt;functional style. I&apos;m currently writing a paper on the details of this&lt;br /&gt;solution.  It won&apos;t be finished for some time, but there already exists&lt;br /&gt;a brief survey of the solution, which you can find at:&lt;br /&gt;www.dcs.gla.ac.uk/~jtod/drafts/ (&quot;Embedding a hardware description&lt;br /&gt;language in Template Haskell&quot;)  This paper focuses on the way Hydra is&lt;br /&gt;implemented as a domain specific language embedded in Haskell, and the&lt;br /&gt;last part of it talks about the graph traversal issues.  This is a&lt;br /&gt;draft, submitted for publication, and any comments on it would be&lt;br /&gt;welcome!  (However, the actual method used in Hydra is considerably more&lt;br /&gt;complex than what&apos;s presented in the draft paper, because there are a&lt;br /&gt;number of other issues that need to be addressed in addition to just&lt;br /&gt;traversing the circular graph safely.)&lt;br /&gt;&lt;br /&gt;There are a lot of alternative approaches to the problem.  They will be&lt;br /&gt;compared in more detail in the paper-in-progress, but briefly they&lt;br /&gt;include: (1) Using adjacency lists, which have the disadvantages that&lt;br /&gt;you pointed out. (2) Using a monadic approach, which can be used in&lt;br /&gt;several distinct ways to solve the problem, but which have a bad impact&lt;br /&gt;on the specification style and the ease of reasoning about the circuit.&lt;br /&gt;(3) Using impure solutions, such as the pointer equality method used in&lt;br /&gt;the 1988 Hydra paper.  Observable sharing (Claessen and Sands, 1999) is&lt;br /&gt;identical to the solution that was implemented in Hydra in the mid 80&apos;s&lt;br /&gt;and described in the 1988 paper; the difference is that they call the&lt;br /&gt;approach &quot;observable sharing&quot; instead of &quot;pointer equality&quot;.&lt;br /&gt;&lt;br /&gt;Best wishes,&lt;br /&gt;John O&apos;Donnell&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;------------------------&lt;br /&gt;&lt;br /&gt;&amp;gt;What is the best way to represent cyclic data structures in Haskell?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There used to be some work on direct cyclic representations at UCL:&lt;br /&gt;&lt;br /&gt;  Dynamic Cyclic Data Structures in Lazy Functional Languages&lt;br /&gt;  Chris Clack, Stuart Clayman, David Parrott&lt;br /&gt;  Department of Computer Science, University College London,&lt;br /&gt;  October 1995&lt;br /&gt;&lt;br /&gt;The link to the project, from&lt;br /&gt;&lt;br /&gt;  &lt;a href=&quot;http://www.cs.ucl.ac.uk/staff/C.Clack/research/report94.html&quot;&gt;http://www.cs.ucl.ac.uk/staff/C.Clack/research/report94.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;is broken, but the paper seems to be online at&lt;br /&gt;&lt;br /&gt;  &lt;a href=&quot;http://www.cs.ucl.ac.uk/teaching/3C11/graph.ps&quot;&gt;http://www.cs.ucl.ac.uk/teaching/3C11/graph.ps&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;If you want to go for this direct cyclic representation, the&lt;br /&gt;interplay with lazy memo functions is also interesting:&lt;br /&gt;&lt;br /&gt;  J. Hughes, Lazy memo-functions, Functional Programming&lt;br /&gt;  Languages and Computer Architecture, J-P. Jouannaud ed., &lt;br /&gt;  Springer Verlag, LNCS 201, 129-146, 1985. &lt;br /&gt;&lt;br /&gt;  (lazy memo-functions remember previous input-output pairs&lt;br /&gt;   based only on pointer-info, which is sufficient to write&lt;br /&gt;   functions over cyclic structures that, instead of infinitely&lt;br /&gt;   unrolling the cycles, produce cyclic results)&lt;br /&gt;&lt;br /&gt;  (not online?-(&lt;br /&gt;&lt;br /&gt;Claus&lt;br /&gt;</description>
  <comments>http://labnotes.livejournal.com/1509.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://labnotes.livejournal.com/1117.html</guid>
  <pubDate>Tue, 22 Jul 2003 14:50:15 GMT</pubDate>
  <title>wxHaskell</title>
  <link>http://labnotes.livejournal.com/1117.html</link>
  <description>This looks heavensent (if it works! -- need to try it and see!)&lt;br /&gt;&lt;br /&gt;--------------&lt;br /&gt;&lt;br /&gt;Announcement: wxHaskell 0.1&lt;br /&gt;---------------------------&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://wxhaskell.sourceforge.net/&quot;&gt;http://wxhaskell.sourceforge.net/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;wxHaskell is a new portable GUI library for Haskell. The goal of the &lt;br /&gt;project is to provide an industrial strength portable GUI library, but &lt;br /&gt;without the burden of developing (and maintaining) one ourselves. &lt;br /&gt;&lt;br /&gt;wxHaskell is therefore build on top of wxWindows -- a comprehensive &lt;br /&gt;C++ library that is portable across all major GUI platforms; including &lt;br /&gt;GTK, Windows, X11, and MacOS X. Furthermore, it is a mature library &lt;br /&gt;(in development since 1992) that supports a wide range of widgets with &lt;br /&gt;native look-and-feel, and it has a very active community (ranked among &lt;br /&gt;the top 25 most active projects on sourceforge).&lt;br /&gt;&lt;br /&gt;Since most of the interface is automatically generated from the &lt;br /&gt;wxEiffel binding, the current release of wxHaskell already supports &lt;br /&gt;about 75% of the wxWindows functionality -- about 2500 methods in 500 &lt;br /&gt;classes with 1200 constant definitions.&lt;br /&gt;&lt;br /&gt;wxHaskell has been build with GHC 6.0 on Windows, MacOS X and Unix &lt;br /&gt;systems with GTK. A binary distribution is available for Windows (and&lt;br /&gt;we are working on a binary release for MacOS X).&lt;br /&gt;&lt;br /&gt;And even if you don&apos;t intend to write GUI&apos;s yourself, it will be fun &lt;br /&gt;to check out the screenshots at &amp;lt;http://wxhaskell.sourceforge.net&amp;gt;.&lt;br /&gt;&lt;br /&gt;All the best,&lt;br /&gt;  Daan Leijen.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;_______________________________________________&lt;br /&gt;Haskell mailing list&lt;br /&gt;Haskell@haskell.org&lt;br /&gt;&lt;a href=&quot;http://www.haskell.org/mailman/listinfo/haskell&quot;&gt;http://www.haskell.org/mailman/listinfo/haskell&lt;/a&gt;</description>
  <comments>http://labnotes.livejournal.com/1117.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://labnotes.livejournal.com/869.html</guid>
  <pubDate>Tue, 22 Jul 2003 14:39:46 GMT</pubDate>
  <title>Arvind&apos;s talk [Fri 15 Aug, provisionally 09:30, room TBA (FW26?)]</title>
  <link>http://labnotes.livejournal.com/869.html</link>
  <description>Cross-posted from cprg-announce:&lt;br /&gt;&lt;br /&gt;Bluespec: Why chip design can&apos;t be left to EE&apos;s&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Arvind&lt;br /&gt;&lt;br /&gt;CSAIL (formerly LCS and AI Lab)&lt;br /&gt;&lt;br /&gt;Massachusetts Institute of Technology&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;A 5M-gate ASIC is common place in 180nm technology today. We may see 50M to&lt;br /&gt;100M-gate ASICs within a decade as technology improves to sub 90nm. (Fully&lt;br /&gt;custom-designed microprocessors are, of course, much denser and faster then&lt;br /&gt;ASICs but also require dramatically more design resources). Numerous&lt;br /&gt;problems related to process and design need to be solved before such large&lt;br /&gt;chips will become commonplace. Some of these problems, e.g., leaky&lt;br /&gt;transistors, porous oxide, controlling multiple Vt&apos;s are clearly in the&lt;br /&gt;domain of EE&apos;s but computer scientists are much better equipped to solve&lt;br /&gt;the new problems related to the design-in-the-large. Large designs have to&lt;br /&gt;be conceived and executed in terms of  a hierarchy of blocks. The hierarchy&lt;br /&gt;cannot be constructed in an ad hoc manner but should use some method of&lt;br /&gt;composition systematically. For example, the functionality of a proper&lt;br /&gt;composition of blocks has to be derivable from the functionality of&lt;br /&gt;individual blocks. Bluespec is a language/methodology that promotes&lt;br /&gt;correctness-by-construction. Its underlying execution model is based on&lt;br /&gt;atomic actions on state elements (flip-flops, registers, ...), i.e., any&lt;br /&gt;legal behavior is explainable in a terms of a sequence of atomic actions on&lt;br /&gt;the state. Bluespec has facilities for expressing highly parameterized&lt;br /&gt;modules (&apos;generic classes&quot; in the language sense) and an expressive&lt;br /&gt;language to compose modules. The expressivity of the language has no limits&lt;br /&gt;because its semantics are orthogonal to hardware execution semantics -- the&lt;br /&gt;source program is turned into a flat interconnection of modules by &quot;static&lt;br /&gt;elaboration&quot; during the compile phase.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In this talk I will present Bluespec via examples and show some of the&lt;br /&gt;designs done so far.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Bluespec is a joint work of people at MIT and Sandburst Corporation.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Arvind is the Johnson Professor of Computer Science and Engineering at the&lt;br /&gt;Massachusetts Institute of Technology. As the Founder and President of&lt;br /&gt;Sandburst, Arvind led the Company from its inception in June 2000 until his&lt;br /&gt;return to MIT in August 2002. His work at MIT on high-level specification&lt;br /&gt;and description of architectures and protocols using Term Rewriting Systems&lt;br /&gt;(TRSs), encompassing hardware synthesis as well as verification, laid the&lt;br /&gt;foundations for Sandburst. Previously, he contributed to the development of&lt;br /&gt;dynamic dataflow architectures, and together with Dr R.S.Nikhil published&lt;br /&gt;the book &quot;Implicit Parallel Programming in  pH&quot;. Arvind is an IEEE Fellow&lt;br /&gt;and was awarded the Charles Babbage Outstanding Scientist Award in 1994. He&lt;br /&gt;has received the Distinguished Alumni Awards from the Indian Institute of&lt;br /&gt;Technology, Kanpur, and the University of Minnesota.</description>
  <comments>http://labnotes.livejournal.com/869.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://labnotes.livejournal.com/658.html</guid>
  <pubDate>Tue, 22 Jul 2003 14:38:56 GMT</pubDate>
  <title>Lazy specialisation thesis</title>
  <link>http://labnotes.livejournal.com/658.html</link>
  <description>This looks interesting:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www-users.cs.york.ac.uk/mjt/thesis-thyer.pdf&quot;&gt;http://www-users.cs.york.ac.uk/mjt/thesis-thyer.pdf&lt;/a&gt; (temporary link), &lt;br /&gt;see also:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.cs.york.ac.uk/ftpdir/reports/&quot;&gt;http://www.cs.york.ac.uk/ftpdir/reports/&lt;/a&gt; (permanent)&lt;br /&gt;&lt;br /&gt;Alan Mycroft passed on the link. Looks interesting from the abstract:&lt;br /&gt;&lt;br /&gt;&lt;i&gt;This thesis describes a scheme to combine the benefits of lazy evaluation&lt;br /&gt;with partial evaluation.  By performing specializations only when needed&lt;br /&gt;(lazily), the specialize-residualize decision is changed from being semantic&lt;br /&gt;to operational.  It is demonstrated that a completely lazy evaluator is&lt;br /&gt;capable of eliminating towers of interpreters.  The scheme is generalised,&lt;br /&gt;devising a new implementation of optimal evaluation, and it is demonstrated&lt;br /&gt;that optimal evaluators do not eliminate towers of interpreters.&lt;br /&gt;It is argued that the concept of scope has too often been overlooked in the&lt;br /&gt;lambda-calculus.  A new system of depths is introduced in order to handle&lt;br /&gt;the issue of scope.  The new approach leads to a much richer understanding&lt;br /&gt;of the issue of sharing in the lambda-calculus.  Although optimal evaluators&lt;br /&gt;are well known, it is argued that less well understood degrees of sharing,&lt;br /&gt;in between the sharing of conventional functional languages and optimal&lt;br /&gt;evaluators, are of more practical use.  A new classification of possible&lt;br /&gt;function body reduction strategies is shown to be analogous and orthogonal&lt;br /&gt;to argument reduction strategies. &lt;/i&gt;</description>
  <comments>http://labnotes.livejournal.com/658.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://labnotes.livejournal.com/354.html</guid>
  <pubDate>Tue, 22 Jul 2003 14:28:21 GMT</pubDate>
  <title>My Lab Notebook</title>
  <link>http://labnotes.livejournal.com/354.html</link>
  <description>I&apos;ve created this second LiveJournal as a lab notebook. Don&apos;t expect to find any personal comments here -- this journal is purely intended as a convenient place to store notes, thoughts, links and other low grade meanderings related to my PhD studies. If you find anything of use here, you&apos;re welcome to it! ;-)&lt;br /&gt;&lt;br /&gt;Sarah Thompson</description>
  <comments>http://labnotes.livejournal.com/354.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
