User loginNavigation 
Programming with alternativesI've come up with a new concept, called 'alternative programs', where expressions can have multiple alternatives. I wonder if there are any papers out there that discuss a similar concept. I'm having trouble defining the concept, but here is a try: Every expression takes the form of a sequence of alternative expressions, syntactically enclosed within curly brackets and separated by commas (in the case of a single alternative, curly brackets are omitted). The combination of two alternative expressions results in the cartesian product combination of their alternatives. Example alternative expressions:
I've taken the bold step to generalise the above into the following: Consecutive alternatives in a sequence that are equal are compressed into singletons, then prefixed with a colon, together with the multiplicity of the consecutive equal alternatives. A compressed representation of a sequence is called the canonical representation of a sequence. Next to that, multiplicities are of type rational and can be negative (where negative multiplicities are prefixed with an underscore). Luckily, the cartesian product of alternatives can be naturally defined over negative and rational multiplicities. Example canonical representations:
By Robbert van Dalen at 20130103 22:21  LtU Forum  previous forum topic  next forum topic  other blogs  2839 reads

Browse archivesActive forum topics 
Recent comments
2 hours 26 min ago
8 hours 57 min ago
10 hours 41 min ago
10 hours 50 min ago
11 hours 35 sec ago
11 hours 4 min ago
11 hours 10 min ago
11 hours 16 min ago
11 hours 22 min ago
11 hours 23 min ago