[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlaplus] Re: TLAPM MCP server



Newer to TLA+ but I have been using agents pretty extensively for 6 months now. I find the agents perform the best when the language/framework they are working in has an extensive cli tool that it can use to verify that its implementation is correct. I see this often when I am programming in Flutter (it has an amazing cli).

I think this is probably one of the better and more robust solution because a cli tool can be packaged with the manager and you get it all in one install and you wouldn't need to hook up an MCP server.



On Fri, Nov 13, 2026 at 3:21 AM Marco Manino <mrcmnn@xxxxxxxxx> wrote:
Very interesting. If I understand correctly, this would mean giving AI the ability to quickly decompose a failing lemma, right? But also AFAICT the current language server does not expose it in CLI (yet?), correct?

I also wonder: lsp are available in some agents, for example OMP can directly plumb that in the agent via very simple configuration. I wonder if this would expose thatto the agent without adding anything to the MCP? I will try and report :-)

Il giorno mer 11 nov 2026 alle ore 14:12 Younes <younesagma@xxxxxxxxx> ha scritto:
Hi Marco,

Not sure if you have looked into this discussion : https://github.com/tlaplus/tlapm/discussions/253#discussioncomment-16383825 

On Tuesday, November 10, 2026 at 2:59:49 PM UTC Marco Manino wrote:
Hi everybody. I am new in this community, but I have been using TLA+ quite a while lately.

I read the other day the article from Markus about AI-assisted proofs and the new AI agent (TILAPIA). The findings matched our experience very closely, as such I want to share some of our findings as well.

One of the main pain-points are:
 - the loop time (as `tlapm` can be sometimes slow, see tlaplus/tlapm#286);
 - the token usage in the sense of context filling and cost.

For the second point, the problem is mainly the way the agent interacts with `tlapm`: it will soon recognize that it can accept a line (`--line`) or a line range (`--toolbox`), but the output of these operation modes is *very* verbose as it is tuned to IDE interaction and not AI interaction. As such the context fills *very* quickly with noise: the agent is forced to deal and filter information to mostly useless messages (from the AI perspective, of course). We found out that Sol 6.1 occasionally filters them with `grep` tool or `python` if available, but that's hardly enough and still consumes a lot of tokens, leading to compaction. Compaction for us has often times been a disruptive operation: most of the time it was hard for the agent to continue successfully the proof after compaction.

Another issue is that the agent struggled to understand that `tlapm` by default tried `SMTT(5)` then `ZenonT(10)` then `IsaT(30)` and wasted lots of effort trying out `BY SMT` or `BY Zenon`, etc..

In our effort to optimize for this, me and Alberto Carretero developed an MCP server (see https://github.com/marco6/tlapm-mcp) to deal with the above issues. It features 2 commands:
 - `check`: a small syntax check (unfortunately it still uses `tlapm` syntax checking, we will soon try to get `SANY` to work with it)
 - `prove`: the main tool. It will accept a range, print only the failed theorems and report suggestions as warnings (for the `BY <solver>` problem).

The latter will accept an agent-friendly syntax to prove theorems and, more importantly, it will provide a compact output by parsing what the `--toolbox` mode prints.

Clearly, this being an MCP is just a matter of AI being trendy these times. Nothing is stopping us from making a standalone wrapper/CLI interface for `tlapm` which is just a CLI tool.

I see that there has been already some thought into this specific problem (for example tlaplus/tlapm#290), so is there a better place to discuss this? How can we collaborate on this together? And (maybe foremost) is there interest in the community for such an effort?

Thanks,
Marco

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/a5b470b9-5273-440f-a595-4253e8e7dacdn%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/CACtxL0YwKsdffKRhYVd_qQQm9P_2dmne9gKogiVn9eU9RtOC1Q%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/CA%2BafN6MJdrha2OK_bWdmdVB25-QDwuzCC6kZbmgakNzX%2BanZMA%40mail.gmail.com.