@prefix math: <http://www.w3.org/2000/10/swap/math#>.
@prefix : <http://eexample.org/#>.

{(?X 0) :pow 1} <= true.
{(?X ?Y) :pow ?Z} <= {?Y math:notEqualTo 0. (?Y 2) math:remainder 0. ((?X ?X)!math:product (?Y 2)!math:integerQuotient) :pow ?Z}.
{(?X ?Y) :pow ?Z} <= {?Y math:notEqualTo 0. (?Y 2) math:remainder 1. (((?X ?X)!math:product (?Y 2)!math:integerQuotient)!:pow ?X) math:product ?Z}.

# query
{(3 0) :pow ?Z} =^ {(3 0) :pow ?Z}.
{(5 6) :pow ?Z} =^ {(5 6) :pow ?Z}.
{(238 13) :pow ?Z} =^ {(238 13) :pow ?Z}.
