Skip to content

Commit 75dc02c

Browse files
authored
Merge branch 'main' into dependabot/cargo/all-012f078a29
2 parents 13745df + 6739099 commit 75dc02c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2328
-1733
lines changed

.vscode/settings.json

+1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77
"coverage-gutters.coverageFileNames": [
88
"lcov.info",
99
],
10+
"workbench.iconTheme": "vs-seti",
1011
}

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conjure_oxide/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ strum = "0.26.2"
2424
versions = "6.2.0"
2525
linkme = "0.3.22"
2626
walkdir = "2.5.0"
27-
itertools = "0.12.1"
2827
regex = "1.10.3"
2928
log = "0.4.21"
3029
structured-logger = "1.0.3"

conjure_oxide/tests/generated_tests.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ fn integration_test(path: &str, essence_base: &str) -> Result<(), Box<dyn Error>
5454
assert_eq!(model, expected_model);
5555

5656
// Stage 2: Rewrite the model using the rule engine and check that the result is as expected
57-
let rule_sets = resolve_rule_sets(SolverFamily::Minion, &vec!["Constant".to_string()])?;
57+
let rule_sets = resolve_rule_sets(
58+
SolverFamily::Minion,
59+
&vec!["Constant".to_string(), "Bubble".to_string()],
60+
)?;
5861
let model = rewrite_model(&model, &rule_sets)?;
5962
if verbose {
6063
println!("Rewritten model: {:#?}", model)

conjure_oxide/tests/integration/basic/bool/03/bool-03.expected-rewrite.serialised.json

+21-23
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,29 @@
11
{
22
"constraints": {
3-
"AllDiff": [
3+
"Neq": [
44
{
55
"clean": false
66
},
7-
[
8-
{
9-
"Reference": [
10-
{
11-
"clean": false
12-
},
13-
{
14-
"UserName": "x"
15-
}
16-
]
17-
},
18-
{
19-
"Reference": [
20-
{
21-
"clean": false
22-
},
23-
{
24-
"UserName": "y"
25-
}
26-
]
27-
}
28-
]
7+
{
8+
"Reference": [
9+
{
10+
"clean": false
11+
},
12+
{
13+
"UserName": "x"
14+
}
15+
]
16+
},
17+
{
18+
"Reference": [
19+
{
20+
"clean": false
21+
},
22+
{
23+
"UserName": "y"
24+
}
25+
]
26+
}
2927
]
3028
},
3129
"next_var": 0,
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
[
22
{
3-
"a": 1,
4-
"b": 1
3+
"MachineName(0)": 1,
4+
"UserName(a)": 1,
5+
"UserName(b)": 1
56
},
67
{
7-
"a": 2,
8-
"b": 2
8+
"MachineName(0)": 1,
9+
"UserName(a)": 2,
10+
"UserName(b)": 2
911
},
1012
{
11-
"a": 3,
12-
"b": 2
13+
"MachineName(0)": 1,
14+
"UserName(a)": 3,
15+
"UserName(b)": 2
1316
},
1417
{
15-
"a": 3,
16-
"b": 3
18+
"MachineName(0)": 1,
19+
"UserName(a)": 3,
20+
"UserName(b)": 3
1721
}
1822
]

conjure_oxide/tests/integration/basic/div/01/input.expected-parse.serialised.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"constraints": {
33
"Eq": [
44
{
5-
"dirtyclean": false
5+
"clean": false
66
},
77
{
8-
"Div": [
8+
"UnsafeDiv": [
99
{
10-
"dirtyclean": false
10+
"clean": false
1111
},
1212
{
1313
"Reference": [
1414
{
15-
"dirtyclean": false
15+
"clean": false
1616
},
1717
{
1818
"UserName": "a"
@@ -22,7 +22,7 @@
2222
{
2323
"Reference": [
2424
{
25-
"dirtyclean": false
25+
"clean": false
2626
},
2727
{
2828
"UserName": "b"
@@ -34,7 +34,7 @@
3434
{
3535
"Constant": [
3636
{
37-
"dirtyclean": false
37+
"clean": false
3838
},
3939
{
4040
"Int": 1
@@ -43,6 +43,7 @@
4343
}
4444
]
4545
},
46+
"next_var": 0,
4647
"variables": [
4748
[
4849
{

conjure_oxide/tests/integration/basic/div/01/input.expected-rewrite.serialised.json

+75-32
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,45 @@
22
"constraints": {
33
"And": [
44
{
5-
"dirtyclean": false
5+
"clean": false
66
},
77
[
88
{
9-
"DivEq": [
9+
"Eq": [
1010
{
11-
"dirtyclean": false
11+
"clean": false
1212
},
1313
{
1414
"Reference": [
1515
{
16-
"dirtyclean": false
16+
"clean": false
1717
},
1818
{
19-
"UserName": "a"
19+
"MachineName": 0
2020
}
2121
]
2222
},
23+
{
24+
"Constant": [
25+
{
26+
"clean": false
27+
},
28+
{
29+
"Int": 1
30+
}
31+
]
32+
}
33+
]
34+
},
35+
{
36+
"Neq": [
37+
{
38+
"clean": false
39+
},
2340
{
2441
"Reference": [
2542
{
26-
"dirtyclean": false
43+
"clean": false
2744
},
2845
{
2946
"UserName": "b"
@@ -33,48 +50,74 @@
3350
{
3451
"Constant": [
3552
{
36-
"dirtyclean": false
53+
"clean": false
3754
},
3855
{
39-
"Int": 1
56+
"Int": 0
4057
}
4158
]
4259
}
4360
]
4461
},
4562
{
46-
"AllDiff": [
63+
"DivEq": [
64+
{
65+
"clean": false
66+
},
4767
{
48-
"dirtyclean": false
68+
"Reference": [
69+
{
70+
"clean": false
71+
},
72+
{
73+
"UserName": "a"
74+
}
75+
]
76+
},
77+
{
78+
"Reference": [
79+
{
80+
"clean": false
81+
},
82+
{
83+
"UserName": "b"
84+
}
85+
]
4986
},
50-
[
51-
{
52-
"Reference": [
53-
{
54-
"dirtyclean": false
55-
},
56-
{
57-
"UserName": "b"
58-
}
59-
]
60-
},
61-
{
62-
"Constant": [
63-
{
64-
"dirtyclean": false
65-
},
66-
{
67-
"Int": 0
68-
}
69-
]
70-
}
71-
]
87+
{
88+
"Reference": [
89+
{
90+
"clean": false
91+
},
92+
{
93+
"MachineName": 0
94+
}
95+
]
96+
}
7297
]
7398
}
7499
]
75100
]
76101
},
102+
"next_var": 1,
77103
"variables": [
104+
[
105+
{
106+
"MachineName": 0
107+
},
108+
{
109+
"domain": {
110+
"IntDomain": [
111+
{
112+
"Bounded": [
113+
0,
114+
3
115+
]
116+
}
117+
]
118+
}
119+
}
120+
],
78121
[
79122
{
80123
"UserName": "a"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
find a : int(0..3)
2+
such that a >= 4 / 2 $ should be simplified to constant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{
3+
"UserName(a)": 2
4+
},
5+
{
6+
"UserName(a)": 3
7+
}
8+
]

0 commit comments

Comments
 (0)