State space search problem math equations and Die Hard movie
I have a state A.
I have operations
A -> AB
AB -> BB
B -> AAA
Can I make symbol ABA from initial symbol A?
I have math expression 5x.
Given all math operations can I transform it to 10x?
All of these are state space search problems.
I have the code. Given the initial inputs
will it reach the state on infinite looping?
There is 3 and 5 gallons of jugs. How to get 4?
TLA+
----MODULE states----
EXTENDS Integers
VARIABLES s,b
typeOK == s \in 0..3 /\ b \in 0..5
Init == s = 0 /\ b = 0
FillBig == b' = 5 /\ s' = s
FillSmall == s' = 3 /\ b' = b
EmptyBig == b' = 0 /\ s' = s
EmptySmall == s' = 0 /\ b' = b
SmallToBig == IF b + s >= 5
THEN s' = s + b - 5 /\ b' = 5
ELSE s' = 0 /\ b' = b + s
BigToSmall == IF b+s >= 3
THEN b' = b + s - 3 /\ s' = 3
ELSE b' = 0 /\ s' = b + s
Next == FillBig \/ FillSmall \/ EmptyBig \/ EmptySmall \/ SmallToBig \/ BigToSmall
====
Check the model with invariant b /= 4 it will find the state sequence needed.