Epic substructures and primitive positive functions
  For $\mathbf{A}\leq\mathbf{B}$ first order structures in a class $\mathcal{K}$, say that $\mathbf{A}$ is an epic substructure of $\mathbf{B}$ in $\mathcal{K}$ if for every $\mathbf{C}\in\mathcal{K}$ and all homomorphisms $g,g^{\prime}:\mathbf{B}\rightarrow\mathbf{C}$, if $g$ and $g'$ agree on $A$, then $g=g'$. We prove that $\mathbf{A}$ is an epic substructure of $\mathbf{B}$ in a class $\mathcal{K}$ closed under ultraproducts if and only if $A$ generates $\mathbf{B}$ via operations definable in $\mathcal{K}$ with primitive positive formulas. Applying this result we show that a quasivariety of algebras $\mathcal{Q}$ with an $n$-ary near-unanimity term has surjective epimorphisms if and only if $\mathbb{SP}_{n}\mathbb{P}_{u}(\mathcal{Q}_{RSI})$ has surjective epimorphisms. It follows that if $\mathcal{F}$ is a finite set of finite algebras with a common near-unanimity term, then it is decidable whether the (quasi)variety generated by $\mathcal{F}$ has surjective epimorphisms. 
Miguel Campercholi
math.LO