Better HN
topnewbestaskshowjobs
Log inSign up

manasij7479

22 karma · joined Dec 4, 2018 (7y ago) · 5 submissions

CS PhD student at the University of Utah, working on LLVM, formal methods, superoptimizers, and compiler development tools.

manasij7479@gmail.com

Submissions

comment 2y ago · link · parent

These are indeed neat papers!

comment 3y ago · link · parent

Neat, I wonder if this idea could be developed into a more refined programming experience where you you spend time in the imperative world by default and only express some iterations as logic puzzles to be solved like this.

comment 3y ago · link · parent

The issue you have circled around here is a bit deeper and nuanced than trimming down exponential code to something more tractable. In fact, it's often worse, and O(2^n) can be a blessing!

The problem with logic programming is the 'logic' part.

Modern imperative and functional programming languages are constructive.

Logic programming is not, and the expressive power varies with the exact logic being used.

Elementary logic gives you the following intuition. Propositional logic -- easy. First order logic -- easy (with caveats). And (some kinds of) second order logic -- only easy if you get lucky with the problem you are trying to solve.

For logic based programming languages and systems, both the language implementer and the programmer have to be careful about supporting and using language constructs which boil down to tractable computation.

This is much more difficult than it seems like.

For example, when using SMT solvers you learn quickly that multiplication and division with constants is very fast while the same operations with variables can be intractable. i.e. reasoning about x * C --easy, while x * y is often (but not always..) going to hang.

comment 3y ago · link · parent

Input's and other side effects are not too tricky to handle.

In most cases, you just slice the program to isolate pure computation, and just optimize that.

Most traditional compiler optimizations stick to that as well, the exceptions to this rule are carefully engineered.

comment 3y ago · link · parent

The pruning part can do a lot of heavy lifting to make it a practical tool.

Related: I work on Souper (https://github.com/google/souper).

Feel free to reach out if anyone has questions!