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

Some basic simplification rules for reals #3305

Merged
merged 3 commits into from
Jun 25, 2024

Conversation

mtzguido
Copy link
Member

@mtzguido mtzguido commented May 23, 2024

There are no primops or simplification rules for reals, which means 1.0R >. 0.0R goes to SMT.

I'm marking this as a draft since it's really some special casing to check for common VCs in Pulse. I could write something more general.. it's just slightly annoying as we have to work with the string representations and make sure we check for canonicity (1.0R vs 01.00R, etc). I wonder if, instead, we should write a library of rational numbers.

mtzguido added a commit to mtzguido/pulse that referenced this pull request May 23, 2024
This enables simplification rules (from
FStarLang/FStar#3305) to kick in, and
potentially significantly reduce the number of queries we send to the
SMT. For instance, for DPE.fst:

Before (595 total queries):
	Verified module: DPE
	All verification conditions discharged successfully
	ramon: end                  Thu May 23 10:25:28 2024
	ramon: root.execname        fstar.exe
	ramon: root.utime           12.940s
	ramon: root.stime           0.160s
	ramon: group.total          139.763s
	ramon: group.utime          139.459s
	ramon: group.stime          0.304s
	ramon: group.mempeak        2181MiB
	ramon: group.pidpeak        4
	ramon: status               exited
	ramon: exitcode             0
	ramon: walltime             139.706s
	ramon: loadavg              1.00

After (448 total queries):
	Verified module: DPE
	All verification conditions discharged successfully
	ramon: end                  Thu May 23 10:31:30 2024
	ramon: root.execname        fstar.exe
	ramon: root.utime           12.550s
	ramon: root.stime           0.130s
	ramon: group.total          110.062s
	ramon: group.utime          109.754s
	ramon: group.stime          0.308s
	ramon: group.mempeak        2094MiB
	ramon: group.pidpeak        4
	ramon: status               exited
	ramon: exitcode             0
	ramon: walltime             110.032s
	ramon: loadavg              1.00

So a 21% speedup. There are more optimizations we could do. The F*
rules in that PR only check for 1.0/0.5/0.0 and decide comparisons
between them.
@mtzguido mtzguido marked this pull request as ready for review June 25, 2024 04:33
@mtzguido
Copy link
Member Author

This is definitely incomplete, but already useful, so I'll merge it.

@mtzguido mtzguido enabled auto-merge June 25, 2024 04:34
@mtzguido mtzguido merged commit b2931df into FStarLang:master Jun 25, 2024
2 checks passed
@mtzguido mtzguido deleted the real_primops branch June 25, 2024 04:43
mtzguido added a commit to mtzguido/pulse that referenced this pull request Jun 25, 2024
This enables simplification rules (from
FStarLang/FStar#3305) to kick in, and
potentially significantly reduce the number of queries we send to the
SMT. For instance, for DPE.fst:

Before (595 total queries):
	Verified module: DPE
	All verification conditions discharged successfully
	ramon: end                  Thu May 23 10:25:28 2024
	ramon: root.execname        fstar.exe
	ramon: root.utime           12.940s
	ramon: root.stime           0.160s
	ramon: group.total          139.763s
	ramon: group.utime          139.459s
	ramon: group.stime          0.304s
	ramon: group.mempeak        2181MiB
	ramon: group.pidpeak        4
	ramon: status               exited
	ramon: exitcode             0
	ramon: walltime             139.706s
	ramon: loadavg              1.00

After (448 total queries):
	Verified module: DPE
	All verification conditions discharged successfully
	ramon: end                  Thu May 23 10:31:30 2024
	ramon: root.execname        fstar.exe
	ramon: root.utime           12.550s
	ramon: root.stime           0.130s
	ramon: group.total          110.062s
	ramon: group.utime          109.754s
	ramon: group.stime          0.308s
	ramon: group.mempeak        2094MiB
	ramon: group.pidpeak        4
	ramon: status               exited
	ramon: exitcode             0
	ramon: walltime             110.032s
	ramon: loadavg              1.00

So a 21% speedup. There are more optimizations we could do. The F*
rules in that PR only check for 1.0/0.5/0.0 and decide comparisons
between them.
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.

None yet

1 participant