15#include <llvm/Support/Error.h>
16#include <llvm/Support/JSON.h>
34 const llvm::json::Value *json, mlir::Type type,
const llzk::Field &field,
35 mlir::Operation *origin
40 const WitnessVal &value, mlir::Type type, mlir::SymbolTableCollection &tables,
46 llvm::ArrayRef<InputBinding> bindings, llvm::ArrayRef<WitnessVal> values,
47 mlir::SymbolTableCollection &tables, mlir::Operation *origin
52 const WitnessVal &root, mlir::Type rootType, llvm::ArrayRef<std::string> path,
53 mlir::SymbolTableCollection &tables, mlir::Operation *origin
58 const llvm::json::Value &expected,
const llvm::json::Value &actual,
59 llvm::SmallVectorImpl<JSONMismatch> &out, llvm::StringRef path =
"$"
Information about the prime finite field used for the interval analysis.
llvm::Expected< llvm::json::Object > buildInputsJSONObject(ArrayRef< InputBinding > bindings, ArrayRef< WitnessVal > values, SymbolTableCollection &tables, Operation *origin)
Serialize named input values into a JSON object.
llvm::Expected< llvm::json::Value > serializeJSONValue(const WitnessVal &value, Type type, SymbolTableCollection &tables, Operation *origin, SerializationMode mode)
Serialize a supported LLZK runtime value into JSON.
llvm::Expected< WitnessVal > extractValueAtPath(const WitnessVal &root, Type rootType, ArrayRef< std::string > path, SymbolTableCollection &tables, Operation *origin)
Extract one nested runtime leaf by path.
void diffJSON(const llvm::json::Value &expected, const llvm::json::Value &actual, llvm::SmallVectorImpl< JSONMismatch > &out, llvm::StringRef path)
Compare two JSON values structurally and append any mismatches to out.
SerializationMode
Select how struct values are filtered during JSON serialization.
llvm::Expected< WitnessVal > parseJSONValue(const llvm::json::Value *json, Type type, const Field &field, Operation *origin)
Parse a supported LLZK input type from JSON.
void printJSONMismatches(llvm::raw_ostream &os, llvm::ArrayRef< JSONMismatch > mismatches)
Render one human-readable mismatch report.
std::variant< std::monostate, bool, int64_t, llvm::DynamicAPInt, ArrayValueRef, PodValueRef, StructValueRef > WitnessVal
Runtime value representation used by the tool-local interpreter.
One structured JSON mismatch between expected and actual witgen output.