Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define behaviour for empty expressions #370

Merged
merged 2 commits into from
Nov 8, 2024

Conversation

YehorBoiar
Copy link
Contributor

This PR is based on the Chris's and Oz's comment on Teams:

"
Chris:
I'd get existing PRs merged in first, but then it might be worth making a pass over empty constraints, I think (please check essence semantics , and I'm not sure which are implemented yet):

and([]) = true
or([]) = false
sum([]) = 0
product([]) = 1

it's worth getting these right because (from experience), while no-one is likely to write these, they often end up getting created as parts of more interesting expressions.

Oz:
min([]) and max([]) are a bit different, as min([])=x is always false, but this falseness will arise naturally from the fact they will end up turning into an 'and([])' and an 'or([])', and the or will be false, so there is no need to special-case empty min([]) and max([]) (hopefully!)

we can define an abstraction which has a zero vale and an append operator for these.
and is true, /
or is false, /
sum is 0, +
product is 1, *
regarding min and max, we already did a bunch of definedness work with Felix last semester (Soph and Yehor taking over this now)
"

@YehorBoiar YehorBoiar force-pushed the removeNothing branch 2 times, most recently from 2fe3b93 to 4d77c6f Compare October 17, 2024 12:19
@ozgurakgun
Copy link
Contributor

we should also actually remove Nothing, shouldn't we?

@YehorBoiar
Copy link
Contributor Author

YehorBoiar commented Oct 17, 2024

Will do. The reason why we are not deleting it yet is that we want to ensure that all empty rules work before deleting Nothing.

@niklasdewally
Copy link
Collaborator

niklasdewally commented Oct 25, 2024

@YehorBoiar I've just merged some code that checks solutions against Conjure when running ACCEPT=true cargo test.
It might be helpful to update your branch to main and rerun ACCEPT=true cargo test to make sure all this still works.

0c9118b

@YehorBoiar
Copy link
Contributor Author

Okay, thanks.

@YehorBoiar YehorBoiar force-pushed the removeNothing branch 2 times, most recently from fd50fcc to 7e74b8a Compare October 27, 2024 16:14
@YehorBoiar YehorBoiar marked this pull request as ready for review October 28, 2024 14:40
@YehorBoiar YehorBoiar requested a review from ozgurakgun October 28, 2024 14:43
Copy link
Contributor

Choose a reason for hiding this comment

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

in addition to removing nothing you introduce an if let here, why is that?

@@ -46,7 +46,7 @@ use crate::metadata::Metadata;
pub struct Model {
#[serde_as(as = "Vec<(_, _)>")]
pub variables: SymbolTable,
pub constraints: Expression,
pub constraints: Option<Expression>,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be a vector actually, instead of a top level and. then it can be empty if needed.

in fact we should probably have a top level vec of statements, including declarations etc, but we can discuss that later. for this pr, let's make constraints a vector.

@@ -130,10 +132,13 @@ pub fn rewrite_model<'a>(
let apply_optimizations = optimizations_enabled();

let start = std::time::Instant::now();

let default_constraint = Expression::Constant(Metadata::new(), Constant::Int(1));
Copy link
Contributor

Choose a reason for hiding this comment

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

when the top level is a vector we won't need magic values like this one...


Ok(Reduction::pure(new_expr))
}
// #[register_rule(("Base", 8800))]
Copy link
Contributor

Choose a reason for hiding this comment

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

don't comment out code please, just remove it!

