minond / bool Goto Github PK
View Code? Open in Web Editor NEWBool is a domain-specific reactive language and environment for Boolean Algebra and Logic Gate Programming.
Bool is a domain-specific reactive language and environment for Boolean Algebra and Logic Gate Programming.
Here's an example where as soon as an expression is returned from a gate and then used again, it fails to evaluate:
$ bool
> .paste
< paste mode: on
gate Adder (a, b, c) = [sum, carry]
where s_ab is a ⊕ b
and c_ab is a ∧ b
and c_ac is a ∧ c
and c_bc is b ∧ c
and carry is c_ab ∨ c_ac ∨ c_bc
and sum is c ⊕ s_ab
gate Add8 (x, y) = sum
where b07 is Adder(x(7), y(7), 0)
and b06 is Adder(x(6), y(6), b07(1))
and b05 is Adder(x(5), y(5), b06(1))
and b04 is Adder(x(4), y(4), b05(1))
and b03 is Adder(x(3), y(3), b04(1))
and b02 is Adder(x(2), y(2), b03(1))
and b01 is Adder(x(1), y(1), b02(1))
and b00 is Adder(x(0), y(0), b01(1))
and sum is [b00(0), b01(0), b02(0), b03(0), b04(0), b05(0), b06(0), b07(0)]
one is [0, 0, 0, 0, 0, 0, 0, 1]
two is Add8(one, one)
one
= Seq[8]{0, 0, 0, 0, 0, 0, 0, 1}
two
= Seq[8]{0, 0, 0, 0, 0, 0, 1, 0}
three is Add8(one, two)
three
< error: Cannot evaluate expression due to errors:
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
< error: Undefined gate `Adder`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.