# Meta quine checker

This challenge, if you accept it, is to write three functions or programs A, B, and C:

• A is a quine that outputs all of A,B and C (which is also the whole content of the code in your submission).
• B takes a parameter F and checks whether it is such a quine (outputting FBC), or doing something different.
• C takes a parameter G and checks whether G possibly works like B (checking whether F outputs FGC). It is impossible to decide whether a function is a quine checker, so let's do something simpler:
• It must return truthy if G is valid for B.
• It must return falsey if G returns falsey for all valid quines, or G returns truthy for all valid non-quines.
• It can return anything, crash or not terminate, etc, if it is any of the other cases.

Note that B is possible. A and F doesn't have any input, so you can just run them and check the result.

### Rules

• There should be some way to tell which parts are A, B and C from the output of A. For example: each has one line, or they are recognized as three functions in the interpreter.
• Each function should run with only the definition of itself, not your complete code.
• You can use a function/program or its source code, or a pair of both as the input of B (or G) and C.
• You can redefine truthy/falsey to a subset of those values. You can also consistently require F returning some type you choose, like a single string.
• You can require A, B, F and G, if they are called with valid parameters, consistently don't have some types of other inputs or side effects you choose, such as accessing global variables, or reading stdin, etc.
• You can also assume F and G, if they are called with valid parameters, always terminate.
• F should work in the same condition as A. So it cannot depend on B or C or another variable's existence, unless that variable is defined in its own part in its output.
• No functions or programs can read its own source code.
• This is code-golf, shortest code (which is the output of A) in bytes wins.
• B is still impossible in general because F might not terminate, as well as in practice in many languages because it requires combinations of abilities like temporary redirection of stdout and either function-to-string or exec. The best you can hope for is probably a half-working solution in a LISP. – Peter Taylor Apr 16 '15 at 7:47
• How would you check G with all quines and non-quines? I'm currently working on a Mathematica solution. – LegionMammal978 Apr 16 '15 at 10:35
• @PeterTaylor "You can also assume F and G, if they are called with valid parameters, always terminate." And "output" can mean return, not necessarily print to stdout. – jimmy23013 Apr 16 '15 at 15:04
• @LegionMammal978 It is impossible to check all quines and non-quines. But the task of C is something simpler, where you only need to check one quine and one non-quine. – jimmy23013 Apr 16 '15 at 15:08
• @PyRulez I think this is in the spirit of this challenge, so I'm going to allow it. But the function cannot access its own source code. – jimmy23013 Apr 18 '15 at 3:20

# CJam, 254 bytes

{{['{\"_~}{{[1$'{@\"_~}"{{["_~}"2$+'{@"_~}"]s"{{['{\\"\+"]s}_~}"+~1$~{L}@~!&}_~}_1>W<"\"]s\~=}_~}"@]s}_~}{{[1$'{@"_~}{{[\"_~}\"2$+'{@\"_~}\"]s\"{{['{\\\\\"\+\"]s}_~}\"+~1$~{L}@~!&}_~}"]s\~=}_~}{{["_~}"2$+'{@"_~}"]s"{{['{\\"\+"]s}_~}"+~1$~{L}@~!&}_~}


The 3 functions are:

{{['{\"_~}{{[1$'{@\"_~}"{{["_~}"2$+'{@"_~}"]s"{{['{\\"\+"]s}_~}"+~1$~{L}@~!&}_~}_1>W<"\"]s\~=}_~}"@]s}_~}  {{[1$'{@"_~}{{[\"_~}\"2$+'{@\"_~}\"]s\"{{['{\\\\\"\+\"]s}_~}\"+~1$~{L}@~!&}_~}"]s\~=}_~}

{{["_~}"2$+'{@"_~}"]s"{{['{\\"\+"]s}_~}"+~1$~{L}@~!&}_~}


A and F take no parameters and return a string. B, G and C take a CJam block as parameter and return 1 for truthy, or 0 for falsey.