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

Rule model should allow evaluating constant expressions #552

Closed
aannleax opened this issue Nov 28, 2024 · 0 comments · Fixed by #564
Closed

Rule model should allow evaluating constant expressions #552

aannleax opened this issue Nov 28, 2024 · 0 comments · Fixed by #564
Assignees
Labels
api public crate API builtins Issue related to built-in functions logical logical layer
Milestone

Comments

@aannleax
Copy link
Member

aannleax commented Nov 28, 2024

Nemo rule api should include a function to evaluate constant expressions:

let term = Term::parse("1 + 2");
let result = term.evaluate(); // TODO

println!("{}", result) // 3

The evaluation should use the same pipeline as during reasoning to avoid mismatches.

Building on this, it should also be possible to evaluate non-ground terms by providing a grounding:

let term = Term::parse("?x + 2");
let grounding = Grounding::from(vec![(Term::parse("?x"), Term::parse("1")]); // TODO
let result = term.evaluate_grounded(grouding); // TODO

println!("{}", result) // 3
@aannleax aannleax added logical logical layer api public crate API builtins Issue related to built-in functions labels Nov 28, 2024
@aannleax aannleax added this to the Release 0.7.0 milestone Nov 28, 2024
@aannleax aannleax self-assigned this Nov 28, 2024
@aannleax aannleax added this to nemo Nov 28, 2024
@github-project-automation github-project-automation bot moved this to Todo in nemo Nov 28, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in nemo Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api public crate API builtins Issue related to built-in functions logical logical layer
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant