このディレクトリの索引
http://toro.2ch.net/test/read.cgi/tech/1364009659/116
#  
#  g :: [Int] -> [Int] -> Int 
#  g (x:xs) (y:ys) 
#  | (x:xs) == [] && (y:ys) == [] = 1 
#  | otherwise = x*y + g xs ys
#  

g([],[],1).
g([_x|_xs],[_y|_ys],_otherwise) :-
        g(_xs,_ys,_otherwise_1),
        _otherwise is _x * _y + _otherwise_1.