How's your string theory? Back to the basics! You're in you comp sci class again, except wiser and golfier. You have the tools, you have the power&hellip; but do you have the skill? Probably.

Crash Course for the non-Computer Scientist (skip if you don't need it)

A string is symbolically represented by an arbitrary letter (usually, for our purposes, will be  etc. Of course, we know a string as something like "Hello, World!" or 'Hello, World!', or, if you're the snarky Python user, """Hello, World!""".

An alphabet can be thought of as a set (i.e. no repeating characters) of symbols, of which strings can be made. For example, ; this is the binary alphabet, of which contains strings like  and .  These strings can said to be strings over , or, alternatively, .

The length of any string is denoted . For example, .

There is the empty or null string , which is equivalent to "". It is a valid string in over any alphabet. In other words,  is the unique string satisfying the property .

The set  is the set of all strings  over  for which .

The set  is called the Kleene closure of , and is the set of all strings over . This can be considered the language of .

The concatenation of two strings  and  is denoted , and is the string containing the characters of  followed by the characters of .

 is said to be a prefix of  if there is some string  that satisfies the equality . (If , then  is said to be a proper prefix of .)

The alphabet of a string  is denoted , and is the minimal alphabet  so that  is a string over 

The projection of a string  relative to an alphabet  is defined as 



and is essentially the removal of all characters in  not in .



TL;DR

Objective Write a program, series of functions, series of programs etc. that can calculate as many of the following tasks as possible:


(1) Calculate, given a string s, its length.
(2) Arrive at, given a string s and an alphabet &Sigma;, whether or not (output a truthy/falsy value) that string is over said alphabet.
(1) Given an alphabet, arrive at whether or not (output a truthy/falsy value) the alphabet is valid (a valid alphabet can have no repeating characters, but is otherwise valid).
(4) Given an alphabet &Sigma; and a positive integer n, display .
(6) Given an alphabet &Sigma; and an integer n, display the first n entries in  (Remember that &epsilon; &in; &Sigma;!)
(1) Given a string s and a string t, output st.
(3) Given a string s, output Al(s).
(5) Given a string s and an alphabet &Sigma;, output &pi;&Sigma;(s).


Input is given by a string or your language's closest equivalent for a string input, an array, tuple, or n-ordinate of characters for an alphabet  (your language's closest equivalent), and a number for a number (or your language's closest equivalent, heaven forbid your language does not support numbers!).

Each task has a score (the number in parenthesis). Your submission's score is calculated as follows:

        sum points scored
score = —————————————————
         length of bytes


Highest score wins.

Bonuses


&times;4 final score iff you output (with the correct symbols!) the input query. E.g., outputting \pi_{\{0,1\}}(012345678910111213)=01101111 for an input of &Sigma; = [0,1]; s = 012345678910111213. (You may choose to do this in either HTML or (La)TeX. Either counts.)
(I'm open to suggestions.)
APL, score 3

Task 7: 3 / 1

∪


This is a built-in that &ndash; according to this discussion &ndash; can be considered an unnamed function.

Try it online on TryAPL.