Skip to content

Conversation

@ZippeyKeys12
Copy link
Collaborator

@ZippeyKeys12 ZippeyKeys12 commented Dec 3, 2025

Closes #461

Addresses the four uses:

Internals only used for runtime checking of CN stuff

  • fulminate/internals.h

Functions and types for evaluating CN pure terms

  • cn-executable/eval.h

Functions used by users

  • fulminate/user.h

Callbacks for use by testing

  • fulminate/api.h

Note: This doesn't really clean up the *.c files

@ZippeyKeys12 ZippeyKeys12 added the Fulminate Related to CN executable spec generation, called using `cn instrument` label Dec 3, 2025
@ZippeyKeys12 ZippeyKeys12 force-pushed the clarify-fulminate-api branch 3 times, most recently from 3d98971 to d1ba26d Compare December 4, 2025 02:43
Copy link
Contributor

@rbanerjee20 rbanerjee20 left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me, bar the comments/questions I've left. Thanks for doing this - the single utils.h file had become quite unruly

#include "rts_deps.h"
#include "stack.h"

#define fallthrough __attribute__((__fallthrough__))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we still need this file at all?

#define alignof _Alignof

#define bool _Bool
#define true 1
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to clean up this file too (@pqwy and I discussed it at length a few months ago) but I'm happy to leave that to be in another PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You should be able to edit this PR and make whatever changes you want


/* Signed bitvectors */

typedef struct cn_bits_i8 {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd probably prefer there to be a different header for the type definitions (e.g. fulminate/ghost_types.h), which gets included in this header, and then the rest can make up eval.h

Copy link
Contributor

Choose a reason for hiding this comment

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

(if that works)

@@ -0,0 +1,426 @@
#ifndef CN_EVAL_H
Copy link
Contributor

Choose a reason for hiding this comment

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

and minor question, but why is this under cn-executable and not fulminate?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've been thinking of Fulminate as the instrumentation, while the stuff in eval.h is the ability to evaluate pure CN terms.

From the testing's perspective, the instrumentation is not necessary, but rather a stronger oracle, whereas evaluating pure CN terms is necessary. In the future, testing will support being run without the instrumentation, but will still require the stuff in cn-executable.

For the counterexample program synthesis prototype, it needs to be able to evaluate CN terms, but instrumentation is unrelated.

void cn_pop_msg_info(void);

void cn_assert(cn_bool* cn_b, enum spec_mode spec_mode);

Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't this morally also include the CN_LOAD, CN_STORE etc macros?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Callbacks for use by testing

fulminate/api.h

Why would we want to expose those to testing frameworks? Excluding them is the main motivator for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Fulminate Related to CN executable spec generation, called using `cn instrument`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Fulminate] Clarify Fulminate API

2 participants