[r-t] gsiril (was Rule Based Construction Notation)
Alexander Holroyd
holroyd at math.ubc.ca
Fri Aug 1 17:32:33 UTC 2008
This is very very cool, Richard!
But it's not really "free software" if no-one knows it's there, is it?
There is nothing here.
Why don't you have a page linking to all this delightful stuff?
Ander
On Fri, 1 Aug 2008, Richard Smith wrote:
> Graham John wrote (slightly reordered):
>
>> It seems quite concise for these examples.
>>
>> 720 PB Minor
>>
>> x16
>> (1 = 1), x12
>> (1 = 1 & 6 > 4 & 5 < 5), x14
>> (1456 = 1456), x1234
>
> 1256 = 1256, I hope.
>
> What you've written gives a 240: WHWsHx2.
>
>
>
> When I wrote gsiril, the MicroSiril clone that is in the
> Ringing Class Library, I added this functionality to it.
>
> http://www.ex-parrot.com/~richard/gsiril/
>
> The syntax I used is a bit different to yours (and uglier)
> because I wanted to retain compatibility with MicroSiril
> (well, nearly), which meant routing around for more obscure
> symbols to use.
>
> So, for example,
>
> 6 bells;
> prove repeat( +-, {
> +1234, /12*56/ : +1234, "s @";
> +14, /1*6?/ || /1*[234]6/ : +14, "- @";
> +12, /1*/ : +12;
> +16;
> }, { /123456/ : break } )
>
> What does this do?
>
> 'repeat' means repeat its argument indefinitely. In this
> case, its argument is a sequence of three things:
>
> - a piece of place-notation, +-, i.e. the cross change;
> per MicroSiril, a + or & prefix is required on place-
> notation;
>
> - a lengthy rule to determine whether the next change is a
> 16, 12, 14 or 1234;
>
> - a rule to see whether we've come back to rounds, and if
> so, exit the loop: this is the { /123456/ : break } bit.
>
> The rule to select one of 16, 12, 14 or 1234 is the
> interesting bit. The syntax is
>
> { test1 : result1 ; test2 : result2 ; ... ; default }
>
> It evaluates test1, and if it is true applies result1 to the
> composition. If test1 fails, test2 is tried, and so on. If
> all tests fail, the default result is applied. The cunning
> bit is that within the test, you can speculatively continue
> adding bits to the composition before actually doing a test.
> Irrespective of the outcome of the test, these are then
> unrolled.
>
> So, +1234, /12*56/ : +1234, "s @"; means speculatively add
> a 1234 single to the end of the composition and see whether
> it produces a 12??56 row. The 1234 single is then removed.
> If the test succeed (i.e. if the single did produce a 12??56
> row), it is reapplied. The "s @" bit justs prints out an
> 's' followed by the row, just as in MicroSiril.
>
>> 720 Kent TB Minor
>>
>> X12x16
>> (1 < 3), 34x34.16
>> (1 = 1 & 6 < 4 & 5 > 3), 34x34.14
>
> 6 bells;
> prove repeat( {
> +34x34.14, /16*/ || /1[234]6*/ : +34x34.14, "- @";
> /1*/ || /?1*/ : +34x34.16, { /1*/: " @" };
> +-12-16;
> }, { /123456/ : break } )
>
>
> I'm sure that prettier syntaxes can be designed, but this
> seems fairly powerful. I frequently use it to prove magic
> block peals, for example.
>
> RAS
>
> _______________________________________________
> ringing-theory mailing list
> ringing-theory at bellringers.net
> http://bellringers.net/mailman/listinfo/ringing-theory_bellringers.net
>
More information about the ringing-theory
mailing list