Skip to content

Optical flow with no shift allowed; True and False as constants in propositional sentences - #1398

Merged
dmeoli merged 6 commits into
masterfrom
tests/edge-cases-fill
Dec 2, 2026
Merged

dmeoli merged 6 commits into
masterfrom
tests/edge-cases-fill

Conversation

@dmeoli

@dmeoli dmeoli commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

every edge case of the matrix now has a test in Python, the only one missing was optical flow with no shift allowed
sum_squared_difference takes a max_shift (30 by default, as before), as in the Julia and JavaScript ports

True and False inside a propositional sentence are now constants: A & False is unsatisfiable, A | False is A, A | True is valid, ~False is True (to_cnf crashed on them, and expr made ~False the integer -1), also as operands of ==>, <== and <=>

the goal of double_tennis_problem put one player at both nets, the book (Figure 18.1) wants some player at either net: it is now the disjunct At(B, RightNet), and the doctest uses the joint plan of Figure 18.2

to_cnf raised AttributeError on A & False, and expr turned ~False into -1;
now A & False is False, A | False is A, A | True is True and ~False is True,
for to_cnf, dpll_satisfiable, cdcl_satisfiable, WalkSAT and pl_resolution.
@dmeoli dmeoli changed the title Optical flow with no shift allowed Optical flow with no shift allowed; True and False as constants in propositional sentences Dec 2, 2026
False |'==>'| A failed on bool | str: the infix operators are now InfixOp
strings, whose __ror__ takes a left operand that is not an Expr, and pl_true
builds the negations of ==> and <== as Expr, so that ~False is not -1.
…sjunct At(B, RightNet)

The goal put one player at both nets, and the doctest reached it with a third
move; now the joint plan of Figure 18.2, Go(A, RightBaseLine) and Hit(A, Ball),
reaches it.
@dmeoli
dmeoli marked this pull request as ready for review December 2, 2026 12:42
@dmeoli
dmeoli merged commit 9baf009 into master Dec 2, 2026
4 checks passed
@dmeoli
dmeoli deleted the tests/edge-cases-fill branch December 2, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant