Haldwani Times
Haldwani Times
Technology

So You Want to Build a Mainstream Formally Verifiable Language

So You Want to Build a Mainstream Formally Verifiable Language
Photo / Illustration: Haldwani Times Editorial Desk

OpenAI’s advances are all in the news these days, and so are Anthropic’s. All of a sudden we are getting hit by a never-ending stream of new mathematical discoveries mediated by large language models. Mathematicians are bracing for a world that’s wildly different from the familiar, while at the same time, we in the other fields that use LLMs are wondering: will we also get similar benefits? Will our profession be transformed the way that mathematics appears to be?

Meanwhile, some say that we are in the golden age of programming language research, and some say we need a formally-verifiable mainstream language. I agree! This is something I’ve been thinking about for some time now, and, by virtue of having played with formal verification for a few years now, I think I have something to offer. As such, I’m writing this article to provide some context and starting points for would-be creators of formal verification languages, particularly those creators that come from a software engineering background and may not (yet!) have a strong familiarity with formal methods.

Throughout, I will state open questions, which I implicitly qualify to be open to me and relevant from my point of view. These are questions I would ask myself if I were to begin working on such a new language (instead of lazily writing about it!). They are not intended to be prescriptive, nor to totally encompass the problem space. They are, however, intended to be usable for skimming this article.

The whole purpose of formal methods is to take an informal process or framework and make it rigorous. To make this possible, we need a sufficiently rigorous, precise, and powerful foundation. In virtually every case I can think of, this foundation is that of logic.

Logic allows us to name objects and express relationships between them. It also allows us to make statements and reason about what it takes for them to be true or false. It has the distinct advantage of being unambiguous: where human language may admit several interpretations, logic forces us to be precise, sometimes to a pedantic extent. Though logic itself is, in each of its varieties, an unambiguous system, there are indeed many varieties. I once heard logic described as a “game of symbols”, and there are many ways to play such games. This, in turn, leads to a variety of ways to describe the world. There are three families of logic that I think are of broad interest to us if we talk about programming languages. I talk about each of them in more detail in the sections below.

Temporal logic, as leveraged by tools such as TLA and Alloy.

Separation logic, as used in Software Foundations and the Iris Project.

Higher-order dependently typed logic, used by Lean, Agda, and other dependently typed theorem provers.

Before I describe these in more depth, I feel I should introduce some other ideas and open questions when it comes to designing a new language amenable to formal verification.

The Specification Gap

Though I find this topic to be among the most well-understood about formal verification, I would nevertheless be remiss if I didn’t mention it here. At its core, formal verification for software is about proving that a program behaves according to a particular specification. The trouble is, of course, that the specification itself may be wrong!

This is already in the public zeitgeist when it comes to the recently published mathematical proofs. Because of their immense size, it’s not uncommon to hear the question: “Did it really prove what they claim it has proven?” The analogy for us is, “It proved the code matches the spec, but is it the spec we wanted?”

The fidelity of a specification with respect to its purpose is entirely separate from the adherence of a program to that specification. My claim here is that fidelity in most existing software is grounded somehow in the interaction with an external (or, indulgently, “real”!) world. Because of this it ceases to be a directly technical matter, and is harder to address with a technical solution such as a programming language. Nevertheless, I think this is an important caveat to keep in mind, to keep ourselves honest about the exact value proposition of things we create.

Metalanguages and Object Languages

Those of us working in software engineering (or just thinking about plain English) do not often think about the distinction between “object” and “meta” languages. However, things get difficult when we need to use “language to talk about language”. A quick-and-dirty example is to note that when we say “your sentence is missing a ’the’ before the noun”, we can observe that while the literal string “the” figures twice in our sentence, it has radically different meanings. In the first, it’s referred to as something separate, while in the second, it’s “just” a part of speech. This same distinction can — but doesn’t always — apply when talking about formal verification. In fact, there are often several levels to this.

Most often, we talk about the language we are trying to prove things about (which in this case will be our programming language) as the object language. This is the thing-we’re-describing. It need not be grounded in logic at all. In the part of Software Foundations I’ve linked above, the language-in-question is C, which is far from logical. While it has some logical operations (bitwise “and” and “or”! short-circuiting “and” and “or”!), by virtue of being an imperative language (more on that later), it’s not very well suited for proving math.

Instead, we lean on the meta language (or metalanguage), which is the thing-we’re-using-to-describe-the-object-language. It can be similar to the thing-we’re-describing, but more often than not, by virtue of being something quite specialized and needing rigor, it tends to be quite different. TLA+ and Alloy, if used to model the behavior of code, are metalanguages. So are inference rules (which I have defined several times in the past), and so is plain old logic when it describes a program somehow. So the expression 1+1, if it figures in some logical or formal definition, is distinct in a way similar to the quoted “the” in the example sentence above.

If you want to be extra pedantic, you might say that English is your meta-metalanguage, since you use it to describe your logical statements, or maybe even define the behavior of your logic.

It might seem that what I’m describing is not particularly important for language design in itself. However, I think it’s crucial to ask the question:

open question: if you’re making a new “language for formal verification”, what are you making? Are you making a new object language (a new C to be analyzed using formal methods) or are you making a new meta language (a new TLA+, Alloy)?

You might answer “both”, and that’s not an unreasonable direction. I’d say that Lean, for one, rarely requires such a distinction or stratification.

Semantics of Languages

