Live data from Hacker News

Learning to prove theorems via interacting with proof assistants

blog.acolyer.org

11–20 of 31 posts

Re: Learning to prove theorems via interacting with proof assistants

#11
"Solving Symbolic Equations with PRESS"

https://core.ac.uk/download/pdf/82605343.pdf

> The PRESS program was originally developed, in 1974--75, as a vehicle to explore some ideas about controlling search in automatic theorem proving by using meta-level descriptions and strategies

https://github.com/maths/PRESS

A lot of this stuff was/is done/doable in Prolog. I've been looking at TLA+ recently and although I'm not to far into it yet, so far everything has been "Oh, I can do that in Prolog."

Re: Learning to prove theorems via interacting with proof assistants

#12

Two more: https://arxiv.org/abs/1907.07794 https://arxiv.org/pdf/1904.03241.pdf

And another https://arxiv.org/pdf/1608.02644.pdf I'd really love to see someone like Deepmind get a hold of this. They are perfectly placed to apply a lot of resources to it and it's right in their wheelhouse. Don't know how to contact them about it though.

Related: https://arxiv.org/abs/1610.01044

"DeepAlgebra - an outline of a program"

> We outline a program in the area of formalization of mathematics to automate theorem proving in algebra and algebraic geometry. We propose a construction of a dictionary between automated theorem provers and (La)TeX exploiting syntactic parsers. We describe its application to a repository of human-written facts and definitions in algebraic geometry (The Stacks Project). We use deep learning techniques.

Re: Learning to prove theorems via interacting with proof assistants

#13

"Solving Symbolic Equations with PRESS" https://core.ac.uk/download/pdf/82605343.pdf > The PRESS program was originally developed, in 1974--75, as a vehicle to explore some ideas about controlling search in automatic theorem proving by using meta-level descriptions and strategies https://github.com/maths/PRESS A lot of this stuff was/is done/doable in Prolog. I've been looking at TLA+ recently and although I'm not to…

The work described in the linked article is very different from what PRESS is doing.

Re: Learning to prove theorems via interacting with proof assistants

#15
post #3

There has been a lot of work like this popping up in the past year. I think it's somewhat promising, but for ML for ITPs to really become useful, I think the models need to better take into account semantic information about terms and types and not just tactics. And this is not easy, because Coq's logic is higher-order and dependently typed, and most work in ML for PL deals with much simpler logics. Still, anything t…

Idea for getting "almost correct" proofs: Take a big Coq project like CompCert or whatever. Search the version control history for commits with small changes to definitions. These very likely come with corresponding changes to proofs as well. Now apply only the code changes but not the proof changes: You get a state with "almost correct" proofs and as a bonus known "ground truth" proofs as well.

Re: Learning to prove theorems via interacting with proof assistants

#16

"Solving Symbolic Equations with PRESS" https://core.ac.uk/download/pdf/82605343.pdf > The PRESS program was originally developed, in 1974--75, as a vehicle to explore some ideas about controlling search in automatic theorem proving by using meta-level descriptions and strategies https://github.com/maths/PRESS A lot of this stuff was/is done/doable in Prolog. I've been looking at TLA+ recently and although I'm not to…

Can you explain what parts of the TLA+ stuff you can express in Prolog and why you think that might be better (or equally good)? It's true that modeling languages all have something in common with Prolog, but do you think that proofs about a similar Prolog version would be nicer than in TLA+?

Re: Learning to prove theorems via interacting with proof assistants

#18
post #3

There has been a lot of work like this popping up in the past year. I think it's somewhat promising, but for ML for ITPs to really become useful, I think the models need to better take into account semantic information about terms and types and not just tactics. And this is not easy, because Coq's logic is higher-order and dependently typed, and most work in ML for PL deals with much simpler logics. Still, anything t…

Idea for getting "almost correct" proofs: Take a big Coq project like CompCert or whatever. Search the version control history for commits with small changes to definitions. These very likely come with corresponding changes to proofs as well. Now apply only the code changes but not the proof changes: You get a state with "almost correct" proofs and as a bonus known "ground truth" proofs as well.

