Все файлы
Главная | Gemini Haskell | Gemini Prolog | Telegram
Всего файлов: 20
Решения: 20
Тексты: 0
Haskell: 11
Prolog: 9
-
Тип: solution
Язык: prolog
Файл: Define the predicate listStar(L1,L2) that is true when the list L2 is cr
Создан: 2026-05-22 06:34:46
Превью: listStar([], []). listStar([X|Xs], [X, * | Ys]) :- listStar(Xs, Ys).
-
Тип: solution
Язык: prolog
Файл: Define the predicate that reads 3 numbers A, B, C given by an user and t
Создан: 2026-05-22 06:30:29
Превью: :- use_module(library(readutil)). calculate :- write('This program calculates the value of A + (B - C)^2.'), nl, write('Please enter each n…
-
Тип: solution
Язык: prolog
Файл: a) Define the predicate sec15(L) that is true when the first number in t
Создан: 2026-05-22 06:30:07
Превью: % Exercise a sec15([X|_]) :- X > 5. % Exercise b avg12([X, Y|_], A) :- A is (X + Y) / 2.
-
Тип: solution
Язык: prolog
Файл: a) Define the predicate sec15(L) that is true when the first number in t
Создан: 2026-05-22 06:28:14
Превью: sec15([X|_]) :- X > 5. avg12([X, Y|_], A) :- A is (X + Y) / 2.
-
Тип: solution
Язык: prolog
Файл: Define the predicate l1plusal2 (X, Y, A, L), which for the given lists X
Создан: 2026-05-22 06:27:54
Превью: l1plusal2([], [], _, []). l1plusal2([X|Xs], [Y|Ys], A, [Z|Zs]) :- Z is X + A * Y, l1plusal2(Xs, Ys, A, Zs).
-
Тип: solution
Язык: prolog
Файл: photo note
Создан: 2026-05-22 05:44:43
Превью: element_at(X, [X|_], 1).
-
Тип: solution
Язык: prolog
Файл: Define max2.
Создан: 2026-05-22 05:44:43
Превью: max2(X, Y, X) :- X >= Y. max2(X, Y, Y) :- Y > X.
-
Тип: solution
Язык: prolog
Файл: 1) Define a predicate element_at(X,L,K) that is true when X is the K'th
Создан: 2026-05-21 21:22:12
Превью: % 1) element_at(X, L, K) element_at(X, [X|_], 1). element_at(X, [_|Tail], K) :- K > 1, K1 is K - 1, element_at(X, Tail, K1). % 2) dupli(L1,…
-
Тип: solution
Язык: prolog
Файл: 1) Write a program that reads a given string of characters and then disp
Создан: 2026-05-21 21:16:53
Превью: % Prolog Programming Exercises % Ex 1: Read a string of characters ended with a dot and display it. exercise1 :- write('Enter a string ende…
-
Тип: solution
Язык: haskell
Файл: Define a recursive function which removes empty sub-lists from the list
Создан: 2026-04-17 06:52:18
Превью: removeEmpty :: [[a]] -> [[a]] removeEmpty [] = [] removeEmpty ([]:xs) = removeEmpty xs removeEmpty (x:xs) = x : removeEmpty xs
-
Тип: solution
Язык: haskell
Файл: a) Define the sequence (an)n=1,2,… such that an=3+(2n−1)^2 when n is eve
Создан: 2026-04-17 06:45:18
Превью: a :: Integer -> Integer a n | odd n = 1 | otherwise = 3 + (2 * n - 1)^2 initialList :: Integer -> [Integer] initialList n = [a i | i <- [1.…
-
Тип: solution
Язык: haskell
Файл: Define a function which for a given list of real numbers creates a list
Создан: 2026-04-17 06:41:39
Превью: filterLessTenA :: (Ord a, Num a) => [a] -> [a] filterLessTenA xs = filter (< 10) xs filterLessTenB :: (Ord a, Num a) => [a] -> [a] filterLe…
-
Тип: solution
Язык: haskell
Файл: a) Define the sequence (an)n=1,2,… such that an=3+(2n−1)^2 when n is eve
Создан: 2026-04-17 06:39:03
Превью: seqA :: Integer -> Integer seqA n | odd n = 1 | otherwise = 3 + (2 * n - 1)^2 generateSequence :: Integer -> [Integer] generateSequence n =…
-
Тип: solution
Язык: haskell
Файл: Define a function which for a given list of real numbers creates a list
Создан: 2026-04-17 06:36:07
Превью: filterLess10Builtin :: [Double] -> [Double] filterLess10Builtin xs = filter (< 10) xs filterLess10Recursive :: [Double] -> [Double] filterL…
-
Тип: solution
Язык: haskell
Файл: Define a recursive function which removes empty sub-lists from the list
Создан: 2026-04-17 06:35:11
Превью: removeEmptySublists :: [[a]] -> [[a]] removeEmptySublists [] = [] removeEmptySublists (x:xs) | null x = removeEmptySublists xs | otherwise…
-
Тип: solution
Язык: haskell
Файл: Define a function that reads 2 real numbers a, b given by an user and th
Создан: 2026-04-17 06:34:49
Превью: calculateExpression :: IO () calculateExpression = do putStrLn "This program calculates the value of a^2 + 2b." putStrLn "Please enter the…
-
Тип: solution
Язык: haskell
Файл: a) Define the sequence (an)n=1,2,… such that an=3+(2n−1)2 when n is even
Создан: 2026-04-17 06:34:35
Превью: an :: Integer -> Integer an n | even n = 3 + (2 * n - 1) ^ 2 | otherwise = 1 sequenceList :: Int -> [Integer] sequenceList n = [an i | i <-…
-
Тип: solution
Язык: haskell
Файл: Define a function which for a given list of real numbers creates a list
Создан: 2026-04-17 06:32:42
Превью: lessThanTenBuiltin :: [Double] -> [Double] lessThanTenBuiltin = filter (< 10) lessThanTenRecursive :: [Double] -> [Double] lessThanTenRecur…
-
Тип: solution
Язык: haskell
Файл: HaskellExamMemorize.hs
Создан: 2026-04-16 21:19:47
Превью: module HaskellExamMemorize where import Data.Char (isDigit, isLetter, isLower, isUpper) -- The shortest useful pack of patterns to memorize…
-
Тип: solution
Язык: haskell
Файл: HaskellMasterSolutions.hs
Создан: 2026-04-16 21:19:47
Превью: module HaskellMasterSolutions where import Data.Char (isDigit, isLetter, isLower, isUpper) -- Haskell 1 -- Ex. 1 -- Define a function that…