Ultimately, if you are trying to build a formally verifiable language for software engineering, what you are trying to do is reason about how a computer program behaves. Even before saying that the program “behaves correctly”, you must ask yourself: what does it mean for this program to “behave at all”? This is a complicated question, particularly for mainstream programming languages. Besides answering the comparatively simple questions (“what will this program do if I write 1+"1"?”, in itself a question that varies between mainstream languages), we need to think about the question “what would happen if I wrote a loop that implements the Collatz conjecture?[note: Described, for instance, in its Wikipedia page, and (phew!) still unsolved at the time of writing. ] ” (in C/C++, thanks to undefined behavior, that loop could be elided and the implementation made to return 1).

One challenge in formally modeling whole programs is that the languages we conventionally use to write them in have very complicated semantics, or indeed semantics that are ill-defined. A clear example of this is “undefined behavior” in C and C++, where compilers and language implementations are free to act in whatever manner they desire. A similar concern is “unspecified behavior”; programmers are told, for example, not to rely on the order of evaluation of arguments to a C function, because it isn’t fixed.

But while the set of undefined and unspecified behaviors in C and C++ is relatively bounded, the overall behavior of these languages is encoded in huge specifications, without particular mathematical rigor. Especially in the case of C++, this specification grows with every release. Other mainstream languages (Python, Ruby, Rust, JavaScript, TypeScript) are not much better in this regard.

Before I go further, I should supplement the ways in which languages can be poorly defined with a list of ways in which we can rigorously specify them. The three classic approaches to program semantics as known in PL literature are:

Operational semantics, which describes how a language is evaluated by some abstract machine. It comes in two varieties, big-step and small-step operational semantics. The former describes the final result of evaluating a program (most commonly in terms of evaluating smaller pieces of it); the latter describes program evaluation one atomic step at a time. Small-step semantics is oftentimes chosen for languages where things can happen concurrently, since the individual steps are easier to interleave.

Denotational semantics, which describes a language in terms of how its constructs map to a mathematical semantic domain (e.g., a def in Python may map to a mathematical function). I posit that this is less relevant to our practical interests today.

Axiomatic semantics, which describes a language in terms of how each of its constructs affects the program state, encoded in logical descriptions thereof. In this, it is very closely related to separation logic, which I introduced above and will elaborate on further below.

Towards Core Languages

We find that simpler languages are easier to reason about, because the fewer the concepts in the language, the less it takes to precisely describe what all of them do. There is, however, a tension here: simple and bare-bones languages are easy to specify, but harder to write code in.

Here, your opinions might diverge on whether this matters in a post-LLM world. A full-on “agentic development without human supervision” proponent might say that it doesn’t matter that the language is simple; LLMs can write code at lightning speed, so why not make them write more of the simple, well-specified language? A “human review is now the new bottleneck” believer might say instead that we need highly expressive languages, such that complex ideas and behaviors can be expressed in ways that are easy to read in a diff viewer.

In any case, the trade-off between “simple” and “powerful” is not direct, thanks to the existence of syntactic sugar. If you can provide a simplification from a “powerful” version of your language into a weaker, simpler, more specified form, you get a specification of the complex language more or less for free: the semantics of a complex construct are “just” the combined semantics of the pieces to which it desugars.

In fact, this is the approach taken in the Lean language itself (which, I might say, is quite close to a general-purpose, formally verifiable language anyway; more on this another time). Lean has a “core language” (or maybe several core languages), each of which are extremely simple. The full, powerful version of Lean is elaborated into these simpler core languages. Because of Gödel’s well-known incompleteness theorem, we can’t prove these languages to be logically consistent from Lean itself (and thus, we have to trust them to be), but because of their simplicity, their correctness is commonly accepted.

open question: if you’re making an object language, how can you make its semantics amenable to formal verification?

open question: if you’re making a metalanguage, how will it know about the semantics of the software it’s describing? Will it know and understand the code-to-be-verified at all?

open question: for an industry-capable programming language, where is the right balance between simplicity of specification and power of expression? Does this change with the presence of LLMs?

When observing the tremendous success of AI in mathematics, we may be led to forget the ways in which mathematics (despite being deeply connected to programming through both the theory of computation and the Curry-Howard isomorphism) differs from the practices of software engineering. In fact, I believe that one crucial distinction is preventing the meteoric ascent of AI in software of the formally verified kind: the everpresence of change.

Once a mathematical theorem has been proven, you are ‘more or less done’. You may clean up the theorems (if in the process of struggling towards a solution you have produced extraneous statements, constraints, or diversions), and you may try to understand the proof (if it was constructed with the help of an LLM, or if you used methods from other mathematicians without a deep understanding — a perfectly valid approach). However, this boils down to “refactoring the math” (in fact, there is a deep connection here which makes this description quite apt).

However, in software engineering it is very often the case that the thing you built is not the right thing. The theorem is not the one that needed to be proven at all. Historically, this has been a big challenge, because seemingly small changes to the code can drastically affect its behavior and correctness. The act of taking a proof that used to describe a piece of software and adapting it to the new, updated version is called proof repair, and it is a whole area of research in PL literature. Although there are techniques to perform this automatically (especially in simple cases), in general, this is a very difficult problem.

This relative difficulty of adapting formal specifications to changes in code is significant because it can drastically slow down the speed at which software is iterated on, and even become a source of friction when dealing with technical debt. As a result, creators of languages that have formal verification components must have some picture of what should happen when code changes. I view this as an open question that could be addressed by a novel language.

open question: if your code changes, do the specifications have to change immediately to preserve the correctness of the program? If yes, how do you make this as effortless as possible?

If no, how do you ensure that specifications eventually keep up with the actual program, and thus are describing the thing being developed?

Intrinsic and Extrinsic Verification

