HNHacker News
TopNewBestAskShowJobs

markusde

209 karma · joined October 2, 2021

PhD student in formal methods.
submissionscomments
markusde··on Writing a Rust compiler in C
This is 100% the case. All of the honest-to-god Rust experts I know work on the compiler in some way. Same goes for Lean, which bootstraps from C as well.
markusde··on AI solves International Math Olympiad problems at silver medal level
Unlike curing cancer, the IMO problems were specifically designed to be solvable
markusde··on Physicist, 98, honoured with doctorate 75 years after groundbreaking discovery
I've also heard quite a few people saying that their PhD was one of the best times of their life, because of how free they were to pursue things they found interesting (many of them have also settled down with a family, as well). Different strokes for different folks, I guess.
markusde··on Ask HN: How has AI changed your learning methods?
Not much. It's too inaccurate for my research and is a bad writer.

Day to day I write Lean, and I use moogle.ai to find theorems. It's... fine as a first pass. The website constantly gets confused about similar-looking theorems, it can't pattern match, and it can't really introspect typeclasses (which can be hiding the theorems I want). However it usually can usually help me go from a vague description of what I want to some relevant doc pages, so credit where it's due for that.

markusde··on How the square root of 2 became a number
> describe 0% of the rational numbers between 0 and 1

I think you mean irrational :)

markusde··on 'Equals' has more than one meaning in math
Fair enough, I haven't used many proof assistants without dependent types, and I probably should.
markusde··on 'Equals' has more than one meaning in math
But with coercions you do have {↑n | n ∈ ℕ} ⊂ ℤ, which is the subtype that you really want!

The issue is that not all properties of subsets can be lifted to supersets. As an example from analysis, you can coerce the reals ℝ to the extended reals ℝ∞, but you lose some of your rewrite rules because you need to choose how to define edge cases like (∞ - ∞) in ℝ∞. Making these choices is common in mathematics (at least in analysis) and in pencil and paper proofs it's usually just handwaved away.

Using subtypes, a proof checker would have to be explicitly given which ambient superset you're going to rewrite something like ((a : ℝ) - (b : ℝ)) in... this is more or less the same as using coercions to distinguish between ℝ and {↑r | r ∈ ℝ} ⊂ ℝ∞ except with subsets type inference is way harder.

I'll admit that coercions are annoying, but subsets don't let you get around it: here there's an essential step up in complexity between sloppy pencil and paper proofs and verified code. Personally, I'm really interested in seeing how much of mathematical handwaving can be rigorously automated away. There's a lot of cool work in this area by I don't think the FM community has a definitive answer for it yet.

markusde··on Borgo is a statically typed language that compiles to Go
It doesn't matter but I fully disagree with this. A transpiler emits code the user is supposed to understand, a compiler does not. At least that's the general way I've seen the term used, and it seems quite consistent.
markusde··on U-M finds students with alphabetically lower-ranked names receive lower grades
I noticed this in myself last time I was as a TA. I'd go back and re-grade the first 15 assignments or so to make sure the rules were being applied consistently.
markusde··on Math writing is dull when it neglects the human dimension
I would also be interested in reading some of these examples!
markusde··on Turning off Rust's borrow checker completely (2022)
Yes... Rust!

I don't know if you can toggle it from the front-end, but the Polonius borrow checker includes a "location insensitive" mode which is faster but accepts fewer programs.

markusde··on I'm sorry but I cannot fulfill this request it goes against OpenAI use policy
The difference is, a junior employee knows that killing prod is bad. An LLM doesn't know anything.
markusde··on P vs NP: The most important unsolved problem in computer science
I chased some links from Wikipedia and you're right that Edmonds uses "efficiently solvable" to mean P. However, he does not take "efficiently solvable" to mean "feasible" for basically the same reasons as I've said in this thread. From section 2 of Edmonds' "Paths, Trees, and Flowers" (1965):

> An explanation is due on the use of the words "efficient algorithm." First, what I present is a conceptual description of an algorithm and not a particular formalized algorithm or "code." For practical purposes computational details are vital. However, my purpose is only to show as attractively as I can that there is an efficient algorithm. According to the dictionary, "efficient" means "adequate in operation or performance." This is roughly the meaning I want—in the sense that it is conceivable for maximum matching to have no efficient algorithm. Perhaps a better word is "good."

