Skip to content

#with_goal tactic#1430

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

#with_goal tactic#1430
bodeveix wants to merge 8 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. It uses builtins to transform lambdapi Pi and -> into 1st order forall and =>.

I have also modified assume - the created variable was not passed to the tactic and the type of #refine in Tactic.lp

In order to use #assume for both sets and props, I have added in the test example a conversion \sigma from Prop to Set. It would be better to convert both Prop and Set to Type: TYPE

@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
let rec as_prop g =
match is_prf g with
| Some u -> u
| None -> match g with

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.

matching on terms must always be of the form match unfold t with ...

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
match is_prf g with
| Some u -> u
| None -> match g with
| Prod(p,bi) when binder_name bi = "_" ->

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.

testing binder_names is not sound; you should use binder_occur instead

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 tests/OK/with_goal.lp
require open tests.OK.Tactic;

injective symbol σ: Prop → Set;
rule π $P ↪ τ (σ $P);

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 do you need this?

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.

Using this, a unique profile for #assume can be used for both Set and Prop. The idea is to say that each object of type Prop can itself be seen as a type, which is given by the function σ.

Comment thread CHANGES.md
@fblanqui

fblanqui commented Jul 1, 2026

Copy link
Copy Markdown
Member

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

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