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

Types are separated from terms #263

Merged
merged 32 commits into from
Oct 8, 2024
Merged

Types are separated from terms #263

merged 32 commits into from
Oct 8, 2024

Conversation

FissoreD
Copy link
Collaborator

@FissoreD FissoreD commented Sep 4, 2024

  • Change the parser: modes and type are parsed and stored in a unique data structure
    • The new syntax pred map i:list A, i:(pred i:A, o:B), o:list B. allows to know modes for the anonymous predicate passed to the map relation symbol
    • A type signature should not allow the discard operator, e.g. pred p i:_ is forbidden
    • A type signature should work only with known types, e.g. pred p i:a where a is not defined is an invalid type declaration for the predicate p
    • It should be invalid to use the syntax type p a1 -> ... -> an if an is prop or o. In this case we should use the pred syntax NOPE
    • Proposition of @gares : use the syntax ttype r1 pred i:(pred i:A, i:B, i:C), i:A, i:B, o:C. for type definition

COMING:

  • Typechecking in ocaml instead of elpi (use Coppo-Denzani algo)
  • Mode checking by looking at the flow of input/output arguments of predicates
    • if an atom is in negative position input are ground and outputs are set to ground,
    • if an atom is in positive position then inputs are set ground and outputs are checked for groundness after the check of the premises.
    • check for HO predicates passed to HO symbols like map
  • Functionality that guarantee that a functional predicate remains functional after the insertion of new clauses with same relation symbols
    • Non overlapping rules
    • If two rules overlap then the first should have a bang
    • Every negative literal which is not in a functional context (a literal not followed by a bang) should be functional so that the rules keep its relation symbol functional
    • Pay attention of locally charged rules (with =>) this could influence the functionality of the predicate

@FissoreD FissoreD force-pushed the functionality branch 3 times, most recently from 2a34228 to b5f7f09 Compare September 23, 2024 15:29
@FissoreD FissoreD changed the title Pass mode and functionality to the typechecker Mode checking and functionality Oct 2, 2024
@FissoreD FissoreD changed the title Mode checking and functionality [mode-checking+functionality] Oct 2, 2024
Copy link
Collaborator Author

@FissoreD FissoreD left a comment

Choose a reason for hiding this comment

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

A list of todo

@FissoreD FissoreD marked this pull request as ready for review October 7, 2024 10:42
@FissoreD FissoreD changed the title [mode-checking+functionality] Type are separated fro terms Oct 7, 2024
@FissoreD FissoreD changed the title Type are separated fro terms Type are separated from terms Oct 7, 2024
@FissoreD FissoreD changed the title Type are separated from terms Types are separated from terms Oct 7, 2024
@gares gares merged commit 5739f28 into LPCIC:master Oct 8, 2024
9 checks passed
@FissoreD FissoreD deleted the functionality branch October 8, 2024 13:59
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.

2 participants