Of course, that should be simply called by “type inference”.
However, today’s ATS2 type inference can’t decide types correctly
(e.g. type of conditional expression in “If”.)
Well, there is a reason for it. Say you have:
if (x > 0) then 1 else 2
What should be the type for this if-expression?
Assume that x has the type int(x). Then one type for the if-expression
is [i:int | (x > 0) && i==1 || not(x > 0) && i==2] int(i).
As you can see, this is a bit complex. Without type annotation, type
inference
needs to infer most general types. You have to imagine how difficult it can
be
to locate/fix type-errors in this way.
The purpose of type-checking is to find type-errors. If it takes (much)
more time
for a programmer to go through type-error messages (reported by a type
inference
algorithm) than for him/her to use type-annotations, then why should the
programmer
refrain from using type-annotations?
the others wouldn’t like to do it
Certainly. But this is no reason to think that these people would prefer to
go through
error messages reported by a higher-order model-checker. These people may
prefer
run-time debugging, for instance.On Wed, Jan 7, 2015 at 11:49 PM, Kiwamu Okabe kiw...@debian.or.jp wrote:
Hi Hongwei,
It’s a just chat.
On Tue, Jan 6, 2015 at 11:06 AM, gmhwxi gmh...@gmail.com wrote:
Because programs (e.g., Linux OS) are written by programmers,
it is only natural that we ask the question: How programs should be
written?
Let’s say that you want to apply Higher-Order model checking (or
something
else)
to some code. Where does your code come from in the first place?
I think I understand it. Some people would like to apply types with their
hand,
and the others wouldn’t like to do it. So, we are the former.
And, can’t we imagine the middle way of them? That is:
- Library is designed with strong dependent types.
- Application and Middleware are designed with Higher-Order Model Checking.
Of course, that should be simply called by “type inference”.
However, today’s ATS2 type inference can’t decide types correctly
(e.g. type of conditional expression in “If”.)
How about adding Higher-Order model checking into ATS2 type inference?
In the past, most challenges are using general-purpose solver on this
domain.
I think that Higher-Order model checking understands static contexts as
tree-ed type.
Thank’s,
Kiwamu Okabe at METASEPI DESIGN
–
You received this message because you are subscribed to the Google Groups
“ats-lang-users” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at http://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dnz6TC4HjNd39rRephHAGmb_oT01ePZNqtggqYwtseXXA%40mail.gmail.com
.