<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss'><id>tag:blogger.com,1999:blog-7421391</id><updated>2009-11-29T11:49:58.910+10:00</updated><title type='text'>Etymon</title><subtitle type='html'>\Et"y*mon\, n.; pl. E. Etymons, Gr. Etyma. 
&lt;br&gt;
[L., fr. Gr. 'e`tymon the true literal sense of a word according to its derivation, an etymon]</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default?start-index=26&amp;max-results=25'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>98</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7421391.post-5455829132119710911</id><published>2009-11-25T09:59:00.008+10:00</published><updated>2009-11-25T10:59:41.758+10:00</updated><title type='text'>JRuby and JNI and OS X.</title><content type='html'>&lt;p&gt;Like practically everyone I sat down a few years back and picked up enough Ruby to write an address-book app in Rails. Nice enough language, a few nice features[0]. Still at the end of the day... YADTL, so ultimately YAWN[1].&lt;/p&gt;
&lt;p&gt;
All this is to say that I found myself yesterday facing the need to convert a trivial rails app into a java servlet, with the added complication that it uses a third-party C++ library to do the bulk of the work.
&lt;/p&gt;
&lt;p&gt;
JRuby is a trivial install, and the application in question didn't make use of continuations, so rip out all the Rails code, and replace with a simple loop that takes requests from the cmdline instead of a POST parameter, and we're in business.
&lt;/p&gt;
&lt;p&gt;
Well up to the point where it falls over because it needs the C++ library.  Here's the first real hurdle.  Apple's JDK for OS X is compiled as a 64-bit binary which can't link against 32-bit libraries[2], and by default the C compiler only produces 32-bit libraries.
&lt;pre&gt;$ file /usr/local/lib/libcrfpp.dylib 
/usr/local/lib/libcrfpp.dylib: Mach-O dynamically linked shared library i386
&lt;/pre&gt;
A quick check on google yields &lt;a href="http://de-co-de.blogspot.com/2008/04/if-you-install-modjk.html"&gt;these&lt;/a&gt; &lt;a href="http://code.google.com/p/modwsgi/wiki/InstallationOnMacOSX"&gt;pages&lt;/a&gt; that suggest that I need to add &lt;code&gt;-arch i386 -arch x86_64&lt;/code&gt; to the &lt;code&gt;CXXFLAGS&lt;/code&gt; and &lt;code&gt;LDFLAGS&lt;/code&gt;. So after modifying the Makefile to compile the library with the above flags and install it in /opt/local we have:
&lt;pre&gt;$ file /opt/local/lib/libcrfpp.dylib 
/opt/local/lib/libcrfpp.dylib: Mach-O universal binary with 2 architectures
/opt/local/lib/libcrfpp.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/opt/local/lib/libcrfpp.dylib (for architecture x86_64): Mach-O 64-bit dynamically linked shared library x86_64&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Then we need to compile the SWIG generated JNI wrapper, which will also require the above parameters, but also needs to link against Apples JNI installation.
Back to Google which provides this page from Apple that describes &lt;a href="http://developer.apple.com/mac/library/DOCUMENTATION/Java/Conceptual/Java14Development/05-CoreJavaAPIs/CoreJavaAPIs.html"&gt;how to compile JNI on Darwin&lt;/a&gt;, which provides the include path and an additional link flag.
&lt;/p&gt;
&lt;p&gt;
The command lines to compile the wrapper in question becomes:
&lt;pre&gt;g++ -arch i386 -arch x86_64 -c -I/System/Library/Frameworks/JavaVM.framework/Headers CRFPP_wrap.cxx
g++ -arch i386 -arch x86_64 -dynamiclib -L/opt/local/lib -lcrfpp -o libCRFPP.jnilib CRFPP_wrap.o -framework JavaVM&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Wanting to avoid calling &lt;code&gt;System.loadLibrary&lt;/code&gt; from ruby code I wrote a quick wrapper class that could make the call in a static block:
&lt;pre&gt;package crfppwrapper;

import org.chasen.crfpp.Tagger;

public class CRFPP {
    public static Tagger newTagger(String args) {
        return new Tagger(args);
    }

    static {
        System.loadLibrary("CRFPP");
    }
}
&lt;/pre&gt;
Finally modify the relevant ruby file to link to the jar file:
&lt;pre&gt;require 'java'
require 'lib/CRFPP-0.53.jar'
&lt;/pre&gt;
and call the wrapper:
&lt;pre&gt;crfppwrapper.CRFPP.newTagger("...");
&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;
Finally modify the toplevel jruby script to pass the necessary java parameters to the jvm:
&lt;pre&gt;#!/usr/bin/env jruby -J-Djava.library.path=/opt/local/lib -J-cp .:lib/CRFPP-0.53.jar -w&lt;/pre&gt;
&lt;/p&gt;
&lt;p&gt;And it worked. No more Rails; migrated to jruby; and ready to bundle into a  trivial servlet that will reintroduce the POST parameter to the mix.&lt;/p&gt;
&lt;p&gt;
[0] The implicit closure parameter to every function and an elegant brace syntax for creating the closures themselves does lend itself to some wonderfully elegant idioms.
&lt;/p&gt;&lt;p&gt;
[1] Of course if you were coming from J2EE you were probably more than happy to exchange static-typing for configuration-by-convention.
&lt;/p&gt;&lt;p&gt;
[2] And all of a sudden I'm having flashbacks to horror of IRIX binary toolchain management in the late 90's.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-5455829132119710911?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/5455829132119710911/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=5455829132119710911' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5455829132119710911'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5455829132119710911'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/11/jruby-and-jni-and-os-x.html' title='JRuby and JNI and OS X.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-2074731896636241995</id><published>2009-09-08T10:44:00.003+10:00</published><updated>2009-09-08T10:49:01.212+10:00</updated><title type='text'>ldd equivalent under Darwin (OS X)</title><content type='html'>&lt;p&gt;
&lt;code&gt;ldd&lt;/code&gt; is an incredibly useful command under linux. It lists the shared-libraries required by an executable, and exactly which .so file each dependency is currently resolved to.
&lt;/p&gt;
&lt;p&gt;
A similarly useful tool is &lt;code&gt;od&lt;/code&gt;, which permits inspection of object files, especially executable and shared-libraries, extracting things like the string-table, symbol-table, and various headers and sections.
&lt;/p&gt;
&lt;p&gt;
Under Darwin these tools are combined in &lt;code&gt;otool&lt;/code&gt;. &lt;code&gt;ldd&lt;/code&gt; can be duplicated by &lt;code&gt;otool -L&lt;/code&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-2074731896636241995?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/2074731896636241995/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=2074731896636241995' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/2074731896636241995'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/2074731896636241995'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/09/ldd-equivalent-under-darwin-os-x.html' title='ldd equivalent under Darwin (OS X)'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-7762819097798653048</id><published>2009-08-26T14:25:00.004+10:00</published><updated>2009-08-26T14:31:17.341+10:00</updated><title type='text'>Gov2.0 and Open-Source - a response</title><content type='html'>&lt;p&gt;
Cross-posted from &lt;a href="http://gov2.net.au/blog/2009/08/26/lessons-from-the-open-source-world/"&gt;Data.gov and lessons from the open-source world&lt;/a&gt; at the &lt;a href="http://gov2.net.au/"&gt;Gov2.0 Taskforce blog&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
My biggest worry is that the government's response to this initiative will be the announcement of some $multi-million grand-gesture. Big press-conference; Minister announcing the 'grand vision'; and the possible benefits we could see, lost in the maze that is large-scale government procurement.
&lt;/p&gt;
&lt;p&gt;
The key insight of &lt;a href="http://www.catb.org/~esr/writings/cathedral-bazaar/"&gt;CatB&lt;/a&gt; is the extent to which redundancy is a benefit in exploratory development.
&lt;/p&gt;
&lt;p&gt;
For the moment, we have no idea of the correct model for Gov2.0 - we have some understanding of what has worked outside of government, and a few promising avenues of approach, but no actual answers. 
&lt;/p&gt;
&lt;p&gt;
So I think we want to recommend that different Agencies experiment with different approaches and that the OIC be tasked with:
&lt;ol&gt;
&lt;li&gt;Examining the success/failure of the different attempts, and eventually start to help agencies improve the success rate.&lt;/li&gt;
&lt;li&gt;Ensuring that the legal and regulatory requirements for aggregation and interoperability of/between these different services is standardised, as these are the issues that will derail bazaar development.&lt;/li&gt;
&lt;li&gt;Acting as a central clearing house where agencies/organisations/individuals can choose to self-publish interface descriptions, custom schema, metadata element schemes, vocabularies etc&lt;/li&gt;
&lt;li&gt;Providing a collaboration and mediation service to allow the reconciliation of conflicting interface/schema/scheme/vocab's.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;
The result would hopefully be a myriad of exploratory projects, some of which would fail, most of which would be ho-hum, but many of which would succeed.
&lt;/p&gt;
&lt;p&gt;
The OIC would act as an institutional memory, learning and recording the lessons learnt; an institutional coordinator, making sure that people wanting to aggregate/integrate the different data-sources aren't forbidden from doing so; and an institutional mediator, assisting the different projects in finding and working together when they would like to.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Please post any comments to the gov2.0 site listed above, not here&lt;/em&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-7762819097798653048?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/7762819097798653048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=7762819097798653048' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/7762819097798653048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/7762819097798653048'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/08/cross-posted-from-data.html' title='Gov2.0 and Open-Source - a response'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-3383970403838754812</id><published>2009-07-13T09:45:00.002+10:00</published><updated>2009-07-13T09:54:53.806+10:00</updated><title type='text'>Google’s new OS could hit Microsoft where it hurts</title><content type='html'>&lt;p&gt;Quoted in a &lt;a href="http://blog.taragana.com/index.php/archive/googles-new-os-could-hit-microsoft-where-it-hurts/"&gt;blog post&lt;/a&gt; by Andy Goldberg, Andy provides a quote that I suspect a lot of Microsoft sycophants will be telling themselves over the next year:
&lt;/p&gt;
&lt;blockquote&gt;"Google may or may not have the experience and capability of actually producing an operating system and getting it deployed," he said. "It may not realise how hard it is."&lt;/blockquote&gt;
&lt;p&gt;
Anyone who takes this line should remind themselves: Chrome OS &lt;strong&gt;is not&lt;/strong&gt; an operating system! - it is browser-based windowing system running on top of an open-source OS; and Google can definitely handle that. Moreover, google has spent the better part of the past decade doing OS design and implementation. It's just that they haven't been selling it, they have been using it internally.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-3383970403838754812?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/3383970403838754812/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=3383970403838754812' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/3383970403838754812'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/3383970403838754812'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/07/googles-new-os-could-hit-microsoft.html' title='Google’s new OS could hit Microsoft where it hurts'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-3443091226434650440</id><published>2009-07-10T14:33:00.002+10:00</published><updated>2009-07-10T14:46:33.234+10:00</updated><title type='text'>How to Write an Equality Method in Java</title><content type='html'>&lt;p&gt;
Martin Odersky, Lex Spoon, and Bill Venners have written an article on &lt;a href="http://www.artima.com/lejava/articles/equality.html"&gt;How to Write an Equality Method in Java&lt;/a&gt;. Given the amount of traffic my post on the same topic has attracted, I thought I might take a look. Their solution is the best I have seen, and well worth a look, but the article suffers the same problem as every article I've read on this topic: it fails to properly define equals().
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;A Java equals() method should implement a test for bisimulation&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
To me, the remarkable thing about the Artima article is that it provides and example where the traditional getClass() approach I have previously recommended fails to implement bisimulation.  The good-news is that this is a rather artificial use-case, and as such isn't going to be causing many bugs.  The bad-news is that the fix requires a helper method defined at the topmost concrete class, and the need for it isn't intuitive.
&lt;/p&gt;
&lt;p&gt;
Anyway, if you program in Java you need to read and understand this article.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-3443091226434650440?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/3443091226434650440/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=3443091226434650440' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/3443091226434650440'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/3443091226434650440'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/07/how-to-write-equality-method-in-java.html' title='How to Write an Equality Method in Java'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-5392366830475445623</id><published>2009-07-02T15:30:00.004+10:00</published><updated>2009-07-08T16:38:09.376+10:00</updated><title type='text'>Scala and Various Things.</title><content type='html'>&lt;p&gt;Not quite ready to move across yet - however capturing some links to make life that little bit easier when I do.  I'm hoping these approaches will work as well for Elmo/OTM as they do for Hibernate.
&lt;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://sntx.livejournal.com/33780.html"&gt;Hibernate and Scala&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://matt.immute.net/content/more-scala-hibernate"&gt;
More Scala + Hibernate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://matt.immute.net/content/scala-hibernate-overview"&gt;Scala + Hibernate overview&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://groups.google.com/group/liftweb/browse_thread/thread/394b3a15206dd3b8"&gt;Lift thread with interesting comments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
I'll be updating this with any more links I want to save for a sunny day.
&lt;/p&gt;
&lt;p&gt;
A couple more links worthy of rereading:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://james-iry.blogspot.com/2007/09/monads-are-elephants-part-1.html"&gt;monads-are-elephants-part-1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://james-iry.blogspot.com/2007/10/monads-are-elephants-part-2.html"&gt;monads-are-elephants-part-2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://james-iry.blogspot.com/2007/10/monads-are-elephants-part-3.html"&gt;http://james-iry.blogspot.com/2007/10/monads-are-elephants-part-3.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://james-iry.blogspot.com/2007/11/monads-are-elephants-part-4.html"&gt;http://james-iry.blogspot.com/2007/11/monads-are-elephants-part-4.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-5392366830475445623?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/5392366830475445623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=5392366830475445623' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5392366830475445623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5392366830475445623'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/07/scala-and-hibernate.html' title='Scala and Various Things.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-5073249135396151226</id><published>2009-06-17T15:20:00.003+10:00</published><updated>2009-06-17T15:37:08.997+10:00</updated><title type='text'>Looking for  JSON, ReST, (and in-memory RDF) frameworks</title><content type='html'>&lt;p&gt;
Currently writing a number of small web-services to do various informatics tasks (more detailed post to come).  Fortunately I'm not the one having to deal with 3rd-party SOAP apis! Still I do need to do various XML and JSON parsing, and not having addressed the latter before I've gone looking for libraries.
&lt;/p&gt;
&lt;p&gt;
Currently I am about to start using &lt;a href="http://jackson.codehaus.org/"&gt;Jackson&lt;/a&gt;, but was wondering if anyone had any warnings, advice, or recommended alternatives?  In the course of looking at what was out there I have also come across &lt;a href="http://www.restlet.org/"&gt;Restlet&lt;/a&gt;, a ReST framework that seems like it is well worth the time to figure out and deploy, so I will probably be doing that soon as well, any warnings or advice on this will be welcome.
&lt;/p&gt;
&lt;p&gt;
One of the nice things about Restlet is its support for RDF. Granted it doesn't support querying, and the terminology in the interface is a bit confused, but it does use its native Resource interface for URIRefs, so it should integrate well. OTOH, if it does prove useful as a ReST framework, I can see myself writing a quick Sesame or Mulgara extension, as there is only so much you can do with RDF before you need a query and/or data-binding interface.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-5073249135396151226?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/5073249135396151226/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=5073249135396151226' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5073249135396151226'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5073249135396151226'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/06/looking-for-json-rest-and-in-memory-rdf.html' title='Looking for  JSON, ReST, (and in-memory RDF) frameworks'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-2771853285995894965</id><published>2009-06-04T15:13:00.003+10:00</published><updated>2009-06-04T15:34:09.102+10:00</updated><title type='text'>Deploying to tomcat using maven</title><content type='html'>&lt;p&gt;
This is a note to capture the process I am currently using to build and deploy a basic web application to tomcat for development.&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;ol&gt;
&lt;li&gt;Create simple web app using archetype. &lt;br/&gt;
&lt;pre&gt;mvn archetype:create ... -DarchetypeArtifactId=maven-archetype-webapp&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add server to ~/.m2/settings.xml
&lt;pre&gt;
  &amp;lt;servers&amp;gt;
    &amp;lt;server&amp;gt;
      &amp;lt;id&amp;gt;local-tomcat&amp;lt;/id&amp;gt;
      &amp;lt;username&amp;gt;username&amp;lt;/username&amp;gt;
      &amp;lt;password&amp;gt;password&amp;lt;/password&amp;gt;
    &amp;lt;/server&amp;gt;
  &amp;lt;/servers&amp;gt;
&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;Add server to toplevel pom.xml
&lt;pre&gt;
  &amp;lt;build&amp;gt;
    ...
    &amp;lt;plugins&amp;gt;
      &amp;lt;plugin&amp;gt;
        &amp;lt;groupId&amp;gt;org.codehaus.mojo&amp;lt;/groupId&amp;gt;
        &amp;lt;artifactId&amp;gt;tomcat-maven-plugin&amp;lt;/artifactId&amp;gt;
        &amp;lt;version&amp;gt;1.0-beta-1&amp;lt;/version&amp;gt;
        &amp;lt;configuration&amp;gt;
          &amp;lt;server&amp;gt;local-tomcat&amp;lt;/server&amp;gt;
        &amp;lt;/configuration&amp;gt;
      &amp;lt;/plugin&amp;gt;
    &amp;lt;/plugins&amp;gt;
  &amp;lt;/build&amp;gt;
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;compile, test, deploy, and subsequently redeploy
&lt;pre&gt;
  $ mvn compile
  $ mvn test
  $ mvn tomcat:deploy
  $ mvn tomcat:redeploy
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;
&lt;p&gt;
Of course what I would dearly love to know is how you configure a server url in the settings.xml file.  The documentation I can find (&lt;a href="http://mojo.codehaus.org/tomcat-maven-plugin/configuration.html"&gt;http://mojo.codehaus.org/tomcat-maven-plugin/configuration.html&lt;/a&gt;) describes how to use a custom url, and how to configure authentication information.  What it doesn't do is explain how you can do both at the same time, and all my attempts have resulted in XML validation errors when trying to run maven --- if I figure it out I'll update this post.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-2771853285995894965?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/2771853285995894965/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=2771853285995894965' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/2771853285995894965'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/2771853285995894965'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/06/deploying-to-tomcat-using-maven.html' title='Deploying to tomcat using maven'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-7847513034228899518</id><published>2009-05-27T10:01:00.002+10:00</published><updated>2009-05-27T10:53:05.756+10:00</updated><title type='text'>ANTLR: an exercise in pain.</title><content type='html'>&lt;p&gt;
Ok, so for my current project I need to either build heuristic or machine learning based fuzzy parser. As someone who has written numerous standard parsers before, this qualifies as interesting. Current approaches I'm considering include cascading concrete grammars; stochastic context-free grammars; and various forms of hidden-markov-model based recognisers. Whatever approach ends up working best, the first stage for all is a scanner.
&lt;/p&gt;&lt;p&gt;
So I start building a jflex lexer, and make reasonable progress when I find out that we are already using ANTLR for other projects, so I should probably use it as well. Having experienced mulgara's peak of &lt;em&gt;5&lt;/em&gt; different parser generators - this does eventually become ridiculous - I was more than willing to use ANTLR. Yes it's LL, and yes I have previously discussed my preference for LR; but, it does support attaching semantic actions to productions, so my primary requirement of a parser-generator is met; and anyway, it has an excellent reputation, and a substantial active community.
&lt;/p&gt;&lt;p&gt;
What I am now stunned by, is just how bad the documentation can be for such a popular tool. One almost non-existent wiki; a FAQ; and a woefully incomplete doxygen dump, does not substitute for a reference. ANTLR has worse documentation than sablecc had when it consisted of an appendix to a masters thesis!
&lt;/p&gt;&lt;p&gt;
My conclusion: If you have any choice don't use ANTLR. For Java: if you must use LL I currently recommend &lt;a href="https://javacc.dev.java.net/"&gt;JavaCC&lt;/a&gt;; if you can use an LALR parser do so, my current preference is &lt;a href="http://beaver.sourceforge.net/"&gt;Beaver&lt;/a&gt;.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-7847513034228899518?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/7847513034228899518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=7847513034228899518' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/7847513034228899518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/7847513034228899518'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2009/05/antlr-exercise-in-pain.html' title='ANTLR: an exercise in pain.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-9062206958188276881</id><published>2008-05-19T19:38:00.002+10:00</published><updated>2008-05-19T19:47:38.246+10:00</updated><title type='text'>So why can't google provide html for 40% of pdfs?</title><content type='html'>&lt;p&gt;
A google search for &lt;a href="http://www.google.com.au/search?hl=en&amp;client=firefox-a&amp;rls=org.mozilla%3Aen-US%3Aofficial&amp;hs=6bM&amp;as_qdr=all&amp;q=opensource+filetype%3Apdf&amp;btnG=Search&amp;meta="&gt;opensource filetype:pdf&lt;/a&gt; returns the standard 10 results on the front page, but only 6 of them offer a "View as HTML" link.  Is it just me, or has this become more prevalent recently? And what is the common property that results in this behaviour?
&lt;/p&gt;
&lt;p&gt;
If anyone has any clues or ideas I would love to hear them.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-9062206958188276881?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/9062206958188276881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=9062206958188276881' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/9062206958188276881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/9062206958188276881'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2008/05/so-why-cant-google-provide-html-for-40.html' title='So why can&apos;t google provide html for 40% of pdfs?'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-6570962635307612468</id><published>2008-01-15T10:40:00.000+10:00</published><updated>2008-01-15T10:43:12.175+10:00</updated><title type='text'>Now this is how conference videos should be presented</title><content type='html'>&lt;p&gt;
A great collection of conference presentations and interviews (mostly on java topics) &lt;a href="http://www.parleys.com/display/PARLEYS/Home"&gt;Parleys&lt;/a&gt; - but of particular interest to me is the presentation, the best I have seen.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-6570962635307612468?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/6570962635307612468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=6570962635307612468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/6570962635307612468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/6570962635307612468'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2008/01/now-this-is-how-conference-videos.html' title='Now this is how conference videos should be presented'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-4638170299047801272</id><published>2007-11-29T16:27:00.000+10:00</published><updated>2007-11-29T16:41:29.403+10:00</updated><title type='text'>How to start thinking about RDF.</title><content type='html'>&lt;p&gt;While trying to understand RDF, its capabilities and its limitations I have done a lot of reading of earlier work on semi-structured data management.  It occurs to me that I haven't blogged a paragraph from an 1995 paper on heterogeneous information sources that really crystalised for me the crucial difference between RDF and previous attempts at semi-structured data (especially XML and friends) - better late than never I suppose...
&lt;/p&gt;
&lt;blockquote&gt;
We need note define in advance the structure of an object ... no notion of a fixed schema or object class. A label can play two roles: identifying an object (component) and identifying the meaning of an object (component).  If an information source exports objects with a particular label, then we assume that the source can answer the question "What does this label mean?".  It is particularly important to note that labels are relative to the source that exports them.  That is, we do not expect labels to be drawn from an ontology shared by all information sources.
&lt;/blockquote&gt;
&lt;p&gt;
Papakonstantinou, Y. et al. "Object Exchange Across Heterogeneous Information Sources", 11th Conference on Data Engineering, IEEE Computer Society, 251-260, 1995.
&lt;/p&gt;
&lt;p&gt;
The actual framework presented in the paper is focused on intraorganisational integration and so doesn't have the property of anarchic scalability required if it is to be applied to the internet - however it does express clearly this need for source-defined semantics if semi-structured data is to be tractable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-4638170299047801272?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/4638170299047801272/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=4638170299047801272' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/4638170299047801272'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/4638170299047801272'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/11/how-to-start-thinking-about-rdf.html' title='How to start thinking about RDF.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-5756428977785451716</id><published>2007-10-17T15:03:00.000+10:00</published><updated>2007-10-17T15:42:02.681+10:00</updated><title type='text'>Implementing a Resource Manger for the Java Transaction API.</title><content type='html'>&lt;p&gt;
One would hope that when an organisation like Sun specifies a standard as important as a transaction api they might take the time to ensure they do a reasonable effort -- unfortunately you would be wrong.  The JTA specification is freely available &lt;a href="http://java.sun.com/products/jta/"&gt;from Sun&lt;/a&gt;, however the document is extremely vague and requires the reader to infer the underlying transaction state machine - with the unsurprising result that the corner cases are left completely unspecified.  So having waded through this morass myself, I include here my advice on what you need to do to understand JTA, in the hope that anyone else coming to this standard won't have to waste as much time as I have understanding it.
&lt;/p&gt;
&lt;p&gt;
Read the JTA spec &lt;span style="font-weight:bold;"&gt;last&lt;/span&gt;.  JTA is a little more than a thin wrapper around the &lt;a href="http://www.omg.org/cgi-bin/doc?formal/00-06-28"&gt;Object Transaction Service 1.1&lt;/a&gt; published by the OMG.  This is one of the CORBA standards published in the late 90's and early 2000's - and like most of the &lt;span style="font-style:italic;"&gt;early&lt;/span&gt; CORBA specs, it is well written; easy to read; and pretty complete.  Unfortunately it too leaves the underlying state-machine and some of the corner-cases (especially those to do with recovery) underspecified.  As a result I recommend printing this out and referring to it as an adjunct to the JTA spec.
&lt;/p&gt;
&lt;p&gt;
Fortunately the CORBA-OTS is itself an object-oriented wrapper around another spec, the &lt;a href="http://www.opengroup.org/bookstore/catalog/c193.htm"&gt;Distributed Transaction Processing: The XA Specification&lt;/a&gt; spec' published by X/Open (now The Open Group).  There in Chapter 2 you will find &lt;span style="font-style:italic;"&gt;most&lt;/span&gt; of the definitions missing from the other two specs; and in Chapter 6 the state-tables that provide definitive semantics for the various operations you will need to implement.  You will also find a reference to another related X/Open specification - &lt;a href="http://www.opengroup.org/bookstore/catalog/g504.htm"&gt;Distributed Transaction Processing: Reference Model&lt;/a&gt; - which contains all the remaining definitions and assumptions missing from the the JTA/OTS specs.
&lt;/p&gt;
&lt;p&gt;
So if you do need to implement a JTA interface I strongly recommend you start with the X/Open reference model; then read the X/Open XA Spec; and only then read the JTA specification alongside the OTS spec for elaboration.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-5756428977785451716?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/5756428977785451716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=5756428977785451716' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5756428977785451716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/5756428977785451716'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/10/implementing-resource-manger-for-java.html' title='Implementing a Resource Manger for the Java Transaction API.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-8167212437675063110</id><published>2007-09-19T22:01:00.000+10:00</published><updated>2007-09-19T22:16:37.849+10:00</updated><title type='text'>Model-URI/URL Use-cases and Requirements and Proposal</title><content type='html'>&lt;p&gt;
&lt;span style="font-style:italic;"&gt;Just posted this to mulgara-general - posting here to provide readily accessible permanent reference.&lt;/span&gt;

&lt;span style="font-style:italic;"&gt;I would greatly appreciate any comments anyone may have - please also feel free to solicit comments from outside the mulgara community if there is interest.
&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="font-weight:bold;"&gt;The Use Cases and Requirements
&lt;/span&gt;&lt;br/&gt;
The three key requirements of a model-URI proposal are:
&lt;/p&gt;
&lt;p&gt;
1. Protocol/Scheme independence&lt;br/&gt;
2. Model/Server mobility&lt;br/&gt;
3. URI-standards compliance (ie. no fragment)&lt;br/&gt;
&lt;/p&gt;&lt;p&gt;
Also desirable are
&lt;/p&gt;&lt;p&gt;
4. Unique-name&lt;br/&gt;
5. Namespaced to allow a) potential resolution; b) predicable, human-readable URI's.&lt;br/&gt;
&lt;/p&gt;&lt;p&gt;
The context of the most complex use-case involves 4 models and 4 machines (and assumes a Distributed or Federated Resolver)
&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
:modelA is on server1 on host1 and needs 
     to reference :modelB and :modelC
