cozodb / cozo

A transactional, relational-graph-vector database that uses Datalog for query. The hippocampus for AI!
https://cozodb.org
Mozilla Public License 2.0
3.36k stars 100 forks source link

thread 'main' panicked at \cozo-0.7.6\src\query\logical.rs:204:46: called `Option::unwrap()` on a `None` value #265

Closed DrAlta closed 3 months ago

DrAlta commented 3 months ago

here's the full backtrace

thread 'main' panicked at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\query\logical.rs:204:46:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\std\src\panicking.rs:647
   1: core::panicking::panic_fmt
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\panicking.rs:72
   2: core::panicking::panic
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\panicking.rs:144
   3: core::option::unwrap_failed
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library\core\src\option.rs:1978
   4: enum2$<core::option::Option<enum2$<core::result::Result<cozo::query::logical::Disjunction,miette::eyreish::Report> > > >::unwrap
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\option.rs:931
   5: enum2$<cozo::data::program::InputAtom>::do_disjunctive_normal_form
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\query\logical.rs:204
   6: enum2$<cozo::data::program::InputAtom>::disjunctive_normal_form
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\query\logical.rs:135
   7: cozo::data::program::InputProgram::into_normalized_program
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\data\program.rs:644
   8: cozo::runtime::db::Db<cozo::storage::mem::MemStorage>::run_query<cozo::storage::mem::MemStorage>
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\runtime\db.rs:1485
   9: cozo::runtime::db::Db<cozo::storage::mem::MemStorage>::execute_single_program<cozo::storage::mem::MemStorage>
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\runtime\db.rs:870
  10: cozo::runtime::db::Db<cozo::storage::mem::MemStorage>::execute_single<cozo::storage::mem::MemStorage>
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\runtime\db.rs:930
  11: cozo::runtime::db::Db<cozo::storage::mem::MemStorage>::do_run_script<cozo::storage::mem::MemStorage>
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\runtime\db.rs:892
  12: cozo::runtime::db::Db<cozo::storage::mem::MemStorage>::run_script<cozo::storage::mem::MemStorage>
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\runtime\db.rs:393
  13: enum2$<cozo::DbInstance>::run_script
             at C:\Users\dralt\.cargo\registry\src\index.crates.io-6f17d22bba15001f\cozo-0.7.6\src\lib.rs:180
  14: ensemblage::cozo::probe::probe
             at .\src\cozo\probe.rs:61
  15: ensemblage::files::read_file::test
             at .\src\files\read_file.rs:26
  16: ensemblage::main
             at .\src\main.rs:6
  17: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\ops\function.rs:250
  18: core::hint::black_box
             at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7\library\core\src\hint.rs:334
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: process didn't exit successfully: `target\debug\ensemblage.exe` (exit code: 101)

and here's the script that I was trying to run


last_named_hero[first, first, max(hist)] := *named_hero_history[first, first, value, hist], hist <= 1;

some_named_hero[first, first, value] := last_named_hero[first, first, last], *named_hero_history[first, first, value, last];

named_hero[first, first, value] := cast[first], value = false, not some_named_hero[first, first, _];
named_hero[first, first, value] := some_named_hero[first, first, value];
?[hero] := 

here's the script used to create te stored relation:


:create named_hero_history {
    name: String,
    value: Bool,
    when: Int
}