This is a really interesting idea. In some sense, you can say a proof script is "almost correct" if it proves a slightly different theorem.

I suspect the one difficulty there would be finding such incremental changes on Github. It was surprisingly difficult to find small changes to specifications in Git history for a different project that I did. Too many large commits and too much history revision, so you often lose the incremental changes. Still, it is worth trying.

Re: Learning to prove theorems via interacting with proof assistants

#19

"Solving Symbolic Equations with PRESS" https://core.ac.uk/download/pdf/82605343.pdf > The PRESS program was originally developed, in 1974--75, as a vehicle to explore some ideas about controlling search in automatic theorem proving by using meta-level descriptions and strategies https://github.com/maths/PRESS A lot of this stuff was/is done/doable in Prolog. I've been looking at TLA+ recently and although I'm not to…

Can you explain what parts of the TLA+ stuff you can express in Prolog and why you think that might be better (or equally good)? It's true that modeling languages all have something in common with Prolog, but do you think that proofs about a similar Prolog version would be nicer than in TLA+?

I don't know if it's better or nicer. "I am but an egg."

Here is Lecture 4 of Lamport's course: https://lamport.azurewebsites.net/video/video4.html

TLA+ source code:

    EXTENDS Integers

    VARIABLES small, big   
            
    TypeOK == /\ small \in 0..3 
            /\ big   \in 0..5

    Init == /\ big   = 0 
            /\ small = 0

    FillSmall == /\ small' = 3 
                /\ big'   = big

    FillBig == /\ big'   = 5 
            /\ small' = small

    EmptySmall == /\ small' = 0 
                /\ big'   = big

    EmptyBig == /\ big'   = 0 
                /\ small' = small

    SmallToBig == IF big + small =
This is what I came up with (SWI Prolog). Note that I made some constraints explicit to prune the search, like guarding the empty_FOO steps with constraints that the jugs must not already be empty:

    :- use_module(library(clpfd)).

    type_ok(Small, Big) :- Small in 0..3, Big in 0..5.

    next_dh(Moves) :- next_dh(0, 0, Moves).

    next_dh(Small, Big, [[Move, Si, Bi]|Moves]) :-
        type_ok(Small, Big),
        die_hard(Move, Small, Big, Si, Bi),
        (Bi = 4 -> Moves = [] ; next_dh(Si, Bi, Moves)).

    die_hard( fill_small, Small, Big, 3, Big) :- Small # 0.
    die_hard(  empty_big, Small, Big, Small, 0) :- Big #> 0.

    die_hard(small_to_big, Small, Big, S, B) :-
        Big # 0,
        small_to_big(Small, Big, S, B).

    die_hard(big_to_small, Small, Big, S, B) :-
        Small # 0,
        big_to_small(Small, Big, S, B).

    big_to_small(Small, Big, S, 0) :-
        Small + Big #= 3,
        B #= Big - (3 - Small).

    small_to_big(Small, Big, 0, B) :-
        Small + Big #= 5,
        S #= Small - (5 - Big).


And here's a query with depth limit and some manual reflow of the list for presentation...

    ?- call_with_depth_limit(next_dh(Moves), 11, _).
    Moves = [
        [fill_big, 0, 5],
        [big_to_small, 3, 2],
        [empty_small, 0, 2],
        [big_to_small, 2, 0],
        [fill_big, 2, 5],
        [big_to_small, 3, 4]
        ] ;
    true.

Re: Learning to prove theorems via interacting with proof assistants

#20

"Solving Symbolic Equations with PRESS" https://core.ac.uk/download/pdf/82605343.pdf > The PRESS program was originally developed, in 1974--75, as a vehicle to explore some ideas about controlling search in automatic theorem proving by using meta-level descriptions and strategies https://github.com/maths/PRESS A lot of this stuff was/is done/doable in Prolog. I've been looking at TLA+ recently and although I'm not to…

The work described in the linked article is very different from what PRESS is doing.

Yeah, I should have said that. I'm just pointing out that Prolog has been used to do things that Coq and Idris do.
Post reply on HN