https://github.com/phenax/ts-theorem-provinator
Experiment to use typescript's type system for theorem proving
https://github.com/phenax/ts-theorem-provinator
theorem-prover typescript typescript-types
Last synced: about 2 months ago
JSON representation
Experiment to use typescript's type system for theorem proving
- Host: GitHub
- URL: https://github.com/phenax/ts-theorem-provinator
- Owner: phenax
- License: mit
- Created: 2023-12-10T12:03:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-22T14:55:15.000Z (over 1 year ago)
- Last Synced: 2025-03-28T04:30:40.166Z (2 months ago)
- Topics: theorem-prover, typescript, typescript-types
- Language: TypeScript
- Homepage:
- Size: 30.3 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Theorem prover in ts types
Experiment to use typescript's type system to make a shitty theorem prover.### Commutativity of addition in ts types or something?
```typescript
export type Commutativity = Rewrite, Add>;export interface Comm_Base_Proof {
type: 'rewrite',
left: Equation, Add>; // 0 + b = b + 0
right: ChainRewrites<[
IdentityR, // b = b + 0
Sym>, // b + 0 = b + 0
Refl>, // true
], this['left']>;
};export interface Comm_Inductive_Proof {
type: 'rewrite',
left: Equation, B>, Add>>; // succ(a) + b = b + succ(a)
right: ChainRewrites<[
SumSucc, // succ(a + b) = b + succ(a)
Commutativity, // succ(b + a) = b + succ(a)
SumSuccR, // succ(b + a) = succ(b + a)
Refl>>, // true
], this['left']>;
};export namespace spec {
export type commutativity = [
assert>>,
assert>>,
]
}
```