Tangentially related to the notion of proof repair is the distinction between intrinsic and extrinsic verification. There is, broadly speaking, a distinction between proving the program you’re writing correct as part of the program or, alternatively, completely separately from the program. Proofs that ride along with the program itself are typically called “intrinsic verification”, whereas proofs that occur “out of band” are called extrinsic verification. The two approaches have their own distinct advantages and tend to be favored differently by various formal verification frameworks and tools.[note: Interestingly, AI agents using systems that are capable of both modes (I have Lean in mind here) seem to prefer extrinsic verification. Personally, I favor intrinsic verification instead, and it has been interesting to watch Claude and Codex continuously try to rewrite my code to separate correctness from implementation. ]

Intrinsic verification often requires one to pay effort upfront. This may come in the form of thinking about the types, preconditions, and postconditions of each function and making them immediately explicit. Insofar as this is an even more rigorous version of immediate, strong typing, this can produce the same sort of discomfort as having to write in a typed language (e.g., TypeScript with strict typing requirements) compared to a more or less untyped language (JavaScript). In fact, the effort required is probably considerably higher, because you are required upfront to state precisely how you might expect a function to behave. In certain forms of intrinsic verification (correctness by construction in particular), the difficulty lies not only in knowing exactly what the code will do but also in wrangling the types in such a way that doing the wrong thing is not possible[note: It might seem at first that this would introduce performance penalties, since we are introducing additional code, potentially in the form of arguments or definitions. However, it is common for languages with intrinsic verification to perform a process called proof erasure, which strips proof-related code from the program being compiled. The net result is a formally verified program that pays a lesser runtime penalty for the surrounding rigor. ] . This is an extreme version of making illegal states unrepresentable. Additional difficulties arise, of course, when the code has to change, as we have discussed in the previous section. In that case, you may find that the specifications you had previously written, or the types you had devised, no longer apply, but you must immediately pay the cost of fixing them, or your code will not compile.

open question: is there room for an intrinsically verified language that is gradually verified, akin to gradual typing? We have, for example, seen that gradual typing can enable incremental migration of codebases from (e.g.) JavaScript to TypeScript and from untyped Python to Python with type hints.

Extrinsic verification separates proofs from the code they describe. Thus, you might write the program “normally” and then separately construct a specification for what your code should be doing. You pay no cost upfront, and moreover, the reader of your code does not necessarily pay the cognitive burden of having to understand both the specification and the code (though one might argue doing so is desirable for proper review). An even more “extrinsic” version is one in which the correct behavior of the exact code is never verified at all. Instead, the system is described at a higher level of abstraction, glossing over the details of assignments, functions, expressions, and so on, in favor of a more condensed (and easier to digest, perhaps) ideal representation. Of course, both of these directions introduce the possibility of drift: do you check your formal specifications against your code each time it changes? Does the code you write still match an abstract system you may be trying to model?

open question: in a language with extrinsic verification, how do you ensure that the description continues to match and verify the implementation?

Referential Transparency in Metalanguages

Some languages are easier to reason about than others. It is no accident that many proof assistants (Agda, Rocq, Lean as canonical examples) have surprisingly similar underlying theories. The most commonly cited property is that of referential transparency. This property asks: if a variable I have was defined as x = foo(), can I replace x with foo() everywhere, and will everything work exactly the same? In most mainstream languages the answer is “no”, for a variety of reasons. Perhaps the simplest example is this:

