Detect evidence dependence and conflict
Implement evidence_matrix(records, claims). Records contain claim, origin, and stance (support or oppose). For each requested claim, return sorted unique support and oppose origins and a state: contested if both sets are nonempty; corroborated if at least two support origins and no opposition; single_origin for exactly one support origin; opposed for opposition only; unsupported for neither. Ignore unrequested claims. Input records are already relevant and temporally eligible. This is an evidence bookkeeping algorithm, not automated fact verification.
Your task
- Complete the starter function using the contract above.
- Use the examples and visible tests to check normal inputs, boundaries, and rejected inputs.
- Run tests to record your result, then compare with the explained reference solution.
Examples
InputTwo copies from origin a support q
Outputsingle_origin
InputOrigin a supports q and origin b opposes q
Outputcontested
Implement the function, then run the tests.
Ctrl / ⌘ + Enter to test · Shift + Tab leaves editor