Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot derive functional induction principle #5602

Closed
3 tasks done
BrunoDutertre opened this issue Oct 3, 2024 · 2 comments · Fixed by #5619
Closed
3 tasks done

Cannot derive functional induction principle #5602

BrunoDutertre opened this issue Oct 3, 2024 · 2 comments · Fixed by #5619
Labels
bug Something isn't working

Comments

@BrunoDutertre
Copy link

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

In the following fragment, the functional induction principle for function conc fails to be constructed..

abbrev Word := List Nat
abbrev Alphabet := Nat

inductive Regex where
  | none: Regex

def inter: Regexp → (Word → Prop) := sorry
def concatenate (a b: Word → Prop) : (Word → Prop) := sorry
def eps: Word → Prop := sorry

def conc (a: Array Regex) (i: Nat): Word → Prop :=
  if h: i < a.size then
    concatenate (inter a[i]) (conc a (i + 1))
  else
    eps

#check conc.induct

I get this error:

Failed to realize constant conc.induct:
  Cannot derive functional induction principle (please report this issue)
  
    Function conc not defined via WellFounded.fix:
      ⋯.fix (fun i a_1 => if h : i < a.size then concatenate (inter a[i]) (a_1 (i + 1) ⋯) else eps) i a✝

Versions

4.11.0 (also lean-nightly at live.lean-lang.org)

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

@BrunoDutertre BrunoDutertre added the bug Something isn't working label Oct 3, 2024
@nomeata
Copy link
Contributor

nomeata commented Oct 3, 2024

Thanks for the report! Today is a holiday, but will debug soon after.

@nomeata
Copy link
Contributor

nomeata commented Oct 4, 2024

That was my bad and easy to fix (#5619)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants