Terms and Constraints
Terms
In Ligare, terms are everything.
1is a term."hello"is a term.fun x => x + 1is a term.intis a term.x >= 0is a term.- Proofs are terms.
There are no types and values, no logic and calculations. There are only terms.
Universes
In Ligare, every term belongs to a universe.
1belongs to thedatauniverse.x >= 0belongs to thepropuniverse.by autobelongs to theproofuniverse.
Apart from theses, there is the theorem universe. Terms representing propositions in this universe are ensured to be true.
Every term carries a universe level.
1has level 0.x + 1has level 1.fun x => x + 1has level 2.
Levels are used to avoid Russell's paradox.
Constraints
A term can be constrained by another term.
1 : intmeans that 1 is a int.1 : int where (x => x >= 0)means that 1 is a int such that1 >= 0.
Contraints replace types in traditional type systems. But it is also a term, which can also be constrained by another term.
int : propmeans thatintis a proposition.data : propmeans thatdatais a proposition.