Skip to content

Commit

Permalink
wip: change rule priorities to do simplifiers first
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasdewally committed Oct 12, 2024
1 parent 0afac8c commit 49e7040
Show file tree
Hide file tree
Showing 31 changed files with 961 additions and 533 deletions.
6 changes: 6 additions & 0 deletions COMMITMSG
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- dont want to do ineq of a sum when we can do a leq!
before this patch, a leq was being rewritten to ineq(sum(...)) causing
partial-eval-03 to fail. Also, this was being done before the sums were
flattened.
- now have not(X) ~ reify(X,0) where X is a constraint

1 change: 1 addition & 0 deletions conjure_oxide/tests/generated_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ fn assert_vector_operators_have_partially_evaluated(model: &conjure_core::Model)
// one
AllDiff(_, _) => (),
WatchedLiteral(_, _, _) => (),
Reify(_, _, _) => (),
};
x.clone()
}));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
[
{
"MachineName(0)": 1,
"UserName(a)": 1,
"UserName(b)": 1
},
{
"MachineName(0)": 1,
"UserName(a)": 2,
"UserName(b)": 2
},
{
"MachineName(0)": 1,
"UserName(a)": 3,
"UserName(b)": 2
},
{
"MachineName(0)": 1,
"UserName(a)": 3,
"UserName(b)": 3
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
[
{
"Eq": [
"DivEq": [
{
"clean": false,
"etype": null
Expand All @@ -19,28 +19,9 @@
"etype": null
},
{
"MachineName": 0
}
]
},
{
"Constant": [
{
"clean": false,
"etype": null
},
{
"Int": 1
"UserName": "a"
}
]
}
]
},
{
"Neq": [
{
"clean": false,
"etype": null
},
{
"Reference": [
Expand All @@ -60,29 +41,18 @@
"etype": null
},
{
"Int": 0
"Int": 1
}
]
}
]
},
{
"DivEq": [
"Neq": [
{
"clean": false,
"etype": null
},
{
"Reference": [
{
"clean": false,
"etype": null
},
{
"UserName": "a"
}
]
},
{
"Reference": [
{
Expand All @@ -95,13 +65,13 @@
]
},
{
"Reference": [
"Constant": [
{
"clean": false,
"etype": null
},
{
"MachineName": 0
"Int": 0
}
]
}
Expand All @@ -112,23 +82,6 @@
},
"next_var": 1,
"variables": [
[
{
"MachineName": 0
},
{
"domain": {
"IntDomain": [
{
"Bounded": [
0,
3
]
}
]
}
}
],
[
{
"UserName": "a"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[
{
"MachineName(0)": 2,
"UserName(a)": 3
},
{
"MachineName(0)": 2,
"UserName(a)": 4
}
]
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
[
{
"Eq": [
"DivEq": [
{
"clean": false,
"etype": null
Expand All @@ -19,29 +19,10 @@
"etype": null
},
{
"Int": 2
"Int": 8
}
]
},
{
"Reference": [
{
"clean": false,
"etype": null
},
{
"MachineName": 0
}
]
}
]
},
{
"Neq": [
{
"clean": false,
"etype": null
},
{
"Reference": [
{
Expand All @@ -60,29 +41,18 @@
"etype": null
},
{
"Int": 0
"Int": 2
}
]
}
]
},
{
"DivEq": [
"Neq": [
{
"clean": false,
"etype": null
},
{
"Constant": [
{
"clean": false,
"etype": null
},
{
"Int": 8
}
]
},
{
"Reference": [
{
Expand All @@ -95,13 +65,13 @@
]
},
{
"Reference": [
"Constant": [
{
"clean": false,
"etype": null
},
{
"MachineName": 0
"Int": 0
}
]
}
Expand All @@ -112,23 +82,6 @@
},
"next_var": 1,
"variables": [
[
{
"MachineName": 0
},
{
"domain": {
"IntDomain": [
{
"Bounded": [
0,
8
]
}
]
}
}
],
[
{
"UserName": "a"
Expand Down
Loading

0 comments on commit 49e7040

Please sign in to comment.