Logic Production Systems 2
A reimplementation of the LPS engine in SWI-Prolog, held to LPS1's own corpus trace-for-trace. Build 2026-08-05T00:19:17.089Z
LPS2 45
- blocks — blocks.lps — the example that separates the two searches (§I.7.4).
- blocks3d — blocks3d.lps — the same blocks world, in three dimensions.
- goat_declarative — The wolf, goat and cabbage, stated rather than solved.
- lights — lights.lps — a program you can click on.
- thermostat — thermostat.lps — a program that never ends, waiting for the world.
Kowalski book 12
- rkbook/citizenship_time — citizenship_time.lps — Kowalski, ch. 6 §6.3: representation of time and
- rkbook/event_calculus — event_calculus.lps — Kowalski, ch. 13 §13.3–13.4: the simplified calculus
- rkbook/fox_crow — fox_crow.lps — Kowalski, ch. 3: the fox and the crow.
- rkbook/hunger — hunger.lps — Kowalski, ch. 8 §8.3: the time factor.
- rkbook/louse — louse.lps — Kowalski, ch. 7 §7.5: what it is like to be a louse.
- rkbook/mars_explorer — mars_explorer.lps — Kowalski, ch. 7 §7.7: what it is like to be a Mars explorer.
- rkbook/penalty — penalty.lps — Kowalski, ch. 1 §1.5: the penalty sentence as an inhibitor.
- rkbook/plan_generation — plan_generation.lps — Kowalski, ch. 13 §13.6: the event calculus for plan
- rkbook/trolley — trolley.lps — Kowalski, ch. 12 §12.2–12.3: the runaway trolley, and the
- rkbook/umbrella — umbrella.lps — Kowalski, ch. 11 §11.2: should you carry an umbrella?
- rkbook/underground — underground.lps — Kowalski, ch. 1: the London Underground Emergency Notice.
- rkbook/violations — violations.lps — Kowalski, ch. 12 §12.4: what to do about violations.
PDDL 18
Drools 5
Minecraft 3
- minecraft/craft — craft.lps — planning over crafting (Part III).
- minecraft/hungry — hungry.lps — a constraint blocking an action, and then explaining itself.
- minecraft/safety — safety.lps — the supervisory tier of a Minecraft agent (Part III, §V.4).
agent 2
- agent/approval — approval.lps — Appendix C's approval gate, as a running program (Part II).
- agent/approval_ide — approval_ide.lps — the Part II safety property, from the IDE alone.
corpus 158
- Ballot — By BK, modified by MC:
- bank account_terse — /** <examples>
- binaryChop
- binaryChop2 — %a(Position,Content)
- dining_philosophers_terse — this must be the FIRST directoive in the file:
- ethereumAntecedent — system fluents below will take a while to succeed, so avoid using maxTime(Cycles):
- ethereumAsync — This illustrates the use of assynchronous Ethereum calls
- goat
- just rains — just rains.lps
- lamport_clock — Lamport's clock example in LPS
- oneprisoner — oneprisoner.lps
- party
- party_minimal — This ilustrates a bug:
- readwrite — %timeout(3600).
- saidsay — %timeout(3600).
- server_space_monitor — Notice that this background server needs relaunching after SWI Prolog restarts.
- simple-smart-contract
- slamodel — slamodel.lps SLA Model as a smart contract
- tictactoe — slot((R,C)) :- member(R, [1,2,3]), member(C,[1,2,3]).
CLOUT workshop 76
- CLOUT_workshop/Escrow — From section 2.2 in http://csp2017.mimuw.edu.pl/data/uploads/papers/CSP2017_paper_24.pdf :
- CLOUT_workshop/GameWithOracle — Based on http://www.liquidity-lang.org/doc/tutorial/game.html, a single player game
- CLOUT_workshop/GameWithOracleSimpler — Inspired on http://www.liquidity-lang.org/doc/tutorial/game.html, a single player game
- CLOUT_workshop/RockPaperScissors — From "Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab",
- CLOUT_workshop/RockPaperScissors-Minimal — these could be inferred:
- CLOUT_workshop/RockPaperScissors-Minimal-en — Formal English specification of the game:
- CLOUT_workshop/RockPaperScissorsBase — Rock, Paper, Scissors
- CLOUT_workshop/RockPaperScissorsBaseEN — Rock, Paper, Scissors
- CLOUT_workshop/RockPaperScissorsEthereum — Rock, Paper, Scissors "gambling" on Ethereum
- CLOUT_workshop/RockPaperScissorsEthereumFEn — /** <examples>
- CLOUT_workshop/RockPaperScissorsServer — From "Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab",
- CLOUT_workshop/RockPaperScissorsServer-noProspectivePCs — From "Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab",
- CLOUT_workshop/SzaboLanguage_futures — /*
- CLOUT_workshop/SzaboLanguage_futures_failing — First example from https://nakamotoinstitute.org/contract-language/
- CLOUT_workshop/SzaboLanguage_insurance_base — Original:
- CLOUT_workshop/SzaboLanguage_insurance_eternal — would never end, because the lawyer allowed foreclosing in any later future... but
- CLOUT_workshop/SzaboLanguage_insurance_foreclosing — should succeed because of foreclosing
- CLOUT_workshop/SzaboLanguage_insurance_irrelevant_events — irrelevant events happened, but our truth prevails so we succeed...
- CLOUT_workshop/SzaboLanguage_insurance_noncompliant — fails, claim not paid
- CLOUT_workshop/SzaboLanguage_insurance_normal_claim — succeeds correctly, claim being paid
- CLOUT_workshop/SzaboLanguage_insurance_tricky_claim — can't claim when it arrives
- CLOUT_workshop/badlight — /** <examples>
- CLOUT_workshop/badlight_user — A click in a room switches its light on. Rooms have atom names
- CLOUT_workshop/ballot — single ballot per program instance, added method names as in Solidity original
- CLOUT_workshop/bankTransfer — Uncomment this to get an experimental 2d display:
- CLOUT_workshop/bankTransfer_lazy2d — /** <examples>
- CLOUT_workshop/bubbleSort — bubble sort with relational data structure .
- CLOUT_workshop/burning — /*
- CLOUT_workshop/concurrentTowers — Note the execution of this program is very sensitive to the order
- CLOUT_workshop/concurrent_towers — Note the execution of this program is very sensitive to the order
- CLOUT_workshop/consolidatedLoan — consolidated loan example.
- CLOUT_workshop/d_test — A few examples of display specifications
- CLOUT_workshop/deliveryDelay — Example from Accord Project:
- CLOUT_workshop/derivative_contract — contract for derivative of UCITS ETF FTSE MIB
- CLOUT_workshop/diningPhilosophers — /** <examples>
- CLOUT_workshop/diningPhilosophers-client — Dining philosophers, detaching the dining table and cutlery from the guests and their seating arrangements
- CLOUT_workshop/diningPhilosophers-table — see diningPhilosphers-client.pl
- CLOUT_workshop/email — /** <examples>
- CLOUT_workshop/employment_contract — Originally at http://demo.logicalcontracts.com/example/employment_contract.pl
- CLOUT_workshop/employment_contract_base — Originally at http://demo.logicalcontracts.com/example/employment_contract.pl
- CLOUT_workshop/fireRecurrent — fire2
- CLOUT_workshop/fireSimple — /** <examples>
- CLOUT_workshop/fire_recurrent — fire2
- CLOUT_workshop/goat — wolf, goat, cabbage and farmer are objects and are located at the south margin.
- CLOUT_workshop/goto_with_ifthenelse — Showing if-then-else originating an iteration like behavior, inspired on RAK's:
- CLOUT_workshop/helloemail — /** <examples>
- CLOUT_workshop/life — Conway's game of life.
- CLOUT_workshop/life_lazyGUI — Conway's game of life.
- CLOUT_workshop/loanAgreementPostConditions — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, 2015.
- CLOUT_workshop/loanAgreementPostConditionsRT — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, March 2017.
- CLOUT_workshop/loanAgreementPostConditionsRTbase — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, March 2017.
- CLOUT_workshop/loanAgreementPostConditionsRTbaseBorrowerCures — Borrower cures a violation of covenant
- CLOUT_workshop/loanAgreementPostConditionsRTbaseBorrowerCuresRep — Borrower cures a violation of representation or warrant
- CLOUT_workshop/loanAgreementPostConditionsRTbaseBorrowerDefaults — The borrower defaults, by paying but not notifying the payment,
- CLOUT_workshop/loanAgreementPostConditionsRTbaseNoComplications — The simplest case with no complications:
- CLOUT_workshop/loanAgreementPostConditionsRTbasePaysEarly — %NOTE: this example is taking too long to run for the web (it takes about 90 seconds on barebones lps.swi), likely due to unconstrained times
- CLOUT_workshop/loanAgreementPostConditionsRTbasePaysEarlyTricky — Borrower pays early, in violation of the contract.
- CLOUT_workshop/loanAgreementPostConditionsRTbasePaysLate — Borrower pays late but cures the default
- CLOUT_workshop/loan_agreement — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, 2015.
- CLOUT_workshop/mapColouring — What happens if we add the following commented out constraint?.
- CLOUT_workshop/negatedEvents — Masochistic agent
- CLOUT_workshop/negatedEvents-FS — /** <examples>
- CLOUT_workshop/prisoners — /** <examples>
- CLOUT_workshop/quicksort — Prolog programs can be called from LPS.
- CLOUT_workshop/redis_toggler — Minimal example to toggle a Redis binary tag value
- CLOUT_workshop/rstapi_test — /*
- CLOUT_workshop/simulateExternalEvent — Technique to simulate an "outside world" event new_lustrum(_) every 5 cycles
- CLOUT_workshop/smartHomePrimitives — /*
- CLOUT_workshop/sortWithTime — Shortest sorting algorithm:-) A single logical implication, universally quantified on the antecedent.
- CLOUT_workshop/sos — RK's SOS recognizer/generator
- CLOUT_workshop/trash — % trash.lps
- CLOUT_workshop/turingTest — for XSB only:
- CLOUT_workshop/use_insulin — This is based on the example in Bench-Capon,
simulation 3
forTesting 63
- forTesting/BugEndingWithSimulatedRealTime — %maxTime(60). no need for this...
- forTesting/DelayPenalty — Late Delivery and Penalty. In case of delayed delivery except for
- forTesting/RockPaperScissors-3players — From "Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab",
- forTesting/RockPaperScissors-3players-badFluent — From "Step by Step Towards Creating a Safe Smart Contract: Lessons and Insights from a Cryptocurrency Lab",
- forTesting/authoriseCard — Bob's April 3, 2020 email
- forTesting/backgroundBankTransfer — golps('examples/forTesting/backgroundBankTransfer.pl',[background(ID),silent])
- forTesting/backgroundRain — just rains.lps
- forTesting/backgroundRain2 — golps('examples/forTesting/backgroundRain2.lps',[background(ID)])
- forTesting/backtrackingAcrossCycles — From Sam Yong's MSc thesis report, page 78
- forTesting/badlight2
- forTesting/ballotTest — By BK, modified by MC:
- forTesting/bankDoubleTransfer — following commented out: all actions are serialised, producing cumulative effects IF using updates
- forTesting/bankTransfer1
- forTesting/bankTransfer2 — bankTransfer
- forTesting/bank_account_realtime — %maxTime(10).
- forTesting/bank_transferWithhappened — Uncomment this to get an experimental 2d display:
- forTesting/bobObservationBug — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, 2015.
- forTesting/changingFluentInAntecedent
- forTesting/compositeEventInconsistency — Adapted by RAK from the simplified loan agreement in Flood and Goodenough, 2015.
- forTesting/compositeEventsInPostConditions
- forTesting/compositeInitiateBug — %%% LPS "system library":
- forTesting/editingActions — probably not to be used in user programs, just shaking things a bit...
- forTesting/externalPrologEvents — Exemplify external events defined as (polled) Prolog predicates
- forTesting/external_stuff
- forTesting/failBetter — we need to discover that the consequent is doomed to fail, given the following observations
- forTesting/failBetter2 — System primitives used next
- forTesting/fariba_sam_bug — This illustrates the need for "backtracking" accross cycles
- forTesting/fluentAfterEvent — %fluents total_due(_). initially total_due(100).
- forTesting/fluentInCompositeEvent
- forTesting/futuresContractCompliant
- forTesting/futuresContractFailing — we need to discover that the consequent is doomed to fail, given the following observations
- forTesting/if_then
- forTesting/if_then_else
- forTesting/if_then_else_with_writes — A convoluted story on the effect of implicit time variables..:
- forTesting/implicitTimeOrdering
- forTesting/inLineTimeExpressions
- forTesting/intensFluentBindingTime
- forTesting/manual_minimal — Use with option 'manual', and inject event 'a'.
- forTesting/mapColouring
- forTesting/meta — Using an "event meta-call" in a precondition to avoid enumerating all forbidden atomic events
- forTesting/negatedFluentInConjunction — Moving not gameOver to the end of the antecedent causes different behaviour!
- forTesting/negatedFluentShouldNotSucceed
- forTesting/negatedIntentionslFluent — By BK, modified by MC:
- forTesting/neverEndingEvent — "Never-ending composite event" hack.
- forTesting/paralellConjunctions
- forTesting/prospectiveGoat — wolf, goat, cabbage and farmer are things and are located at the south margin
- forTesting/prospectiveGoat2 — Basd on prospectiveGoat.pl, but with RK fixes
- forTesting/realTimeObservations — See datetime formats in http://www.swi-prolog.org/pldoc/doc_for?object=parse_time/3
- forTesting/real_time_constants
- forTesting/rock_scissor_paper_bug
- forTesting/saver — Force saving at cycle 5:
- forTesting/serializedDice — %unserializable roll(_).
- forTesting/simulatedTime — /** <examples>
- forTesting/simulatedTimeCompositeEvent
- forTesting/simulatedTimeCompositeEvent2 — /** <examples>
- forTesting/sos — if true then sos.
- forTesting/switchingWithTimeExpression — if lightOff then switch.
- forTesting/terminator — Demo lps_terminate action, and Prolog system "output predicate" called as an action
- forTesting/testNLPhook — /** <examples>
- forTesting/trash_forall — % trash.lps
- forTesting/trash_two_locked — % trash.lps
- forTesting/two_initiate
- forTesting/unserializedDice
Logical English 15
- le/badlight.le — Two agents disagreeing about the lights.
- le/bank_transfer.le — The canonical "contract" shape: an obligation that fires on a transfer.
- le/delivery_delay.le — Late Delivery and Penalty (Accord Project). Deadlines and elapsed time.
- le/dining_philosophers.le — Concurrent actions, and a precondition over a set of them.
- le/escrow.le — Multi-party obligations: buyer, seller and an escrow agent.
- le/fire_simple.le — The smallest interesting reactive rule.
- le/goat.le — Wolf, goat, cabbage and farmer. Composite events with recursive decomposition.
- le/goat_declarative.le — The same puzzle, stated rather than solved: no decomposition, just denials
- le/life.le — Conway's Game of Life: an intensional fluent recomputed over a grid every
- le/loan_agreement.le — A simplified loan agreement: real time, calendar dates, and a legal text
- le/map_colouring.le — Timeless-heavy, almost no state: the constraints do the work.
- le/prospective_goat.le — The acceptance test for this surface language (docs/le_lps_surface.md §5):
- le/rock_paper_scissors_base.le — The second LE1 specimen, re-expressed in LE2 idiom.
- le/rock_paper_scissors_ethereum.le — The third LE1 specimen, re-expressed in LE2 idiom.
- le/rock_paper_scissors_minimal.le — The first of the three LE1 specimens, re-expressed in LE2 idiom.