tuprolog

A tuprolog syntax error.Syntax error at/before line -1

末鹿安然 提交于 2020-01-07 02:27:07
问题 I am new to prolog. I have a .pl file consulting normally on swi-prolog, but when I consult it on tu-prolog, crazy things always happen. Here are parts of my codes. :- dynamic(assignopT/6). :- multifile(assignopT/6). assignopT(30246,30244,30210,30247,+,30248). When I consulted it on tu-prolog,it said syntax error at/before line 12219,which is the third line above. It work all right on swi-prolog. Then I thought maybe there is something wrong with +, so I changed it to this. assignopT(30246

Tuprolog and defining infix operators

廉价感情. 提交于 2019-12-11 12:17:57
问题 So I have some prolog... cobrakai$more operator.pl be(a,c). :-op(35,xfx,be). +=(a,c). :-op(35,xfx,+=). cobrakai$ Which defines some infix operators. I run it using SWI prolog and get the following (perfectly expected) results ?- halt. cobrakai$swipl -s operator.pl % library(swi_hooks) compiled into pce_swi_hooks 0.00 sec, 3,992 bytes % /Users/josephreddington/Documents/workspace/com.plancomps.prolog.helloworld/operator.pl compiled 0.00 sec, 992 bytes Welcome to SWI-Prolog (Multi-threaded, 64

Running prolog in Android

烈酒焚心 提交于 2019-12-08 08:02:30
I am testing tuProlog in Android. I have an Activity TuProlog, class Parser to interact with prolog code and data.pl which contains prolog code. I can run it fine as a java project with output to console but I am facing trouble doing so as an Android project. For Android I get FileNotFoundException even though my file data.pl is copied in root of project, inside src and inside my package. I just want to fetch the result as string and display my result in TextView. Here are my codes public class TuProlog extends Activity implements OnClickListener{ TextView tv; Button b1; /** Called when the

Running prolog in Android

前提是你 提交于 2019-12-08 04:37:43
问题 I am testing tuProlog in Android. I have an Activity TuProlog, class Parser to interact with prolog code and data.pl which contains prolog code. I can run it fine as a java project with output to console but I am facing trouble doing so as an Android project. For Android I get FileNotFoundException even though my file data.pl is copied in root of project, inside src and inside my package. I just want to fetch the result as string and display my result in TextView. Here are my codes public

Need to Capture selective STDOUT from Android for display in listview

天涯浪子 提交于 2019-12-03 10:17:19
问题 I'm running the an embedded library [tuProlog (2p.jar)] Prolog Inference Engine in Android with custom logic bases which I can successfully query and display (some) of the results in an Android ListView. What gets displayed is only the results from the inference engine itself, not ancillary commands like a Prolog 'write' statement which (by default) writes to STDOUT. I need to capture the result of that 'write' printing to the STDOUT in an Android variable to display to the user. The general