def foo(): print("Hey!") return 1; x = foo() print(x+x+x+x) As written, this program prints “Hey!” once, then prints 4. Meanwhile, replacing x with foo() in the last statement will cause “Hey!” to be printed four times! Things would similarly go awry if foo() generated and returned a random number, or if it allocated a fresh object in its body. In general, the issue is that of side effects: things that the function does “in addition” to a naive computation. Console output, random number generation, and memory allocation are all side effects. It is entirely possible to reason about such functions at the object level; this is the subject of Hoare logic and, more generally, separation logic. However, side effects are very strange for a formal metalanguage, because they prevent exactly the sort of algebraic manipulation (e.g., substituting a variable for its definition) we may be used to in plain mathematics. As a result, metalanguages (like TLA+ or Alloy) and proof assistants which offer a single language for both the code and the theorem proving (Agda, Lean) do not natively support side effects.[note: Effects can, however, be quite elegantly modeled with monads, as Haskell users will not hesitate to tell you. Further techniques, such as monad transformers and the MTL (for "monad transformer library") style can further improve side-effect-free code that models effects. Algebraic effects are another approach to solving this problem, though one that I haven't seen in a metalanguage. ] If your goal is a new metalanguage or a unified system, you will likely want to do the same.

Mutation is a side effect, and as a result, data structures in languages without side effects are immutable. However, whereas the semantics of a language do not allow for mutation, it is possible to leverage properties of the type system to allow for an efficient implementation (which uses mutation) of such languages. The canonical example here is that of linear types.

A value with a linear type must be used exactly once (less strictly, values with an affine type may be used at most once). Thus, if you, for example, ask for “a copy of this linearly-typed array whose first element is modified”, you are spending your one and only use; nothing else can ever use your original array. As a result, the implementation can perform the update in-place, without copying. An O(n)O(n)O(n) copy turns into an O(1)O(1)O(1) update, but crucially, no observable side effects occur.

In general, invariants about programs in a language can be used to perform effectful optimizations, though I do not claim here that this makes it easy (or possible) to recover the performance of a plain effectful algorithm.

It’s one thing to construct a language for formal verification. It’s a whole other thing to construct a mainstream language that accomplishes the same goal. Breaking into the mainstream is difficult in its own right, but for formal methods there are additional challenges.

I think it’s fundamentally true that proving program properties requires more precise and rigorous thinking; this is an inherent requirement to show that a property holds in all possible cases or for all possible inputs. I think that this creates an inherent barrier to entry. LLMs can, of course, take care of this thinking — we have clearly seen evidence of this in mathematics! But in leaning heavily in this direction, you may be inventing a language that is not intended to be read by humans. This is another defensible direction given the current climate and the analogy to assembly/compilers (how many people know nowadays to read assembly fluently?), but it is a choice that should be made deliberately.

open question: if your language goes mainstream, who writes it, who engages in formal verification, and who reads the results? Where should the balance fall when choosing between human and machine?

Separately, there is the matter of interoperability. A novel language fighting for adoption is at a significant disadvantage when it comes to its ecosystem. A programmer taking Python off the shelf can pip install packages for LLMs, machine learning, statistics, and virtually anything else under the sun. The user of a new language rarely has such a luxury — unless it can interoperate with other languages. But in the context of formal verification, interoperability becomes more than a matter of technical implementation: it may require that your formal system can reason about the semantics of the interoperating languages, too. If your goal in inventing a new language is to build up a small and stable foundation, having to reason about the semantics of (say) Python directly undermines that goal and forces you to ask: “if I have to think about Python’s [say] semantics, why don’t I just create a formal verification framework for Python, instead of a new language?”

open question: how does your language handle interoperability? Do you try to reason about the correctness of other-language dependencies? If yes, why use your language? If no, can real-world, “not-invented-here” software still be verified? How?

I will now finally give a deeper overview of the three sorts of logic that I have called out as relevant for our purposes.

As the name might suggest, the class of temporal logics (indeed, itself a subset of modal logics) deals with statements about events in time. Most commonly, logical expressions like “this and that” or “if this then that” are extended with an additional modality (kind of like an operator) that makes what was to be read as “something” instead say “always something” or “eventually something”. Thus, instead of simply making claims about what’s true “right now”, you can make claims about the behavior of your system as it evolves. This is useful for proving behaviors such as eventual consistency for distributed systems (indeed, a canonical use case of TLA+ is the validation of the Paxos consensus algorithm). For example, here is a claim stated in temporal logic:

This reads, “it is always (□\Box□) the case that if mmm is acquired, it will eventually (◊\Diamond◊) be released”.

In systems that use temporal logic today, you feed the specification through a model checker or solver. There are a variety of solvers, including SMT, SAT, and ones specific to temporal logic. These tools apply all sorts of clever heuristics and strategies to check for behaviors that violate the properties you want to hold. If they find such a behavior, you are left with a counterexample, which tells you that a bug could indeed be found, and that it appears when, for example, certain variables are set to particular values or certain steps occur in sequence.

One classic problem with tools based on temporal logic is the exponential cliff. The size of the state space (perhaps unsurprisingly, the set of possible states within your model) can grow exponentially. If using a SAT solver, you may also hit exponentially-costing computations as you add more logical rules. As a result, the time spent by the model checker can quickly go from seconds to minutes to “effectively infinite”.

On the other hand, more often than not, you don’t have to prove anything about your models yourself. You construct your formal specification in the language of temporal logic, hoping that it matches reality (see the specification gap), then check if that specification has the properties you want (such as the aforementioned eventual consistency). If it works, great! You have a model that is correct, at least within the scope of what the specific model checker has verified. If not, it’s back to the drawing board.

One other consequence of the exponential cliff is that you very rarely want to run your entire program or piece of software through the temporal logic checker. The reasons are twofold: first, the language you’re using is likely quite hard to model in formal logic at all (see semantics of languages). Second, the program you’re trying to check is likely very large, so even if you did know its full behavior, modeling this as a giant set of boolean expressions is sure to overwhelm your solver. In the end, you instead construct a model of your software that is abstract and easier to represent, and very likely separate from the semantics of your program (do you really want to talk about garbage collection, memory allocation, system calls, interrupts, etc. when trying to show you will handle a message properly?)

So, when we think about formal verification using temporal logic, a “new language” can have two meanings. The first is an object language amenable to modeling with temporal logic. The second is a new language for writing temporal logic. The latter would be a competitor to TLA+ or Alloy.

open question: if you’re working on a language amenable to modeling, how do you achieve this amenability? How do you ensure this scales to large software projects, despite the exponential cliff?

Separation logic is a generalization of Hoare logic. At their core, these logics deal with the specification of programs in terms of preconditions and postconditions. A single claim in such a logic might look like this:

This is called a Hoare triple. We start with the precondition that the variable x\texttt{x}x is equal to 1. In that case, assigning y=x+1\texttt{y=x+1}y=x+1 leaves x\texttt{x}x still equal to 1, and y\texttt{y}y now equal to 2. That is the postcondition.

You may notice that there are two different equal signs in the above figure: one === and one =\texttt{=}=. This is deliberate, and it goes back to the section on metalanguages and object languages. The small equal sign, =\texttt{=}=, is the assignment symbol in the programming language we’re reasoning about; it represents the assignment operation. Meanwhile, the big equal sign, ===, represents the mathematical claim, in the metalanguage of Hoare logic, that the variable x\texttt{x}x is equal to 1. These families of logic maintain a very strict distinction here.

Separation logic extends the more or less “regular” (first-order logic, typically) expressions that go between the curly brackets in Hoare logic with a separating conjunction (∗)(*)(∗) and resource assertions such as x↪1\texttt{x} \hookrightarrow 1x↪1. While in all cases the expressions describe the “state of the world” (values of variables, perhaps the state of the heap), separation logic makes it possible to partition the “world” into disjoint pieces. Specifically, the expression A∗BA*BA∗B describes a world that can be split such that one of its pieces is described by AAA, and the other by BBB.

Why do we want this? Because keeping the entire state of the world (such as the value of each heap-allocated variable) in mind for every proof is needlessly cumbersome! I want to be able to 1) prove facts about code that need to mention only the part of the world that I care about and 2) be able to use these facts as part of larger proofs! The disjointness of the two pieces of the world is crucial for the second aspect. When folding my smaller proof into a larger one, I can guarantee that the resources belonging to the rest of the world were not modified by my code, and thus, no external properties could’ve been broken.

