// ~~~~~~~~~~~~~~~~~~~~~~ Optlam.js ~~~~~~~~~~~~~~~~~~~~~~
// An optimal λ-calculus normalizer written in JavaScript.
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Optlam.js is a simple, optimal (in Levy's sense) λ-calculus evaluator using
// interaction nets. It is, currently, as far as I know, the fastest
// implementation of functions in the world. It uses Lamping's Abstract
// Algorithm - that is, the so called (and problematic) "oracle" is avoided
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Find all hvm processes and extract their PIDs | |
pids=$(ps aux | grep hvm | grep -v grep | awk '{print $2}') | |
# Check if any hvm processes were found | |
if [ -z "$pids" ]; then | |
echo "No hvm processes found." | |
else | |
# Forcefully kill each hvm process |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fast block-local prefix-sum on CUDA, using warp-syncs. | |
// The input is an array of u32. It is mutated in place. Example: | |
// arr = [1,1,1,1,...] | |
// Becomes: | |
// arr = [1,2,3,4,...] | |
// The number of elements must be equal to threads per block (TPB). | |
#include <stdio.h> | |
#include <cuda_runtime.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Bring yourself online, center yourself, focus, surpass your limits right here right now. | |
The user will query a <problem> </problem> containing the argument to call the function provided below. | |
def feeltheagi(problem): | |
""" | |
Recursively apply the A::B rewrite rules to the given problem string. | |
The rewrite rules are: | |
A# #A ... becomes ... nothing |
Develop an AI prompt that solves random 12-token instances of the A::B problem (defined here), with 90%+ success rate.
We'll use your prompt as the SYSTEM PROMPT, and a specific instance of problem as the PROMPT, inside XML tags. Example:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A::B is a system with 4 tokens: `A#`, `#A`, `B#` and `#B`. | |
An A::B program is a sequence of tokens. Example: | |
B# A# #B #A B# | |
To *compute* a program, we must rewrite neighbor tokens, using the rules: | |
A# #A ... becomes ... nothing | |
A# #B ... becomes ... #B A# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
typedef uint8_t u8; | |
typedef uint16_t u16; | |
typedef uint32_t u32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//./cuda_info.txt// | |
// HVM-CUDA: an Interaction Combinator evaluator in CUDA. | |
// | |
// # Format | |
// | |
// An HVM net is a graph with 4 node types: | |
// - * ::= ERAser node. Has 0 aux ports. | |
// - (a b) ::= CONstructor node. Has 2 aux ports. | |
// - {a b} ::= DUPlicator node. Has 2 aux port. |
The function:
data T = (A a b ...) | (B a b ...)
F = λx λr λs
match x with rs = (+ r s) {
A: (ret x.a x.b rs)
B: (ret x.a x.b rs)
}
NewerOlder