Prolog

1 program Added 2025-10-22T09:40:09Z Model: openai/gpt-4o-miniTemp: 0.4 Evidence Report issue View issues
Aliases: Logic Programming, Prolog Programming
Provenance: commit ae5dc160b2 · authored 2025-10-22T11:40:09+02:00 · model openai/gpt-4o-mini

Sources mentioning this language

8 sources · pl_id: pl/prolog
LLM (this repo) · 1PldbLinguistPygmentsWikipediaHyperpolyglotRosettacodeWikidata · Q163468

Wikipedia infobox

Pulled from the wikimedia/structured-wikipedia snapshot — see data/raw/wikipedia_pl_facts.*.jsonl and pl_fact.csv for the long-table provenance.

Paradigmslogic
Typinguntyped (its single data type is "term")
Designed byAlain Colmerauer
First appeared1972
Influenced byPlanner
Homepagehttps://www.iso.org/standard/21413.html

Extensions claimed by this language

12 claims. Each row is one upstream assertion with its strength. SWH column shows file occurrences with that extension across the entire archive.
ExtensionSourceStrengthSWH
.eclpygmentsprimary201.6K files
.pwikidataprimary5.0M files
.pllinguistprimary5.4M files
.plwikidataprimary5.4M files
.prowikidataprimary3.4M files
.plpygmentssecondary5.4M files
.pltlinguistsecondary330.7K files
.prolinguistsecondary3.4M files
.propygmentssecondary3.4M files
.prologlinguistsecondary11.7K files
.prologpygmentssecondary11.7K files
.yaplinguistsecondary17.9K files

Related languages

PROGOL (0.52)HiLog (0.39)Ladder Diagram (0.39)Jac (0.34)Piet (0.34)

LLM-contributed programs

Family Tree Example

Provenance: commit ae5dc160b2 · authored 2025-10-22T11:40:09+02:00 · model openai/gpt-4o-mini · Temp 0.4
code.pl · license: MIT · added: 2025-10-22T09:40:09Z
parent(john, mary).
parent(john, tom).
parent(mary, alice).
parent(tom, bob).

sibling(X, Y) :- parent(Z, X), parent(Z, Y), X \= Y.

% Example Queries:
% ?- sibling(alice, bob).
% ?- sibling(mary, tom).

Real programs from Software Heritage

3 samples mined from derived_datasets/<date>/contents/*.parquet, byte-verified against the SWH archive. Citation-grade qualified SWHIDs preserved.
ubiq.pro · 50 B · ext .pro · seen 3376× in SWH
via fallback
swh:1:cnt:88fa153a6ccb3529f980494c6fd1241787dd41a7;origin=https://github.com/timbog/GreatGunGame;anchor=swh:1:rev:2c6b7799780573ef06376775de9d8de37d1888ba;path=/my_qreal_project/qreal-master/plugins/ubiq.pro
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
TEMPLATE = subdirs

SUBDIRS = \
	ubiq/ubiq.pro \

nessus_translator.P · 2310 B · ext .p · seen 42× in SWH
via fallback
swh:1:cnt:8bd0acb72f6634648a52b82f1a345ca1ed7d9c77;origin=https://github.com/risksense/mulval;anchor=swh:1:rev:369f7484ea5263074f70464a7fada98b6e546df6;path=/src/adapter/nessus_translator.P
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source

:- import member/2 from lists.
hasEffect(privEscalation).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC ).

vulExists(Host, CVE, Prog):- 
  vuln_exists(Host, CVE, Prog, _Range, _Losstype, _Severity, _AC, Port, Prot ).

vulProperty(CVE, localExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(local,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect, Port, Prot):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).

vulProperty(CVE, remoteExploit, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, _Port, _Prot ),
  member(remoteExploit,RangeList),
  not  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


vulProperty(CVE, remoteClient, Effect):- 
  vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC ),
  member(remoteExploit,RangeList),
  member(user_action_req,RangeList),
  lossTypetoEffect(Losstype, Effect).


lossTypetoEffect(Losstype, Effect):-
            member('data_modification', Losstype),
            hasEffect(Effect).

lossTypetoEffect(Losstype, Effect):-
            member('data_loss', Losstype),
            hasEffect(Effect).

cvss(CVE, AC):-
	vuln_exists(Host, CVE, Prog, _RangeList, _Losstype, _Severity, AC ).

cvss(CVE, AC):-
        vuln_exists(_Host, CVE, _Prog, RangeList,Losstype, _Severity, AC, Port, Prot ).

networkServiceInfo(Host, Program, Prot, Port, someUser) :-
	vulExists(Host, CVE, Program),
        vulProperty(CVE, remoteExploit, _Effect, Port, Prot).

%hacl(Host, internet, Prot, Port) :-
 %       vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%hacl(internet, Host, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

%this is not corrent, because it binds the CVE Port and Prot together which couldn't be true.
%hacl(Host, Host2, Prot, Port) :-
 %      vuln_exists(Host, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ),
  %     vuln_exists(Host2, CVE, _Prog, RangeList,Losstype, _Severity, _AC, Port, Prot ).

leap_tests.plt · 706 B · ext .plt · seen 34× in SWH
via heuristicrule h/linguist/.plt/0
swh:1:cnt:dab8d49d5bf24b75ad32d4bae2775d536300e3ad;origin=https://github.com/exercism/prolog;anchor=swh:1:rev:931d44cad86edbb5f630c6a08df8f5fe79bec52e;path=/exercises/practice/leap/leap_tests.plt
Open in SWH · Raw bytes (SWH) · GitHub raw
Show source
pending :-
    current_prolog_flag(argv, ['--all'|_]).
pending :-
    write('\nA TEST IS PENDING!\n'),
    fail.

:- begin_tests(leap_tests).

    test(leap_year, condition(true)) :-
        leap(1996).

    test(standard_and_odd_year, condition(pending)) :-
        not(leap(1997)).

    test(standard_even_year, condition(pending)) :-
        not(leap(1998)).

    test(standard_nineteeth_century, condition(pending)) :-
        not(leap(1900)).

    test(standard_eighteenth_century, condition(pending)) :-
        not(leap(1800)).

    test(leap_twenty_fourth_century, condition(pending)) :-
        leap(2400).

    test(leap_y2k, condition(pending)) :-
        leap(2000).

:- end_tests(leap_tests).

Disambiguation rules

Linguist heuristic rules that predict this language when one of its claimed extensions is shared with another.
RuleExtKindPredicates (truncated)
h/linguist/.pl/0.plpredicates[{"kind": "any", "regexes": ["^[^#]*:-"]}]
h/linguist/.pro/1.propredicates[{"kind": "any", "regexes": ["^[^\\[#]+:-"]}]
h/linguist/.plt/0.pltpredicates[{"kind": "any", "regexes": ["^\\s*:-"]}]

Contribute — propose a file extension

Tell us where to find evidence about Prolog (mapped to pl/prolog). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Prolog/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Prolix 1.1 Prolog II →