crates/conjure_core/src/rules/constant.rs Outdated Show resolved Hide resolved
@@ -1,5 +1,5 @@
{
"constraints": "Nothing",
"constraints": null,
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 always either have true or false instead of null here?

Copy link
Collaborator

@niklasdewally niklasdewally Oct 28, 2024

Choose a reason for hiding this comment

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

FYI: Given that this passes, it seems that null passes through to Minion without erroring: ideally, the Minion solver adaptor shouldn't support null at all. You didn't introduce this functionality, so I don't think fixing it is necessary for this PR.

@YehorBoiar YehorBoiar force-pushed the removeNothing branch 2 times, most recently from bd44406 to bd5c7db Compare October 30, 2024 17:08
@YehorBoiar
Copy link
Contributor Author

YehorBoiar commented Oct 30, 2024

@ozgurakgun @niklasdewally I'm getting this error on rules now, but I don't understand why. Could you help?

mismatched types
expected fn pointer `for<'a, 'b> fn(&'a std::vec::Vec<Expression>, &'b model::Model) -> std::result::Result<_, _>`
      found fn item `for<'a, 'b> fn(&'a Expression, &'b model::Model) -> std::result::Result<_, _> {unwrap_sum}`rustc[Click for full compiler diagnostic](rust-analyzer-diagnostics-view:/diagnostic%20message%20[2]?2#file:///cs/home/yb33/Documents/VIP/conjure-oxide/crates/conjure_core/src/rules/base.rs)

image

@@ -63,7 +63,11 @@ pub struct Reduction {
pub type ApplicationResult = Result<Reduction, ApplicationError>;

impl Reduction {
pub fn new(new_expression: Expression, new_top: Expression, symbols: SymbolTable) -> Self {
pub fn new(
new_expression: Vec<Expression>,
Copy link
Contributor

Choose a reason for hiding this comment

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

@YehorBoiar this shouldn't be a vec. it's the replacement expression, so you want to replace expression with expression. this is probably the reason for the error you are getting.

symbols: SymbolTable::new(),
}
}

/// Represents a reduction that also modifies the symbol table.
pub fn with_symbols(new_expression: Expression, symbols: SymbolTable) -> Self {
pub fn with_symbols(new_expression: Vec<Expression>, symbols: SymbolTable) -> Self {
Copy link
Contributor

Choose a reason for hiding this comment

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

propagate that change here too. we just want to change the constraints in the model (and new_top as well) to be a vec, not everything else.

@ozgurakgun
Copy link
Contributor

just to make sure this is not blocked on me @YehorBoiar ?

@YehorBoiar
Copy link
Contributor Author

@ozgurakgun No, it's not. I was working on it, but got stuck at some point. I decided to take one day off this task and focus on gen_reduce for a little bit. I will start working on it either today's evening or tomorrow morning. I will write more details about the issue in case if I wouldn't resolve it.

Thanks for double checking on me!

@YehorBoiar
Copy link
Contributor Author

When I'm running cargo run or cargo test I'm getting

thread 'coordinator' panicked at /rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/compiler/rustc_codegen_ssa/src/back/write.rs:1676:29:
/rustc/f6e511eec7342f59a25f7c0534f1dbea00d01b14/compiler/rustc_codegen_ssa/src/back/write.rs:1676:29: worker thread panicked
stack backtrace:
   0:     0x7f7025bce6ea - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h304520fd6a30aa07
   1:     0x7f7026419525 - core::fmt::write::hf5713710ce10ff22
   2:     0x7f7027234d91 - std::io::Write::write_fmt::hda708db57927dacf
   3:     0x7f7025bd0dbb - std::panicking::default_hook::{{closure}}::he1ad87607d0c11c5
   4:     0x7f7025bd0a2e - std::panicking::default_hook::h81c8cd2e7c59ee33
   5:     0x7f7024d9a5d7 - std[5204e9590b4985ef]::panicking::update_hook::<alloc[fd15fd9026f491e1]::boxed::Box<rustc_driver_impl[c41f2638408ed175]::install_ice_hook::{closure#0}>>::{closure#0}
   6:     0x7f7025bd16d7 - std::panicking::rust_panic_with_hook::had2118629c312a4a
   7:     0x7f70252f2892 - std[5204e9590b4985ef]::panicking::begin_panic::<alloc[fd15fd9026f491e1]::string::String>::{closure#0}
   8:     0x7f70252ebb76 - std[5204e9590b4985ef]::sys::backtrace::__rust_end_short_backtrace::<std[5204e9590b4985ef]::panicking::begin_panic<alloc[fd15fd9026f491e1]::string::String>::{closure#0}, !>
   9:     0x7f70252dec11 - std[5204e9590b4985ef]::panicking::begin_panic::<alloc[fd15fd9026f491e1]::string::String>
  10:     0x7f70253760bd - rustc_middle[c83967c7761a8780]::util::bug::opt_span_bug_fmt::<rustc_span[233999951ced9cd1]::span_encoding::Span>::{closure#0}
  11:     0x7f702535b11a - rustc_middle[c83967c7761a8780]::ty::context::tls::with_opt::<rustc_middle[c83967c7761a8780]::util::bug::opt_span_bug_fmt<rustc_span[233999951ced9cd1]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  12:     0x7f702535afcb - rustc_middle[c83967c7761a8780]::ty::context::tls::with_context_opt::<rustc_middle[c83967c7761a8780]::ty::context::tls::with_opt<rustc_middle[c83967c7761a8780]::util::bug::opt_span_bug_fmt<rustc_span[233999951ced9cd1]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  13:     0x7f7022be2960 - rustc_middle[c83967c7761a8780]::util::bug::bug_fmt
  14:     0x7f7027273a1a - rustc_codegen_ssa[4b0e0146219e1624]::back::write::start_executing_work::<rustc_codegen_llvm[1041eb84fe8a92c6]::LlvmCodegenBackend>::{closure#5}
  15:     0x7f70272714f7 - std[5204e9590b4985ef]::sys::backtrace::__rust_begin_short_backtrace::<<rustc_codegen_llvm[1041eb84fe8a92c6]::LlvmCodegenBackend as rustc_codegen_ssa[4b0e0146219e1624]::traits::backend::ExtraBackendMethods>::spawn_named_thread<rustc_codegen_ssa[4b0e0146219e1624]::back::write::start_executing_work<rustc_codegen_llvm[1041eb84fe8a92c6]::LlvmCodegenBackend>::{closure#5}, core[d89802b8f5f07590]::result::Result<rustc_codegen_ssa[4b0e0146219e1624]::back::write::CompiledModules, ()>>::{closure#0}, core[d89802b8f5f07590]::result::Result<rustc_codegen_ssa[4b0e0146219e1624]::back::write::CompiledModules, ()>>
  16:     0x7f702727773b - <<std[5204e9590b4985ef]::thread::Builder>::spawn_unchecked_<<rustc_codegen_llvm[1041eb84fe8a92c6]::LlvmCodegenBackend as rustc_codegen_ssa[4b0e0146219e1624]::traits::backend::ExtraBackendMethods>::spawn_named_thread<rustc_codegen_ssa[4b0e0146219e1624]::back::write::start_executing_work<rustc_codegen_llvm[1041eb84fe8a92c6]::LlvmCodegenBackend>::{closure#5}, core[d89802b8f5f07590]::result::Result<rustc_codegen_ssa[4b0e0146219e1624]::back::write::CompiledModules, ()>>::{closure#0}, core[d89802b8f5f07590]::result::Result<rustc_codegen_ssa[4b0e0146219e1624]::back::write::CompiledModules, ()>>::{closure#1} as core[d89802b8f5f07590]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  17:     0x7f7027277d2b - std::sys::pal::unix::thread::Thread::new::thread_start::hcdbd1049068002f4
  18:     0x7f7021689c02 - start_thread
                               at /usr/src/debug/glibc-2.34-100.el9_4.4.x86_64/nptl/pthread_create.c:443:8
  19:     0x7f702170ec40 - clone3
                               at /usr/src/debug/glibc-2.34-100.el9_4.4.x86_64/misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  20:                0x0 - <unknown>

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.82.0 (f6e511eec 2024-10-15) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack

I'm not sure what caused it, and I don't know how to navigate this error message. @ozgurakgun @niklasdewally Do you have any idea how I can fix it?

@niklasdewally
Copy link
Collaborator

niklasdewally commented Nov 3, 2024

error: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.82.0 (f6e511eec 2024-10-15) running on x86_64-unknown-linux-gnu

Seems like a rust bug, nothing to do with you or us....

Maybe try cargo clean and updating rust? Failing that, sending Rust a bug report (with the link above) would be the best move...

@YehorBoiar
Copy link
Contributor Author

YehorBoiar commented Nov 3, 2024

Thanks! cargo clean fixed the issue

@YehorBoiar
Copy link
Contributor Author

Hey! I forgot how to generate a parse, rewrite models when testing essence. Can somebody remind me how to do that? @niklasdewally @Soph1514

@niklasdewally
Copy link
Collaborator

Hey! I forgot how to generate a parse, rewrite models when testing essence. Can somebody remind me how to do that? @niklasdewally @Soph1514

ACCEPT=true cargo test

@YehorBoiar YehorBoiar force-pushed the removeNothing branch 2 times, most recently from 435dc50 to a94ea05 Compare November 4, 2024 15:53
@YehorBoiar
Copy link
Contributor Author

I'm getting in an infinte loop when running tests.
image
Is it because my apply function behaves funny?

@niklasdewally
Copy link
Collaborator

What do the logs say?

@YehorBoiar
Copy link
Contributor Author

I'm getting failures on


failures:

---- tests_integration_eprime_minion_partial_eval_add stdout ----
WARNING: Unimplemented constant eval: SumEq(Metadata { clean: false, etype: None }, [Reference(Metadata { clean: false, etype: None }, UserName("x")), Constant(Metadata { clean: false, etype: None }, Int(10)), Reference(Metadata { clean: false, etype: None }, UserName("y")), Constant(Metadata { clean: false, etype: None }, Int(25))], Constant(Metadata { clean: false, etype: None }, Int(100)))
WARNING: Unimplemented constant eval: SumEq(Metadata { clean: false, etype: None }, [Reference(Metadata { clean: false, etype: None }, UserName("x")), Reference(Metadata { clean: false, etype: None }, UserName("y"))], Constant(Metadata { clean: false, etype: None }, Int(65)))
Building Minion model...
Running Minion...
Error: ConjureSolutionsError("expected value at line 6 column 1")

---- tests_integration_eprime_minion_partial_eval_01_add stdout ----
WARNING: Unimplemented constant eval: SumEq(Metadata { clean: false, etype: None }, [Reference(Metadata { clean: false, etype: None }, UserName("x")), Constant(Metadata { clean: false, etype: None }, Int(10)), Reference(Metadata { clean: false, etype: None }, UserName("y")), Constant(Metadata { clean: false, etype: None }, Int(25))], Constant(Metadata { clean: false, etype: None }, Int(100)))
WARNING: Unimplemented constant eval: SumEq(Metadata { clean: false, etype: None }, [Reference(Metadata { clean: false, etype: None }, UserName("x")), Reference(Metadata { clean: false, etype: None }, UserName("y"))], Constant(Metadata { clean: false, etype: None }, Int(65)))
Building Minion model...
Running Minion...
Error: ConjureSolutionsError("expected value at line 6 column 1")

I suspect that the reason for that is the fact that I deleted the rule that removes nothings. However, I tried to rewrite it to this, and it only made things worse (even less tests were passing and the results were chaotic)

/// Remove empty Ands from expressions:
/// ```text
/// and([a, And([], ...), b]) = and([a, b])
/// sum([a, And([], ...), b]) = sum([a, b])
/// sum_leq([a, And([], ...), b], c) = sum_leq([a, b], c)
/// ...
/// ```
#[register_rule(("Base", 8800))]
fn remove_empty_ands(expr: &Expression, _: &Model) -> ApplicationResult {
    fn filter_empty_ands(exprs: Vec<Expression>) -> Result<Vec<Expression>, ApplicationError> {
        let mut changed = false;
        let mut new_exprs = Vec::new();

        for e in exprs {
            match e.clone() {
                Expression::And(_, ref sub_exprs) if sub_exprs.is_empty() => {
                    changed = true;
                }
                _ => new_exprs.push(e),
            }
        }

        if changed {
            Ok(new_exprs)
        } else {
            Err(ApplicationError::RuleNotApplicable)
        }
    }

    fn get_lhs_rhs(sub: Vec<Expression>) -> (Vec<Expression>, Box<Expression>) {
        if sub.is_empty() {
            return (Vec::new(), Box::new(Expression::And(Metadata::new(), Vec::new())));
        }

        let lhs = sub[..(sub.len() - 1)].to_vec();
        let rhs = Box::new(sub[sub.len() - 1].clone());
        (lhs, rhs)
    }

    let new_sub = filter_empty_ands(expr.children().into_iter().collect())?;

    match expr {
        Expression::And(md, _) => Ok(Reduction::pure(Expression::And(md.clone(), new_sub))),
        Expression::Or(md, _) => Ok(Reduction::pure(Expression::Or(md.clone(), new_sub))),
        Expression::Sum(md, _) => Ok(Reduction::pure(Expression::Sum(md.clone(), new_sub))),
        Expression::SumEq(md, _, _) => {
            let (lhs, rhs) = get_lhs_rhs(new_sub);
            Ok(Reduction::pure(Expression::SumEq(md.clone(), lhs, rhs)))
        }
        Expression::SumLeq(md, _, _) => {
            let (lhs, rhs) = get_lhs_rhs(new_sub);
            Ok(Reduction::pure(Expression::SumLeq(md.clone(), lhs, rhs)))
        }
        Expression::SumGeq(md, _, _) => {
            let (lhs, rhs) = get_lhs_rhs(new_sub);
            Ok(Reduction::pure(Expression::SumGeq(md.clone(), lhs, rhs)))
        }
        _ => Err(ApplicationError::RuleNotApplicable),
    }
}

@niklasdewally Do you think that it is the reason why we currently fail, or it could be something else in my implementation that went wrong?

@YehorBoiar YehorBoiar marked this pull request as draft November 7, 2024 15:55
@niklasdewally
Copy link
Collaborator

niklasdewally commented Nov 7, 2024

Error: ConjureSolutionsError("expected value at line 6 column 1")

This is an error to do with reading the solutions against json output from Conjure, which happens after we run the model through oxide.

Try to conjure solve the failing test manually, and see what happens.
Otherwise, we can stick this in a debugger and see exactly where this error comes from.

@niklasdewally
Copy link
Collaborator

niklasdewally commented Nov 7, 2024

If you still suspect a rule issue, it might help to update your branch against main, as I have recently improved our logging output:

 RUST_LOG=TRACE cargo run -- --verbose <path-to>/input.essence

@YehorBoiar
Copy link
Contributor Author

Sorry, for bother, I run the same script on my own machine, and it worked just fine. All tests are being passed. Please review @ozgurakgun

@YehorBoiar YehorBoiar requested a review from ozgurakgun November 7, 2024 19:36
@YehorBoiar YehorBoiar marked this pull request as ready for review November 7, 2024 19:36
Copy link
Contributor

@ozgurakgun ozgurakgun left a comment

Choose a reason for hiding this comment

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

a few comments for you

@YehorBoiar YehorBoiar force-pushed the removeNothing branch 3 times, most recently from c85e827 to e9423aa Compare November 8, 2024 17:01
@YehorBoiar YehorBoiar requested a review from ozgurakgun November 8, 2024 17:02
Copy link
Collaborator

@niklasdewally niklasdewally left a comment

Choose a reason for hiding this comment

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

@YehorBoiar you should update this branch to main; there are some merge conflicts due to f931a3d

For now, we would treat top as Expression::And(Metadata::new, Vec::new())
Copy link
Contributor

github-actions bot commented Nov 8, 2024

Code and Documentation Coverage Report

Documentation Coverage

Click to view documentation coverage for this PR
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| crates/conjure_macros/src/lib.rs    |          2 |      66.7% |          1 |      33.3% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          2 |      66.7% |          1 |      33.3% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...m_compatability_macro/src/lib.rs |          2 |     100.0% |          1 |      50.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          2 |     100.0% |          1 |      50.0% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| solvers/kissat/src/lib.rs           |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| solvers/minion/src/ast.rs           |         11 |      11.0% |          0 |       0.0% |
| solvers/minion/src/error.rs         |          8 |     100.0% |          0 |       0.0% |
| solvers/minion/src/lib.rs           |          1 |     100.0% |          1 |     100.0% |
| solvers/minion/src/run.rs           |          2 |     100.0% |          1 |     100.0% |
| solvers/minion/src/wrappers.rs      |          1 |     100.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |         23 |      20.5% |          2 |      11.8% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| .../conjure_core/src/ast/domains.rs |          0 |       0.0% |          0 |       0.0% |
| ...jure_core/src/ast/expressions.rs |         23 |      92.0% |          0 |       0.0% |
| ...s/conjure_core/src/ast/factor.rs |          1 |      33.3% |          0 |       0.0% |
| ...conjure_core/src/ast/literals.rs |          1 |      33.3% |          0 |       0.0% |
| crates/conjure_core/src/ast/mod.rs  |          0 |       0.0% |          0 |       0.0% |
| ...ure_core/src/ast/symbol_table.rs |          0 |       0.0% |          0 |       0.0% |
| ...es/conjure_core/src/ast/types.rs |          0 |       0.0% |          0 |       0.0% |
| ...onjure_core/src/ast/variables.rs |          1 |      50.0% |          0 |       0.0% |
| crates/conjure_core/src/bug.rs      |          1 |      50.0% |          1 |      50.0% |
| crates/conjure_core/src/context.rs  |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/error.rs    |          1 |      14.3% |          0 |       0.0% |
| crates/conjure_core/src/lib.rs      |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/metadata.rs |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/model.rs    |          2 |      12.5% |          0 |       0.0% |
| ...core/src/parse/example_models.rs |          2 |     100.0% |          0 |       0.0% |
| ...es/conjure_core/src/parse/mod.rs |          0 |       0.0% |          0 |       0.0% |
| ...re_core/src/parse/parse_model.rs |          0 |       0.0% |          0 |       0.0% |
| ...jure_core/src/rule_engine/mod.rs |          5 |      71.4% |          5 |      71.4% |
| ...src/rule_engine/resolve_rules.rs |          3 |     100.0% |          0 |       0.0% |
| ..._core/src/rule_engine/rewrite.rs |          2 |      66.7% |          0 |       0.0% |
| ...ure_core/src/rule_engine/rule.rs |          3 |      25.0% |          1 |     100.0% |
| ...core/src/rule_engine/rule_set.rs |          4 |     100.0% |          0 |       0.0% |
| ...conjure_core/src/rules/checks.rs |          1 |      50.0% |          0 |       0.0% |
| ...njure_core/src/rules/constant.rs |          1 |     100.0% |          0 |       0.0% |
| ...es/conjure_core/src/rules/mod.rs |          1 |     100.0% |          0 |       0.0% |
| ...re/src/solver/adaptors/kissat.rs |          1 |     100.0% |          0 |       0.0% |
| ...re/src/solver/adaptors/minion.rs |          1 |     100.0% |          0 |       0.0% |
| ..._core/src/solver/adaptors/mod.rs |          1 |     100.0% |          0 |       0.0% |
| ...s/conjure_core/src/solver/mod.rs |         14 |      33.3% |          1 |       4.2% |
| ...ore/src/solver/model_modifier.rs |          7 |      70.0% |          0 |       0.0% |
| ...onjure_core/src/solver/states.rs |          7 |      63.6% |          0 |       0.0% |
| ...es/conjure_core/src/stats/mod.rs |          0 |       0.0% |          0 |       0.0% |
| ...core/src/stats/rewriter_stats.rs |          1 |      20.0% |          0 |       0.0% |
| ...e_core/src/stats/solver_stats.rs |          3 |      37.5% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |         87 |      40.8% |          8 |       9.6% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| conjure_oxide/src/defaults.rs       |          1 |      50.0% |          0 |       0.0% |
| conjure_oxide/src/find_conjure.rs   |          1 |      50.0% |          0 |       0.0% |
| conjure_oxide/src/lib.rs            |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/conjure.rs  |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/json.rs     |          2 |      66.7% |          0 |       0.0% |
| conjure_oxide/src/utils/misc.rs     |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/mod.rs      |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/testing.rs  |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          4 |      12.9% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
Click to view documentation coverage for main
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| crates/conjure_macros/src/lib.rs    |          2 |      66.7% |          1 |      33.3% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          2 |      66.7% |          1 |      33.3% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...m_compatability_macro/src/lib.rs |          2 |     100.0% |          1 |      50.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          2 |     100.0% |          1 |      50.0% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| solvers/kissat/src/lib.rs           |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| solvers/minion/src/ast.rs           |         11 |      11.0% |          0 |       0.0% |
| solvers/minion/src/error.rs         |          8 |     100.0% |          0 |       0.0% |
| solvers/minion/src/lib.rs           |          1 |     100.0% |          1 |     100.0% |
| solvers/minion/src/run.rs           |          2 |     100.0% |          1 |     100.0% |
| solvers/minion/src/wrappers.rs      |          1 |     100.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |         23 |      20.5% |          2 |      11.8% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| .../conjure_core/src/ast/domains.rs |          0 |       0.0% |          0 |       0.0% |
| ...jure_core/src/ast/expressions.rs |         24 |      92.3% |          0 |       0.0% |
| ...s/conjure_core/src/ast/factor.rs |          1 |      33.3% |          0 |       0.0% |
| ...conjure_core/src/ast/literals.rs |          1 |      33.3% |          0 |       0.0% |
| crates/conjure_core/src/ast/mod.rs  |          0 |       0.0% |          0 |       0.0% |
| ...ure_core/src/ast/symbol_table.rs |          0 |       0.0% |          0 |       0.0% |
| ...es/conjure_core/src/ast/types.rs |          0 |       0.0% |          0 |       0.0% |
| ...onjure_core/src/ast/variables.rs |          1 |      50.0% |          0 |       0.0% |
| crates/conjure_core/src/bug.rs      |          1 |      50.0% |          1 |      50.0% |
| crates/conjure_core/src/context.rs  |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/error.rs    |          1 |      14.3% |          0 |       0.0% |
| crates/conjure_core/src/lib.rs      |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/metadata.rs |          0 |       0.0% |          0 |       0.0% |
| crates/conjure_core/src/model.rs    |          2 |      12.5% |          0 |       0.0% |
| ...core/src/parse/example_models.rs |          2 |     100.0% |          0 |       0.0% |
| ...es/conjure_core/src/parse/mod.rs |          0 |       0.0% |          0 |       0.0% |
| ...re_core/src/parse/parse_model.rs |          0 |       0.0% |          0 |       0.0% |
| ...jure_core/src/rule_engine/mod.rs |          5 |      71.4% |          5 |      71.4% |
| ...src/rule_engine/resolve_rules.rs |          3 |     100.0% |          0 |       0.0% |
| ..._core/src/rule_engine/rewrite.rs |          2 |      66.7% |          0 |       0.0% |
| ...ure_core/src/rule_engine/rule.rs |          3 |      25.0% |          1 |     100.0% |
| ...core/src/rule_engine/rule_set.rs |          4 |     100.0% |          0 |       0.0% |
| ...conjure_core/src/rules/checks.rs |          1 |      50.0% |          0 |       0.0% |
| ...njure_core/src/rules/constant.rs |          1 |     100.0% |          0 |       0.0% |
| ...es/conjure_core/src/rules/mod.rs |          1 |     100.0% |          0 |       0.0% |
| ...re/src/solver/adaptors/kissat.rs |          1 |     100.0% |          0 |       0.0% |
| ...re/src/solver/adaptors/minion.rs |          1 |     100.0% |          0 |       0.0% |
| ..._core/src/solver/adaptors/mod.rs |          1 |     100.0% |          0 |       0.0% |
| ...s/conjure_core/src/solver/mod.rs |         14 |      33.3% |          1 |       4.2% |
| ...ore/src/solver/model_modifier.rs |          7 |      70.0% |          0 |       0.0% |
| ...onjure_core/src/solver/states.rs |          7 |      63.6% |          0 |       0.0% |
| ...es/conjure_core/src/stats/mod.rs |          0 |       0.0% |          0 |       0.0% |
| ...core/src/stats/rewriter_stats.rs |          1 |      20.0% |          0 |       0.0% |
| ...e_core/src/stats/solver_stats.rs |          3 |      37.5% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |         88 |      41.1% |          8 |       9.6% |
+-------------------------------------+------------+------------+------------+------------+
+-------------------------------------+------------+------------+------------+------------+
| File                                | Documented | Percentage |   Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| conjure_oxide/src/defaults.rs       |          1 |      50.0% |          0 |       0.0% |
| conjure_oxide/src/find_conjure.rs   |          1 |      50.0% |          0 |       0.0% |
| conjure_oxide/src/lib.rs            |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/conjure.rs  |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/json.rs     |          2 |      66.7% |          0 |       0.0% |
| conjure_oxide/src/utils/misc.rs     |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/mod.rs      |          0 |       0.0% |          0 |       0.0% |
| conjure_oxide/src/utils/testing.rs  |          0 |       0.0% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total                               |          4 |      12.9% |          0 |       0.0% |
+-------------------------------------+------------+------------+------------+------------+

Code Coverage Summary

This PR: Detailed Report

  lines......: 73.8% (3224 of 4370 lines)
  functions..: 42.8% (374 of 874 functions)
  branches...: no data found

Main: Detailed Report

  lines......: 73.2% (3230 of 4410 lines)
  functions..: 42.9% (378 of 881 functions)
  branches...: no data found

Coverage Main & PR Coverage Change

Lines coverage changed by 0.60% and covered lines changed by -6
Functions coverage changed by -0.10% and covered lines changed by -4
Branches... coverage: No comparison data available

@ozgurakgun ozgurakgun merged commit efc68bb into conjure-cp:main Nov 8, 2024
8 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