Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Proposal for proof language #87

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Proposal for proof language #87

wants to merge 5 commits into from

Conversation

nishantjr
Copy link
Contributor

No description provided.

proof-language.md Outdated Show resolved Hide resolved
abstract def well_formed:
...

abstract class Pattern(Term):
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe consider adding Contexts that should have the distinguished hole variable check, as we discussed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I recall what we discussed. MetaVars already have an application_context field that is used for this check.

proof-language.md Outdated Show resolved Hide resolved
* Supporting:

`List n:uint32`
: Consume $n$ items from the stack, and push a list containing those items to the stack.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add the explanation we discussed, please.


* Variables and Symbols:

`EVar <uint32>`
Copy link
Contributor

@fiedlr fiedlr Jul 13, 2023

Choose a reason for hiding this comment

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

Let's think about whether this should pop from the stack instead (adding this comment just for reference).


# Meta-requirements that must be satisfied by any instantiation.
fresh: list[EVar | SVar] # variables that must not occur in an instatiation
positive: list[SVar] # variables that must only occur positively in an instatiation
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't at least positive, negative rather be in Pattern? Pattern also have positive/negative occurrences of variables, there's little reason why we should compute them. These could also be actual references in the concrete pattern.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I follow. For concrete patterns, we don't need additional metadata to know whether something is positive or negative. We can just look at the term and check. For metavariables, that is not the case, since we cannot see "inside" the metavariable.

Note that a smart implementation, may keep track of positivity/negativity track in a clever way. That is not our concern here. This is not an implementation, its a specification of the language.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, it's a specification. I was pointing more to the current python implementation.

It is a bit redundant if you can hold direct references to them. Especially later on when we want to do substitutions more efficiently. But sure, we can do optimizations later.

name: int
fresh: tuple[EVar | SVar, ...]
positive: tuple[SVar, ...]
negative: tuple[SVar, ...]
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have both 'positive' and 'negative', when an occurrence of a variable can only be either positive or negative? Is this for performance reasons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We need both to be able to prove the other, since they are only defined mutually. Note that a variable meets both positivity and negativity if it does not occur at all.

Copy link
Contributor

Choose a reason for hiding this comment

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

So if it's in both, it does not occur, if it is in one of them, it is positive/negative, and if it is in neither of them, then it is undefined?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants