Commit Graph

15 Commits

Author SHA1 Message Date
Samir Jindel ed0590b532 [kernel-f11n] Cleanup to object model.
- Fix force_options so it doesn't take so long to run
- Fix property get typechecking so it forces getters to be synchronized with
  methods.
- Simplify member_env.

Bug:
Change-Id: I3e2a0710c7fde950e7573ba6216820907b9ae374
Reviewed-on: https://dart-review.googlesource.com/9040
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-28 14:20:01 +00:00
Samir Jindel 77736e83f2 [kernel-f11n] Fix statement typing and complete proof of statement typing consistency.
Previously, we inferred the return type of statements in a way that made it
impossible to prove the statement typing consistency. Now, we use just the
stated return type for checking statements.

The proofs of statement typing are complete, except for one result generalizing
the expression typing consistency result to multiple variables changing; this
result is obvious to see directly from the provided lemmas but very tedious to
prove in Coq.

Bug:
Change-Id: I0bbcfb613df7510015f278fa85021ba0b3e57503
Reviewed-on: https://dart-review.googlesource.com/9020
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-28 13:20:00 +00:00
Samir Jindel cf0d17df57 [kernel-coq] Correct statement of subtyping consistency, extend to statements.
Bug:
Change-Id: I48f073fa592ccdac56fb63b33b7d9961be5fc3fe
Reviewed-on: https://dart-review.googlesource.com/8220
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-27 13:39:05 +00:00
Samir Jindel 1cac4c7924 [kernel-coq] Extend interfaces to contain getters.
Bug:
Change-Id: If8411f356496017cf371349b3edfae3972725662
Reviewed-on: https://dart-review.googlesource.com/8121
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-26 17:39:15 +00:00
Samir Jindel b75f1baaf2 [kernel-coq] Cleaning up and exposing program well-formedness proof.
Bug:
Change-Id: If55a527f439a7bec39f2d286a582cb606efdabfb
Reviewed-on: https://dart-review.googlesource.com/7554
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-22 11:55:53 +00:00
Samir Jindel 4087297d4a [kernel-coq] Proof for program well-formedness.
Bug:
Change-Id: I614d967fc0386c2c4cb0c56586f7f7c2e50b033a
Reviewed-on: https://dart-review.googlesource.com/7362
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-21 14:00:43 +00:00
Samir Jindel 8ebdd7662f [kernel-coq] Build class and function table, allow mutually recursive functions and classes.
Bug:
Change-Id: I0d1fb82bccdf8174e4ab5ffdd38301600ecf4dd2
Reviewed-on: https://dart-review.googlesource.com/6620
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-20 12:51:34 +00:00
Samir Jindel 09f891b89b [kernel] Generalization of type equivalence to subtyping.
This revision includes changes from:
- [kernel] Completion of consistency proofs for type system of first subset of kernel.
due to the suckiness of gerrit.

We generalize type equivalence to subtyping. The contravariant property of
function parameter types causes properties for the totality checker. To
cicumvent this, we define a well-ordered relation on pairs of dart types and
prove subtyping respects it. We develop new lemmas and tactics for managing
proofs involving subtyping, includinging factoring out the messy business of
dealing with its convoluted recursion scheme.

Bug:
Change-Id: I18936168006617874a82eefc983f1b2d4d8af5af
Reviewed-on: https://dart-review.googlesource.com/5861
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-18 11:47:31 +00:00
Samir Jindel 12c4b62be8 [kernel] Completion of consistency proofs for type system of first subset of kernel.
Bug:
Change-Id: I5ae6fa1ddbb79b6f9dfecb53762b7ee5660c9117
Reviewed-on: https://dart-review.googlesource.com/5746
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-18 11:37:03 +00:00
Samir Jindel 79386c100e [kernel] type_equiv proof for property_get case.
Bug:
Change-Id: Ibbaabc8ca7652eef1077fc743a9d0927a1c7911a
Reviewed-on: https://dart-review.googlesource.com/5461
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-14 12:56:40 +00:00
Samir Jindel 184d1959c5 [kernel] Proofs about type equality, beginnings of the type checking homomorphism proof.
I also added mutual induction schemes for types and expressions.
Some changes from the "Cleanup" revision are in here as well because Gerrit is terrible.

Bug:
Change-Id: I0859a6c1cba8179e0a64cc0455ab2a83fad8f26b
Reviewed-on: https://dart-review.googlesource.com/5300
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-13 12:00:19 +00:00
Samir Jindel a71d91ea62 [kernel] Cleanup of object model and coq.dart.
Bug:
Change-Id: I4a93d2ab0a052b61d3819d04316c05f534057f02
Reviewed-on: https://dart-review.googlesource.com/5266
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-13 11:43:30 +00:00
Samir Jindel 474c075794 [kernel] Simplified Coq AST and first draft of it's type system.
Details to come in discussions.

Bug:
Change-Id: Ia50d85dd27cde83e25086f64dc6746cc52036128
Reviewed-on: https://dart-review.googlesource.com/4941
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-12 16:23:16 +00:00
Samir Jindel 95c5b043fb [kernel] Infrastructure for the Coq formalization.
Summary:

Common datastructures used by both the Kernel AST definition and the object
model are factored into a shared module. A monad for partial computation is
defined to allow us to factor out termination proofs and syntactic validity
checks from the type checking and subtyping relations.

Test Plan:

Ran through coqc.

Bug:
Change-Id: I884666d7cc5b757d62541a46b868f8579a06f011
Reviewed-on: https://dart-review.googlesource.com/4700
Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
2017-09-11 17:22:14 +00:00
Dmitry Stefantsov 1132579731 Add the first draft of the object model formalization in Coq
Change-Id: I6c1a79f23d7a8327766cc450d4c0d6e1b1a5902a
Reviewed-on: https://dart-review.googlesource.com/3921
Reviewed-by: Samir Jindel <sjindel@google.com>
2017-09-07 14:08:00 +00:00