First-order logic: individuals, scope and finite models
一阶逻辑
Interpret functions and predicates, distinguish quantifier order, and build a finite model checker with correct variable scope.
first-order-logicEveryone has someone to ask. Is it the same someone?
Imagine a workshop with three participants. Ada can ask Bert for help, Bert can ask Chen, and Chen can ask Ada. No other help relationships are available in this hypothetical model.
| Person asking, x | Person who can help, y |
|---|---|
| Ada | Bert |
| Bert | Chen |
| Chen | Ada |
Let Helps(x,y) mean y can help x. The order of the arguments matters. Compare:
The first sentence says that each participant has someone to ask. It is true: the helper can depend on the person asking. The second says that one participant can help everyone. It is false: no column in the table covers all three people. Moving a quantifier changed which choices may depend on earlier choices.
First-order logic describes individuals, functions and relations, then combines assertions with logical connectives and quantifiers over individuals. It can express this distinction without listing a separate Boolean variable for every possible pair. Predicates and functions are interpreted by a structure; the quantifiers here do not range over predicates or functions. Klaus Sutner, CMU, slides 9–12 and 19
Our program will evaluate formulas in this specific three-person structure. A successful evaluation is not a proof that the formula holds in every possible structure.
Separate the expression from its interpretation
A signature lists nonlogical symbols and their arities, meaning their numbers of arguments. A constant symbol names one individual. A function symbol takes individuals as arguments and denotes an individual; a predicate symbol takes individuals as arguments and yields an assertion. A variable gets its value from an assignment, which a quantifier may temporarily change.
For this example, leader is a constant symbol interpreted as Ada. next is a unary function interpreted by the cycle Ada → Bert → Chen → Ada. Helps is the binary predicate defined by the table above. Thus next(leader) is a term denoting Bert, while Helps(leader,next(leader)) is a formula that is true here. A term by itself is not true or false. Constants can be viewed mathematically as functions with zero arguments; the program gives them a separate tag for readability.
A structure M supplies a nonempty domain D and the interpretations of its signature:
Functions must be total: each argument tuple has exactly one result in D. A predicate is a relation and may contain any subset of the permitted tuples. Equality means that two terms denote the same domain element, not that their spellings match. Different constant symbols may denote the same element, and a domain element need not have its own constant symbol. These are properties of ordinary first-order semantics, not optional defaults invented by the example. Open Logic Project, Definition 7.1 and §7.3
An assignment s gives values to variables. Write M,s ⊨ θ when formula θ is true under that structure and assignment. Terms are evaluated from their variable values, constant interpretations and function tables. Predicate applications look up the resulting tuple; equality compares the resulting elements. Connectives use their usual Boolean meanings. For a quantifier, s[x ↦ a] agrees with s everywhere except at x:
The same outer assignment is restored after a quantified subformula is evaluated. A later sibling subformula does not inherit the last value tried by the quantifier. This assignment-based definition is given explicitly in Sutner, slides 59–65.
A variable occurrence is bound by the nearest enclosing quantifier with that variable’s name. An occurrence outside such a scope is free. The same name can have both kinds of occurrence in one formula. A sentence has no free occurrences. Let FV denote the set of free variable names:
In (∃x x=leader) ∧ Helps(x,next(leader)), the first x is bound and the x in Helps is free. With the external assignment x = Chen, the left conjunct is true but the right one is false. The existential’s successful choice x = Ada must not leak into the right conjunct. By contrast, ∀x ∃x Helps(x,y) uses the inner quantifier for the x in Helps; the outer x has no bound occurrence in its body after that inner binding is accounted for. Renaming the inner bound x to a fresh z preserves its meaning. Open Logic Project, §§6.8–6.9
Quantifier order has a general one-way implication: if one y works for every x, it also supplies a witness separately for each x. The reverse implication fails in our cycle. This argument is about witness dependence, not the order in which a program happens to traverse a list.
Check a supplied finite structure
This Python 3.10+ program supports equality, predicates, constants, positive-arity functions, negation, conjunction, disjunction, implication and both quantifiers. It uses tagged tuples instead of parsing a text language:
| Tuple | Meaning |
|---|---|
('v','x') | Variable x |
('c','leader') | Constant leader |
('f','next',(term,)) | Unary function application |
('rel','Helps',(left,right)) | Binary predicate application |
('eq',left,right) | Equality between terms |
('not',body) | Negation |
('and',left,right); similarly or, implies | Boolean connective |
('forall','x',body); similarly exists | Quantified formula |
FiniteStructure accepts a nonempty list or tuple of distinct nonempty string labels. The labels are handles for domain elements; they do not have to be constant names. Constant, function and predicate interpretations are dictionaries. This interface requires their symbol names to be distinct across these three categories. Function and predicate entries have the form (arity, table) with a positive integer arity. A function table maps argument tuples to output labels; a predicate table lists exactly the tuples for which it is true. No table omission means “unknown” in this supplied structure.
The constructor copies these inputs and keeps interpretation tables in read-only mappings or frozen sets. It checks every row’s arity and membership in D. A function table must also have exactly |D| raised to its arity distinct input keys, and every output must belong to D. Since all its keys have already been checked as in-domain tuples, that count establishes totality without enumerating a second copy of the Cartesian product. Constants need not denote distinct elements. Empty domains, partial functions, out-of-domain values and malformed entries are rejected.
check first validates the entire syntax tree and computes its free variables, including branches that later short-circuit. Every free variable must be supplied in environment, with a value in the domain. Extra environment entries are allowed but also validated. The caller’s environment is copied; each quantifier saves and restores its internal binding in a finally block, including on early return.
Counters record formula-node visits, term-node visits and individual quantifier bindings during evaluation. They exclude construction and syntax validation. Quantifiers follow the supplied domain order. An existential returns at its first witness, a universal at its first counterexample, and connectives short-circuit from left to right. Those choices affect work counts, not the truth value.
from types import MappingProxyType
def symbol(value):
if type(value) is not str or not value:
raise ValueError('symbols and domain labels must be nonempty strings')
return value
class FiniteStructure:
def __init__(self, domain, constants, functions, predicates):
if type(domain) not in (list, tuple) or not domain:
raise ValueError('domain must be a nonempty list or tuple')
self.domain = tuple(symbol(x) for x in domain)
carrier = frozenset(self.domain)
if len(carrier) != len(self.domain):
raise ValueError('duplicate domain element')
if any(type(m) is not dict for m in (constants, functions, predicates)):
raise ValueError('interpretations must be dictionaries')
names = [symbol(name) for m in (constants, functions, predicates) for name in m]
if len(set(names)) != len(names):
raise ValueError('this interface requires distinct nonlogical symbol names')
if any(type(v) is not str or v not in carrier for v in constants.values()):
raise ValueError('constant value outside domain')
self.constants = MappingProxyType(dict(constants))
self.functions, self.predicates = {}, {}
for collection, functional in ((functions, True), (predicates, False)):
for name, specification in collection.items():
if type(specification) is not tuple or len(specification) != 2:
raise ValueError('interpretation must be (arity, table)')
arity, table = specification
if type(arity) is not int or arity < 1:
raise ValueError('function and predicate arities must be positive')
if functional:
if type(table) is not dict:
raise ValueError('function table must be a dictionary')
rows = table.keys()
else:
if type(table) not in (list, tuple, set, frozenset):
raise ValueError('predicate table must be a finite collection')
rows = table
if any(type(row) is not tuple or len(row) != arity
or any(type(v) is not str or v not in carrier for v in row)
for row in rows):
raise ValueError('invalid table row')
if functional:
if (len(table) != len(carrier) ** arity
or any(type(v) is not str or v not in carrier for v in table.values())):
raise ValueError('function must be total and domain-valued')
self.functions[name] = (arity, MappingProxyType(dict(table)))
else:
self.predicates[name] = (arity, frozenset(table))
self.functions = MappingProxyType(self.functions)
self.predicates = MappingProxyType(self.predicates)
def _term_vars(self, term):
if type(term) is not tuple:
raise ValueError('a term must be a tagged tuple')
match term:
case ('v', name):
return {symbol(name)}
case ('c', name):
if symbol(name) not in self.constants:
raise ValueError('unknown constant')
return set()
case ('f', name, args):
if symbol(name) not in self.functions or type(args) is not tuple:
raise ValueError('unknown function or invalid arguments')
if len(args) != self.functions[name][0]:
raise ValueError('function arity mismatch')
return set().union(*(self._term_vars(t) for t in args))
raise ValueError('invalid term')
def free_variables(self, formula):
"""Validate the entire finite syntax tree, including dead branches."""
if type(formula) is not tuple:
raise ValueError('a formula must be a tagged tuple')
match formula:
case ('rel', name, args):
if symbol(name) not in self.predicates or type(args) is not tuple:
raise ValueError('unknown predicate or invalid arguments')
if len(args) != self.predicates[name][0]:
raise ValueError('predicate arity mismatch')
return set().union(*(self._term_vars(t) for t in args))
case ('eq', left, right):
return self._term_vars(left) | self._term_vars(right)
case ('not', body):
return self.free_variables(body)
case ('and' | 'or' | 'implies', left, right):
return self.free_variables(left) | self.free_variables(right)
case ('forall' | 'exists', name, body):
return self.free_variables(body) - {symbol(name)}
raise ValueError('invalid formula')
def check(self, formula, environment=None):
free = self.free_variables(formula)
if environment is None:
environment = {}
if type(environment) is not dict:
raise ValueError('environment must be a dictionary')
env = dict(environment)
carrier = frozenset(self.domain)
if any(type(k) is not str or not k or type(v) is not str or v not in carrier
for k, v in env.items()) or not free <= env.keys():
raise ValueError('missing free variable or invalid environment entry')
stats = dict(formulas=0, terms=0, bindings=0)
absent = object()
def term_value(term):
stats['terms'] += 1
if term[0] == 'v':
return env[term[1]]
if term[0] == 'c':
return self.constants[term[1]]
args = tuple(term_value(t) for t in term[2])
return self.functions[term[1]][1][args]
def truth(node):
stats['formulas'] += 1
tag = node[0]
if tag == 'rel':
args = tuple(term_value(t) for t in node[2])
return args in self.predicates[node[1]][1]
if tag == 'eq':
return term_value(node[1]) == term_value(node[2])
if tag == 'not':
return not truth(node[1])
if tag == 'and':
return truth(node[1]) and truth(node[2])
if tag == 'or':
return truth(node[1]) or truth(node[2])
if tag == 'implies':
return not truth(node[1]) or truth(node[2])
name, body = node[1:]
previous = env.get(name, absent)
try:
for value in self.domain:
env[name] = value
stats['bindings'] += 1
answer = truth(body)
if answer == (tag == 'exists'):
return answer
return tag == 'forall'
finally:
if previous is absent:
env.pop(name, None)
else:
env[name] = previous
answer = truth(formula)
return dict(value=answer, free=tuple(sorted(free)), **stats)
model = FiniteStructure(
('Ada', 'Bert', 'Chen'), {'leader': 'Ada'},
{'next': (1, {('Ada',): 'Bert', ('Bert',): 'Chen', ('Chen',): 'Ada'})},
{'Helps': (2, {('Ada', 'Bert'), ('Bert', 'Chen'), ('Chen', 'Ada')})})
x, y = ('v', 'x'), ('v', 'y')
helps = ('rel', 'Helps', (x, y))
each_has_someone = ('forall', 'x', ('exists', 'y', helps))
one_helps_everyone = ('exists', 'y', ('forall', 'x', helps))
function_agrees = ('forall', 'x', ('rel', 'Helps', (x, ('f', 'next', (x,)))))
shadowing = ('and', ('exists', 'x', ('eq', x, ('c', 'leader'))),
('rel', 'Helps', (x, ('f', 'next', (('c', 'leader'),)))))
for label, formula in (('each', each_has_someone), ('one', one_helps_everyone),
('function', function_agrees)):
print(label, model.check(formula))
env = {'x': 'Chen'}
print('scope', model.check(shadowing, env), env)
The complete output is:
each {'value': True, 'free': (), 'formulas': 10, 'terms': 12, 'bindings': 9}
one {'value': False, 'free': (), 'formulas': 8, 'terms': 8, 'bindings': 7}
function {'value': True, 'free': (), 'formulas': 4, 'terms': 9, 'bindings': 3}
scope {'value': False, 'free': ('x',), 'formulas': 4, 'terms': 5, 'bindings': 1} {'x': 'Chen'}
For each, the inner existential tries 2, 3 and 1 helpers for Ada, Bert and Chen, respectively: six inner bindings plus three outer bindings. For one, Ada fails as a universal helper on the first person, Bert on the second and Chen on the first: four inner bindings plus three outer bindings. function checks the separate statement that next always names an available helper; that agreement is data in this example, not built into the function symbol. scope confirms both the false result and the unchanged external binding x = Chen.
Why does the evaluator work? By induction on terms, each term lookup returns its denotation in M,s. This establishes the atomic cases. The connective cases apply their truth functions. For a quantifier, the loop visits the domain values needed by its semantic clause and uses the induction hypothesis for its body. Saving and restoring the binding supplies the correct assignment to surrounding formulas. The syntax tree is finite and the domain is finite, so this abstract evaluation terminates. The Python implementation still has ordinary recursion-depth and memory limits.
Let d ≥ 1 be the domain size, L the unfolded syntax-tree size counting term and formula occurrences, e the environment size and q the maximum number of nested quantifiers. After the structure has been constructed, a safe time bound for check is
The L² term conservatively covers the validator’s repeated unions and copies of free-variable sets; it is not a lower bound. During evaluation, each syntactic occurrence can be revisited for at most d to the power q enclosing bindings. Tuple construction and hashing are charged by their argument counts, which are included in L. A conservative extra-space bound is O(1+d+e+L²), including validation sets, the active environment and recursion; the evaluator does not retain all d to the power q valuations. These bounds treat names and labels as atomic identifiers and assume expected constant-time dictionary/set operations per item. The structure’s stored tables are additional: an r-argument total function already requires d to the power r rows, before any formula is checked.
Truth in one structure is not validity in all structures
Keep four questions separate. Does M,s satisfy this formula? Does some structure and assignment satisfy it? Does every structure and assignment satisfy it? And does every model of some stated premises also satisfy it? These ask about model checking, satisfiability, validity and semantic consequence, respectively. For a sentence, an external assignment is unnecessary. One successful finite check proves that a sentence has a model; it does not establish validity. One failed check supplies a countermodel to validity; it does not establish unsatisfiability.
The input tables describe a complete chosen structure. Missing Helps tuples are false in that structure because the relation was specified that way. An incomplete record of real people is a different object: absence from a database need not justify the claim that a help relation is false in the world. Similarly, the word next contributes no promise that its interpretation is a cycle, and the constant leader contributes no leadership rules.
A finite checker cannot settle every first-order sentence by trying larger finite domains. For example, let f be a unary function and consider:
This requires f to be injective while missing some domain element. No finite nonempty domain works: an injective map of a finite set into itself has an image of the same size as the set, so it is surjective. On the nonnegative integers, f(n)=n+1 is injective and misses 0. Thus χ is satisfiable but has no finite model. The counting argument and this infinite witness establish that fact; a finite batch of failed searches would not.
For unrestricted classical first-order logic with effectively represented formulas, validity is undecidable: no algorithm always halts with a correct yes/no answer on every sentence. It is nevertheless semidecidable. A fair enumeration of finite proofs in an effective sound and complete proof calculus eventually finds a proof of every valid sentence, while this search runs forever on an invalid sentence. Unsatisfiability is semidecidable by applying that validity search to the negated sentence. General satisfiability is not semidecidable: if both it and its complement were, running the two recognizers alternately would yield the impossible total decision procedure. Restricted signatures and fragments can have stronger decision results. These distinctions follow from Open Logic Project, Theorem 13.16, Corollary 13.17 and Theorem 13.18.
Changing a variable’s value in an environment is also different from substituting a term into syntax. Replacing free x by y in ∀y Helps(x,y) must first rename that bound y to a fresh z, giving ∀z Helps(y,z). Naively producing ∀y Helps(y,y) captures the formerly free y and changes the claim. Our evaluator avoids textual substitution altogether; it does not implement a capture-avoiding substitution engine or a unification algorithm.
Change a relation, a scope or a domain
1. Count the quantifier-order difference
Keep the three-person domain, but allow any binary Helps relation, including self-help. Among its 512 possible tables, how many satisfy ∀x∃y Helps(x,y), and how many satisfy ∃y∀x Helps(x,y)? No condition involving next is imposed in this counting experiment.
Answer: Each of three rows must be a nonempty subset of the three possible helpers, giving 7³ = 343 tables for the first sentence. For the second, at least one of the three columns must be full. Inclusion–exclusion gives 3×2⁶ − 3×2³ + 1 = 169 tables. Two named full columns leave three free entries; three full columns leave no free entries. Every table in the second group belongs to the first group, but the cycle in the opening does not belong to the second. The tests enumerate all 512 tables to check these counts.
2. Restore the outer x
Evaluate (∃x x=leader) ∧ Helps(x,next(leader)) under x = Chen in the workshop structure. Which x is free? What result could a faulty implementation produce if it leaked the existential’s witness?
Answer: The x in Helps is free; the x in the equality is bound. The existential succeeds immediately with Ada. It must then restore x = Chen, making Helps(Chen,Bert) false. The whole formula is false, and the caller’s environment remains unchanged. Leaking x = Ada would instead test Helps(Ada,Bert), producing the incorrect result true.
3. Equality and total functions
Add a second constant symbol alias interpreted as Ada. Is leader=alias true? If next has entries only for Ada and Bert, may the evaluator simply return false when it needs next(Chen)?
Answer: The equality is true because both constants denote the same individual. Different names do not imply different denotations. The two-row next table is not a valid interpretation of a total unary function on this domain; the constructor must reject it. A missing predicate row denotes false in the supplied relation, but a missing function output does not denote either a domain element or a Boolean falsehood.
4. Separate a finite test from a proof
Suppose χ from the limitations section fails for every unary function on domains of sizes 1 through 4. Does that establish unsatisfiability? How many function tables were tested, and what mathematical argument settles the finite-domain part?
Answer: There are 1¹ + 2² + 3³ + 4⁴ = 288 tables. Those tests alone establish only their own finite cases. For every finite size, injectivity forces the image to contain as many distinct elements as the domain, hence to be the entire domain; this contradicts the missing-value conjunct. On the infinite domain of nonnegative integers, the successor function supplies a model. The sentence is therefore satisfiable and has no finite model.
Use semantics to decide what a result means
Sutner’s CMU slides separate syntax, structures, assignments, finite model checking and proof theory. The cover says Spring 2023; the filename’s F23 is not used to infer a different teaching term. The Open Logic Project’s Sample Logic Text provides explicit definitions of free occurrences, substitution conditions, structures and the undecidability/semidecidability boundary. Only relevant sections were read; the project text is CC BY 4.0, and no passage, program or figure is reproduced here.
The tests use a second semantics based on relations of complete valuations. Connectives become set operations; quantifiers project away a coordinate and retain groups with some or all domain values. That implementation shares no mutable environment with the article’s evaluator. It checks the workshop counts, all 512 three-person help relations, 40,960 formula/structure/assignment cases on two-element domains, scope renaming, capture counterexamples, function totality and the 288 finite function tables. These are AI-assisted technical checks, not human review or a general theorem-prover certification. The unification chapter develops substitutions between terms separately.
Make a prediction, then check
In the cycle Ada asks Bert, Bert asks Chen, Chen asks Ada, Helps(x,y) means y can help x. Which statement is correct?
Learning objectives
- Distinguish individuals, constant/variable/function terms, predicate formulas and interpretations, checking total functions and equality in a finite nonempty structure.
- Explain free occurrences, nearest quantifier bindings, quantifier order and capture-avoiding substitution, checking shadowing and environment restoration.
- Implement finite-structure model checking with independent relational-projection verification, distinguishing truth in a fixed structure, satisfiability, validity and general semidecision limits.
Prerequisites & connections
Explore related knowledge →References
- CDM — First-Order Logic
Klaus Sutner; Carnegie Mellon University · 2023 - Sample Logic Text — Open Logic Project
Open Logic Project
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Codex · 2026-09-05 · Codex technical check: primary-source locations, original runnable models, independent finite-state oracles, bilingual review and second-agent cross-checks; not independent human peer review.
- Author AI technical self-check: reread both languages for terms versus formulas, total functions/predicate tables/equality, co-referring constants and unnamed elements, nonempty domains, free occurrences/nearest binding, quantifier dependence, try/finally restoration and validation of dead branches. Code and6 display equations match exactly;6 anchors and4 answered exercises correspond; review written, not human review.
- Final8 tests executed successfully with no skips. The relational-algebra oracle represents satisfying valuations as sets, uses set operations for connectives, and implements quantifiers by coordinate projection/group counts, sharing no mutable-environment evaluation algorithm. All128 two-element structures (4 unary functions×2 constant values×16 binary relations),80 seeded formulas each and4 external assignments yield40,960 matching cases, including shadowing, free variables, function terms and connectives.
- Also independently counted rows/columns for all512 three-person binary tables:343 satisfy∀∃ and169 satisfy∃∀, with the latter contained in the former. Exhausted288 unary function tables at sizes1–4 and checked injection/missing values by image cardinality; none satisfies both. The general finite impossibility is proved by finite counting, and infinite satisfiability uses nonnegative-integer successor, not extrapolation from tests. Checked binder renaming/capture counterexamples, binary/nested functions, aliased constants, rejected partial functions, empty relations/nonempty domains, invalid syntax/inputs, complete free-variable requirements before short-circuiting and preserved caller input.
- Executed complete example: each true/10 formula visits/12 term visits/9 bindings; one false/8/8/7; function true/4/9/3; scope false/4/5/1 with external x=Chen unchanged. Evaluation work is separated from conservative validation set-copy bounds; domain order/short-circuiting affect counts but not truth. The d^r function-table size and Python recursion/memory limits are explicit.
- General classical first-order validity is undecidable but semidecidable by fair proof enumeration; unsatisfiability reduces to validity of a negation, and a semidecision procedure for satisfiability would yield a forbidden total decider by dovetailing. This concerns unrestricted effectively encoded first-order sentences, with restricted fragments treated separately. Fixed/finite/all structures and truth in standard arithmetic are not conflated. No proof search, capture-avoiding substitution engine or unification implementation claimed.
- Each locale was individually compiled with repository math plugins and KaTeX strict:error/throwOnError:true and actually rendered through React renderToStaticMarkup:6 displays/6 headings/4strong answer labels, with no KaTeX errors or literal emphasis outside code. Targeted prose scan and bilingual reread performed. Only /tmp/aiwiki-next-first-order-logic written; no repository/registry mutations, whole-site build or browser visual acceptance. Awaiting separate AI cross-review.
- A second AI agent read both complete articles, the original finite-structure program, eight tests and metadata without edits. Checked terms versus formulas, symbols/arities, nonempty domains, total functions/arbitrary predicate subsets, denotational equality, aliased constants, free/bound occurrences, nearest binding, shadowing, quantifier dependency and the conceptual boundary of capture avoidance. No algorithmic, numerical or source-attribution defect found; no author/repository edits.
- Independent /tmp/aiwiki-first-order-logic-independent-review.py compiles variable occurrences to lexical binder distances (de Bruijn-style indices) or free variables, grounds quantifiers using immutable value stacks into finite Boolean trees, then short-circuit evaluates those trees. It reuses neither the author’s relational-projection oracle nor mutable named-environment updates during evaluation. Complete results are compared: free-variable set, truth and all three formula/term/binding counters.
- Exhausted all 512 three-person Helps tables ×six domain orders ×four article queries for 12,288 comparisons. Another 160 seeded structures with one-to-four-element domains, two possibly aliased constants, total unary/binary functions and unary/binary predicates, across 24 mixed formulas of generation depth at most four ×two external assignments ×forward/reversed domain order give 15,360 comparisons. All 27,648 complete results agree. Another 768 bijective domain-label renamings of the entire interpretation and external assignment preserve truth and counts.
- Exhausted all 81 missing-row/output combinations for binary function tables on two elements: 16 total maps accepted and 65 partial maps rejected, checked independently by equality of key sets with the full Cartesian product. Traced actual truth frames: 21 normal/early quantifier returns restore the entire internal environment to entry state. Threw an exception at atomic term evaluation inside two quantifiers, retaining the actual env reference to verify finally restoration of prior bindings and unrelated entries. The exception audit concerns this injection point, not arbitrary resource-failure recovery.
- Actually reran all eight final author tests successfully. Reproduced each true/10 formulas/12 terms/9 bindings, one false/8/8/7, function true/4/9/3 and scope false/4/5/1 with caller x=Chen unchanged; the 343/169 relation counts and 288 function-table count are correct. Checked empty-domain rejection, missing function outputs, out-of-domain values, invalid arities, dead-branch syntax/free-variable prevalidation, copied/frozen input data and validation of extra environment entries.
- Independently checked mathematical limits: fixed-structure evaluation differs from satisfiability, validity in all structures and semantic consequence. Injective/nonsurjective sentences have no nonempty finite model but successor on nonnegative integers supplies an infinite model; failed finite batches do not prove unsatisfiability. Validity is undecidable yet semidecidable by fair proof enumeration, unsatisfiability reduces to validity of negation, and the dovetailing argument against semidecidable general satisfiability is valid for unrestricted effectively encoded classical first-order sentences. The check bounds O(1+d+e+L²+Ld^q) time and O(1+d+e+L²) extra space are conservative after tables are supplied, accounting for free-variable set copies, tuple arities and atomic-symbol cost assumptions; d^r total-function storage is separate.
- Both Python blocks equal example.py, with six matching displays, six stable anchors and four answers. Independently compiled with current repository math plugins, remark-math and strict:error/throwOnError:true KaTeX, then actually rendered React static HTML: six displays/six headings/four strong answers each, no KaTeX errors or emphasis remnants outside code. Only the independent reference, review JSON and review HTML were saved under /tmp; no whole-site check/build, browser visual QA or human peer-review claim.
- Promotion preserves full prose, equations, program and exercises. Tests load published articles only, with draft fallback/skip paths removed and the first-order review assertion updated to checked; algorithm and independent oracle logic are unchanged. Final review binds both MDX SHA-256 hashes.
- After group publication, reread the navigation paragraph and changed completed first-order logic, unification or resolution directory entries to their articles, removing stale pending wording. Algorithms, derivations, prior sources and exercises are unchanged; final MDX hashes bind this scoped navigation revision.
- Final static checking found trailing spaces caused two display lines to be omitted from the source count although HTML rendered6displays. Removed only trailing spaces from those paired lines, preserving every formula symbol and rebinding hashes; the equation checker is unchanged.
Source locations checked:
- CDM — First-Order Logic · Actually read cover PDFp1 (Klaus Sutner/CMU/Spring2023), printed slides9–12 (individual variables, constants, functions, relations, arities),19 (first-order versus relation quantification),24–28 (terms/atoms/equality/grammar),32–35 (free variables and shadowing; the universal-closure convenience is not our API),38–40 (structures/interpretations),59–65 (term values, satisfaction under assignments, quantifier update, validity/satisfiability),66 and69–71 (finite table model checking),82–86 (effective proof enumeration and soundness/completeness). Infinite-model/injectivity context at85 was read. Scope of actual reading excludes a full-deck or source-code audit.
- Sample Logic Text — Open Logic Project · Actually read cover PDFp1/lines0–8 for title and CC BY4.0. Definitions6.33–6.37/PDFpp82–83, printed73–74, lines2806–2860 distinguish free occurrences, bound occurrences, scope and sentences. Definitions6.38–6.41 and discussion/PDFpp83–84, printed74–75, lines2861–2914 specify capture-free substitution. §7.1–7.3/PDFpp85–87, printed77–79, lines2916–2999 define satisfaction, nonempty domains, constant/function/predicate interpretations and equality context. Read §13.8/Theorem13.16, Corollary13.17, Theorem13.18/PDFpp211–212, printed203–204, lines7950–7991 for undecidability and proof-enumeration semidecidability. Article’s non-semidecidable-satisfiability statement is explicitly derived by dovetailing with its semidecidable complement. No general result inferred from finite model experiments.
- CDM — First-Order Logic · Independently opened/read the official 95-page CMU deck. Read cover/title lines0–4 for Klaus Sutner/CMU/Spring2023; slides9–12 and19 for individual quantification, syntax categories and arities; slides28,32–35 for term/formula distinction, free variables and shadowing, including the explicitly unadopted universal-closure convenience; slides59–66, lines591–683, for assignments, term values, atomic/connective/quantifier semantics, satisfiability and finite table evaluation; slide56, lines556–565, and85, lines871–882, for injective nonsurjective/infinite-model context; slides82–86, lines836–890, for effective proofs and soundness/completeness. This reviewer did not claim a full-deck read, full proof-theory development or reproduction of slide examples.
- Sample Logic Text — Open Logic Project · Independently opened/read the official 384-page Sample Logic Text. Read cover lines0–8 for the OLP title and CC BY4.0 without inventing a revision year. Read §§6.8–6.9/Definitions6.33–6.41, printed73–75 (PDF82–84), lines2806–2914, on free/bound occurrences, nearest scope, sentences and restrictions preventing variable capture. Read §7.1 introduction, printed77/PDF85, lines2916–2928, for nonempty domains, interpreted constants/functions/relations and satisfaction relative to assignments. Read §13.8/Theorem13.16, Corollary13.17 and Theorem13.18, printed203–204/PDF211–212, lines7950–7988, for general validity/satisfiability undecidability and proof-enumeration semidecidability. Independently checked the article’s complement/dovetailing inference for non-semidecidable general satisfiability; did not infer general results from finite examples or claim a full-book audit.
Related topics