How to find out if a piecewise function is partially computable? I know exactly what a partially computable function is, but I've seen a few functions that I really can not understand why they are not partially computable. As an example in Davis book page 78, he says the following function is not partially computable: ($\uparrow$ means undefined and $\downarrow$ means defined)

Given an infinite set C such that $\phi(c,c) \uparrow$ for all $c \in C$ and such that


  $$
H_4(x) = 
\begin{cases}
1 &amp; IF \phi (x,x) \downarrow \\
0 &amp; x \in C \\
\uparrow &amp; Otherwise \\
\end{cases}
$$


is not partially computable.

Or in page 77 he says the following is partially computable while I cannot understand what is difference between these two functions! 

Given an infinite set B such that $\phi(b,b) \uparrow$ for all $b \in B$ and such that


  $$
H_3(x) = 
\begin{cases}
1 &amp; IF \phi (x,x) \downarrow \\
0 &amp; x \in B \\
\uparrow &amp; Otherwise \\
\end{cases}
$$


Or between these two functions which one is partially computable? ($K=\{ n \in N | \phi(n,n) \downarrow \}$)


  $$
f_1(x) = 
\begin{cases}
2 &amp; x \in K \\
\uparrow &amp; Otherwise \\
\end{cases}
$$
  
  $$
f_2(x) = 
\begin{cases}
\uparrow &amp; x \in K \\
2 &amp; Otherwise \\
\end{cases}
$$


So I would like to know what makes a piecewise function to be partially computable?



UPDATE: 

Since $K$ is recursively enumerable (in face m-complete), it is not recursive so checking membership in this set is semi decidable. I guess $f_2(x)$ should be partially computable but I'm not sure!
Page 3 of the book says: "partial function on a set S is a simply function whose domain is a subset of S."

The difference between $H_3(x)$ and $H_4(x)$ are the sets of $B$ and $C$ that you are going to make. for example if you give $B$ such that for all $x$ the other wise don't happen, then $H_3(x)$ will be a total function and we know every total functions are partial functions since $S \subseteq S$. 

between $f_1(x)$ and $f_2(x)$ the one is partial computable which gives output for some $x$s in its domain.