简体   繁体   中英

How do i run a prolog file

this is my first time programing with prolog so I dont know my way around it, i've written the code but how do I execute it in prolog here the code:

id --> letter, digitsLetters.
digitsLetters --> digit, digitsLetters.
digitsLetters --> letter, digitsLetters.
digitsLetters --> [].

positive_digits --> sign, digits.
sign --> "+"; [].
digits --> digit; digit, digits.

letter --> "A"; "B"; "C"; "D"; "E"; "F"; "G"; "H"; "I"; "J"; "K"; "L"; "M".
letter --> "N"; "O"; "P"; "Q"; "R"; "S"; "T"; "U"; "V"; "W"; "X"; "Y"; "Z".
letter --> "a"; "b"; "c"; "d"; "e"; "f"; "g"; "h"; "i"; "j"; "k"; "l"; "m".
letter --> "n"; "o"; "p"; "q"; "r"; "s"; "t"; "u"; "v"; "w"; "x"; "y"; "z".
letter -->  "_".

digit --> "0".
digit --> "1".
digit --> "2".
digit --> "3".
digit --> "4".
digit --> "5".
digit --> "6".
digit --> "7".
digit --> "8".
digit --> "9".

1 . Make it from the Compile tab and Save it

2 . Open SWI-Prolog > File > Consult > Now open the saved above code file name will like FileName.Pl

3 . Now Type your method name and it's arguments then > Enter,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM