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

Restate type alias raises errors #119

Open
sankalpgambhir opened this issue Jan 10, 2023 · 2 comments
Open

Restate type alias raises errors #119

sankalpgambhir opened this issue Jan 10, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@sankalpgambhir
Copy link
Member

A comment here mentions that the type alias is equivalent, but there seems to be some weird casting happening in the background.

def apply(using proof: Library#Proof)(premise: proof.ProofStep | proof.OutsideFact | Int)(bot: Sequent): proof.ProofTacticJudgement =

Consider the following:

val testThm = makeTHM("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") {
    ...
}

val test1 = makeTHM("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") {
    have("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") by Rewrite(thm"testThm")
}

val test2 = makeTHM("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") {
    have("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") by Restate(thm"testThm")
}

test1 compiles and checks through the kernel, while test2 raises a type error:

[error] -- [E134] Type Error: /home/sankalp/projects/lisa/lisa-working2/lisa-examples/src/main/scala/Exercise.scala:31:57 
[error] 31 |    have("'P('x) ⇒ 'P('f('x)) ⊢ 'P('x) ⇒ 'P('f('x))") by Restate(thm"testThm")
[error]    |                                                         ^^^^^^^
[error]    |None of the overloaded alternatives of method apply in object Restate with types
[error]    | (using proof: lisa.utils.Library#Proof)
[error]    |  (premise: proof.ProofStep | proof.OutsideFact | Int)
[error]    |    (bot: lisa.kernel.proof.SequentCalculus.Sequent): proof.ProofTacticJudgement
[error]    | (using proof: lisa.utils.Library#Proof)
[error]    |  (bot: lisa.kernel.proof.SequentCalculus.Sequent): proof.ProofTacticJudgement
[error]    |match arguments (lisa.settheory.SetTheoryLibrary.theory.Theorem)
[error] one error found

For reference, here is the type signature of Rewrite:

def apply(using proof: Library#Proof)(premise: proof.Fact)(bot: Sequent): proof.ProofTacticJudgement = {

@sankalpgambhir sankalpgambhir added the bug Something isn't working label Jan 10, 2023
@SimonGuilloud
Copy link
Collaborator

That's a scala 3 bug. Not much to do about it except finding a work arround.

@sankalpgambhir
Copy link
Member Author

Despite the closing of #120, this one continues to struggle (just tried).

@sankalpgambhir sankalpgambhir self-assigned this Apr 27, 2023
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

No branches or pull requests

2 participants