2014-04-14から1日間の記事一覧
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. t('x', t('x', t('x', nil, nil), nil), t('x', nil, nil)) t('x', t('x', nil, t('x', nil, nil)), t('x', nil, nil)) t('x', t('x', nil, nil), t('x', t('x', nil, nil), nil)) t(…
P-99: Ninety-Nine Prolog Problemsの問題にMercuryで解答していきます. Mercuryでは以下のようなユーザ定義型でTreeを表すので、形式のチェックは不要。 :- type tree(T) ---> t(T, tree(T), tree(T)) ; nil.