Top-down evaluation (#177)

When executing a query, only those rules that are used
by the query will be evaluated.

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2024-03-10 19:46:11 -07:00
committed by GitHub
parent 7bc9a50a52
commit 90757210bc
7 changed files with 187 additions and 85 deletions

View File

@@ -72,6 +72,7 @@ fn rego_eval(
// Evaluate query.
let results = engine.eval_query(query, enable_tracing)?;
println!("{}", serde_json::to_string_pretty(&results)?);
#[cfg(feature = "coverage")]
@@ -147,11 +148,11 @@ enum RegorusCommand {
#[arg(long, short)]
trace: bool,
// Non strict execution
/// Perform non-strict evaluation. (default behavior of OPA).
#[arg(long, short)]
non_strict: bool,
// Display coverage information
/// Display coverage information
#[cfg(feature = "coverage")]
#[arg(long, short)]
coverage: bool,