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

Coq lang #38

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open

Coq lang #38

wants to merge 44 commits into from

Conversation

lucaspena
Copy link
Contributor

No description provided.

prover/build Outdated

# Functional tests
# ----------------

# prover_kore.tests(inputs = glob('t/*.kore'), implicit_inputs = glob('t/definitions/*.kore'), flags = '-cCOMMANDLINE=.CommandLine')
# prover_smt .tests(inputs = glob('t/*.smt2'), flags = '-cCOMMANDLINE=.CommandLine')

prover_coq .tests(inputs = glob('t/*.v'), flags = '-cCOMMANDLINE=.CommandLine')
Copy link
Member

Choose a reason for hiding this comment

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

Let's move each test format to its own directory.

@@ -135,11 +137,13 @@ is to be used for generating fresh variables. *The second variety must be used
only in this scenario*.

```k
syntax Variable ::= VariableName "{" Sort "}" [klabel(sortedVariable)]
syntax Variable ::= VariableName "{" Sort "}" [klabel(sortedVariable)]
syntax SetVariable ::= VariableName "{{" Sort "}}" [klabel(sortedSetVariable)]
Copy link
Member

Choose a reason for hiding this comment

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

Should we be moving away from having the sort attached to the variable if we are moving towards AML?
Maybe we want: syntax SetVariable ::= "#" VariableName, and axiom \implies(#X, Int) as a local declaration (or part of the claim).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will this break any existing tests? It's definitely a change that won't affect anything for the Coq translation though

Copy link
Member

Choose a reason for hiding this comment

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

Since we don't use set variables yet, I don't think anything would break? It should be \typeof(#X, Int) not implies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops sorry, I thought you were talking about all variables. I'll fix this for set variables.

</goals>
<declarations>
<declaration>
axiom \equals ( AndComm , \lambda { A { Term } , B { Term } , H { Term } , .Patterns } \or ( \exists { H0 , H1 , .Patterns } \and ( \equals ( H , conj ( H0 , H1 , .Patterns ) ) , conj ( H1 , H0 , .Patterns ) , .Patterns ) , .Patterns ) )
Copy link
Collaborator

@h0nzZik h0nzZik Feb 6, 2020

Choose a reason for hiding this comment

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

In the current master, axioms in has always names attached: axiom ax0 : \equals[...]. Could you use getFreshGlobalAxiomName() from KORE-HELPERS to generate the names?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, but should we remove the ability to have non-named axioms if we want to make named axioms standard?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should remove it. I will create an issue.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ad named axioms: you forgot to update the test files (*.expected).

Copy link
Member

@nishantjr nishantjr left a comment

Choose a reason for hiding this comment

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

Looks good.

@@ -101,8 +101,8 @@ module COQ
| CoqInductive
// | CoqCoInductive
Copy link
Member

Choose a reason for hiding this comment

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

Any reason to keep these commented lines?

Copy link
Member

@nishantjr nishantjr left a comment

Choose a reason for hiding this comment

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

Looks good. I'm guessing you found a way to do the type checking and infering the type at the same time since you've dropped the (* hasType ... *) syntax

syntax CoqDefinition ::= "Definition" CoqIdent ":=" CoqTerm "(*" "hasType" CoqTerm "*)" "."
| "Definition" CoqIdent CoqBinders ":" CoqTerm ":=" CoqTerm "(*" "hasType" CoqTerm "*)" "."
syntax CoqDefinition ::= "Definition" CoqIdent ":" CoqTerm ":=" CoqTerm "."
// | "Definition" CoqIdent CoqBinders ":" CoqTerm ":=" CoqTerm "."
Copy link
Member

Choose a reason for hiding this comment

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

And here?

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.

3 participants