What is this error in clojure Execution error (FileNotFoundException) at…
- User
What is this error in clojure Execution error (FileNotFoundException) at test/eval138$loading (main.clj:3). Could not locate api__init.class, api.clj or api.cljc on classpath.
Full report at: /tmp/clojure-7149624166054919882.edn
[Execution complete with exit code 1] and how I need to fix this code
(ns test (:use api) (:require [clojure.test :as test]))
(test/deftest defpackage-test (test/testing "dnf-test" (test/is (= (dnf (IMPL (variable :x) (variable :y))) (OR (NOT (variable :x)) (variable :y)))) (test/is (= (dnf (NOT (OR (OR (NOT (variable :x)) (variable :y)) (NOT (IMPL (variable :y) (variable :z)))))) (OR (AND (variable :x) (NOT (variable :y))) (AND (variable :x) (NOT (variable :y)) (variable :z))))) (test/is (= (dnf (IMPL (IMPL (NOT (variable :x)) (NOT (variable :y))) (IMPL (AND (variable :y) (variable :z)) (AND (NOT (variable :x)) (variable :z))))) (OR (NOT (variable :y)) (NOT (variable :z)) (AND (NOT (variable :x)) (variable :z)) (NOT (variable :x))))) (test/is (= (dnf (OR (variable :x) (IMPL (variable :y) (AND (variable :y) (variable :x))))) (OR (variable :x) (NOT (variable :y)) (AND (variable :y) (variable :x))))) ) (test/testing "substitution-test" (test/is (= (eliminate-constant-domination (dnf (substitution (IMPL (variable :x) (variable :y)) {:x 1}))) (variable :y))) (test/is (= (eliminate-constant-domination(dnf (substitution (NOT (OR (OR (NOT (variable :x)) (variable :y)) (NOT (IMPL (variable :y) (variable :z))))) {:x 0, :y 1}))) (constant 0))) (test/is (= (eliminate-constant-domination (dnf (substitution (NOT (OR (OR (NOT (variable :x)) (variable :y)) (NOT (IMPL (variable :y) (variable :z))))) {:z 0}))) (AND (variable :x) (NOT (variable :y))))) (test/is (= (eliminate-constant-domination(dnf (substitution (OR (variable :x) (IMPL (variable :y) (AND (variable :y) (variable :x)))) {:x 0}))) (NOT (variable :y))))))
(test/run-tests 'test)
(ns api)
(defn constant "Конструктор константы со значением value" [value] {:pre [(or (= value 0) (= value 1))]} (list ::const value))
(defn constant? "Проверка, является ли выражение expr константой" [expr] (= (first expr) ::const))
(defn constant-value "Вернуть значение константы" [expr] {:pre [(constant? expr)]} (second expr))
(defn same-constants? "Проверить, являются ли константы const1 и const2 идентичными" [const1 const2] (and (constant? const1) (constant? const2) (= (constant-value const1) (constant-value const2))))
(defn variable "Конструктор переменной с именем name" [name] {:pre [(keyword? name)]} (list ::var name))
(defn variable? "Проверка, является ли выражение expr переменной" [expr] (= (first expr) ::var))
(defn variable-name "Вернуть имя переменной var" [var] (second var))
(defn same-variables? "Проверить, являются ли переменные var1 и var2 идентичными" [var1 var2] (and (variable? var1) (variable? var2) (= (variable-name var1) (variable-name var2))))
(defn AND "Конструктор конъюнкции (&)" [expr & rest] (if (empty? rest) expr (cons ::and (cons expr rest))))
- Assistant
The error message you encountered indicates that Clojure could not locate the
apinamespace when trying to run your tests. This typically happens if the namespace is not correctly defined or not found on the classpath. - User
- ДНФ По аналогии с задачей дифференцирования реализовать представление символьных булевых выражений с операциями конъюнкции, дизъюнкции отрицания, импликации. Выражения могут включать как булевы константы, так и переменные. Реализовать подстановку значения переменной в выражение с его приведением к ДНФ. Обеспечить расширяемость для новых операций (исключающее ИЛИ, стрелка Пирса и пр.) Код должен быть покрыт тестами, API документирован. Could you Solve me this problem with clojure language and explain me please with english language
- Assistant