Skip to content

Conditional rules#1438

Open
bodeveix wants to merge 14 commits into
Deducteam:masterfrom
bodeveix:condrules
Open

Conditional rules#1438
bodeveix wants to merge 14 commits into
Deducteam:masterfrom
bodeveix:condrules

Conversation

@bodeveix

@bodeveix bodeveix commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

This PR extends the syntax of rules to add optional equational constraints of the form:

rule <term> when <term> ≡ <term> ↪ <term>
rule <term> when <term> «[op] <term> ↪ <term>

  • In the first form, the compared terms must be flat, i.e. of the form f $p1 ... $pn to avoid cyclic dependencies between files.

  • In the second form, the compared terms are restricted to pattern variables. The condition is satisfied if the valeur of the first is a sub term of the value of the second one by crossing only op arguments. Subterm conditions could be expressed using the first form, but it would need defining a sub term relation for each operator.

Remarks:

  • It would be possible to let the comparison instantiate some pattern variables.
  • Static type checking of the constraint is not done

@bodeveix bodeveix changed the title Condrules Conditional rules Jul 2, 2026
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.

1 participant