LLZK 2.1.1
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
JSON.cpp File Reference
#include "JSON.h"
#include "Errors.h"
#include "WitgenUtils.h"
#include "WitnessSelection.h"
#include "llzk/Dialect/Felt/IR/Types.h"
#include "llzk/Dialect/POD/IR/Attrs.h"
#include "llzk/Util/Compare.h"
#include <mlir/IR/Operation.h>
#include <llvm/ADT/SmallString.h>
#include <llvm/ADT/TypeSwitch.h>
#include <llvm/Support/FormatVariadic.h>
#include <llvm/Support/MathExtras.h>
#include <llvm/Support/raw_ostream.h>
Include dependency graph for JSON.cpp:

Go to the source code of this file.

Namespaces

namespace  llzk
namespace  llzk::witgen

Functions

llvm::Expected< WitnessValllzk::witgen::parseJSONValue (const llvm::json::Value *json, Type type, const Field &field, Operation *origin)
 Parse a supported LLZK input type from JSON.
llvm::Expected< llvm::json::Value > llzk::witgen::serializeJSONValue (const WitnessVal &value, Type type, SymbolTableCollection &tables, Operation *origin, SerializationMode mode)
 Serialize a supported LLZK runtime value into JSON.
llvm::Expected< llvm::json::Object > llzk::witgen::buildInputsJSONObject (ArrayRef< InputBinding > bindings, ArrayRef< WitnessVal > values, SymbolTableCollection &tables, Operation *origin)
 Serialize named input values into a JSON object.
llvm::Expected< WitnessValllzk::witgen::extractValueAtPath (const WitnessVal &root, Type rootType, ArrayRef< std::string > path, SymbolTableCollection &tables, Operation *origin)
 Extract one nested runtime leaf by path.
void llzk::witgen::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.
void llzk::witgen::printJSONMismatches (llvm::raw_ostream &os, llvm::ArrayRef< JSONMismatch > mismatches)
 Render one human-readable mismatch report.