An open API service indexing awesome lists of open source software.

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

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>>,
]
}
```