Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

replace borrow with theory expression #94

Merged
merged 1 commit into from
Jul 17, 2020
Merged

replace borrow with theory expression #94

merged 1 commit into from
Jul 17, 2020

Conversation

aep
Copy link
Collaborator

@aep aep commented Jul 17, 2020

a theory can now finally contain an expression body

pub theory small(x) -> bool (x < 10)

borrow is now deprecated and will eventually be completely removed.
to carry type state, simply use expressive theories

pub dothings(int mut * x)
    where small(*x)
    model small(*x)

this change also rewrites string using integrity theories

string is renamed to buffer, to make the name string available for a unicode implementation.
buffer holds null terminated data, which may be something not a string.

this change also rewrites slice using integrity theories

mut_slice should now be passed by by value rather than pointer.
the state is internally held as pointer.
this makes the api more composable.

@aep aep requested a review from jwerle July 17, 2020 15:58
@jwerle
Copy link
Member

jwerle commented Jul 17, 2020

this is huge!

@aep aep force-pushed the theory_expr branch 2 times, most recently from 1a05686 to 7bc64d1 Compare July 17, 2020 16:32
a theory can now finally contain an expression body

    pub theory small(x) -> bool (x < 10)

borrow is now deprecated and will eventually be completely removed.
to carry type state, simply use expressive theories

    pub dothings(int mut * x)
        where small(*x)
        model small(*x)

this change also rewrites string using integrity theories:

    string is renamed to buffer,
    to make the name string available for a unicode implementation.
    buffer holds null terminated data, which may be something not a string.

this change also rewrites slice using integrity theories:

    mut_slice should now be passed by by value rather than pointer.
    the state is internally held as pointer.
    this makes the api more composable.
Copy link
Member

@jwerle jwerle left a comment

Choose a reason for hiding this comment

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

nice 👍 buffer makes way more sense. Do you intend to implement string again?

@jwerle jwerle added the enhancement New feature or request label Jul 17, 2020
@aep aep merged commit 64023b9 into master Jul 17, 2020
@aep aep deleted the theory_expr branch July 17, 2020 18:09
@aep
Copy link
Collaborator Author

aep commented Jul 17, 2020

Do you intend to implement string again?

@jwerle no. i dont have time to implement unicode support. if someone else wants to contribute that, that would be great of course. (#44)

@jwerle
Copy link
Member

jwerle commented Jul 17, 2020

@aep I'll take a look! I did some stuff over here before: https://github.com/jwerle/libutf8

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

Successfully merging this pull request may close these issues.

2 participants