Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Whitepaper.md #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Whitepaper.md
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ function safe_div(a: Number, b: Number): Number {

Since here `a` and `b` have the static `Number` type, we don't need to check
that at runtime. Moreover, calling `safe_div` with a `String` results in a nice
compile-time error. Problem is, we still need to check that `b` is larger than
compile-time error. Problem is, we still need to check that `b` is not equal to
`0`. Is it possible to perform that check at runtime too? Indeed, that's
precisely what dependent types do. In Formality-Core, we can write:

Expand All @@ -522,7 +522,7 @@ safe_div : (a: Number) -> (b: Number) -> NonZero(b) -> Number

Here, `NonZero(a)` represents a symbolic proof that `b` isn't zero. In order to
call `safe_div`, the compiler would demand us to assert that this is true by,
for example, using `if b != 0` before calling `safe_div`. In another words, the
for example, using `if b != 0` before calling `safe_div`. In other words, the
type-system is Turing complete, allowing all sorts of invariants to be
symbolically enforced at compile time. That's what makes it suitable as a proof
language.
Expand Down