nyuuzyou/wikis huggingface dataset:
Halticopter

Halticopter is an esoteric programming language.
== Overview ==
Source code consists of a single Turing machine (we call it X). Input is also a Turing machine (we call it Y). Output is a single bit.
Halticopter assumes that X does not halt. From that assumption only, it tries to determine whether Y halts. If the program can conclude that Y halts, the program outputs 1 and halts. If the program can conclude that Y does not halt, the program outputs 0 and halts. If the program cannot determine whether Y halts or not, the program does not halt. If X halts, the result is undefined (the program may either output 0 or 1, or may not halt).
== Syntax ==
Both source code and input represent Turing machines. The syntax of the Turing machine is the following: it is an array of states separated by new lines and each state is represented either as the "HALT" string (for halting states), or as two groups of 3 space-separated decimal non-negative integers enclosed in parentheses (for non-halting states) - the first group is for the current pointed bit being 0 and the second is for 1. In each group, the first number is 0 or 1 (0 - do not invert the memory bit, 1 - invert the memory bit), the second one is 0 or 1 (0 - go left, 1 - go right), and the third one is the next state (0-indexed). The initial state is the state with index 0. Invalid syntax (either in the source code, or in the input) triggers a syntax error.
== Examples ==
=== Example 1 ===
Source code:
 HALT
Input: (anything)
Output: undefined (because X halts)
=== Example 2 ===
Source code:
 (0 0 0) (0 0 0)
Input: (anything)
Output: If the input is literally the same as the source code, the output is 0. For any other input, the output depends on the inference rules used to determine whether Y halts or not (see the "Further research" section).
=== Example 3 ===
Source code: (a Turing machine that halts iff ZF is inconcistent)See https://github.com/sorear/metamath-turing-machines/blob/master/zf2.nql
Input: (a Turing machine that tries to prove a ZF statement starting from the ZF axioms)
Output: If ZF is consistent: if the statement is provable, then the output is 1, otherwise the output is either 0, or the program does not halt. If ZF is inconsistent, the result is undefined.
== Further research ==
The language does not seem to be precisely defined. The statement "assuming that X does not halt, we conclude that..." is pretty vague. The language specification can be improved by defining some formal computable inference rules for deducing whether Y halts based on the assumption that X does not halt (if such rules even exist), but without assuming anything else (such as the consistency of ZF or any other formal mathematical system). The author did not come up with any such rules so far.
== References ==
Category:Languages
Category:Unknown_computational_class
Category:Unimplemented
Category:2020
Halting problem

I know nothing but my own ignorance.
::::::::::::::::::::::::::: -- Socrates
The halting problem is to determine, given a program and its 
input, whether the program will halt or loop forever. On
Turing machines, which have no constraints on memory, the halting 
problem can be shown to be unsolvable. The same is thus true for any 
Turing-complete programming language, such as Brainfuck.
The proof is actually relatively simple. It can be done by proof of negation.
== 1 ==
Suppose that there is an algorithm that can decide if other programs, given certain inputs, will end or not. Let's use a C-like syntax, for demonstration purposes. Say that this algorithm is a function declared like so: 
 bool doesHalt(program, input) {
 //How the program and its arguments are represented doesn't actually matter.
 ...
 }
Now let's say we have another function that takes a program as input, like so:
 void selfLoop(program) {
 if (doesHalt(program, program)) {
 infiniteLoop(); //Doesn't matter what happens in this function, just that it will never end
 }
 else {
 return;
 }
 }
If the program, passed as an argument, halts when given itself as input, then selfLoop will loop forever. Otherwise, it will end.
Here's the kicker. What happens if we do this?
 selfLoop(selfLoop);
