Name Last modified Size Description
Parent Directory - proofs.py 2022-03-02 07:56 358 Makefile 2022-03-02 07:56 817 README.md 2022-03-02 07:56 1.2K tests.c 2022-03-02 07:56 5.8K tests-O3.ll 2022-03-02 07:56 17K tests-O3-opt-pass.ll 2022-03-02 07:56 17K tests-O0.ll 2022-03-02 07:56 42K tests-O0-opt-pass.ll 2022-03-02 07:56 42K tests 2022-03-02 07:56 49K
Can clang be used as a problem solving assistant?
Spoiler: No
In this tweet Joe Groff links to this online compiler interface of a collatz conjecture implementation and clang/llvm optimizes it to return true. Its optimization is so aggressive, and perhaps arrogant, it treats the conjecture as settled and returns 1. The conjecture is of course unproven, and tested only up to about 2**68, a small fraction of the __int128_t parameter.
But it raises an interesting question. Could we glean insights to problems by writing solution checkers and observe clang/llvm's optimizer? Proposed workflow:
If the complexity of the compiled checker reduces, the partial solution is correct. Iterate this process to converge on a solution.
See ./tests.c for the tests and results.
generated from: clang-as-problem-solving-assistant/README.md