mirror of
https://github.com/ellmau/adf-obdd.git
synced 2025-12-21 09:49:38 +01:00
Compare commits
No commits in common. "fc0042fcd1ce3126b5444e801402d1e833e1c602" and "eeef4729b6ff250b0cc5024ffb710ae804b03152" have entirely different histories.
fc0042fcd1
...
eeef4729b6
833
Cargo.lock
generated
833
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
24
flake.lock
generated
24
flake.lock
generated
@ -5,11 +5,11 @@
|
|||||||
"systems": "systems"
|
"systems": "systems"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1689068808,
|
"lastModified": 1685518550,
|
||||||
"narHash": "sha256-6ixXo3wt24N/melDWjq70UuHQLxGV8jZvooRanIHXw0=",
|
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "919d646de7be200f3bf08cb76ae1f09402b6f9b4",
|
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -36,11 +36,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690927903,
|
"lastModified": 1686059680,
|
||||||
"narHash": "sha256-D5gCaCROnjEKDOel//8TO/pOP87pAEtT0uT8X+0Bj/U=",
|
"narHash": "sha256-sp0WlCIeVczzB0G8f8iyRg3IYW7KG31mI66z7HIZwrI=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "bd836ac5e5a7358dea73cb74a013ca32864ccb86",
|
"rev": "a558f7ac29f50c4b937fb5c102f587678ae1c9fb",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -52,11 +52,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1690881714,
|
"lastModified": 1686020360,
|
||||||
"narHash": "sha256-h/nXluEqdiQHs1oSgkOOWF+j8gcJMWhwnZ9PFabN6q0=",
|
"narHash": "sha256-Wee7lIlZ6DIZHHLiNxU5KdYZQl0iprENXa/czzI6Cj4=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9e1960bc196baf6881340d53dccb203a951745a2",
|
"rev": "4729ffac6fd12e26e5a8de002781ffc49b0e94b7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -85,11 +85,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1691029059,
|
"lastModified": 1686191569,
|
||||||
"narHash": "sha256-QwVeE9YTgH3LmL7yw2V/hgswL6yorIvYSp4YGI8lZYM=",
|
"narHash": "sha256-8ey5FOXNms9piFGTn6vJeAQmSKk+NL7GTMSoVttsNTs=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "99df4908445be37ddb2d332580365fce512a7dcf",
|
"rev": "b4b71458b92294e8f1c3a112d972e3cff8a2ab71",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|||||||
@ -9,32 +9,32 @@
|
|||||||
"build": "parcel build"
|
"build": "parcel build"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@parcel/transformer-inline-string": "2.9.3",
|
"@parcel/transformer-inline-string": "2.8.3",
|
||||||
"@types/node": "^20.4.6",
|
"@types/node": "^18.15.11",
|
||||||
"@types/react": "^18.2.18",
|
"@types/react": "^18.0.26",
|
||||||
"@types/react-dom": "^18.2.7",
|
"@types/react-dom": "^18.0.10",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.2.1",
|
"@typescript-eslint/eslint-plugin": "^5.48.1",
|
||||||
"@typescript-eslint/parser": "^6.2.1",
|
"@typescript-eslint/parser": "^5.48.1",
|
||||||
"eslint": "^8.46.0",
|
"eslint": "^8.31.0",
|
||||||
"eslint-config-airbnb": "^19.0.4",
|
"eslint-config-airbnb": "^19.0.4",
|
||||||
"eslint-config-airbnb-typescript": "^17.1.0",
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
||||||
"eslint-plugin-import": "^2.28.0",
|
"eslint-plugin-import": "^2.27.4",
|
||||||
"eslint-plugin-jsx-a11y": "^6.7.1",
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
||||||
"eslint-plugin-react": "^7.33.1",
|
"eslint-plugin-react": "^7.32.0",
|
||||||
"parcel": "^2.9.3",
|
"parcel": "^2.8.2",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"typescript": "^5.1.6"
|
"typescript": "^4.9.4"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@antv/g6": "^4.8.20",
|
"@antv/g6": "^4.8.3",
|
||||||
"@emotion/react": "^11.11.1",
|
"@emotion/react": "^11.10.5",
|
||||||
"@emotion/styled": "^11.11.0",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@fontsource/roboto": "^5.0.6",
|
"@fontsource/roboto": "^4.5.8",
|
||||||
"@mui/icons-material": "^5.14.3",
|
"@mui/icons-material": "^5.11.16",
|
||||||
"@mui/material": "^5.14.3",
|
"@mui/material": "^5.11.4",
|
||||||
"markdown-to-jsx": "^7.2.1",
|
"markdown-to-jsx": "^7.2.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-router-dom": "^6.14.2"
|
"react-router-dom": "^6.10.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@ The Web UI mimics many options of the CLI version of the [underlying adf-bdd too
|
|||||||
|
|
||||||
In the below form, you can either type/paste your `code` or upload a file in the same format.
|
In the below form, you can either type/paste your `code` or upload a file in the same format.
|
||||||
To put it briefly, an ADF consists of statements and accectance conditions for these statements.
|
To put it briefly, an ADF consists of statements and accectance conditions for these statements.
|
||||||
For instance, the following code indicates that `a,b,c,d` are statements, that `a` is assumed to be true (verum), `b` is true if `b` is true (which is self-supporting), `c` is true if `a` and `b` are true, and `d` is true if `b` is false.
|
For instance, the following code indicates that `a,b,c,d` are statements, that `a` is assumed to be true (verum), `b` is true if is true (which is tautological), `c` is true if `a` and `b` are true, and `d` is true if `b` is false.
|
||||||
|
|
||||||
```
|
```
|
||||||
s(a).
|
s(a).
|
||||||
|
|||||||
2055
frontend/yarn.lock
2055
frontend/yarn.lock
File diff suppressed because it is too large
Load Diff
@ -1,6 +1,7 @@
|
|||||||
//! Collection of all nogood-related structures.
|
//! Collection of all nogood-related structures.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
|
borrow::Borrow,
|
||||||
fmt::{Debug, Display},
|
fmt::{Debug, Display},
|
||||||
ops::{BitAnd, BitOr, BitXor, BitXorAssign},
|
ops::{BitAnd, BitOr, BitXor, BitXorAssign},
|
||||||
};
|
};
|
||||||
@ -22,8 +23,11 @@ pub struct NoGood {
|
|||||||
impl Eq for NoGood {}
|
impl Eq for NoGood {}
|
||||||
impl PartialEq for NoGood {
|
impl PartialEq for NoGood {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
(&self.active).bitxor(&other.active).is_empty()
|
self.active
|
||||||
&& (&self.value).bitxor(&other.value).is_empty()
|
.borrow()
|
||||||
|
.bitxor(other.active.borrow())
|
||||||
|
.is_empty()
|
||||||
|
&& self.value.borrow().bitxor(other.value.borrow()).is_empty()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,11 +113,15 @@ impl NoGood {
|
|||||||
/// Given a [NoGood] and another one, conclude a non-conflicting value which can be concluded on basis of the given one.
|
/// Given a [NoGood] and another one, conclude a non-conflicting value which can be concluded on basis of the given one.
|
||||||
pub fn conclude(&self, other: &NoGood) -> Option<(usize, bool)> {
|
pub fn conclude(&self, other: &NoGood) -> Option<(usize, bool)> {
|
||||||
log::debug!("conclude: {:?} other {:?}", self, other);
|
log::debug!("conclude: {:?} other {:?}", self, other);
|
||||||
let implication = (&self.active).bitxor(&other.active).bitand(&self.active);
|
let implication = self
|
||||||
|
.active
|
||||||
|
.borrow()
|
||||||
|
.bitxor(other.active.borrow())
|
||||||
|
.bitand(self.active.borrow());
|
||||||
|
|
||||||
let bothactive = (&self.active).bitand(&other.active);
|
let bothactive = self.active.borrow().bitand(other.active.borrow());
|
||||||
let mut no_matches = (&bothactive).bitand(&other.value);
|
let mut no_matches = bothactive.borrow().bitand(other.value.borrow());
|
||||||
no_matches.bitxor_assign(bothactive.bitand(&self.value));
|
no_matches.bitxor_assign(bothactive.bitand(self.value.borrow()));
|
||||||
|
|
||||||
if implication.len() == 1 && no_matches.is_empty() {
|
if implication.len() == 1 && no_matches.is_empty() {
|
||||||
let pos = implication
|
let pos = implication
|
||||||
@ -132,16 +140,16 @@ impl NoGood {
|
|||||||
|
|
||||||
/// Updates the [NoGood] and a second one in a disjunctive (bitor) manner.
|
/// Updates the [NoGood] and a second one in a disjunctive (bitor) manner.
|
||||||
pub fn disjunction(&mut self, other: &NoGood) {
|
pub fn disjunction(&mut self, other: &NoGood) {
|
||||||
self.active = (&self.active).bitor(&other.active);
|
self.active = self.active.borrow().bitor(&other.active);
|
||||||
self.value = (&self.value).bitor(&other.value);
|
self.value = self.value.borrow().bitor(&other.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns [true] if the other [Interpretation] matches with all the assignments of the current [NoGood].
|
/// Returns [true] if the other [Interpretation] matches with all the assignments of the current [NoGood].
|
||||||
pub fn is_violating(&self, other: &Interpretation) -> bool {
|
pub fn is_violating(&self, other: &Interpretation) -> bool {
|
||||||
let active = (&self.active).bitand(&other.active);
|
let active = self.active.borrow().bitand(other.active.borrow());
|
||||||
if self.active.len() == active.len() {
|
if self.active.len() == active.len() {
|
||||||
let lhs = (&active).bitand(&self.value);
|
let lhs = active.borrow().bitand(self.value.borrow());
|
||||||
let rhs = (&active).bitand(&other.value);
|
let rhs = active.borrow().bitand(other.value.borrow());
|
||||||
if lhs.bitxor(rhs).is_empty() {
|
if lhs.bitxor(rhs).is_empty() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user