Inside that function call, we'll see doesHalt(selfLoop, selfLoop) be run. That statement will return whether or not selfLoop(selfLoop) runs forever when given itself as input. So if selfLoop(selfLoop) eventually halts, selfLoop(selfLoop) should run forever.
Wait, what? That can't be right. We've come upon a contradiction, a statement that cannot be true. Thus, the halting problem cannot be solved for Turing machines.
== 2 ==
There's actually another way to counter it, and you don't even need that program to put it in.
First, suppose that there is an algorithm that calls halts(p).
Then we build up a infinite loop: 
void forever()
{
 forever;
}
And then we build up a program called "G": 
void G()
{
 if (halts(G))
 {
 forever();
 }
 else
 {
 return;
 }
}
In program G, we call the halts() algorithm to determine whether G will be halt. If it halts, call the forever() program and let it run forever. But this just shows that G will not be halt, so halts(G) should be false, and we will halt at this time. But this just shows that halts(G) should be true, so ...... We're stuck in an endless loop. That is, whether halts (G) is true or not, we arrive at a contradictory conclusion. Therefore, our initial assumption is not true, that is, there is no universal algorithm that can determine whether any program can be halt (at least on a Turing-complete programming language).
== Summary ==
The halting problem is, however, solvable for finite state machines: 
whenever a state change occurs, you compare the new state of the FSM 
against all previous states. If you find a match, the program will not 
halt. Since the machine has a finite number of states, it is guaranteed 
to either halt or return to a previous state at some point. This is how 
the Smallfuck to lookup table compiler works.
Category:Concepts
Halting problem (language)

Halting problem is a language designed by islptng. 
==Commands==
 (code)loop| while code halts, execute loop.
 <name> executes function called name.
 <name:value> defines a function.
 # halt
==Computation class==
If this language is turing-complete, it will be uncomputable, which self-contradicts. 
Therefore, this language is never turing-complete.
Category:Languages Category:2024 Category:Unknown computational class Category:Unusable for programming
Haltingfuck

HaltingFuck is a language very much like Brainfuck, with one key difference: instead of loops stopping when the value in the current cell is zero, they stop when the value in the current cell is the Gödel number of a HaltingFuck program that halts. The specific Gödel encoding is not specified since it doesn't affect any interesting properties of the language.
==Computational Class==
It is consistent with the definition of Haltingfuck to claim that all Haltingfuck programs halt. However, this is not the only consistent interpretation - the specification is incomplete. When determining whether a Haltingfuck program halts, there are three possible cases to consider:
# A program with no loops in it. This definitely halts.
# A program containing only loops that start on a cell containing the number of programs of type 1 or 2. This halts too, since by induction none of its loops will run.
# A program containing a loop that starts on a cell containing the number of a program of type 3. These can be divided into two subtypes - those where if you follow the list of programs whose halting behaviour you need to determine in order to determine the behaviour of the first program you eventually come back around to the start, and those where the list continues forever without repetition. For instance, in an encoding where 0 encodes [] then [] is of type 3a: in order to determine whether [] halts, you must determine whether [] halts. On the other hand in an encoding where a number n encodes n+1 +s followed by [], then [] is of type 3b: in order to determine whether [] halts, you must determine whether </code>+[]</code> halts, and in order to that you must determine whether ++[] halts, and so on.
The specified semantics tell us nothing about whether programs of type 3 halt. We can specify that they do, but we can also self-consistently specify that some or all of them don't. If there is any Haltingfuck program that doesn't halt, then that version of Haltingfuck is uncomputable by the same argument as applies to Unhaltingfuck.
==UnHaltingFuck==
HaltingFuck implies a sister language, Unhaltingfuck, whose loops stop when the value in the current cell is the Gödel number of an Unhaltingfuck program that doesn't halt. This language is uncomputable - ie. its specification is complete but inconsistent.
Category: Languages
Category: Brainfuck derivatives
Category: 2021
Category: Cell-based
Hamiltonian

Hamiltonian is an esolang based on Hamiltonian cycles. Finding the result of a Hamiltonian computation is an NP-complete problem.
See Hamiltonian cycle
== Syntax ==
Any given program will consist of any number of tokens, which are either digits and * symbols. An example program is below:
 12*8**
Any character that is not a token is ignored.
 12 This is the same program.
 *8aa**
To execute a program, the compiler counts the number of tokens and adds *'s until the number of tokens is a triangle number.
 12*8 Again, the same program.
