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

Predicate solving #8

Open
Cypher1 opened this issue Oct 1, 2018 · 0 comments
Open

Predicate solving #8

Cypher1 opened this issue Oct 1, 2018 · 0 comments
Labels
compiler Related to semantic checking and code generation enhancement New feature or request help wanted Extra attention is needed

Comments

@Cypher1
Copy link
Owner

Cypher1 commented Oct 1, 2018

Is your feature request related to a problem? Please describe.
Current triples can only be combined when their preconditions and postconditions match.
These matches are unnecessarily restrictive and do not support rewriting or reasoning.

Describe the solution you'd like
I propose that conditions be 'solved' rather than simply checked, using a search based rewriting strategy similar to Prolog's query resolution algorithm.
This should allow expressive pre+post-conditions that can express more clearly the requirements that a function has without requiring users to manually promise that things are safe (without any actual checking).

Describe alternatives you've considered
One alternative would be having Coq style expressions that are added in the process of 'merging' two triples that mutate the pre/post conditions until there is a match or a failure. This would lead to writing proofs that functions could be run in others contexts which may be hard to reason about.

Also, Coq already does this quite well.

I have yet to find another alternative.

Additional context

Unfortunately this requires the addition of 'unknown variables' or placeholders that are not explicitly specified and inference rules for resolving predicates. This complicates the symbol and predicate models.

e.g. {?x, ?y, ?z, isa, ?x isa ?y, ?y isa ?z}[]{?x isa ?z} allows the program to reason about the isa relationship.

@Cypher1 Cypher1 added enhancement New feature or request help wanted Extra attention is needed labels Oct 1, 2018
@Cypher1 Cypher1 added the compiler Related to semantic checking and code generation label May 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Related to semantic checking and code generation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant