Charles-Johnson / zia_programming

A language that can program itself
https://zia-lang.org
GNU General Public License v3.0
3 stars 0 forks source link

Set comprehension #21

Open Charles-Johnson opened 3 years ago

Charles-Johnson commented 3 years ago

After realising how specific exists_such_that's semantics are, a more fundamental approach to implement high order logic is to construct sets from conditional expressions.

_x_ where _x_ > 0 is any positive value

{ _x_ where _x_ > 0 } is the set of all positive values

| { _x_ where _x_ > 0 } | is the cardinality of the set of all positive values

(| { _x_ where _x_ > 0 } |) > 0 is true if there exists a positive value. (_x_ exists_such_that) _x_ > 0 should reduce to this.

How can we generalise this for any kind of condition?

let ((_x_ exists_such_that) _y_) -> (| { _x_ where _y_ } |) > 0

So exists_such_that need not be a concrete concept in the future as it could be implemented with Zia after implementing set comprehension and cardinality