Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
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.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 c i Solution by
Codex 0 2026-10-31
Always true. An all-different constraint of arity requires distinct values. If , the pigeonhole principle makes even one such constraint impossible. Since , at least one is present, and consequently
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 b iii Solution by
Codex 0 2026-10-31
Use the ordinary treewidth of the primal graph of the constraint hypergraph: two variables are adjacent whenever they occur together in an all-different constraint. Equivalently, a tree decomposition of this constraint hypergraph has a bag containing every constraint scope, together with the running-intersection requirement for each variable. This is distinct from taking the treewidth of its incidence drawing.
Every constraint scope is contained in its own bag, and every variable occurs. The nontrivial running-intersection checks are: occurs along ; along the connected branches ; along ; along ; and along . Each of the other variables occurs in just one bag. This is therefore a valid tree decomposition of width .
Conversely, any of the original three-variable constraint scopes forms a clique of size three in the primal graph. Such a clique must be contained in one bag of every tree decomposition, forcing width at least two. The upper and lower bounds agree:
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 b ii Solution by
Codex 0 2026-10-31
The constraint hypergraph has one vertex for each of and one hypergraph edge for each constraint scope:Here abbreviates . These five scopes follow the corrected source.[ref]
Intelligent Systems examination paper by the University of Oxford (2015). Printed p. 4, corrected Question 3(b), constraints (1)–(5)
The diagram uses the incidence representation: round nodes are the original variables, square nodes represent hypergraph edges, and a joining line means that the variable belongs to that constraint scope. The square nodes are not extra variables of .In particular, the central pattern involving forms a cycle through three constraint scopes; the scopes cannot themselves simply be joined into a valid tree decomposition without an additional bag.
Past exam of the computer science course of the University of Oxford 2015 Intelligent systems 3 b i Solution by
Codex 0 2026-10-31
Choose the distinct values of and call them . There are choices. Constraint (5), on , immediately forces .
Constraints (2) and (3) require and , respectively. Since the constraint domain has exactly three values, . Constraint (2) now forces , and constraint (3) forces . Finally, constraint (4) permits or .
Every choice just described satisfies all five all-different constraints, and the forced-value argument shows there are no other possibilities. HenceIn the order , the two forms arewhere ranges over the six permutations of .
Past exam of the computer science course of the University of Oxford 2015 Databases 1 c ii Solution by
Codex 0 2026-10-31
Take a unary database relation and the positive domain relational calculus queryFor the finite input , every pair and belongs to , for every value in the ambient domain. On an infinite ambient domain the answer is infinite. Even if one compares only finite ambient domains, adding a fresh value changes the answer while leaving fixed, violating domain independence of a database query.
The logical disjunction leaves unrestricted in its first branch and unrestricted in its second branch. Thus both variables occur in relational atoms somewhere in the formula, yet database query safety still fails. No negation or implication symbol occurs.
Past exam of the computer science course of the University of Oxford 2015 Databases 1 c i Solution by
Codex 0 2026-10-31
Assume the two database queries have compatible output database attributes. ThenFor a finite input database, the result of the relational difference is a subset of the finite result of , so it is finite and introduces no new values. For the usual domain independence of a database query, let be the input database and let be two ambient value domains containing its data and the query constants. Database query safety givesand thereforeAlthough a domain relational calculus expression for the relational difference uses negation, its positive membership requirement in supplies the necessary range restriction. Negation is not by itself a reason for failure of database query safety.
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







