Topics (374k) Articles (387k) Users (410) Discussions (242) Comments (383) Files (12k) New article
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 3 f i Solution by
Codex 0 2026-10-31
For polynomial-time many-one reductions, an unconditional example is the empty language:A procedure that rejects every input decides it in constant time, so it belongs to P and hence NP. It is not NP-hard: the nonempty formal language belongs to NP, but no many-one reduction can satisfyThe right-hand side is always false. Thus the hardness condition fails without assuming . Giving an ordinary nontrivial problem in P would not establish the requested separation unconditionally, because that would require excluding the possibility .
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 3 c iii Solution by
Codex 0 2026-10-31
Add the ground atomTogether with the three rules above, this is the Datalog with negation knowledge base . There are no supplied divisibility facts and no other year facts. In particular, nothing in this knowledge base asserts or .
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 3 c ii Solution by
Codex 0 2026-10-31
The remaining classification rule isThe positive premise restricts the rule to years. Its negation as failure premise is evaluated by stable model semantics; it does not assert a separately stored negative fact. This gives a stratified Datalog program: divisibility and year facts are inputs, leap status is computed next, and common status last.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 3 c i Solution by
Codex 0 2026-10-31
Use
not for negation as failure, rather than classical logical negation. The disjunctive condition is expressed by two separate Datalog with negation rules:The positive premise restricts the rule to years and makes the variable explicitly safe. The divisibility relation is input data; the integer-looking constants do not make arbitrary arithmetic facts true automatically. Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 2 a ii Solution by
Codex 0 2026-10-31
Absorb (4) using the equivalenceThus we can takeHere is a primitive inclusion, handled by adding whenever labels a node. For literal substitution-based TBox unfolding, introduce a fresh description logic concept and replace the primitive inclusion byThis preserves the original models after forgetting : any model of the primitive inclusion extends by taking , and any model of the new definition satisfies the primitive inclusion. The fresh name is important. Replacing by alone would incorrectly assert that every non- element is an element.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 2 a i Solution by
Codex 0 2026-10-31
An initial split into an acyclic definition and the remaining general concept inclusions isThe definition of is suitable for TBox unfolding: its right-hand side does not depend on , and has only this defining left-hand side. The other displayed general concept inclusions do not initially have an atomic defined left-hand side. In particular, can be rewritten for TBox absorption, but is not already an atomic definition.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 d iii Solution by
Codex 0 2026-10-31
An exponential increase is unavoidable for an equivalent conjunctive normal form over the original variables. Consider the linear-size Boolean formulaDistributing gives the Boolean clausesTo prove that the growth is necessary, fix one choice . Let make every false and its partner true. Each pair then contains a false variable, so is false. Any equivalent conjunctive normal form must contain a Boolean clause falsified by and entailed by .
Every individual term entails , because that term implies . After tautological Boolean clauses are discarded, this forces to contain a positive or positive for every : otherwise set both variables in that pair true and independently falsify all Boolean literals of , contradicting the entailment. Since is false at , it must contain the false member , never its true partner. Consequently the same cannot be false at any different . The different assignments therefore require at least different Boolean clauses.
Writing the answer already takes . This obstruction applies to first-order logic as well, since the example can be expressed using ground unary atomic formulas. It concerns exact equivalence without auxiliary symbols. A Tseytin transformation can produce a polynomial-size equisatisfiable conjunctive normal form with auxiliary variables, so the statement must not be extended to that different task.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 d ii Solution by
Codex 0 2026-10-31
The usual transformation to clausal normal form preserves . Removing implications and distributing logical conjunction and logical disjunction preserve logical equivalence. Skolemization introduces new symbols and chooses witnesses as functions of preceding universally quantified variables.
For example,On the domain , let be equality. Then is true. Expand this same first-order structure by interpreting as the constant function with value . The resulting first-order structure falsifies at . Interpreting as the identity instead satisfies .
Thus every model of has a reduct satisfying , and a model of can be expanded with suitable witnesses to satisfy . That model-expansion property gives equisatisfiability, not logical equivalence for every interpretation of the added function. If “CNF” means a conjunctive matrix with existential quantifiers retained, Skolemization has not yet happened and an equivalent form is possible; this is why the convention must be specified.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 d i Solution by
Codex 0 2026-10-31
For resolution, a first-order sentence is in clausal normal form when it is a universally quantified logical conjunction of first-order clauses:where every is a first-order literal, meaning an atomic formula or the logical negation of an atomic formula. The quantifiers are often left implicit and the first-order clauses treated as a set. The empty first-order clause represents falsity; an empty set of first-order clauses represents truth.
A convention that allows an arbitrary quantifier prefix followed by a conjunctive matrix is weaker: that is a prenex normal form with a conjunctive matrix. The elimination of existential quantifiers by Skolemization is the extra step relevant to resolution and to part (ii).
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 c iv Solution by
Codex 0 2026-10-31
In ALC, is representable over the given symbols. It is the general concept inclusionEquivalently, use one general concept inclusion for each category. Unary predicates become description logic concepts and the supervision predicate becomes a description logic role.
Sentence (i) depends on a ternary predicate evaluated at two named constants. Basic ALC has unary description logic concepts and binary description logic roles, with no constructor for that course-and-year slice of a ternary predicate. Sentence (iii) uses a counting function and a comparison relation that basic ALC cannot express. Replacing these conditions by freshly named description logic concepts would give an informal encoding, but would not define their meanings or establish equivalence in the supplied vocabulary.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 c iii Solution by
Codex 0 2026-10-31
The standard relational guarded fragment contains . In (i), guards the only quantified variable:The constants in the course-taking relation do not introduce additional free variables that need guarding.
For (ii), use the two implications from part (c)(i). Each outer universal quantification is guarded by its unary category predicate. The inner existential quantification can be writtenwhose guard contains both and . Sentence (iii) uses a nonconstant function and so is outside the standard relational guarded fragment. This conclusion uses the original vocabulary; it does not silently replace the counting term by a fresh relation.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 c ii Solution by
Codex 0 2026-10-31
For ordinary function-free Datalog, has the required form. Sentence (i) is not a definite first-order Horn clause: the category choice gives two positive alternatives, and its second clause is a negative constraint. Even allowing constraints would not remove the positive choice. Semantically, the category-choice condition fails closure under intersection of interpretations with fixed domain and functions: one model can choose only the undergraduate category, another only the masters category, and their intersection chooses neither.
Sentence (ii) needs an existentially supplied supervisor. Function-free Datalog cannot demand such a witness without naming or otherwise fixing it in the rule. Its Skolemized form is a first-order Horn clause with a function, rather than a Datalog rule. Sentence (iii) also contains a nonconstant function. Being Horn is therefore insufficient for membership in Datalog.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 c i Solution by
Codex 0 2026-10-31
With existential rules understood as function-free tuple-generating dependencies, belongs to the fragment. Split its antecedent to obtainThese two existential rules have exactly the same meaning as (ii): either category requires a supervisor, and when both hold the same supervisor may witness both requirements.
Sentence (i) requires a genuine choice between two positive alternatives and also an exclusion condition. Positive existential rules cannot enforce that exclusion: interpreting all their relations as full relations on a one-element domain always satisfies them, whereas that interpretation violates (i). Sentence (iii), in the supplied vocabulary, uses the nonconstant function and is therefore outside the function-free fragment. Introducing a new relation for the counting comparison would change the representation and require additional axioms; it is not an equivalent sentence in the stated vocabulary.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 a iii Solution by
Codex 0 2026-10-31
Using the supplied counting function, an appropriate first-order sentence isHere the counting comparison expresses the threshold and the existential quantification expresses teaching at least one course. The word “if” supplies this direction of logical implication; it does not assert that these are the only reasons a faculty member can be busy. With the intended meanings of the nonlogical symbols, no further counting axioms are needed for this translation. If those meanings were unspecified, the displayed first-order sentence alone would not define arithmetic or connect the counting function to the supervision relation.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 a ii Solution by
Codex 0 2026-10-31
The supervisor can depend on the student, so the existential quantification belongs inside the universal quantification:The first-order sentence permits different students to share a supervisor. It requires neither that the supervisor be different from the student nor that the supervisor be a faculty member, since neither additional condition was given.
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 a i Solution by
Codex 0 2026-10-31
The condition about taking the course restricts which students the first-order sentence talks about. Within that condition we need both an inclusive logical disjunction and a prohibition on satisfying both alternatives:The logical conjunction on the right expresses exactly one of the two categories. It does not prohibit unrelated individuals from belonging to both categories: the restriction applies to the students in the antecedent.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 c v Solution by
Codex 0 2026-10-31
Always true for a nonempty finite constraint domain, as conventionally assumed. Write and identify its values with . For each satisfying assignment , simultaneously replace every value byThis permutation of the common constraint domain preserves every equality and inequality, hence every all-different constraint. The resulting assignments are distinct: equality of even one coordinate before and after a shift forces . There is at least one variable, since and .
The cyclic group of shifts therefore partitions the solution set into disjoint orbits of size . It follows thatThe conclusion includes an unsatisfiable instance, whose solution count is zero. Full permutation group orbits need not have size , because unused values can be permuted without changing an assignment; the cyclic-shift argument avoids that mistake.
If an empty constraint domain is permitted, there are zero assignments here, but the wording “divisible by ” then asks about divisibility by zero, which is ordinarily left undefined. The asserted divisibility uses the standard nonempty-domain convention, and the no-solution conclusion still holds for that degenerate input.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 c iv Solution by
Codex 0 2026-10-31
Always true. Replace every all-different constraint by the pairwise inequalities on its scope. Then solutions are precisely the proper graph colourings of the primal graph using values from as colours. Put .
A graph of treewidth has a proper graph colouring with at most colours. Here is a constructive proof. In a width- tree decomposition, remove any leaf bag contained in its neighbor. If more than one bag remains, a leaf bag has a vertex absent from its neighbor. The running-intersection property means that vertex occurs only in the leaf bag, so every neighbor of the vertex belongs to that bag. It has at most neighbors. If only one bag remains, it has at most vertices and the same degree bound holds.
Remove the chosen vertex and repeat; deleting vertices cannot increase the width of the restricted tree decomposition. Now colour in reverse removal order. At most already coloured neighbors forbid colours, so one of colours is always available. Since the integer inequality gives , this produces a satisfying assignment:The common unrestricted constraint domain and the exclusively all-different constraints are essential: arbitrary constraint relations do not reduce to graph colouring in this way.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 c iii Solution by
Codex 0 2026-10-31
True in some cases and false in others. Equality of the constraint domain size and treewidth does not decide satisfiability.
For an unsatisfiable example, let and impose the three binary all-different constraints , , and . The primal graph is a triangle, with treewidth two. It needs three different values, so no solution exists despite .
For a satisfiable example, take four variables with the same constraint domain and constraintsIts primal graph is a four-cycle of treewidth two: bags and give width two, while width one would require a forest. The assignment satisfies all constraints.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 c ii Solution by
Codex 0 2026-10-31
True in some cases and false in others: the two numerical inequalities do not guarantee a solution.
For an unsatisfiable example satisfying both inequalities, take six variables, a constraint domain with five values, and , , with all-different constraints onAny pair of the six variables occurs together in at least one of these scopes: view the variables as the three pairs , and each scope as the union of two pairs. All six values must therefore be distinct. This is impossible with five available values, even though and .
For a satisfiable example with the same , take three disjoint groups of four variables and impose one all-different constraint on each group. Assign values separately in every group. All three constraints hold with .These examples concern the intended cases in which the antecedent holds; they do not rely on vacuous truth of an implication.
Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact





