Skip to content

#with_goal tactic - #1430

Open
bodeveix wants to merge 17 commits into
Deducteam:masterfrom
bodeveix:with_goal
Open

bodeveix wants to merge 17 commits into
Deducteam:masterfrom
bodeveix:with_goal

Conversation

@bodeveix

@bodeveix bodeveix commented Jun 26, 2026 •

Copy link
Copy Markdown
Collaborator

The tactic term with_goal (only available in eval) calls its parameter tactic with the current goal seen as a Prop.

@fblanqui fblanqui left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jean-Paul.

  1. If there are problems with assume, please open an issue with an example, and propose a separate PR to solve that problem.

  2. A more general approach to with_goal, not requiring gconf.ml, would be to generate a unification problem goal == Prf ?M, solve it to instantiate ?M and, in case of success, handle the tactic (t ?M).

Yes but I suppose this would need another tactic to solve the unification problem automatically.

Comment thread src/handle/tactic.ml Outdated
Comment thread src/handle/tactic.ml Outdated
Comment thread tests/OK/with_goal.lp Outdated
Comment thread CHANGES.md Outdated
@fblanqui

fblanqui commented Jul 1, 2026

Copy link
Copy Markdown
Member

I see the problem with assume. I'll fix it this afternoon.

@bodeveix

bodeveix commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator Author

The goal is now matched with (Prf _) through LP standard unification. The example uses the new encoding of Set and Prop declared in Univ. The corresponding unification rules replace what was done in OCaml.

@bodeveix
bodeveix requested a review from fblanqui September 7, 2026 12:31

@fblanqui fblanqui left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi JP. Here are some comments.

Comment thread src/core/builtin.ml Outdated
register_typ "try" (arr tac tac);
register_typ "why3" tac
register_typ "why3" tac;
register_typ "with_goal" (arr (arr prop tac) tac);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why restricting goals to Prop? It could be of type Π l:L, U l → Tactic.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I have changed to this profile: Π [l], (U l → Tactic) → Tactic. In general the parameter is not polymorphic.

Comment thread src/core/sign.ml Outdated
s
end
else assert false
else begin failwith s.sym_name end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use the qualified name:
Console.out 0 "link: didn't find %a" Raw.sym s
and add let qsym = qsym let _ = qsym in Core.Print.Raw

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment thread src/handle/tactic.ml Outdated
| Some(t,_) ->
if Unif.solve_noexn p then
let ps, t = p_tactic ps g env pos t in handle ps t
let ps,t = p_tactic ps g env pos t in handle ps t

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unnecessary change

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment thread CHANGES.md Outdated
- Type of `#assume` in order to generate a new symbol and use it inside a tactic term.
- Errors occurring while a proof is in progress now report the proof state: the goals a failing tactic was applied to, the goals before and after the tactic for a subproof-count mismatch, and the remaining goals when a proof is unfinished at `end`. The state is printed after the error message, which stays unchanged. The LSP server does not attach the proof state to tactic failures since editors display it themselves.
- Lambdapi does not use Cmdliner anymore.
>>>>>>> dk/master

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Comment thread CHANGES.md Outdated
- Tactic `all_hyps t` calls parameterized tactic term t on all hypotheses ignoring failing calls.
- Extend `print` query to the following arguments: `verbose`, `debug`, `flag`, `builtin`, `prover`, `prover_timeout`.
- add a version number to the header of the index db file to prevent crash of LP when the structure of db changes.
- Tactic `#with_goal t` which calls term tactic t with current goal of type Prop as parameter.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applies the tactic producing term t to the current goal

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have changed the comment: Tactic #with_goal t applies the tactic t with current goal as parameter.

Comment thread doc/structure.rst Outdated

* ``command.ml``: command handling
* ``compile.ml``: file parsing and compiling (.lpo files)
* ``gconf.ml``: builtins needed to build current goal (tactic #with_goal)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be removed

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@bodeveix
bodeveix requested a review from fblanqui September 12, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants