about summary refs log tree commit diff stats
path: root/js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt
diff options
context:
space:
mode:
Diffstat (limited to 'js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt')
-rw-r--r--js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt39
1 files changed, 39 insertions, 0 deletions
diff --git a/js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt b/js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt
new file mode 100644
index 0000000..ed79947
--- /dev/null
+++ b/js/scripting-lang/tests/turing-completeness/01_basic_proof_compat.txt
@@ -0,0 +1,39 @@
+/* Basic Turing Completeness Proof - Compatibility Version */
+/* Modified to work with current implementation limitations */
+
+..out "=== Baba Yaga: Basic Turing Completeness Proof ===";
+
+/* Test 1: Conditional Logic */
+cond_test : when 42 is 42 then "PASS" _ then "FAIL";
+..assert cond_test = "PASS";
+..out "1. Conditionals: PASS";
+
+/* Test 2: Recursion */
+factorial : n -> when n is 0 then 1 _ then n * (factorial (n - 1));
+fact_result : factorial 4;
+..assert fact_result = 24;
+..out "2. Recursion: factorial(4) = 24";
+
+/* Test 3: Data Structures */
+data : {name: "test", value: 100, nested: {deep: true}};
+deep_val : data.nested.deep;
+..assert deep_val = true;
+..out "3. Data: nested access works";
+
+/* Test 4: Function Composition */
+double : x -> x * 2;
+add5 : x -> x + 5;
+composed : double (add5 10);
+..assert composed = 30;
+..out "4. Composition: double(add5(10)) = 30";
+
+/* Test 5: Higher-Order Functions - using different name to avoid conflicts */
+call_func : f x -> f x;
+square : x -> x * x;
+ho_result : call_func @square 6;
+..assert ho_result = 36;
+..out "5. Higher-order: call_func(square, 6) = 36";
+
+..out "---";
+..out "✅ RESULT: Turing Complete!";
+..out "All computational requirements satisfied.";
\ No newline at end of file