Передача нужного аргумента в substring - Prolog
Формулировка задачи:
Добрый день!
Пытаюсь реализовать программу-поиск лучшей сесси для конференции на swi prolog.
Данные представлены в таком виде
Если использовать комманду в комментарии - всё работает, так что полагаю что проблема в обращении к списку.
По заданию - надо проверить является ли введенная строка частью темы сессии или схожа с уже имеющимися докладами, в зависимости от этого начисляются баллы и в результате надо вывести отсортированные темы сессий.
Пытаюсь сначала сравнить с темой - выводит ошибку
ERROR: table:sub_string/3: Type error: `text' expected, found `session(('_'|[_G8263]))' (a compound)
Решение задачи: «Передача нужного аргумента в substring»
textual
Листинг программы
% Facts about sessions, and respective topics session('Rules; Semantic Technology; and Cross-Industry Standards', ['XBRL - Extensible Business Reporting Language', 'MISMO - Mortgage Industry Standards Maintenance Org', 'FIXatdl - FIX Algorithmic Trading Definition Language', 'FpML - Financial products Markup Language', 'HL7 - Health Level 7', 'Acord - Association for Cooperative Operations Research and Development (Insurance Industry)', 'Rules for Governance; Risk; and Compliance (GRC); eg; rules for internal audit; SOX compliance; enterprise risk management (ERM); operational risk; etc', 'Rules and Corporate Actions']). session('Rule Transformation and Extraction', ['Transformation and extraction with rule standards; such as SBVR; RIF and OCL', 'Extraction of rules from code', 'Transformation and extraction in the context of frameworks such as KDM (Knowledge Discovery meta-model)', 'Extraction of rules from natural language', 'Transformation or rules from one dialect into another']). session('Rules and Uncertainty', ['Languages for the formalization of uncertainty rules', 'Probabilistic; fuzzy and other rule frameworks for reasoning with uncertain or incomplete information', 'Handling inconsistent or disparate rules using uncertainty', 'Uncertainty extensions of event processing rules; business rules; reactive rules; causal rules; derivation rules; association rules; or transformation rules']). session('Rules and Norms', ['Methodologies for modeling regulations using both ontologies and rules', 'Defeasibility and norms - modeling rule exceptions and priority relations among rules', 'The relationship between rules and legal argumentation schemes', 'Rule language requirements for the isomorphic modeling of legislation', 'Rule based inference mechanism for legal reasoning', 'E-contracting and automated negotiations with rule-based declarative strategies']). session('Rules and Inferencing', ['From rules to FOL to modal logics', 'Rule-based non-monotonic reasoning', 'Rule-based reasoning with modalities', 'Deontic rule-based reasoning', 'Temporal rule-based reasoning', 'Priorities handling in rule-based systems', 'Defeasible reasoning', 'Rule-based reasoning about context and its use in smart environments', 'Combination of rules and ontologies', 'Modularity']). session('Rule-based Event Processing and Reaction Rules', ['Reaction rule languages and engines (production rules; ECA rules; logic event action formalisms; vocabularies/ontologies)', 'State management approaches and frameworks', 'Concurrency control and scalability', 'Event and action definition; detection; consumption; termination; lifecycle management', 'Dynamic rule-based workflows and intelligent event processing (rule-based CEP)', 'Non-functional requirements; use of annotations; metadata to capture those', 'Design time and execution time aspects of rule-based (Semantic) Business Processes Modeling and Management', 'Practical and business aspects of rule-based (Semantic) Business Process Management (business scenarios; case studies; use cases etc)']). session('Rule-Based Distributed/Multi-Agent Systems', ['rule-based specification and verification of Distributed/Multi-Agent Systems', 'rule-based distributed reasoning and problem solving', 'rule-based agent architectures', 'rules and ontologies for semantic agents', 'rule-based interaction protocols for multi-agent systems', 'rules for service-oriented computing (discovery; composition; etc)', 'rule-based cooperation; coordination and argumentation in multi-agent systems', 'rule-based e-contracting and negotiation strategies in multi-agent systems', 'rule interchange and reasoning interoperation in heterogeneous Distributed/Multi-Agent Systems']). session('General Introduction to Rules', ['Rules and ontologies', 'Execution models; rule engines; and environments', 'Graphical processing; modeling and rendering of rules']). session('RuleML-2010 Challenge', ['benchmarks/evaluations; demos; case studies; use cases; experience reports; best practice solutions (design patterns; reference architectures; models)', 'rule-based implementations; tools; applications; demonstrations engineering methods', 'implementations of rule standards (RuleML; RIF; SBVR; PRR; rule-based Event Processing languages; BPMN and rules; BPEL and rules); rules and industrial standards (XBRL; MISMO; Accord) and industrial problem statements', 'Modelling Rules in the Temporal and Geospatial Applications', 'temporal modelling and reasoning; geospatial modelling and reasoning', 'cross-linking between temporal and geospatial knowledge', 'visualization of rules with graphic models in order to support end-user interaction', 'Demos related to various Rules topics', 'Extensions and implementations of W3C RIF', 'Editing environments and IDEs for Web rules', 'Benchmarks and comparison results for rule engines', 'Distributed rule bases and rule services', 'Reports on industrial experience about rule systems']). query(ListOfKeywords):- %здесь будет ещё код, поэтому checktheme вызывается не напрямую пользователем checktheme(ListOfKeywords). checktheme(ListOfKeywords):- %sub_string(case_insensitive,ListOfKeywords,"rules"). - работает sub_string(case_insensitive,ListOfKeywords,session("",[])).
ИИ поможет Вам:
- решить любую задачу по программированию
- объяснить код
- расставить комментарии в коде
- и т.д