:modelB is on server2 on host2
:modelC is on server3 on host3
:modelD is on server4 on host4 run by an unrelated organisation
&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;
The application needs to perform the query:
&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
select $id subquery(
  select $s $p $o 
  where $s $p $o in $locn and 
        $id &amp;lt;mulgara:locatedAt&amp;gt; $locn in &amp;lt;mulgara:modelURLResolver&amp;gt;)
from host1:modelA
where [ &amp;lt;:useModel&amp;gt; $identifier ] ;
&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;
Which queries each model listed in :modelA after converting their identifier into a URL via a posited resolution mechanism.
&lt;/p&gt;&lt;p&gt;
Now host2 fails, and we restore server2 on host3 to run alongside server3.
&lt;/p&gt;&lt;p&gt;
We would like to be able to have the query run unmodified.
&lt;/p&gt;&lt;p&gt;
What this means is that :modelB cannot encode host2 in its URI.
&lt;/p&gt;&lt;p&gt;
The URI does need to encode some sort of server-id as servers are guaranteed to use the same model-names at least some of the time (consider all system-model's have the name "").
&lt;/p&gt;&lt;p&gt;
Also because :modelD and :modelA-C are managed by unrelated organisations we must somehow encode the organisation in the model's URI-stem as they may well decide to use the same server-id ("server1" or "database" anyone?).
&lt;/p&gt;&lt;p&gt;
Also consider that any encoding of the organisation must also allow that organisation to maintain their own independent registry, or the proposal ceases to be scale-free (it's on this that the original UUID proposal floundered).
&lt;/p&gt;&lt;p&gt;
I have considered abandoning requirement 4, and just using URL's.  However ultimately we require a canonical name for internal purposes (even if it isn't exposed externally), and so even using URL's we would have to pick a designated 'unique name' for the model - we can't escape that - so we might as well save ourselves the headache and make it unambiguous.
&lt;/p&gt;&lt;p&gt;
So a summary of my thinking on the use-cases/requirements for rdf model-names - we desire:
&lt;/p&gt;&lt;p&gt;
1. Unambiguously an identifier&lt;br/&gt;
2. Encodes organisation&lt;br/&gt;
3. Encodes server-id&lt;br/&gt;
4. Doesn't encode hostname&lt;br/&gt;
5. Potentially resolvable via a per-organisation registry&lt;br/&gt;
&lt;/p&gt;&lt;p&gt;
&lt;span style="font-weight:bold;"&gt;* Proposal&lt;/span&gt;
&lt;/p&gt;&lt;p&gt;
If we wish to be unambiguous then we should use our own URI-scheme.  This has the added benefit that once we use our own scheme we have a lot more flexibility regarding how we structure the rest of the URI to meet our requirements.
&lt;/p&gt;&lt;p&gt;
I am proposing to use the scheme 'rdfdb' - as did the original UUID proposal.
&lt;/p&gt;&lt;p&gt;
I would prefer to avoid the use of opaque URI's; there is no reason why our URI can't be introspected if we structure it sanely - so the structure according to RFC2396 will be 'rdfdb://authority/path'.
&lt;/p&gt;&lt;p&gt;
Logically the model-name itself makes a good path so we arrive at 'rdfdb://authority/modelName'.  Leaving the need to encode an organisation and a server-id in the authority in a fashion that will potentially permit resolution via a registry.
&lt;/p&gt;&lt;p&gt;
Now as the authority is not a hostname, RFC2396 identifies us as a "Registry-based Naming Authority".  As such, the characters we have permitted to us are [ - _ . ! ~ * ' ( ) $ , ; : @ &amp; = + ] (excluding the []'s) - and the characters reserved are [ ? / ].
&lt;/p&gt;&lt;p&gt;
I therefore propose to structure the authority 'server-id~organisation-id' (that is the server-id and org-id separated by a tilde).
&lt;/p&gt;&lt;p&gt;
At the moment we don't support hierarchical server-id's; but I would like to leave us the option of doing so once we start supporting more aggressive distribution.  We also need to consider that it needs to remain a valid path-element for use in our existing model-URL's.  So for now I would like to limit server-id to what we currently use, but ultimately I think we should consider some sort of delimited hierarchical form (probably dotted).
&lt;/p&gt;&lt;p&gt;
The organisation-id should be something that will eventually permit the identification of a registry.  For now a dotted hierarchical form should suffice - although I will make sure the implementation leaves this as open as possible (the use of a tilde makes this possible).
&lt;/p&gt;&lt;p&gt;
It has also been suggested that to make it unambiguously clear we are *not* encoding a hostname as the organisation-id we should invert the traditional dns-style representation.
&lt;/p&gt;&lt;p&gt;
So putting all the pieces together:  If I am running a mulgara server -
&lt;/p&gt;&lt;p&gt;&lt;pre&gt;
host:         pneuma.netymon.com
organisation: netymon.com
server-id:    rdfDatabase
model-name:   addressBook
&lt;/pre&gt;&lt;/p&gt;&lt;p&gt;
The model URL for addressBook remains: rmi://pneuma.netymon.com/rdfDatabase#addressBook&lt;br/&gt;
or: soap://pneuma.netymon.com/rdfDatabase#addressBook   ...etc...
&lt;/p&gt;&lt;p&gt;
and the model URL for the model is: rdfdb://rdfDatabase~com.netymon/addressBook
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-8167212437675063110?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/8167212437675063110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=8167212437675063110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/8167212437675063110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/8167212437675063110'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/09/model-uriurl-use-cases-and-requirements.html' title='Model-URI/URL Use-cases and Requirements and Proposal'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-1781048797997844167</id><published>2007-09-17T20:48:00.001+10:00</published><updated>2007-09-17T20:54:38.829+10:00</updated><title type='text'>Operational vs. Denotational Semantics</title><content type='html'>&lt;p&gt;
Spent a little time this afternoon discussing several topics with LB and SR.  One topic we touched on was our continuing efforts to understand the distinction between denotational and operational semantics - I continue to be surprised at just how hard it's proving to nail down the precise distinction.
&lt;/p&gt;
&lt;p&gt;
Looking at the various scrawls on my whiteboard that are the only physical remnants of what was a fascinating discussion, I gave some more thought to the distinction, and I believe it can be described thus:
&lt;blockquote&gt;
Operational  :  M ( P ) |= σ -&gt; σ' &lt;br/&gt;
Denotational :  M ( P ) |= κ -&gt; P' &lt;br/&gt;
&lt;/blockquote&gt;
ie. In Operational semantics the meaning of a program is a transition function on a virtual machine.&lt;br/&gt;
in Denotational semantics the meaning of a program is a mapping from an initial basis to a new (simplified) program.
&lt;/p&gt;
&lt;p&gt;
Now this is confused by most operational semantics being "small-step", where the meaning is defined via structural recursion on the abstract grammar: 
&lt;blockquote&gt;
 M ( ρ ) |- σ -&gt; M (ρ') σ' { the meaning of an AST production is a transition function from an initial VM state to the meaning of a (simplified) production applied to a new VM state. }
&lt;/blockquote&gt;
Which end up looking very similar to denotational semantics as denotational semantics are normally defined via structural recursion.
&lt;/p&gt;&lt;p&gt;
But even for the similarity there remains the core distinction (as I understand it) - Denotational Semantics are defined in terms of a reduction-semantics from program+basis to a simplified program (although normally a program in a different, mathematically tractable language such as the lambda-calculus) whereas Operational Semantics are defined in terms of a transition-semantics from a program+initial-state to a new state (although normally a state extended with function-values defined in a mathematically tractable language such as the lambda-calculus).
&lt;/p&gt;&lt;p&gt;
Now of course Interpreter Semantics is a whole different kettle of fish, and of course leaves you facing the 'turtle problem' - you can try for 'turtles all the way down' if you like, but once you hit the metal you've pretty much lost the point of a semantics in the first place.  I must admit admiring the way ECMAscript handled it - an interpreter semantics in SML, which has an operational semantics of its own avoiding the problem.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-1781048797997844167?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/1781048797997844167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=1781048797997844167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/1781048797997844167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/1781048797997844167'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/09/operational-vs-denotational-semantics.html' title='Operational vs. Denotational Semantics'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-8884653012674580607</id><published>2007-08-30T17:23:00.000+10:00</published><updated>2007-08-31T18:56:37.204+10:00</updated><title type='text'>RDF, Document Repositories</title><content type='html'>&lt;p&gt;
I have recently had several discussions with people working on/with various document repository projects.  One thing I hear is the increasing understanding of the importance of semantics in repository metadata management.  I'm naturally pleased to see this because storage, query, and management of semantics is precisely where projects like &lt;a href="http://www.mulgara.org/"&gt;mulgara&lt;/a&gt; come in.
&lt;/p&gt;
&lt;p&gt;
Now digital repositories are alot more than just a semantic store, there are also issues associated with the actual document storage, retrieval, and the QA, workflow, and various metadata extraction tasks.  However these days most repository projects include some sort of semantic store to manage metadata, and the question is reasonably asked - why not just use that?
&lt;/p&gt;
&lt;p&gt;
The reason I recommend considering using mulgara to augment a document repository is due to the additional flexibility gained by doing so.  When a repository developer approaches the metadata problem they have a natural tendency to view adopt an 'instance-focused' view of metadata.  This is where the focus is on the 'document', where each document is of a given 'document type', and each 'document type' implies  corresponding 'attributes'.  In contrast, RDF is 'property-focused' --- where the focus is on defining the 'meaning' of 'properties', and a 'document' having a given property 'classifies' the document as belonging to a given 'class of documents'.
&lt;/p&gt;
&lt;p&gt;
While the two are duals they do influence design.  If you are taking an instance-focused approach you will find yourself heading towards document-type hierarchies and defined attribute lists.  If you take a property-focused approach you will find yourself defining lexicons and ontologies.  The former tends towards relational approaches, the latter towards semantic approaches such as RDF.  The reason why I believe the semantic approach to be superior is in its flexibility.  Hierarchies are predicated on centralised control.  Even if you can maintain central control over the document type definitions and their attributes, the very act of standardisation in this manner leaves your project with the unfortunate choice of 'scale' or 'responsive to change'.
&lt;/p&gt;
&lt;p&gt;
RDF and its related standards allow the decentralisation of attribute/property definition, while providing the tools to manage the resulting 'mess'.  With the combination of namespaces, RDFS, and assuming the provision of schema repositories, it becomes possible to allow global use and reuse of locally defined 'models'.  This is especially relevant when you consider that 'local' should be considered in both temporal and spatial senses - keeping the system responsive both to the differing needs of independent organisations, and the changing requirements of a single entity.
&lt;/p&gt;
&lt;p&gt;
The result is the need for two additional boxes in your architecture diagram.  The first, a vocabulary server that allows users to define their own vocabulary extensions, and makes those definitions available to applications and critically capable of management and eventual rationalisation.  The second is a metadata server that can store the resulting data and permit ad-hoc querying by applications, and the inferencing required by vocabulary rationalisation.  One of the reasons &lt;a href="http://www.mulgara.org/"&gt;mulgara&lt;/a&gt; exists is to provide the storage and query engine required by these components - and so I do enjoy having the chance to talk to people about it.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-8884653012674580607?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/8884653012674580607/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=8884653012674580607' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/8884653012674580607'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/8884653012674580607'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/08/rdf-document-repositories.html' title='RDF, Document Repositories'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-117142375642534111</id><published>2007-02-14T13:22:00.000+10:00</published><updated>2007-02-14T13:29:16.443+10:00</updated><title type='text'>The Effect of File Sharing on Record Sales: An Empirical Analysis</title><content type='html'>&lt;p&gt;
&lt;em&gt;Felix Oberholzer-Gee Harvard University and Koleman Strumpf University of Kansas&lt;/em&gt;
&lt;/p&gt;&lt;p&gt;
&lt;strong&gt;&lt;a href="http://www.journals.uchicago.edu/JPE/journal/issues/v115n1/31618/brief/31618.abstract.html"&gt;Abstract&lt;/a&gt;&lt;/strong&gt;
&lt;/p&gt;&lt;p&gt;
&lt;blockquote&gt;
For industries ranging from software to pharmaceuticals and entertainment, there is an intense debate about the appropriate level of protection for intellectual property. The Internet provides a natural crucible to assess the implications of reduced protection because it drastically lowers the cost of copying information. In this paper, we analyze whether file sharing has reduced the legal sales of music. While this question is receiving considerable attention in academia, industry, and Congress, we are the first to study the phenomenon employing data on actual downloads of music files. We match an extensive sample of downloads to U.S. sales data for a large number of albums. To establish causality, we instrument for downloads using data on international school holidays. Downloads have an effect on sales that is statistically indistinguishable from zero. Our estimates are inconsistent with claims that file sharing is the primary reason for the decline in music sales during our study period.
&lt;/blockquote&gt;
&lt;/p&gt;&lt;p&gt;
In the &lt;a href="http://www.journals.uchicago.edu/JPE/papers.html"&gt;Journal of Political Economy&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
Available in &lt;a href="http://www.journals.uchicago.edu/JPE/journal/contents/v115n1.html"&gt;Volume 115, Number 1, February 2007&lt;/a&gt;
&lt;/p&gt;&lt;p&gt;
From &lt;a href="http://arstechnica.com/news.ars/post/20070212-8813.html"&gt;Ars Technica&lt;/a&gt; via &lt;a href="http://www.lessig.org/blog/"&gt;Lawrence Lessig&lt;/a&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-117142375642534111?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/117142375642534111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=117142375642534111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117142375642534111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117142375642534111'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/02/effect-of-file-sharing-on-record-sales.html' title='The Effect of File Sharing on Record Sales: An Empirical Analysis'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-117136955536846164</id><published>2007-02-13T21:08:00.000+10:00</published><updated>2007-07-13T13:49:42.547+10:00</updated><title type='text'>Java generics and the covariance and contravariance of arguments</title><content type='html'>&lt;p&gt;
Well given we require 1.5 now for other reasons, and 1.5 does complain if you don't constrain generic classes I have finally bitten the bullet and started using generics.  Unfortunately I just got bitten by what I suspect is going to be a very common mistake - in this case by failing to properly consider the type equivalence of parametrised method calls.
&lt;/p&gt;
&lt;p&gt;
Consider the following code:
&lt;/p&gt;&lt;pre&gt;
public interface TestInterface { }

public class TestClass implements TestInterface { }

import java.util.ArrayList;
import java.util.List;

public class Test {
 private List&amp;lt;testclass&amp;gt; list;

 public TestInterface test() {
   list = new ArrayList&amp;lt;testclass&amp;gt;();
   list.add(new TestClass());

   return covariant(list);
 }

 public TestInterface covariant(List&amp;lt;testinterface&amp;gt; ilist) {
   return ilist.remove(0);
 }
}
&lt;/pre&gt;
Now there is absolutely no reason why this should not work.  It is trivially inferable that the above code treats ilist as covariant in the list-type - and that therefore this code is statically correct.
&lt;p&gt;&lt;/p&gt;&lt;p&gt;
Of course Java's typing has never been particularly smart. List&amp;lt;t1&amp;gt;.add(T1) is contra-variant in t1, and T2 List&amp;lt;t2&amp;gt;.get(int) is co-variant in t2; so the Java compiler is correct to infer that in the general case List&amp;lt;t1&amp;gt; and List&amp;lt;t2&amp;gt; are substitutable iff t1 == t2.
&lt;/p&gt;&lt;p&gt;
If we can't declare a generic parameter to be covariant in its type parameter we have   a serious problem - it means that any non-trivial algorithm involving collections is going to run afoul of this.  You might consider trying to cast your way around it:
&lt;/p&gt;&lt;pre&gt;
 public TestInterface test() {
   list = new ArrayList&amp;lt;testclass&amp;gt;();
   list.add(new TestClass());

   return covariant((List&amp;lt;testinterface&amp;gt;)list);
 }
&lt;/pre&gt;
but not surprisingly that didn't work.
&lt;pre&gt;
Test.java:11: inconvertible types
found   : java.util.List&amp;lt;testclass&amp;gt;
required: java.util.List&amp;lt;testinterface&amp;gt;
 return convariant((List&amp;lt;testinterface&amp;gt;)list);
                                       ^
1 error
&lt;/pre&gt;
If you continue to hack at it you might try a double cast via a non-generic List.
&lt;pre&gt;
 public TestInterface test() {
   list = new ArrayList&amp;lt;testclass&amp;gt;();
   list.add(new TestClass());

   return covariant((List&amp;lt;testinterface&amp;gt;)((List)list));
 }
&lt;/pre&gt;
This works but leaves us with the unchecked/unsafe operation warning:
&lt;pre&gt;
Note: Test.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
&lt;/pre&gt;
Now this is a perfectly reasonable warning - it is unchecked; it is unsafe; and more importantly it &lt;em&gt;does violate encapsulation&lt;/em&gt;.  The problem here is that the caller should not be defining the type invariants of the callee - that's the job of the method signature!
&lt;p&gt;&lt;/p&gt;&lt;p&gt;
The correct solution is to allow us to declare covariant() to be covariant in its argument; and fortunately Java does support this.
&lt;/p&gt;&lt;p&gt;
To declare an argument to be covariant in its type parameter you can use the extends keyword:
&lt;/p&gt;&lt;pre&gt;
 public TestInterface covariant(List&amp;lt;? extends TestInterface&amp;gt; ilist) {
   return ilist.remove(0);
 }
&lt;/pre&gt;
To declare an argument to be contravariant in its type parameter you use the super keyword:
&lt;pre&gt;
 public void contravariant(List&amp;lt;? super TestClass&amp;gt; clist, TestClass c) {
   clist.add(c);
 }
&lt;/pre&gt;
Without these two facilities generics would be badly broken, so I am glad Sun had the presence of mind to include them - btw if you are using Java 1.5 I strongly recommend you read the &lt;a href="http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf"&gt;Java Generics Tutorial&lt;/a&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;
As an aside it is worth noting that as Java includes a Top type 'Object', List is a common covariant type - sufficiently common that Sun has included a syntactic sugar for it, List.  Personally I'm not sure this was such a good idea, List would work anyway, and I think I would prefer to have kept the covariance explicit.
&lt;/p&gt;
&lt;p&gt;
Update: Corrected capitalisation error in initial java example.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-117136955536846164?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/117136955536846164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=117136955536846164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117136955536846164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117136955536846164'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/02/java-generics-and-covariance-and.html' title='Java generics and the covariance and contravariance of arguments'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-117075020521407017</id><published>2007-02-06T18:11:00.000+10:00</published><updated>2007-02-06T18:28:14.206+10:00</updated><title type='text'>Five things to consider when writing a Mulgara Resolver</title><content type='html'>&lt;p&gt;
Ended up writing a longer response than I had planned to a query about &lt;a href="http://mulgara.org/pipermail/mulgara-dev/2007-February/000323.html"&gt;writing a resolver&lt;/a&gt; in &lt;a href="http://www.mulgara.org/"&gt;Mulgara&lt;/a&gt; today.  I'm putting it here to keep a handle to it as it does cover the basic structure of the resolve() method in reasonable detail.
&lt;/p&gt;&lt;p&gt;
First it is important to realise that resolvers *don't* return triples - they return Resolutions.  These are Tuples that provide bindings for the variables in the Constraint passed to resolve().  So in the case of &amp;lt;http://www.example.com/path/subpath&amp;gt; $predicate $object the resulting Resolution should have two variables ($predicate $object).  In the case of &amp;lt;../subpath&amp;gt; &amp;lt;http://www.schema.com#parent&amp;gt; $subpath it will have one ($subpath).
&lt;/p&gt;&lt;p&gt;
You should also be aware that a Resolution can be unevaluated!  It is not uncommon for bindings, required to evaluate the constraint, come from other parts of the query.  Consider the following where clause:
&lt;pre&gt;
$url $p $o in &amp;lt;rmi://localhost/server1#sample&amp;gt; 
and 
&amp;lt;myfile&amp;gt; &amp;lt;hasurl&amp;gt; $url
&lt;/pre&gt;
in this case your resolver will be asked to resolve ($url $p $o), return a Resolution that will later be passed the $url in the prefix argument to beforeFirst().  Evaluation would then occur either in beforeFirst() or in the calls to next() - we prefer it to happen in beforeFirst if the memory requirement isn't unreasonable, our algorithmic reasoning assumes a comparatively cheap next().
&lt;/p&gt;&lt;p&gt;
If you require that a particular variable be bound prior to final evaluation then you need to provide a MandatoryBindingAnnotation - this indicates to the join logic that it must ensure a specific binding is satisfied by other constraints in the query before you are evaluated (in this case $url).
&lt;/p&gt;&lt;p&gt;
It is also worth noting that due to the support of intervals and the resulting interaction with query transformations, the XSDResolver is quite complicated as resolvers go.  Without that a call to resolve consists of:
&lt;ol&gt;
&lt;li&gt;Obtaining the model (constraint.getModel()).&lt;/li&gt;
&lt;li&gt;Do any preparatory work, especially any work that might be able to prove the result Empty (or a singleton).&lt;/li&gt;
&lt;li&gt;If you can't prove the result empty (or singleton), defer further evaluation to the returned Resolution.&lt;/li&gt;
&lt;/ol&gt;
Then inside the Resolution you need to consider how you implement the following four key methods
&lt;dl&gt;
&lt;dt&gt;MandatoryBindingAnnotation&lt;/dt&gt;
&lt;dd&gt;are there any variables that *must* be bound for the deferred evaluation to terminate.&lt;/dd&gt;
&lt;dt&gt;DefinablePrefixAnnotation&lt;/dt&gt;
&lt;dd&gt;can you cheaply reorder the variables in the result (log n or less)&lt;/dd&gt;
&lt;dt&gt;ReresolvableResolution&lt;/dt&gt;
&lt;dd&gt;can you cheaply reresolve the constraint if additional information becomes available (again log n or less)  [note: this will become an Annotation like the other two in the Mulgara 1.2 dev-cycle]&lt;/dd&gt;
&lt;dt&gt;beforeFirst()&lt;/dt&gt;
&lt;dd&gt;you can ignore the suffixTruncation arg, but you can't ignore the prefix - these *are* the values of the first N variables of the resolution - if all the variables are passed as a prefix your only decision is 1 row or 0 - but most of the time you will be passed less than this.&lt;/dd&gt;
&lt;/dl&gt;

At this point you have either performed the evaluation, or you have setup the evaluation and deferred the rest to be done incrementally on each call to next().
&lt;dl&gt;
&lt;dt&gt;next()&lt;/dt&gt;
&lt;dd&gt;does whatever is required to ensure that calls to getColumnValue().&lt;/dd&gt;
&lt;/dl&gt;
There is only one Tuple class that defers evaluation beyond this point (the implementation of count()).  Naturally we don't want to go to the effort of evaluating an entire subquery until the user actually goes to use it - so we defer evaluation of the count() until the call to getColumnValue().
&lt;dl&gt;
&lt;dt&gt;getColumnValue()&lt;/dt&gt;
&lt;dd&gt;normally this is a matter of returning values calculated in either beforeFirst() or next() - occasionally this amounts to evaluating it but this is uncommon.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/p&gt;&lt;p&gt;
The whole point of the Resolution/Tuples/beforeFirst/next bother is to implement lazy-evaluation in java.  We only scale to bignum-levels when all query evaluation is done on a call-by-need basis.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-117075020521407017?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/117075020521407017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=117075020521407017' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117075020521407017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117075020521407017'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/02/five-things-to-consider-when-writing.html' title='Five things to consider when writing a Mulgara Resolver'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-117041822827380653</id><published>2007-02-02T22:07:00.000+10:00</published><updated>2007-02-02T22:10:28.296+10:00</updated><title type='text'>Ok now this is too cool for words.</title><content type='html'>&lt;p&gt;If you are a fan of Pratchett you have to checkout &lt;a href="http://homepages.tesco.net/janefisk/discworld/discworld.htm"&gt;The Great A'Tuin as a wedding cake&lt;/a&gt;!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-117041822827380653?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/117041822827380653/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=117041822827380653' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117041822827380653'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/117041822827380653'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/02/ok-now-this-is-too-cool-for-words.html' title='Ok now this is too cool for words.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-116968506234948277</id><published>2007-01-25T10:17:00.000+10:00</published><updated>2007-01-25T10:31:02.370+10:00</updated><title type='text'>Umm, would you mind if we borrowed your DPP?</title><content type='html'>&lt;p&gt;&lt;em&gt;from &lt;a href="http://www.boingboing.net/"&gt;boingboing&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Finally a public official has the courage to &lt;a href="http://politics.guardian.co.uk/terrorism/story/0,,1997247,00.html"&gt;speak sense&lt;/a&gt;.
&lt;blockquote&gt;
"London is not a battlefield. Those innocents who were murdered on July 7 2005 were not victims of war. And the men who killed them were not, as in their vanity they claimed on their ludicrous videos, 'soldiers'. They were deluded, narcissistic inadequates. They were criminals. They were fantasists. We need to be very clear about this. On the streets of London, there is no such thing as a 'war on terror', just as there can be no such thing as a 'war on drugs'.

"The fight against terrorism on the streets of Britain is not a war. It is the prevention of crime, the enforcement of our laws and the winning of justice for those damaged by their infringement."
&lt;/blockquote&gt;
If this was the only sentiment I would applaud, but to see his respect for the rule of law gives me hope our nations can come through this intact.
&lt;blockquote&gt;
"We wouldn't get far in promoting a civilising culture of respect for rights amongst and between citizens if we set about undermining fair trials in the simple pursuit of greater numbers of inevitably less safe convictions. On the contrary, it is obvious that the process of winning convictions ought to be in keeping with a consensual rule of law and not detached from it. Otherwise we sacrifice fundamental values critical to the maintenance of the rule of law - upon which everything else depends."
&lt;/blockquote&gt;
There is no right, no principle, no aspect of our 'way of life' that isn't completely dependent on the rule of law.  Without rule of law every other guarantee, social contract, or bill of rights is moot - completely and absolutely unenforcable and thereby irrelevant.
&lt;/p&gt;&lt;p&gt;
Note to any political types who might read this: This is a vote swinger.  The courage to respect and maintain rule of law in the face of fear is my definition of leadership, and what I am looking for above all when deciding my vote.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-116968506234948277?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/116968506234948277/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=116968506234948277' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/116968506234948277'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/116968506234948277'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2007/01/umm-would-you-mind-if-we-borrowed-your.html' title='Umm, would you mind if we borrowed your DPP?'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-115813512090112179</id><published>2006-09-13T18:08:00.000+10:00</published><updated>2006-09-13T18:12:00.970+10:00</updated><title type='text'>Erlang in 5 seconds.</title><content type='html'>&lt;p&gt;
There was recently a thread on erlang-questions that discussed how you would present Erlang in 5 seconds.  In an unrelated thread it is possible Richard Carlsson managed to nail it:
&lt;blockquote&gt;
In most respects, Erlang _is_ a concurrent, nondestructive Lisp with
a Prolog-inspired syntax that focuses on pattern matching and rules.
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;p&gt;
For my own reference he original email:
&lt;blockquote&gt;
&lt;pre&gt;
Nick Linker wrote:
I wonder why Erlang is not Lisp? I mean why inventors of Erlang chose
to create its own language instead of creating just ERTS-specific
library for LISP (or at least Scheme)?

Here are some reasons why Lisp might not be a perfect match to
the problem they wanted to solve:
 - no built-in concurrency
 - destructive updates abound (in Scheme, too)
 - no pattern matching

And if you're going to fix those things, you might as well use a syntax
that feels more comfortable to you. In particular, pattern matching
makes function definitions and selective receives much more readable,
which I assume was an important goal for the kind of industrial
applications that Erlang was created for.

In most respects, Erlang _is_ a concurrent, nondestructive Lisp with
a Prolog-inspired syntax that focuses on pattern matching and rules.

 /Richard
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-115813512090112179?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/115813512090112179/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=115813512090112179' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115813512090112179'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115813512090112179'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2006/09/erlang-in-5-seconds.html' title='Erlang in 5 seconds.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-115811145748307136</id><published>2006-09-13T11:26:00.000+10:00</published><updated>2006-09-13T11:37:37.513+10:00</updated><title type='text'>The Monad Laws</title><content type='html'>&lt;p&gt;
Every now and then I come across a post that explains a concept so clearly it is inspiring.  I'd like to thank Albert Lai for just such a post.  &lt;a href="http://haskell.org/haskellwiki/Monad_Laws"&gt;Re: [Haskell-cafe] Monad laws&lt;/a&gt;
&lt;blockquote&gt;
&lt;pre&gt;
Deokhwan Kim &lt;dk@xxxxx.xxx.ac.kr&gt; writes:
&gt;
&gt;What is the practical meaning of monad laws?
&gt;
&gt;  1. (return x) &gt;&gt;= f == f x
&gt;  2. m &gt;&gt;= return == m
&gt;  3. (m &gt;&gt;= f) &gt;&gt;= g == m &gt;&gt;= (\x -&gt; f x &gt;&gt;= g)

I offer to re-write the laws in do-notation.  (Please view with a
fixed-width (non-proportional) font.)

1. do { x' &lt;- return x            do { f x
      ; f x'               ==        }
      }

2. do { x &lt;- m             ==     do { m
      ; return x }                   }

3. do { y &lt;- do { x &lt;- m          do { x &lt;- m
                ; f x                ; do { y &lt;- f x
                }          ==             ; g y
      ; g y                               }
      }                              }

                                  do { x &lt;- m
                    using 3.14       ; y &lt;- f x
                           ==        ; g y
                                     }

I think in this notation everyone sees the laws as plain common sense.
If you do write a monad that doesn't follow some common sense, the
dire consequence (practical or theoretical) is obvious.

Just in case it is still not obvious to somebody...

When we see a program written in a form on the LHS, we expect it to do
the same thing as the corresponding RHS; and vice versa.  And in
practice, people do write like the lengthier LHS once in a while.
First example: beginners tend to write

  skip_and_get = do { unused &lt;- getLine
                    ; line &lt;- getLine
                    ; return line
                    }

and it would really throw off both beginners and veterans if that did
not act like (by law #2)

  skip_and_get = do { unused &lt;- getLine
                    ; getLine
                    }

Second example: Next, you go ahead to use skip_and_get:

  main = do { answer &lt;- skip_and_get
            ; putStrLn answer
            }

The most popular way of comprehending this program is by inlining
(whether the compiler does or not is an orthogonal issue):

  main = do { answer &lt;- do { unused &lt;- getLine
                           ; getLine
                           }
            ; putStrLn answer
            }

and applying law #3 so you can pretend it is

  main = do { unused &lt;- getLine
            ; answer &lt;- getLine
            ; putStrLn answer
            }

Law #3 is amazingly pervasive: you have always assumed it, and you
have never noticed it.  (To put it into perspective, you hardly notice
yourself breathing, but this only makes the practical meaning of
breathing more profound, not less.)

Whether compilers exploit the laws or not, you still want the laws for
your own sake, just so you can avoid pulling your hair for
counter-intuitive program behaviour that brittlely depends on how many
redundant "return"s you insert or how you nest your do-blocks.
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/p&gt;
&lt;p&gt;
It is also worth reading apfelmus' followup for further elaboration on the intuition behind the monad laws.
&lt;blockquote&gt;
&lt;pre&gt;
Deokhwan Kim wrote:
&gt; But what practical problems can unsatisfying them cause? In other words,
&gt; I wonder if declaring a instance of the Monad class but not checking it
&gt; for monad laws may cause any problems, except for not being qualified as
&gt; a theoretical monad?

This question is likely to be a result of an unlucky introduction to
monads where they are introduced top down: "Hear ye, a monad, this is
some mystic thing obeying the spiritual laws 1.,2. and 3.", isn't it?
It is this way that monads get the attribute "theoretical".

Asking what the practical meaning of the monad laws might be is like
asking what the practical meaning of the laws for natural number
addition could be: what does
i)  a + (b+c) == (a+b) + c mean?
How can i understand
ii)  a + 0 == a ?
What does
iii)  a + b == b + a signify?

