We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Talk:KBAT

From Esolang
Jump to navigation Jump to search

My proof that KBAT is Turing-complete

According to its definition, KBAT is Turing complete.

Although its official page doesn’t state this directly, based on the features it offers, it already has the core elements needed to form a Turing complete system.

Here’s the key proof of its Turing completeness:

Core Basis: Has Conditional Recursion and Basic Operations

For a programming language to be Turing complete, it usually needs infinite storage, conditional branching, and looping/recursion ability. KBAT happens to provide these:

  • Recursion and Conditional Branching: KBAT uses 'f to define recursive functions and provides the ternary conditional operator f?g:h. This forms the basic control flow needed to implement any complex algorithm.
  • Basic Data Operations: The language has a rich set of basic operations, including:
    • Arithmetic: add (+), subtract (-), multiply (*), modulo (%).
    • List/String Operations: get length (#), head (h), tail (t), index (/).
    • Type Conversion: like integer to character (chr), string to list, etc.
  • Infinite Data: The language supports integers (even though only natural numbers are directly supported, you can simulate negative numbers, fractions, and even decimals), strings, and lists. Theoretically, the size of these data structures is only limited by memory, so they can be considered infinite storage.

Proof Idea: Simulate a Known Turing Complete System

A rigorous way to prove this is constructively—by implementing an interpreter for a known Turing complete language (like Brainfuck or μ-recursive functions) in KBAT.

Since KBAT has the following capabilities, such a simulation is theoretically fully feasible:

  • Basic Operations: Can simulate the arithmetic and logical operations needed for a Turing machine.
  • List Operations: Lists can be used to simulate an infinite tape, and the h (head) and t (tail) operations can move the read/write head.
  • Recursion and Conditionals: Can simulate loops ([...]) and instruction dispatch in Brainfuck.

Therefore, we can conclude that KBAT has the capability to simulate a universal Turing machine and is a Turing complete language.

Appendix

北国风光,千里冰封,万里雪飘。望长城内外,惟余莽莽;大河上下,顿失滔滔。山舞银蛇,原驰蜡象,欲与天公试比高。须晴日,看红装素裹,分外妖娆。江山如此多娇,引无数英雄竞折腰。惜秦皇汉武,略输文采;唐宗宋祖,稍逊风骚。一代天骄,成吉思汗,只识弯弓射大雕。俱往矣,数风流人物,还看今朝。 2025年8月20日(星期四), 13:03 农历七月初八 (CHN)