Of course, there are complications to this. For one, what if we want two pieces of code to use the same part of the world (a heap address?), especially in a parallel setting? Moreover, how do we specify properties of functions such as map or filter, which take functions as arguments? Increasingly complicated frameworks arise as answers to such demands. Of particular note is the Iris project, which describes itself as:

A Higher-Order Concurrent Separation Logic Framework

The “Higher-Order” bit above (typical for sufficiently powerful separation logic frameworks, I think) means that Hoare triples can have other Hoare triples in their pre- and postconditions, such that we might write (in moderately abused notation):

What a mouthful! In short, this specification says: “given a predicate that returns true or false for each value, and a list of values, filter\texttt{filter}filter returns a new list that contains exactly the values in the original for which the predicate returned true[note: The attentive reader may have noticed that this specification is insufficient, because it seems to allow filter\texttt{filter}filter to duplicate and reorder elements. Moreover, it does not deal very well with a nondeterministic pred\texttt{pred}pred. I'm just trying to give you a feel for separation logic here! ] ”.

Matters of concurrency are even more complicated, and for Iris specifically involve notions such as resource algebras, invariants, and ghost state. I think the lecture notes are quite accessible if you want to learn more!

The key to this approach lies in the Curry-Howard correspondence, which I’ve written about (and written about writing), but which nevertheless you may want to look up independently. In short, there is a very deep connection between types (yes, like types in your programming language) and mathematical statements of fact, and a similar connection between programs that have that type and proofs of the corresponding mathematical statement. Product types (tuples in more common parlance, and records and structs if you squint hard enough) correspond to logical conjunction, “and”. Disjoint unions (most commonly something like Rust enums) correspond to logical disjunction, “or”. Functions correspond to claims of implication, “if this then that”.

This can be taken further. Parametric polymorphism, mostly like Java generics, corresponds to statements like “forall”, and associated types or values (like in Swift) are not unlike “there exists”. Keep taking this further and you will get a type system so powerful that it implements higher-order, dependently typed logic.

It’s higher order because in addition to saying “forall values”, you can say “forall functions”, and “forall functions on functions”, and so on. In programming language terms, this directly corresponds to higher-order functions.

It’s dependently typed because in addition to saying “A implies B”, you can say “for each particular value a in A, B(a) holds”. In programming language terms, this means constructing functions whose type differs depending on the value of the argument that was given (“depends on it” is the eponymous way of stating this).

Unlike methods based on temporal logic (which tend to abstractly model systems) and separation logic (which have a clear delineation between the object language and metalanguage), higher-order dependently typed languages (Agda, Lean, Rocq, etc.) more or less blur this line. The code you write is in the language, possibly using a simpler subset of the types (though not always; see the paragraph on correctness by construction). The proof about your code is also in the language, using the full suite of powerful tools. This has many distinct advantages, such as being able to freely reference your normal code from your proofs and, in fact, not having to worry about explicitly modeling the semantics of your language. On the other hand, as I mentioned in the section on referential transparency, the desirable properties of the proof part of the language depend on there being no side effects! Since you are writing your “business” code in the same language in which you write your proofs, you are suddenly obligated to write purely functional programs. As always, you can still get your work done, including by modeling effectful code in a functional way, but you are nearly automatically booted upwards several levels of abstraction.

Instead of giving examples in place, I invite you to take a look at other posts on my site, which leverage this sort of formal verification. In particular, I’ve implemented a formally verified static analysis framework and applied a correct-by-construction approach in my series on meaningfully typechecking a language in Idris. A simpler, self-contained example is one of my Advent of Code in Coq posts. Of course, you may choose to look outside this blog for samples. I credit Software Foundations for teaching me most of what I know about theorem proving.

It is this approach, using Lean, that OpenAI and Anthropic have been recently using for their mathematical breakthroughs. I suspect, though I am not sure, that in particular the presence of tactics is key to their success.

Tactics are a feature commonly — though not universally — found in proof assistants, and they more or less solve two major problems:

Curry-Howard “proofs as programs” are unreadable. More often than not, these proof terms are strange invocations of recursors or induction principles intermixed with all sorts of peculiar intermediate function calls. They are also often very low-level. Tactics also result in proof terms, but they build them incrementally, step by step, and oftentimes allow you to see intermediate states of your proof.[note: I further suspect that this ability to inspect a half-written proof is a huge boon for LLMs debugging their theorems. It certainly seems to help humans. ] Oftentimes, sequences of tactics read much like a conventional mathematical proof.

Precise proofs require large volumes of case analysis and “rote” work. Tactics can make it possible to automate the construction of proof terms, such that instead of 15 hand-written cases, you may write cases <;> simpl. They may also encapsulate well-known strategies, allowing the author to say “by principle X” as they might in an informal proof.

My prior observations of LLMs favoring extrinsic verification even in Lean, over the also-supported correct-by-construction intrinsic verification (see the sidenote in the relevant section) may come down to the fact that LLM agents today are very good at using tactics, but actually not particularly good at constructing proof terms. Other (also anecdotal) evidence in favor of this hypothesis is that LLMs continue to struggle with Agda, which does not have a well-developed tactic framework. If this is the case, to leverage LLMs’ current verification abilities, languages leaning on DTHOL may need to support tactics properly.

As a final aside, I’d like to note that tactics aren’t actually specific to formal verification; they are, more generally, a stateful way to construct programs. See Sandy Maguire’s Towards Tactic Metaprogramming in Haskell for an example of tactics completely outside the formal domain.

I think it is undeniable that LLMs have made the construction of formal proofs considerably more accessible, and I personally believe that the time seems right for formal verification to hit the software engineering mainstream. I think that as software engineers, we will face unique challenges when trying to leverage this newfound power in our domain, whether with existing frameworks or a new, mainstream, verification-capable language. In this post I hope to have given brave explorers in these exciting times a general survey of (what I believe to be) some of these challenges, and the tools of the trade as they exist today. I hope to see the delightful rigor of formal methods become popular thanks to our recent advances, and I remain, as is not uncommon in these times, very cautiously, and a little defiantly, optimistic.

Source Attribution: This report incorporates information referenced or syndicated from Danilafe.com. Read original coverage at Danilafe.com.

More from Technology →
Haldwani Times
Haldwani Times Independent News & Editorial
Login
MARKETS & FINANCE
BRENT CRUDE: $78.40 -0.52% SENSEX: 81,450.20 +0.42% NIFTY 50: 24,820.15 +0.38% GOLD (24K): ₹74,500/10g -0.18% USD/INR: ₹95.54 +0.10%

ADMINISTRATIVE LEADERSHIP

Mr. Narendra Modi
Mr. Narendra Modi
Mr. Lt. Gen. Gurmit Singh
Mr. Lt. Gen. Gurmit Singh
Mr. Pushkar S. Dhami
Mr. Pushkar S. Dhami
Mr. Lalit M. Rayal
Mr. Lalit M. Rayal
Mr. Gajraj S. Bisht
Mr. Gajraj S. Bisht

Top Headlines & Breaking Stories

View All News →

Haldwani Times – Everything in Haldwani: News, Shops, Businesses & Services

Haldwani Times is the premier digital news and commercial discovery platform built specifically for the citizens, business owners, students, professionals, and visitors of Haldwani, Nainital district, and the wider Kumaon region of Devbhoomi Uttarakhand. As the economic gateway to the Kumaon Himalayas, Haldwani is a bustling metropolis connecting the plains of northern India with the scenic mountain districts of Nainital, Almora, Pithoragarh, Bageshwar, Champawat, and Udham Singh Nagar. Haldwani Times serves as the definitive digital heartbeat of the city, bringing breaking hyperlocal news, verified commercial directories, educational updates, healthcare guides, Mandi Bhav rates, and civic announcements onto a single unified, trusted platform.

The Definitive Source for Breaking Haldwani News & Civic Updates

Haldwani stands as one of the fastest-growing urban conglomerates and commercial engines in northern India. Positioned in the fertile Terai-Bhabhar belt at the foothills of the Shivalik range, the twin cities of Haldwani and Kathgodam form the administrative and logistical nerve center for the entire Kumaon division. With rapid urbanization, expanding commercial infrastructure, flourishing educational centers, and increasing inter-state transit, the demand for fast, fact-checked, and unbiased local journalism has never been greater. Haldwani Times delivers 24/7 comprehensive news coverage built on rigorous journalistic standards: - **Hyperlocal Civic News:** Real-time coverage of municipal corporation affairs, city drainage projects, traffic management blueprints, and road widening drives across Tikonia, Mukhani, Kusumkhera, Bareilly Road, and Rampur Road. - **Administrative Directives:** Official notifications from the District Magistrate (DM) Nainital, Senior Superintendent of Police (SSP), and state secretariat decisions affecting citizen welfare. - **Kumaon Weather & Disaster Alerts:** Timely mountain rainfall warnings, landslide advisories along NH-109 (Haldwani-Nainital Highway), and emergency bulletins during the monsoon and winter seasons. - **Education & Campus News:** Timely reports on Kumaon University examination schedules, Uttarakhand Board (UBSE) results, medical college admissions, and competitive coaching updates. - **Commercial & Market Trends:** Daily wholesale Mandi Bhav rates from Haldwani Subzi Mandi, real estate trends, retail market festivals, and local business openings. - **Cultural & Pahadi Heritage:** In-depth feature stories celebrating Kumaoni folk traditions, Aipan art, Nanda Devi festivals, and local community milestones.

Everything in Haldwani on One Unified Digital Ecosystem

Beyond traditional news reporting, Haldwani Times is engineered as an exhaustive local discovery engine. Historically, finding verified local business telephone numbers, emergency hospital contacts, specialized doctors, reliable plumbers, or trusted real estate consultants in Haldwani required asking neighbors or browsing outdated social media posts. Haldwani Times eliminates this friction by organizing every commercial, professional, and civic resource into searchable, verified categories. Whether you are a newly arrived resident in Kusumkhera looking for high-speed broadband providers, a parent searching for reputable CBSE schools near Kaladhungi Road, or a tourist seeking taxi rentals to Nainital, our portal delivers accurate, verified, and actionable information in seconds.

Local Shops, Retail Hubs & Traditional Bazaars in Haldwani

The retail commerce of Haldwani spans centuries-old traditional bazaars and modern commercial complexes: - **Bada Bazaar & Mangal Parao:** The historic retail heart of Haldwani, renowned for traditional Kumaoni wedding jewelry (Pauji, Guloband, Nath), brass utensils, ethnic handlooms, and wholesale clothing. - **Nainital Road & Tikonia Commercial Corridor:** Modern multi-brand retail showrooms, electronics stores, authorized smartphone service centers, branded footwear outlets, and international apparel stores. - **Bareilly Road & Rampur Road Trade Hubs:** Major agricultural machinery dealers, hardware and building material wholesalers, furniture manufacturing units, plywood distributors, and automobile showrooms. - **Subzi Mandi & Wholesale Grain Market:** One of the largest agricultural distribution centers in North India, supplying fresh vegetables, hill fruits (apples, peaches, plums), and organic Pahadi pulses (Gahat, Bhatt, Rajma) across northern states.

Healthcare Hub of Kumaon: Hospitals & Emergency Services

Haldwani serves as the premier medical lifeline for all six hill districts of Kumaon. Patients travel from Almora, Pithoragarh, Bageshwar, and Champawat to access specialized clinical treatments in Haldwani: - **Government Healthcare Institutions:** Dr. Susheela Tiwari Government Medical College & Hospital (STGH) and Base Hospital Haldwani provide tertiary trauma care, specialized super-specialties, pediatric ICUs, and 24/7 emergency response. - **Private Multi-Specialty Hospitals:** Advanced private medical centers specializing in cardiology, joint replacements, neurology, critical care, nephrology, and advanced laparoscopic surgeries. - **Diagnostic Centers & 24/7 Pharmacies:** Fully automated pathology laboratories, high-resolution MRI/CT scan centers, and round-the-clock emergency pharmacies clustered around Medical College Road, Kaladhungi Road, and Rampur Road.

Education, Colleges, Coaching Academies & Youth Development

Haldwani is the educational capital of the Kumaon region, home to thousands of ambitious students preparing for medical, engineering, defense, and civil services careers: - **Premier Degree Colleges:** Motiram Baburam Government Post Graduate College (MBPG College) and Women's Degree College providing extensive undergraduate and postgraduate humanities, commerce, and science programs. - **Competitive Coaching Ecosystem:** Highly reputed coaching academies for NEET UG, JEE Main & Advanced, UPSC Civil Services, UKPSC/UKSSSC, NDA, CDS, and Banking examinations along Kaladhungi Road and Tikonia. - **Affiliated Schooling Infrastructure:** Esteemed CBSE, ICSE, and Uttarakhand Board schools imparting value-based holistic education with modern sports and laboratory facilities.

Real Estate, Housing Colonies & Urban Expansion Trends

Driven by rapid infrastructure expansion and high quality of life, Haldwani's real estate market is expanding outward into organized residential colonies: - **Prime Residential Localities:** Highly sought-after residential sectors in Mukhani, Kusumkhera, Kaladhungi Road, Judge Farm, Daharia, and Bhotia Parao offering planned housing, green parks, and modern civic amenities. - **Commercial Property Investments:** Thriving commercial retail complexes, office spaces, and warehouse hubs developing rapidly along the proposed Haldwani Ring Road and transport corridors. - **Property Advisory & RERA Compliance:** In-depth real estate updates, circle rate revisions by the Nainital district administration, and buyer advisory guidelines for safe property acquisitions.

Strategic Transit Gateway, Tourism Routes & Kumaon Himalayan Connectivity

Haldwani-Kathgodam is the vital transit bridge connecting the plains of Delhi NCR and Uttar Pradesh with the hill stations of Uttarakhand: - **Kathgodam Railway Terminal:** Connecting Kumaon directly to New Delhi (Shatabdi Express, Ranikhet Express), Lucknow, Kolkata, Jammu, and Dehradun. - **ISBT Haldwani:** Operating round-the-clock interstate and mountain bus routes managed by Uttarakhand Transport Corporation (UTC) and private deluxe coaches. - **Pantnagar Airport (PGH):** Located just 26 km from Haldwani, offering scheduled domestic flights to New Delhi, Dehradun, Pithoragarh, and regional hubs. - **Himalayan Tourism Hub:** The primary staging point for journeys to Nainital (34 km), Bhimtal (30 km), Mukteshwar (72 km), Kainchi Dham (42 km), Almora (90 km), Ranikhet (80 km), and Jim Corbett National Park (55 km).

Gaula River Mining, Ecological Balance & The Bhabhar Economy

The Gaula River represents the undisputed economic and hydrological lifeline of Haldwani and the broader Nainital district. Originating from the Sattal-Bhimtal catchment in the lesser Himalayas, the river flows south past Kathgodam and Haldwani before merging into the Ramganga. For generations, the Gaula riverbed has provided the foundation for both regional agriculture and the construction economy across northern India: - **Regulated Minor Mineral Extraction:** During the open mining season (typically October to May), thousands of registered tractor-trolleys and heavy dumpers harvest riverbed gravel, sand, and boulders under strict surveillance by the Uttarakhand Forest Development Corporation and the Nainital district administration. - **Livelihood Support for Over 50,000 Families:** The Gaula mining economy directly and indirectly sustains vehicle owners, drivers, mechanics, diesel pump stations, roadside eateries, and local laborers, circulating over ₹500 crore into Haldwani's local markets annually. - **Environmental Safeguards & Flood Mitigation:** In strict adherence to High Court and National Green Tribunal (NGT) directives, scientific replenishment studies, satellite GPS tracking on transport vehicles, and seasonal mining bans during the monsoon protect the river's ecological balance and prevent bank erosion along low-lying residential sectors.

Culinary Landscape: From Traditional Kumaoni Rasoi to Modern Cafes

Haldwani's gastronomic scene reflects a delightful blend of rustic mountain traditions and cosmopolitan dining: - **Authentic Kumaoni Specialties:** Local restaurants and heritage dhabas serve traditional mountain delicacies cooked in iron vessels, including Bhatt ki Churkani (black soybean curry), Gahat ke Dubke (horsegram puree), Aloo ke Gutke tempered with wild Himalayan chives (Jamboo) and Jakhiya, and refreshing cucumber Raita flavored with freshly crushed mustard seeds. - **Traditional Confectioneries:** Historic sweet shops along Bada Bazaar and Nainital Road craft Almora's world-famous Bal Mithai (roasted caramelized khoya fudge coated in sugar balls) and Singaudi (sweetened khoya wrapped in wild Malu leaves). - **Vibrant Street Food & Cafe Culture:** As dusk falls, Tikonia and Nainital Road come alive with bustling street food stalls offering steaming Tibetan momos, spiced thukpa, Kathi rolls, and hot Masala Chai, alongside modern rooftop cafes serving specialty Italian coffees and continental snacks.

Cultural Festivals, Folk Heritage & The Aipan Art of Kumaon

Beyond commercial enterprise, Haldwani is the proud cultural showcase of Devbhoomi Uttarakhand: - **Aipan Folk Art Tradition:** The sacred geometrical floor and wall art handcrafted with red ochre (Geru) and white rice paste (Biswar) adorning thresholds, altars, and chowkis during auspicious ceremonies, now preserved through local women's self-help cooperatives. - **Classical Baithki & Khadi Holi:** Unique to Kumaon, musical celebrations starting as early as the month of Paush, featuring classical Hindustani ragas sung in community courtyards followed by energetic Chholiya dance performances during spring. - **Nanda Devi & Chholiya Heritage:** Grand annual fairs celebrating the patron deity Nanda Devi, accompanied by martial sword-and-shield Chholiya dancers whose rhythmic brass trumpets (Ransingha) and hurka drums resonate through the valley.

Public Amenities, Parks & Community Spaces in Haldwani

Urban lifestyle and recreational infrastructure in the city: - **Green Parks & Walking Tracks:** Walkway projects around Daharia, Judge Farm, and Awas Vikas providing lush recreational zones for families and seniors. - **Community Centers & Sports Grounds:** Multi-purpose auditoriums and grounds hosting cultural melas, badminton tournaments, and community celebrations. - **Gaula Barrage & Forest Trails:** Scenic river viewpoints and natural birdwatching areas attracting eco-tourists and local nature enthusiasts on weekends.

Frequently Asked Questions (FAQs)

How can I access live breaking news and weather alerts for Haldwani?

Haldwani Times operates a dedicated 24/7 hyperlocal newsroom providing real-time breaking bulletins, traffic alerts, and meteorological warnings. You can access live news directly from our homepage, subscribe to instant browser push notifications, or view categorical updates on Uttarakhand, Education, and Mandi Bhav. During monsoon and winter weather events, our correspondents provide live updates on NH-109 road blockages and emergency administrative orders issued by the Nainital District Magistrate.

Is Haldwani Times completely free to read for all visitors?

Yes, Haldwani Times offers completely unrestricted, open-access reading to all users without mandatory paywalls. Readers across Haldwani, Uttarakhand, and the global diaspora can freely browse all breaking news reports, investigative articles, business directory listings, and historical archives. Our public-interest mission ensures that essential civic information, emergency hospital directories, and educational circulars remain universally accessible to everyone at zero cost.

How can local business owners list their shop or service in the Haldwani directory?

Local merchants, medical practitioners, schools, and service professionals can register their business by navigating to our 'Business Directory' page and selecting 'Add Listing'. The registration process allows you to input your business name, address, contact numbers, operational hours, services offered, and high-resolution showroom photographs. Once submitted, our local verification team verifies the physical address within 24 hours to ensure high consumer trust and top ranking on Google.

Can I read Haldwani Times articles in Hindi as well as English?

Yes, Haldwani Times features a seamless, native bilingual reading experience tailored for our regional readership. With our one-click language toggle located prominently in the navigation bar, you can instantly switch between English and pure Hindi. Both versions feature carefully crafted editorial phrasing, accurate regional terminology, and culturally resonant storytelling to ensure maximum readability for students, families, and senior citizens alike.

How do I submit news tips, event notices, or press releases to the editorial team?

Our newsroom warmly welcomes verified news tips, community event notices, civic grievances, and official press releases from citizens and local organizations. You can submit your documents, photos, or video evidence directly to our central editorial desk at editorial@haldwanitimes.com or via our Help & Support page. Our senior editors review every submission for factual authenticity, multi-source verification, and public relevance prior to publication.

Where can visitors find authentic Kumaoni Bal Mithai and Singaudi in Haldwani?

Renowned traditional sweet houses clustered along Bada Bazaar, Mangal Parao, Kathgodam Station Road, and Nainital Road specialize in daily batches of authentic Bal Mithai and fragrant Singaudi prepared with pure mountain dairy khoya and natural ingredients.

What transportation options are available for traveling from Haldwani to Nainital and Bhimtal?

Continuous state transport buses (UTC), KMOU coaches, and registered taxi union sharing cabs operate 24/7 from the Haldwani Roadways Bus Station (near Tikonia) and Kathgodam Railway Station. Fares are regulated by the transport department, with mountain travel times ranging between 1 to 1.5 hours.