These question are unlikely to arise because you have an intuition of
what a natural number is: a number of bullets in sack, coins in your
pocket, people in the mailing-list etc. With this knowledge, you will
most likely not have any problems explaining the laws i),ii),iii) to
somebody else and most likely you will have not doubt about *why* they
must be true.



For monads, my intuition is as following: a value of type (M a) is an
action, something producing a value of type  a  and (or by) executing a
side-effect like drawing on the screen or screwing up the hard drive.


With the operator &gt;&gt;=, I can execute such actions in a specific
sequence. For the sequence, it is of course unimportant how i group my
actions: i can group actions act1 and act2 first and then postpend act3,
or i can group act2 and act3 first and then prepend it with act1.

To simplify writing down a formular corresponding to this fact, we
introduce the operator &gt;&gt; defined by
    act1 &gt;&gt; act2 = act1 &gt;&gt;= \x -&gt; act2
which sequences actions but for simplicity discards the computed value x
of type a. It is only the side-effect of act1 we are interested in.

Now, the thought about grouping written does as formular is just
    (act1 &gt;&gt; act2) &gt;&gt; act3  ==  act1 &gt;&gt; (act2 &gt;&gt; act3)
and this is the simplified version of law 3. Of course, we know that
this is coined "associativity".

The actual law 3 is just a formulation for &gt;&gt;= that takes proper care of
the intermediate calculation result x.


