trueagi-io / hyperon-experimental

OpenCog Hyperon experimental version
https://wiki.opencog.org/w/Hyperon
MIT License
122 stars 43 forks source link

Move out executable #718

Closed vsbogd closed 3 weeks ago

vsbogd commented 3 weeks ago

Straightforward change to separate Grounded::execute method in a same way Grounded::match_ is separated.

trait Grounded {
  fn execute(...) -> ...;
}

by

trait Grounded {
  as_execute(&self) -> Option<&dyn CustomExecute>
}
trait CustomExecute {
  fn execute(...) -> ...;
}

Using such interface one can check whether atom is executable in advance without executing it. Main change is inside lib/src/atom/mod.rs all other changes are moving old code according new interface.

vsbogd commented 3 weeks ago

Luke, thanks for reviewing this!