47 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
		
		
			
		
	
	
			47 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| 
								 | 
							
								/tmp/clpq
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- use_module(library('clpqr/monash')).
							 | 
						||
| 
								 | 
							
								{compiling /freyung/christian/sicstus2.1.9.clp/library/clpqr/monash.pl...}
							 | 
						||
| 
								 | 
							
								{loading /freyung/christian/sicstus2.1.9.clp/library/clpqr/printf.ql...}
							 | 
						||
| 
								 | 
							
								{loaded /freyung/christian/sicstus2.1.9.clp/library/clpqr/printf.ql in module printf, 30 msec 27216 bytes}
							 | 
						||
| 
								 | 
							
								{loading /freyung/christian/sicstus2.1.9.clp/library/clpqr/expand.ql...}
							 | 
						||
| 
								 | 
							
								{loaded /freyung/christian/sicstus2.1.9.clp/library/clpqr/expand.ql in module expand, 40 msec 26832 bytes}
							 | 
						||
| 
								 | 
							
								{/freyung/christian/sicstus2.1.9.clp/library/clpqr/monash.pl compiled, 90 msec 54848 bytes}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- expand, [library('clpqr/examples/monash/mortgage')], noexpand.
							 | 
						||
| 
								 | 
							
								{consulting /freyung/christian/sicstus2.1.9.clp/library/clpqr/examples/monash/mortgage...}
							 | 
						||
| 
								 | 
							
								{Warning: [Int] - singleton variables in go4/0 in lines 45-51}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								>>> Sample goals: go1/0, go2/0, go3/0, go4/0
							 | 
						||
| 
								 | 
							
								{/freyung/christian/sicstus2.1.9.clp/library/clpqr/examples/monash/mortgage consulted, 20 msec 4992 bytes}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- go1.
							 | 
						||
| 
								 | 
							
								Forward: MP = 1721.65
							 | 
						||
| 
								 | 
							
								Backward: P = 120000
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- go2.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- mg(P,120,0.01,0,MP), dump([P,MP]).
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								{P=230038689457366504787696421844051916348685607672853885051027633046922230334437656640810235469538098584320203208140788877352356725532780953940525919735874426790409432648433950808597819868060753380384018578968864514756271928149406197791141200100/3300386894573665047876964218440519163486856076728538850510276330469222303344376566408102354695380985843202032081407888773523567255327809539405259197358744267904094326484339508085978198680607533803840185789688645147562719281494061977911412001*MP} ? 
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- mg(P,120,0.01,B,MP), dump([P,B,MP]).
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								{P=1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000/3300386894573665047876964218440519163486856076728538850510276330469222303344376566408102354695380985843202032081407888773523567255327809539405259197358744267904094326484339508085978198680607533803840185789688645147562719281494061977911412001*B+230038689457366504787696421844051916348685607672853885051027633046922230334437656640810235469538098584320203208140788877352356725532780953940525919735874426790409432648433950808597819868060753380384018578968864514756271928149406197791141200100/3300386894573665047876964218440519163486856076728538850510276330469222303344376566408102354695380985843202032081407888773523567255327809539405259197358744267904094326484339508085978198680607533803840185789688645147562719281494061977911412001*MP} ? 
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- mg(999, 3, Int, 0, 400), dump.
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								nonlin:{_B-_B*Int+_A+400=0},
							 | 
						||
| 
								 | 
							
								nonlin:{_A-_A*Int+400=0},
							 | 
						||
| 
								 | 
							
								{_B=599+999*Int} ? 
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								yes
							 | 
						||
| 
								 | 
							
								| ?- 
							 |