With  return x , we can create an action which computes the value x but
 has absolutely no side-effects.
This can also be stated in formulas, as Mr "return" explains:
1. "if i am prepended to guys doing side-effects, i give them the value
x but do not take any responsibility for side-effects happening"
   (return x) &gt;&gt;= (\y -&gt; f y) ==  f x
2. "if i am postponed to an action which computes a value x, i don't do
any additional side-effects but just return the value i have been given"
   m &gt;&gt;= (\x -&gt; return x)  ==  m
which is of course equivalent to
   m &gt;&gt;= return  ==  m



So to answer your question:
&gt; In other words, I wonder if declaring a instance of the Monad class
&gt; but not checking it for monad laws may cause any problems, except for not
&gt; being qualified as a theoretical monad?
A thing you declare to be an instance of the Monad class, but one that
does not fulfill the three laws above, simply does not match the
intuition behind a monad. I.e. your definitions of (&gt;&gt;=) and (return)
are most likely to be void of the intended meaning.
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-115811145748307136?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/115811145748307136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=115811145748307136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115811145748307136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115811145748307136'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2006/09/monad-laws.html' title='The Monad Laws'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-115703902396453954</id><published>2006-09-01T01:34:00.000+10:00</published><updated>2006-09-01T01:46:17.163+10:00</updated><title type='text'>Why I prefer LALR parsers</title><content type='html'>&lt;p&gt;
I was asked on a mailing list why I prefer LALR to LL based parser generators.  I ended up spending enough time on it to justify posting it here.  Summary: &lt;em&gt;"Reduced complexity in the semantic analyser is well worth the 'cost' of thinking bottom-up in the parser."&lt;/em&gt;
&lt;/p&gt;
&lt;blockquote&gt;
How come you prefer LALR? What about LR(k)?
&lt;/blockquote&gt;
&lt;p&gt;
I haven't really found the need for the added expressiveness of LR(k); this combined with the dearth of good GLR and LR(k) generators for many languages means that I haven't ended up using one for a project yet.  When people write production generators (as opposed to experimental), they seem to be either LL(k) or yacc+.
&lt;/p&gt;&lt;p&gt;
I'm not surprised at the popularity of LL, as you say, if you're going to write your parser by hand you're going to use top-down, recursive decent - ie LL.  Consequently for people coming to the problem of parsing for the first time, they are much easier to visualise, and as you point-out consequently to debug.  I recently had to assist a colleague with a couple of sablecc[0] bugs that were a direct result of visualising the parse top-down, while using a bottom-up parser.
&lt;/p&gt;&lt;p&gt;
However once you've written a handful of parsers, the expressive limitations of LL(k), and the software engineering challenges top-down imposes on semantic analysis quickly teach you to appreciate LALR.  Consequently I do not voluntarily use LL parsers in new projects.
&lt;/p&gt;
&lt;blockquote&gt;
I prefer LL(k) as it generates code similar to that you'd write
yourself (top down parser) and that's useful when you are debugging.
LL(k) is quicker :). 
&lt;/blockquote&gt;
&lt;p&gt;
You're right, debugging of the parser is simpler with LL(k).  That of course is beside the point, as I mentioned in my original email, the parser is the easy stage - the hard part is the semantic analysis, and LL makes this tougher.  Simplifying the parser at the expense of the SA is false economy.
&lt;/p&gt;&lt;p&gt;
The added complexity derives from two places.  The first derives from the additional information available with non-terminal productions in bottom-up parsers.  Because bottom-up parsers reduce non-terminals after their children are fully parsed.  This additional information makes using S or L-attribute grammars feasible for the first stage of SA.  When working with LL I have come across three ways of dealing with this:
&lt;ol&gt;
&lt;li&gt;Don't use attribute grammars, and use gradually (ie. most of the time, partially) initialised parser-global mutable state.&lt;/li&gt;
&lt;li&gt;Use nested parsers as accumulators.&lt;/li&gt;
&lt;li&gt;Use a eulers walk to convert top-down into bottom-up by attaching the SA to the post-order events.&lt;/li&gt;
&lt;/ol&gt;
In my experience the general approach is a combination of 1 and 2 - and they both cause serious structural problems in the resulting code, which all manner of coupling and structural aliasing between the parser and the SA that complicate ongoing maintenance.  3 wastes alot of memory (although admittably that is less of a problem now), but more importantly you have thrown away the very reason you went LL(k) in the first-place - top-down parsing.
&lt;/p&gt;
&lt;p&gt;
The second source of complexity is the consequence of losing access to left-recursive grammars - which has two key impacts.
&lt;ol&gt;
&lt;li&gt;Elimination of left-recursion replaces one simple rule with two coupled rules.&lt;/li&gt;
&lt;li&gt;This elimination is achieved by converting left-recursion to right-recursion; which will always[4] convert an S-attribute grammar into an L-attribute grammar; and seriously complicate any L-attribute grammar.&lt;/li&gt;
&lt;/ol&gt;
&lt;/p&gt;&lt;p&gt;
This causes problems analogous to the interaction of non-associative operators with foldr.
&lt;br/&gt;
Consider the following grammar (where &lt;code&gt;n&lt;/code&gt; is a terminal matching &lt;code&gt;{digit}+&lt;/code&gt; )
&lt;pre&gt;
E -&gt; E - n | n
&lt;/pre&gt;
converted[1] becomes
&lt;pre&gt;
E -&gt; nT*
T -&gt; - n
&lt;/pre&gt;
"10 - 5 - 3" is then parsed:
&lt;ul&gt;
&lt;li&gt;L-recursive : &lt;code&gt;(((10) - 5) - 3)&lt;/code&gt;&lt;/li&gt;

