https://github.com/janverschelde/PHCpack
Raw File
Tip revision: 6e62d1d26aaa0f5d9e4e7a1bf28d307e3d7e0737 authored by Jan Verschelde on 30 July 2020, 23:11:33 UTC
set optimization flags on by default on makefile for mac os x
Tip revision: 6e62d1d
usephc.mws
{VERSION 4 0 "IBM INTEL NT" "4.0" }
{USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 
1 0 0 0 0 1 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 
0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 1 }
{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 
2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 1" -1 3 1 
{CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 6 
6 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times
" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 4 4 1 0 1 0 2 2 0 1 }
{PSTYLE "Maple Output" -1 11 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 
2 2 2 2 2 2 1 1 1 1 }3 3 0 0 0 0 1 0 1 0 2 2 0 1 }}
{SECT 0 {SECT 0 {PARA 3 "" 0 "" {TEXT -1 20 "Using phc with Maple" }}
{PARA 0 "" 0 "" {TEXT -1 99 "Assume the executable version of phc is i
n c:\\PHCv2\\bin; and we are executing this under windows..." }}{SECT 
0 {PARA 4 "" 0 "" {TEXT -1 27 "1. Preparing the input file" }}{PARA 0 
"" 0 "" {TEXT -1 163 "The input file to phc consists of a sequence of \+
polynomials separated by semicolons.  The first element in the file sh
ould be the number of equations and unknowns." }}{EXCHG {PARA 0 "> " 
0 "" {MPLTEXT 1 0 14 "p1 := x*y - 1:" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 15 "p2 := x**2 - 1:" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 47 "n := 2:      # number of equations and unknowns" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "sp1 := convert(p1,'string'):
" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "sp2 := convert(p2,'stri
ng'):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "semcol := `;`:" }}
}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "sp1 := ` `||sp1||semcol:   \+
# appending semicolons to equations" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 24 "sp2 := ` `||sp2||semcol:" }}}{EXCHG {PARA 0 "> " 0 "
" {MPLTEXT 1 0 58 "ssystem(`rm -f input`): # removing any previous inp
ut file" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "fprintf(input,`%
d\\n%s\\n%s\\n`,n,sp1,sp2):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 
14 "fclose(input);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "show_
input := ssystem(`cat input`):  # testing the input" }}}{EXCHG {PARA 
0 "> " 0 "" {MPLTEXT 1 0 17 "op(2,show_input);" }}{PARA 11 "" 1 "" 
{XPPMATH 20 "6#Q32|+~x*y-1;|+~x^2-1;|+6\"" }}}}{SECT 0 {PARA 4 "" 0 "
" {TEXT -1 14 "2. Calling phc" }}{PARA 0 "" 0 "" {TEXT -1 260 "The mai
n trouble is that phc is an interactive program and Maple (at least on
 a Sun workstation) is not very good in releasing the control.  So mak
e absolutely sure that the file \"input\" is correct and there is no o
ther file \"output\" in the current directory. " }}{EXCHG {PARA 0 "> \+
" 0 "" {MPLTEXT 1 0 24 "ssystem(`rm -f output`):" }}}{EXCHG {PARA 0 ">
 " 0 "" {MPLTEXT 1 0 44 "ssystem(`c:/PHCv2/bin/phc -b input output`):
" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 151 "If phc takes control, you ha
ve to go to your window where you launched Maple in the background and
 explicitly tell unix to run Maple in the foreground." }{MPLTEXT 1 0 
0 "" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 29 "3. Processing the output
 file" }}{PARA 0 "" 0 "" {TEXT -1 45 "Here we invoke a new option of p
hc, the \"-z\"." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "ssystem(`
c:/PHCv2/bin/phc -z output maple_sols`):" }}}{EXCHG {PARA 0 "> " 0 "" 
{MPLTEXT 1 0 16 "read maple_sols;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7
$7$^$$!0+++++++\"!#9$\"\"!F*F%7$^$$\"0+++++++\"F(F)F," }}}{EXCHG 
{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "sols := %:" }}}{EXCHG {PARA 0 "> " 
0 "" {MPLTEXT 1 0 25 "op(sols[1]); op(sols[2]);" }}{PARA 11 "" 1 "" 
{XPPMATH 20 "6$^$$!0+++++++\"!#9$\"\"!F(F#" }}{PARA 11 "" 1 "" 
{XPPMATH 20 "6$^$$\"0+++++++\"!#9$\"\"!F(F#" }}}{EXCHG {PARA 0 "> " 0 
"" {MPLTEXT 1 0 47 "fp1 := unapply(p1,x,y); fp2 := unapply(p2,x,y);" }
}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$fp1GR6$%\"xG%\"yG6\"6$%)operatorG%
&arrowGF),&*&9$\"\"\"9%F0F0F0!\"\"F)F)F)" }}{PARA 11 "" 1 "" {XPPMATH 
20 "6#>%$fp2GR6$%\"xG%\"yG6\"6$%)operatorG%&arrowGF),&*$)9$\"\"#\"\"\"
F2F2!\"\"F)F)F)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "fp1(op(s
ols[1])); fp2(op(sols[1]));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#^$$\"\"
!F%$!\"!F%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#^$$\"\"!F%$!\"!F%" }}}
{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}}}{MARK "0 4 8 0 0" 0 }
{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }
back to top