> It is by no means obvious whether or not there exists an algorithm whose difficulty increases only algebraically with the size of the graph. The mathematical significance of this paper rests largely on the assumption that the two preceding sentences have mathematical meaning.

> ...

> When the measure of problem-size is reasonable and when the sizes assume values arbitrarily large, an asymptotic estimate of FA(N) (let us call it the order of difficulty of algorithm A) is theoretically important. It cannot be rigged by making the algorithm artificially difficult for smaller sizes. It is one criterion showing how good the algorithm is—not merely in comparison with other given algorithms for the same class of problems, but also on the whole how good in comparison with itself. There are, of course, other equally valuable criteria. And in practice this one is rough, one reason being that the size of a problem which would ever be considered is bounded.

You should read the rest of section 2, it's short very clear. Calling P the class of "efficiently solvable" problems is a completely reasonable framing for this paper, considering that this was written at a time when we had fewer tools to formally compare algorithms. Edmonds correctly does not claim that all P algorithms are feasible, and my opinion that P=NP is not important is based on the 60 years of feasible non-P computations we've had since.

markusde··on P vs NP: The most important unsolved problem in computer science
I am a theorist (though not in complexity) so I agree with you that new math is never bad. I also agree that an very lucky P=NP result _may_ be implementable _at some point_ in the future, though to be honest I wouldn't put my money on that happening.

As for more important problems-- I think it's more important to improve the specializations of NP problems, heuristically, for problem instances which arise in practice. A concrete example in my line of work could be improving the performance of SMT solvers on encodings of real programs. There's a lot of exciting work happening in this area and it's opening doors in program verification previously thought to be unrealistic. IIUC the formal methods team at AWS is putting a lot of work into memoized, distributed SMT solving, and are making meaningful gains over the current state of the art.

I don't really care if we can solve the most general NP hard problems in O(bad*N^bad) only for N>bad. A) Even a getting result that weak seems to be too challenging to prove and probably not true, and B) trying to solve the most general problem is complete overkill for any problems that come up outside a complexity textbook.

markusde··on P vs NP: The most important unsolved problem in computer science
That's not Cobham-Edmonds thesis. The assertion is that problems are feasible _only if_ they are in P, not _if and only if_ they are in P.
markusde··on P vs NP: The most important unsolved problem in computer science
Ok. When I say efficient, I mean "produces efficient code on near-term hardware". I understand that complexity theorists have a different definition of "efficient"-- they also have a different definition of "important" too.
markusde··on P vs NP: The most important unsolved problem in computer science
Even a P=NP result doesn't tell us that NP problems have efficient solutions. That depends entirely on

- if the solution is constructive,

- if the asymptotic solution has good constants (lower bound on input size, highest degree term), and

- having no other mitigating factors (requiring absurd amounts of space, for example)

The idea that P=efficient is a complete misnomer. For simple algorithms, asymptotic analysis is a fine enough coarse-grained view of program performance. However for extreme cases (like may be the case for P=NP) asymptotic analysis tells you almost nothing at all.

markusde··on P vs NP: The most important unsolved problem in computer science
I disagree that this is an important problem. Even in the unlikely case that some NP-hard algorithm is P, it may be completely infeasible to compute on modern hardware. I'd wager that to certainty be the case if any solution exists at all.

I am not aware of any practical use of P=NP outside of pure complexity theory, and the P!=NP case is already ubiquitous assumption anyways. P=NP would be a notable result, but probably not important.

markusde··on Ask HN: What are the most interesting takes on Generative AI you've come across?
Full verification is one, but that is still challenging at scale. Formal methods has many weaker methods as well which are easier to apply in general (automated proof, abstract interpretation, static or dynamic model checking, hell some would even argue the judicious use of dynamic checks is a kind of formal methods).

I think that a shift from "this is my program, it's a sequence if steps that does what it does" to "I asked a LLM to generate me a program that does this vague thing I want" makes you naturally ask questions like "wait is it actually doing the thing I want" and "what do I even want it do do". Formal methods, broadly, has a lot of good answers to those questions.