&lt;li&gt;R-recusive : &lt;code&gt;(10 (- 5 (- 3)))&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
Now of course SA can evaluate the R-form correctly, it just takes more work[2]; less intuitive code[3]; greater coupling; greater complexity.
&lt;/p&gt;&lt;p&gt;
LL parsers can't handle the L-recursive grammar, LR parsers can.
&lt;/p&gt;&lt;p&gt;
&lt;strong&gt;Reduced complexity in the SA is well worth the 'cost' of thinking bottom-up; seriously, it's not that difficult to do.&lt;/strong&gt;
&lt;/p&gt;&lt;p&gt;
[1] The kleene star simplifies this a bit, using e for the empty match the classic conversion is&lt;pre&gt;
    E -&gt; nE'
    E' -&gt; - nE' | e&lt;/pre&gt;
See Aho et al for details.
&lt;/p&gt;
&lt;p&gt;
[2] The L-recursive SA is a trivial S-attribute grammar defined as
&lt;pre&gt;
E -&gt; E' - n { E.val := E'.val - n.val }
E -&gt; n      { E.val := n.val }
&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;
[3] In this case the L-recursive form is so trivial that the resulting R-form produces a trivial accumulator based SA.  However note that even at this basic level, we have converted a simple declarative form into a recursive form that is fundamentally more complex.  In cases where the L-form is naturally recursive, the resulting R-form invariably introduces mutable shared state, with it's attendant complications.
&lt;/p&gt;&lt;p&gt;
[4] I'm reasonably certain this is the case, I don't however have time to double check this.  Presumably someone will correct me if I'm mistaken here.
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-115703902396453954?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/115703902396453954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=115703902396453954' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115703902396453954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/115703902396453954'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2006/09/why-i-prefer-lalr-parsers.html' title='Why I prefer LALR parsers'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7421391.post-114557706469320051</id><published>2006-04-21T08:56:00.000+10:00</published><updated>2006-04-21T09:51:23.750+10:00</updated><title type='text'>Open Recursion: a definition.</title><content type='html'>&lt;p&gt;
I've been asked a couple of times now about my use of "open recursion".  It's covered in some detail by Pierce in "Types and Programming Languages"; I've included the one paragraph definition he gives below.
&lt;blockquote&gt;
&lt;p&gt;
&lt;strong&gt;Open recursion.&lt;/strong&gt; Another handy feature offered by most languages with objects and classes is the ability for one method body to invoke another method of the same object via a special variable called &lt;code&gt;self&lt;/code&gt; or, in some langauges, &lt;code&gt;this&lt;/code&gt;.  The special behavior of &lt;code&gt;self&lt;/code&gt; is that it is &lt;em&gt;late-bound&lt;/em&gt;, allowing a method defined in one class to invoke another method that is defined later, in some subclass of the first.
&lt;/p&gt;
&lt;p&gt;
&lt;em&gt;Types and Programming Lanauges, Benjamin C. Pierce, 2002, MIT Press, pg 227.&lt;/em&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7421391-114557706469320051?l=etymon.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://etymon.blogspot.com/feeds/114557706469320051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://www.blogger.com/comment.g?blogID=7421391&amp;postID=114557706469320051' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/114557706469320051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7421391/posts/default/114557706469320051'/><link rel='alternate' type='text/html' href='http://etymon.blogspot.com/2006/04/open-recursion-definition.html' title='Open Recursion: a definition.'/><author><name>Andrae Muys</name><uri>http://www.blogger.com/profile/04967415260912980895</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='06968995227588419577'/></author><thr:total xmlns:thr='http://purl.org/syndication/thread/1.0'>1</thr:total></entry></feed>