Skip to content

Conversation

@ajreynol
Copy link
Member

@ajreynol ajreynol commented May 27, 2025

Also adds a test to confirm that the builtin operators behave as the builtin ones, based on the examples from the user manual.

It also makes the contents of this regression part of the user manual.

Copy link
Collaborator

@hansjoergschurr hansjoergschurr left a comment

Choose a reason for hiding this comment

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

I think it would be great to have some tests that test that the builtin operators are equivalent to the definition.

@ajreynol ajreynol changed the title Add regression corresponding to draft of standard definitions of list operators Add draft of standard definitions of list operators to user manual and as a regression May 29, 2025
@ajreynol ajreynol added this to the cvc5 1.2.2 milestone May 29, 2025
@ajreynol ajreynol removed this from the cvc5 1.2.2 milestone Jun 14, 2025
@ajreynol
Copy link
Member Author

ajreynol commented Jul 8, 2025

@hansjoergschurr this is now updated to contain list_diff and list_inter.

Copy link
Collaborator

@hansjoergschurr hansjoergschurr left a comment

Choose a reason for hiding this comment

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

This is great. However, I think it would be better to not repeat the definitions in the manual and in the test file.
Maybe we need to make the testing infrastructure more general to not have everything in test/?

definition `$eo_X` in the following signature.
Including this signature and modifying a Eunoia
file to use `$eo_` instead of `eo::` should
have no impact on behavior (apart from performance), unless otherwise noted.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should refer to the encoding file here instead of including the definitions. Otherwise, the files will inadvertently diverge.
I think that the comments about the lists operators that only show up after a long list of definitions will be missed by many readers.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I agree. I'll refactor this.

; Returns true if t and s are equivalent values (ground and fully evaluated).
; define: $eo_is_eq
; implements: eo::is_eq
(define $eo_is_eq ((T Type :implicit) (S Type :implicit) (t T) (s S))
Copy link
Collaborator

Choose a reason for hiding this comment

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

one small thing: the documentation says these are Eunoia programs, but most here are define i.e., macros. Maybe the documentation should say that it's either.


;;; $eo_cmp

; An arbitrary deterministic comparison of terms. Returns true if a > b based
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should be very precise about the assumptions here.
IIRC this ordering can be different from run to run?

Copy link
Member Author

Choose a reason for hiding this comment

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

This definition is accurate, but the documentation indeed is a bit misleading. Saying "arbitrary" here summarizes the behavior, but indeed it isn't arbitrary: it is determined by eo::hash. I'll update the doc.

@ajreynol
Copy link
Member Author

I've addressed the review, PTAL

Copy link
Collaborator

@hansjoergschurr hansjoergschurr left a comment

Choose a reason for hiding this comment

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

Looks great 📑

@ajreynol ajreynol merged commit 7761fee into main Oct 24, 2025
24 checks passed
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.

3 participants