If the new number of tokens is the nth triangle number, there are considered to be (n+1) nodes in the graph. The first n tokens are the weights on the arcs from the starting node, with the first token corresponding to the arc to node 1, the second to node 2 and so on. The next (n-1) tokens are on the arcs from node 1 to node 2, from node 1 to node 3 and so on. (I've called the starting node 0, in case you were confused.)
A weight of * means there is no connection between the two nodes.
== Solving ==
The compiler takes the resultant graph and finds the lengths of all possible Hamiltonian cycles. It then orders the cycles from shortest to longest and executes an instruction based on the length of each.
To execute an instruction, the length mod 8 is calculated, and the compiler selects an instruction from the following:
 0 - Swap the top two elements of the stack. (Underload's "~")
 1 - Duplicate the top element of the stack. (Underload's ":")
 2 - Discard the top element of the stack. (Underload's "!")
 3 - Concatenate the top element of the stack to the end of the second element of the stack. (Underload's "*")
 4 - Pop the stack and append that string to the program. (Underload's "^")
 5 - Push the string "0" onto the stack.
 6 - If the string on the stack is a single digit, increment it by 1, mod 8
 7 - Print the stack, see below (Underload's "S")
To print, take characters in groups of 3, padding with 0 if needed. Take the values as bits, and print each group of 9 bits as a char, ignoring the first bit.
Hanabi

Hanabi (pronounced /ˈha.na.bi/) is a stack-based esoteric language written by User:Ellie, named after the Japanese word for firework, 花火 (hanabi). Each operation is decided by the amount of whitespace on all four sides of the instruction character, .
== Encoding instructions ==
The core of Hanabi is the method of encoding operations. To execute one instruction, the amount of whitespace on each side of the . is counted, and then is translated into an instruction, which is executed. For example:
 #
# . #
 #
In this example, there is no whitespace above the ., 1 to the left, 2 to the right, and 3 below.
 ##
#..#
 #
 #
.s can use each other as non-whitespace characters.
If a . doesn't have a non-whitespace character in one of its directions, it is considered a syntax error.
 #
#.
 #
== Execution order ==
The .s are executed left-to-right then top-to-bottom.
 # #
#. .#
#. .#
 # #
In this example, the top-left . is executed first, followed by the top-right, bottom-left, and the bottom-right.
== Instructions ==
U	D 	L	R 	Instruction
0	n 	0	0 	push n
0	n 	0	1 	push ASCII codes for number n
0	0 	0	2 	input one byte
0	0 	0	3 	input one number
0	0 	0	4 	input one line
0	1 	1	0 	push stack length
0	0 	1	0 	swap top two
0	0 	1	1 	reverse entire stack
0	0 	1	n≥2	reverse top n items
0	0 	2	0 	swap top two
0	0 	2	1 	rotate entire stack upwards
0	0 	2	n≥2	rotate top n items upward
0	1 	2	0 	swap top two
0	1 	2	1 	rotate entire stack downwards
0	1 	2	n≥2	rotate top n items downward
1	0 	0	0 	pop; print as ASCII
1	1 	0	0 	print entire stack as ASCII
1	c≥2	0	0 	print top c items as ASCII
1	0 	0	1 	pop; print as number
1	1 	0	1 	print entire stack as numbers
1	c≥2	0	1 	same as above; c times
1	0 	0	2 	print a newline
1	0 	1	0 	pop and throw away
1	0 	1	c 	pop and throw away c items
1	0 	2	0 	clear stack
2	0 	0	0 	duplicate top item
2	0 	c	n 	duplicate top n items c times
2	1 	0	0 	==
2	1 	1	1 	!=
2	1 	1	0 	<
2	1 	2	0 	<=
2	1 	0	1 	>
2	1 	0	2 	>=
2	2 	0	0 	addition
2	2 	0	1 	subtraction
2	2 	1	0 	multiplication
2	2 	1	1 	division
2	2 	2	0 	exponentiation
2	2 	2	1 	logarithm
2	2 	n	m 	etc
2	2 	0	2 	modulo
2	2 	1	2 	integer division
2	2 	2	2 	divmod
2	3 	0	0 	pop n; push 1 if n == 0 else 0 (not)
3	n 	0	0 	set label n
3	n 	0	1 	pop; go to label n if nonzero
3	n 	1	0 	pop; go to label n if zero
3	n 	1	1 	go to label n
== Examples == 
=== Hello, world! ===
 ## ## # # ## ## # ##
#..# # # # # #
 ## # # #
 # .....# ... #.............##
 # ## # ## #### ## #
 #. # # # ##
 ##.# #. ##.#.# # # #..#
 #..# # ...#.## ##. #
 # ## #
 #.# # ## # #
 # # #..## # # #.#..#.#
 # # # # # ##
 # # ###
#. #.#. #.# #.# #....# # .#.#.#
 # # # # #
 #
 # # # # ## #
 # #
 #
 #
=== Fibonacci numbers ===
 ## #
#..#
 # #
 # # # ## #
 #.# . #
#.# # # . #. # #. #
 # #.## . ##.# . #
 # # #
 #
=== Primality testing ===
 ##
#..### # #
 #
 # # # #
 # ...# ... #.. # # #
 # #
 # # # # #
#.#.# #. ###.# . ##..# . #.## #
 # . # ### #
 ## # # ## # #
 ## # #. # . # # .# . #.. #
#.# . # . ##.# #.# # .#
 # .##.# # # # . ##
 # # ##. # # # #
 # #
Category:Languages
Category:2018
Category:Implemented
Category:Two-dimensional languages
Category:Pattern-based
Category:Turing complete
Category:Stack-based
Hannah

Hannah is a two-dimensional esoteric programming language invented by Marz. It is believed to be Turing complete.
A description of Hannah can be found here, and some examples can be found here .
==Examples==
===Hello, world!===
This program outputs the ASCII for "Hello, world!" in binary.
 hello world
 v v vv v v vv vv vv vv vv vvvv v vv v vvv vvv v v
 oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
===Cat===
This program outputs input bytes until it reaches a null.
 cat
 v
 xv< < < < < < <
 /////////////////
 v v v v v v v v
 i i i i i i i i
 /oo/ /oo/ /oo/ /oo/
Category:Languages
Category:Two-dimensional languages 
Category:Low-level 
Category:Self-modifying
Hanoi

Hanoi is a stack-based esoteric programming language designed by Otesunki (talk), composed of three towers (or four if you count the I/O tower), where each element in each tower must be less than or equal to the element below it.
Instruction 	Description
Subtraction: Pop the two most recent values off the current stack as a and b. push b, then push b - a</code>.	
> 	Duplicate: Pop a value off stack 2, then push it back twice.
< 	Deduplicate: Pop two values off stack 2, if they're equal, push the value back once. otherwise, error.
( 	1->2: Pop a value off stack 1, then try to push the value to stack 2.
) 	2->1: Pop a value off stack 2, then try to push the value to stack 1.
[ 	3->2: Pop a value off stack 3, then try to push the value to stack 2.
] 	2->3: Pop a value off stack 2, then try to push the value to stack 3.
{ 	i->2: Get a character from stdin, then try to push it's ASCII code to stack 2.
==Examples==
Single character cat:
 {}
Category:Stack-based
Category:Unusable for programming
Category:Reversible computing
Category:Total
Category:Non-interactive IO
Category:Implemented
Category:Thematic
Hanoi Love

Hanoi Love is a minimal stack based language created by Jeffry Johnston, April 30, 2001. Its name was inspired by the Towers of Hanoi game, while the language itself was inspired by Spaz and brainfuck.
Command	Short Name	Description
. 	nxtstk 	next stack: selects next stack in order (A,B,C,D). loops back to A from D.
' 	cpyreg 	copy register: copies byte in register and pushes it to the stack: unless stack D, then push location pointer -1
, 	pfsmir 	pop from stack move into register: unless stack D, then pop & goto location previously pushed location
; 	pfsatr 	pop from stack add to register: unless stack D, then pop location and noop
` 	pfssfr 	pop from stack sub from register: unless stack D, then pop location and noop
' 	iomode 	io mode prefix: next instruction will pop from stdin or push to stdout instead of a stack.
: 	sifzer 	skip if zero: if the register is zero, skip instructions until the ! instruction is reached.
] 	eskhlt 	end skip/halt: if matching a :, end skip. if not matching a :, halt.
All characters other than .',;`":! should be considered comments and ignored.
==Overview==
There are 4 stacks and one register. A, B, C, D, REG.
Stack A is the initial stack. It pops a 1 if empty, holds 8bit values, and has boundless memory (limited only by physical memory)
Both Stack B and C pop a 0 if empty, hold 8bit values, and have boundless memory (limited only by physical memory)
Stack D is for storing the location of instructions. When a push operation is performed here, the previous instruction location (current location minus one) is pushed onto the stack. When a pop operation is performed the new instruction location is popped from the stack. If a ";" or "`" instruction is performed on this stack then the instruction location is popped, but no further action is taken (this is useful for breaking out of loops).
The register holds one 8 bit value, used for swapping between stacks. It is initalized to 0.
The original implementation does not specify EOL behavior or wrapping behavior.
==BF to HL==
Any brainfuck program can theoretically be run in Hanoi Love using a simple translation table. The original implementation provides this:
Brainfuck 	Hanoi Love
> 	..,...'...
< 	.,.'..
,.;'... 	
.,...`.'...	
. 	.,'"'...
, 	.,",'...
[ 	...'..,'...:
] 	...,!...;.
==Cat program example==
 ...'.,'";:`"'...,!
==Hello world example==
 .'...,;';';;';';';'.,...;"'.'...,;;';;';';;'.,...;"';;;;;;;"'"';;;
 "'.'.,...'...,;';';';';'.,...;"'..'...,'...,;;';';';'.,...`"'.'...,
 ;;';';';'.,...;"';;;"'``````"'````````"'.'.,..;"'.'.,..;;;;;;;;;;"'
==External resources==
* Hanoi Love Programming Language
* 
* Language home, including programs
* A (WIP) Reimplementation of the Hanoi Love Programming Language in Ruby
* A Python interpreter for Hanoi Love
Category:Languages
Category:Turing complete
Category:Stack-based
Category:Implemented
Category:Low-level
Category:2001
Hanoifuck

Hanoifuck is an esoteric programming language invented by Joshua Barretto. It draws influence from Brainfuck, but swaps Brainfuck's tape-driven memory model for a multi-stack LIFO memory model similar in conception to the 'Towers of Hanoi' puzzle game.
==Language overview==
Syntactically, and in terms of code execution, Hanoifuck behaves exactly like Brainfuck. However, it differs in the instructions it has and the way in which they operate upon the memory model.
Hanoifuck's memory model is composed of 3 independent LIFO stacks of bytes. Each stack can have bytes push onto them or popped off them (through various operations). At any one moment, only one of the stacks is operated upon. The ! instruction is used to switch between each of the stacks in turn.
Instruction 	Description
Addition: Pop the two most recent values off the current stack as a and b. Then, push a + b 	
Subtraction: Pop the two most recent values off the current stack as a and b. Then, push a - b	
$ 	One: Push the value 1 onto the stack
! 	Swap: Switch to the next of the three stacks, looping if necessary
, 	Read: Read a single character from stdin, replace the item at the top of the current stack (similar to Brainfuck)
. 	Write: Write the ASCII value of the item at the top of the current stack to stdout (similar to Brainfuck)
[ 	Skip forward: As in Brainfuck, skip forward to the next matching ] if the item at the top of the current stack is zero
] 	Skip backward: As in Brainfuck, skip backward to the next matching [ if the item at the top of the current stack is non-zero
==Comparisons with Brainfuck==
While the execution semantics of Hanoifuck is deliberately very similar to Brainfuck, the use of stacks makes static analysis, and hence optimisation, of Hanoifuck much more viable than that of Brainfuck.
==Examples==
A simple example that outputs HELLO to the console:
$+$+$+[$-!$+$+$+$+!!]![$-!!$+$+$+$+$+$+!]!!.$-$-$-.$$$$$$$+++++++..$$$+++.[$-]$+$+[$-!$+$+$+$+$+!!]!.
==External resources==
* Hanoifuck reference interpreter in C
Hanoiing

A language made by User:Beefster based on the Towers of Hanoi puzzle.
The language architecture consists of a single unbounded integer register and three unbounded stacks of unbounded integers. The catch is that the top value of every stack must be smaller than the number immediately below it (and by extension, every other number in the stack), just like in the Towers of Hanoi puzzle. All programs begin with the register set to 0 and all stacks empty.
Instructions are unicode-based using the following opcodes:
* a, b, c: pop the top value from the corresponding stack into the register and branch if empty
* A, B, C: push the register value onto the corresponding stack and branch if invalid
* Branching executes the next character and skips it otherwise
* =: set the register to the value represented by the following decimal digits
* +, -: increment/decrement the register
* ~: negate the register
* j: jump to the byte index, ignoring the instruction if invalid
* J: ditto, but using the register's value
* l: jump to beginning line number, ignoring the instruction if invalid
* L: ditto, but using the register's value
* z: execute the next character if the register == 0 (otherwise, skip it)
* p: ditto for positive numbers
* n: ditto for negative numbers
* i: read the next unicode point of stdin into the register
* o: output the register's unicode value to stdout
* all other characters are no-op
The language is Turing complete, as it can simulate a 3-counter machine which is Turing complete. This can be done by using only one entry in an otherwise empty stack to represent the three registers. All counter machine operations are simple sequences of a few operations:
* To copy, pop the destination, pop the source, push to source, push to destination
* To increment or decrement, pop, increment/decrement, then push
* To clear, pop, set register to 0, push
* To jump if zero, pop, push, then branch if zero "zj___"
An implementation in Python with two sample programs (a simple Hello World and a (broken) Towers of Hanoi solver) can be found here.
Category:Languages