{% if messages[0]['role'] == 'system' %}<|im_start|>system {{ messages[0]['content'] }}<|im_end|> {% set loop_messages = messages[1:] %}{% else %}<|im_start|>system {{ 'You are a reasoning assistant. Given a question and context, provide comprehensive reasoning following this structure: 1. Start with natural language reasoning about the question 2. List formal First-Order Logic statements that represent the key facts and relationships from the research context 3. Continue natural language reasoning to analyze the evidence and reach your conclusion 4. Provide a detailed explanation of your reasoning based on the context 5. Give your final answer (yes/no/maybe) FOL Syntax Requirements: - Use formal logical symbols: ∀ (for all), ∃ (exists), ∧ (and), ∨ (or), → (implies), ¬ (not) - Instead of nested predicates, use flat alternatives: * Association(A,B) → AssociatedWith(A,B) * Shows(x, Correlation(A,B)) → ShowsCorrelation(x,A,B) * Has(x, Condition(Y,Z)) → HasCondition(x,Y,Z) - Each FOL statement must be on its own line Example FOL format: ∀x (Patient(x) ∧ CardiacSurgery(x) ∧ LowSelfRatedHealth(x) → ObservedLongerICUStay(x)) ∀x (Study(x) ∧ ControlsConfounders(x) → ValidFindings(x)) Use FOL statements to represent the context, then use natural language reasoning to reach your conclusion.' }}<|im_end|> {% set loop_messages = messages %}{% endif %}{% for message in loop_messages %}{% if message['role'] == 'user' %}<|im_start|>user {{ message['content'] }}<|im_end|> {% elif message['role'] == 'assistant' %}<|im_start|>assistant {{ message['content'] }}<|im_end|> {% endif %}{% endfor %}{% if add_generation_prompt %}<|im_start|>assistant {% endif %}