-
Notifications
You must be signed in to change notification settings - Fork 16
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
Remove Formula
#327
Merged
NatKarmios
merged 35 commits into
GillianPlatform:master
from
N1ark:no-more-formula-bis
Jan 12, 2025
Merged
Remove Formula
#327
NatKarmios
merged 35 commits into
GillianPlatform:master
from
N1ark:no-more-formula-bis
Jan 12, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
N1ark
commented
Jan 10, 2025
N1ark
commented
Jan 10, 2025
N1ark
commented
Jan 10, 2025
8029b74
to
f3cbb95
Compare
NatKarmios
previously approved these changes
Jan 10, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A big'un! Looks fine overall, nice stuff.
Happy to merge once comments are resolved :)
NatKarmios
approved these changes
Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Partial Changelog:
Formula.t
, usingExpr.t
anywhere it was used:The only difference at this point was a slightly different AST and the fact an
Expr.t
is not always a boolean expression, but it's not actually that big of a deal it seems.The biggest downside I got so far is that it's slightly more verbose:
Eq (e1, e2)
becomesBinOp (e1, Equals, e2)
,Not f
becomesUnOp (Not, e)
, etc.reduce_formula
intoreduce_lexpr
, cleaning up a bit, and removereduce_formula
There are a few rules that I removed, as they do not seem to stop the tests from passing and they caused errors after the merge -- I'll highlight these in the PR, to see if I'm correct in removing them.
BinOp
: renameBAnd
→And
,BOr
→Or
,BImpl
→Impl
,SLessThan
→StrLess
,BSetMem
→SetMem
,BSetSub
→SetSub
UnOp
: renameUNot
→Not
, addIsInt
from Formula#==
,#<
,#&&
...) to remove the hash, becoming==
,<
, etc. This deeply embeds theExpr
operators which I found nicer and also means the operators actually have different precedence! Because all operators starting with#
have the same precedence which made using them annoying due to parenthesis.Formula
now compile asExpr
, meaning that some operators have two equivalent symbols (eg.=
and==
,<#
and<
,/\
and&&
,--e--
and-e-
...)The only difference is that pure formulae must be enclosed in parenthesis, and all other assertions must not be in parenthesis, ie.
pred isTrue(+b: Boolean): b = true;
must becomepred isTrue(+b: Boolean): (b = true);
. This is to allow distinguishing the assertion*
operator from the expression's multiplication. (In reality this change only affected a handful of definitions).vt
,st
andaction_ret
from the signature of the typeSMemory
, since their value was already set anyways (I think this doesn't change anything about the module type?) by usingtype _ := _
instead.