mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-20 09:39:38 +01:00
Support stable model semantics with nogoods
This commit is contained in:
parent
f27502784a
commit
9ab4ff3de4
@ -40,6 +40,7 @@ enum Strategy {
|
||||
Ground = 'Ground',
|
||||
FirstComplete = 'FirstComplete',
|
||||
FirstStable = 'FirstStable',
|
||||
FirstStableNogood = 'FirstStableNogood',
|
||||
}
|
||||
|
||||
function App() {
|
||||
@ -73,7 +74,7 @@ function App() {
|
||||
<CssBaseline />
|
||||
<main>
|
||||
<Typography variant="h2" component="h1" align="center" gutterBottom>
|
||||
Solve your ADF Problem with Style!
|
||||
Solve your ADF Problem with OBDDs!
|
||||
</Typography>
|
||||
|
||||
<Container>
|
||||
@ -101,6 +102,8 @@ function App() {
|
||||
<Button variant="outlined" onClick={() => submitHandler(Strategy.FirstComplete)}>(First) Complete Model</Button>
|
||||
{' '}
|
||||
<Button variant="outlined" onClick={() => submitHandler(Strategy.FirstStable)}>(First) Stable Model</Button>
|
||||
{' '}
|
||||
<Button variant="outlined" onClick={() => submitHandler(Strategy.FirstStableNogood)}>(First) Stable Model using nogoods</Button>
|
||||
</Container>
|
||||
|
||||
{graph
|
||||
|
||||
@ -16,6 +16,7 @@ enum Strategy {
|
||||
Ground,
|
||||
FirstComplete,
|
||||
FirstStable,
|
||||
FirstStableNogood,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
@ -55,6 +56,9 @@ async fn solve(req_body: web::Json<SolveReqBody>) -> impl Responder {
|
||||
Strategy::FirstComplete => Some(adf.complete().next().unwrap()),
|
||||
// TODO: error handling if no such model exists!
|
||||
Strategy::FirstStable => Some(adf.stable().next().unwrap()),
|
||||
// TODO: error handling if no such model exists!
|
||||
// TODO: support more than just default heuristics
|
||||
Strategy::FirstStableNogood => Some(adf.stable_nogood(adf_bdd::adf::heuristics::Heuristic::default()).next().unwrap()),
|
||||
};
|
||||
|
||||
let dto = adf.into_double_labeled_graph(ac.as_ref());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user