# Assert relationship between variables with Symbolics.jl

**URL:** <https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204>\
**Category:** General Usage\
**Tags:** symbolic, symbolics\
**Created:** [June 1, 2021, 4:01pm UTC](https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204 "2021-06-01T16:01:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [June 1, 2021, 4:01pm UTC](https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204/1 "2021-06-01T16:01:11Z")

</div>

Hi

I was just wondering if there’s a way to assert and then test for a relationship between two varablie in Symbolics, or Julia in general.

Specifically, a game theory payoff table

```markdown
| | R | W 
|R| 0 | b    
|W| b-k | b - k/2    

```

where the payoff is to the player on the left. Given that b \> k I want to show that

V(R|R) \<V(W|R) \< V(W|W) \< V(R|W)

Obviously, this is pretty trivial in this example. But that’s not the point. I can plug in values like so

```julia
V(self,other) = payoffTable[self,other]
b = 2
k = 1
R = 1
W = 2
payoffTable = [0 b
                b-k b-k/2]

V(R,R) < V(W,R) < V(W,W) <V(R,W)

```

`true`  
But it would be nice to have a way to assert ` b > k` instead of inputting values.

---

<div class="post-metadata">

**Author:** ![EvoArt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/evoart/32/25357_2.png) [@EvoArt](https://discourse.julialang.org/u/EvoArt)\
**Post date:** [June 2, 2021, 10:09am UTC](https://discourse.julialang.org/t/assert-relationship-between-variables-with-symbolics-jl/62204/2 "2021-06-02T10:09:02Z")

</div>

Seems like this could be possible with IntervalConstraintProgramming + ModelingToolkit and setting a large enough IntervalBox to cover all feasible values, unless I’ve misunderstood how IntervalConstraintProgramming works. But it would require ModelingToolkit v3, which conflicts with Symbolics.

I am Weaving solutions to mathematical problems from [here](https://xcelab.net/rm/book/) (some plotting, algebra, diffeqs and a bit of optimization to come) into a pdf for students at my university, and trying to showcase how cool Julia is in this domain. So ideally I need a solution that doesn’t involve uninstalling and reinstalling key packages throughout.
