# Glossary of Computer Science Terms

### facts

With relation to expert systems, these are givens - known truths that are written in to a program. These are what expert systems use to help them make decisions.

### generator

The rule that defines the L-system and how it changes the initiator.

### genetic algorithm

A process that is used in computer science to obtain good results for something based on a set of rules. In this case, we're trying to find a good melody line. One way to do that would be to compute every possible melody line and score it according to our rules for how well it complies. That would take forever. A different idea that takes less time but is not likely to get the absolute best result is a genetic algorithm. Start with a series of randomly generated melodies (say 50 or 100) and score them according to the scale. Take the top scorers and find a spot (the same spot in both melodies). Cut the melodies at that point and switch them. For instance, if the two melodies were:
1. A B E C F A A C
2. G D G F E D A A
and we decided to break them after the third note and switch them, the result would be:
1. A B E F E D A A
2. G D G C F A A C
That process is called mating, and it is analogous to how DNA strands mix when an egg is fertalized. Next, score those and put them back in the list. Hopefully, it created a melody that took the best parts of both of the origonal two and combined them to make a better melody. This is the basic idea. There are more variations on the algorithm, such as randomly changing a single note in the melody every so often (a process called mutation).

### grammars

This term is generally used in relation to artificial intelligence. A grammar is a formal system for accepting or rejecting strings (sentences, in many cases). A grammar may be used as the membership criterion for a language.

### heuristics

These are suggestions that ar written into the expert system program that give it suggestions for how to act when it doesn't really know what to do or doesn't have enough information.

### initiator

With reference to L-systems, an initiator is the input string. That is to say, it could be anything from rddlu to . The initiator is altered by the generator in an L-system.

### Lindenmayer systems

This is actually a subject from math, but L-systems are used quite often in computer science, so we don't feel bad about putting it here. L-systems are what is called a string replacement algorithm. They take the input of an initiator and a generator and apply the generator to the initiator, then apply the generator to the result of the last application, and so on. For instance, if the intiator is the first example under the definition of initiator above, then a generator could be d -> ruul. That means that in that example, rddlu would become rruulruullu, because the generator replaces d with ruul every time it sees it in the initiator. If You then used that as the initiator, You wouldn't get any change when You applied the generator, because there isn't a d to replace. If You used as the initiator and as the generator, after one iteration, You would get (roughly) , because, in this case, You replace every line with the generator. This is known as Koch's snowflake. You can iterate it out as many times as You want. If You wish, You may read a brief history of L-systems.

A term used to mean that a computer has multiple threads of execution that it switches between quickly to give the illusion that it is executing them simultaneously. That means the computer will work on the instructions in one thread of execution for a little while (a fraction of a second), then it will stop and leave that thread of execution temporarily hanging while it works on another one for a little while.

### natural language

Any language spoken by people, with all of its hidden implications and assumptions.