markusde··on Ask HN: What are the most interesting takes on Generative AI you've come across?
How's this for interesting: many people in my field (formal methods) seem to be pretty excited about our job prospects. Before we used to just say that people don't actually know what their code does, but now it looks like it might really be true.
markusde··on Formalizing 100 Theorems
A problem with randomly searching for theorems is that it blows up exponentially, and many of the theorems you would find are probably not useful in their own right. Another problem is that "check the for truth" is undecidable: they are what I think of when you mention "trade CPU cycles for proofs" though if you're just trying to prove random theorems they will be limited.
markusde··on Why programming languages matter [video]
You're mixing up functional programming with an execution model for functional languages. These are not the same.
markusde··on The elderly are becoming homeless at a rate not seen since the Great Depression
It's not absurd because nobody is forcing that person to rent. Housing is a public resource, and contributing to that public resource shouldn't come without asterisks.

Cities need the non-owning class to function, and cities function better when the non-owning class has some degree of stability-- letting landlords juice their tenants for as much as possible is counterproductive to this.

markusde··on Don’t Forget Intuition: The art of doing science
This is slightly misleading. "All of science" doesn't rely on intuition-- it relies on the scientific method. Intuition guides how we develop our models but ultimately there _is_ a real forcing function in the sense that the models need to hold up to experiment.

An example of why this matters: string theory. AFAICT It's a field that is built with a clear(ish) intuition and rigorous use of logic, but because it is experimentally unverifiable the field has never really moved past conjecture.

markusde··on Ask HN: When is pure functional programming beneficial?
IMO pure FP is nice because _compositionality_ is nice. If my problem has lots of simple data structures that represent mathematical objects, then usually I find that most of things I want to do with them can be succinctly modeled with pure function compositions. When my problem gets more complex, including but not limited to state, monads can restore that compositionality in a way that works with the rest of my pure code.

This property is true to varying degrees outside of pure FP too. For example in Rust I find that expression-orientation makes programs fairly easy to compose, modulo thinking about ownership.

markusde··on The internet's “town square” is dead
That's a good way to put it!

Town squares sound great, but every city square I've been in is full of yelling and pickpockets.

markusde··on Programming languages going above and beyond
I get your point, and I agree with it too. My comment is (trying to) say that in those cases we don't know that humans are any better!

Your other comment has some problems, but a better example is

fn collatz(mut n: bigint, mut v: Vec<...>) {

  loop {

     n = { if n%2==0 then n/2 else 3\*n+1 };

     v.push(...);

  }
}

As far as we know, we can't bound the memory usage of this program: and if any FM can do it as well then there's a million bucks on the table. But so far no human can do it either! And if your program relies on this program using bounded memory, from an engineering perspective you're kind of SOL no matter what.

On the other hand, if you're writing programs which humans are pretty sure they know why the properties they want hold (as we usually try to do, anyways), then translating this into a machine-checked proof can give you a lot more faith that the property actually holds and possibly even find flaws in your reasoning/implementation if there are any!

markusde··on Programming languages going above and beyond
It's not verifiable because you're trying to prove an incorrect spec! This program's memory usage is _not_ bounded above by a constant!

However, many modern formal methods _could_ prove that this function uses `f(x)` space, provided the loop body is simple enough.

markusde··on Programming languages going above and beyond
This is a good but also misunderstood point. It is true that you can't automatically do this in general. However, expressive enough type systems can contain human-written, machine-checked proofs of (models of) these properties. I think the jury's still out on whether or not humans or machines are better at coming up with proofs, but computers are decisively a lot better at checking them than we are.

The way I see it formal methods not a holy grail where we don't have to think about the code we're writing anymore, but it is a very strong next step from "I wrote this code and here's why I think it's right" to "I wrote this code and here's a machine-checked proof that it's right". Effective automation can make that step easier to take in a lot of real-world cases.

markusde··on UW CSE 391 – System and Software Tools
Agreed. At my undergraduate we didn't have an equivalent, and a common complaint amongst the TA's was how little concrete devops skills the students had. One of my friends TAing a second year course even went so far as to say almost all of his time in office hours was (watching students fail to do, and then) showing students the basics.
← PreviousPage 2 of 3Next →