Re:Self Healing Code with clojure.spec
by catnaroek on Sunday December 25, 2016 @10:21PM
(#13256745)
That's not what's happening in this case. You're fixing a program that has just run if it doesn't pass certain validations. This is pretty much by definition not possible in a static analysis, whose purpose is to determine whether a putative program is in fact worth running in the first place.
On the other hand, in a typed language, when you check whether a term “t” has type “T”, it's a precondition that “T” is a valid type. If you haven't established that “T” is a type, you have to establish it first.
You can always view the term and type levels of a programming language as two separate but intertwined languages. In this case, both the term and type level would be identical instead of the type level being specialized with logic programming-esque constructs as usual.