59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
DataSection
|
|
TLogic:
|
|
Data.i -1,0,1
|
|
TSymb:
|
|
Data.s "F","?","T"
|
|
EndDataSection
|
|
|
|
Structure TL
|
|
F.i
|
|
M.i
|
|
T.i
|
|
EndStructure
|
|
|
|
Structure SYM
|
|
TS.s{2}[3]
|
|
EndStructure
|
|
|
|
*L.TL=?TLogic
|
|
*S.SYM=?TSymb
|
|
|
|
Procedure.i NOT3(*x.TL)
|
|
ProcedureReturn -*x
|
|
EndProcedure
|
|
|
|
Procedure.i AND3(*x.TL,*y.TL)
|
|
If *x>*y : ProcedureReturn *y : Else : ProcedureReturn *x : EndIf
|
|
EndProcedure
|
|
|
|
Procedure.i OR3(*x.TL,*y.TL)
|
|
If *x<*y : ProcedureReturn *y : Else : ProcedureReturn *x : EndIf
|
|
EndProcedure
|
|
|
|
Procedure.i EQV3(*x.TL,*y.TL)
|
|
ProcedureReturn *x * *y
|
|
EndProcedure
|
|
|
|
Procedure.i IMP3(*x.TL,*y.TL)
|
|
If -*y>*x : ProcedureReturn -*y : Else : ProcedureReturn *x : EndIf
|
|
EndProcedure
|
|
|
|
If OpenConsole("")
|
|
PrintN(" (AND) ( OR) (EQV) (IMP) (NOT)")
|
|
PrintN(" F ? T F ? T F ? T F ? T ")
|
|
PrintN(" -------------------------------------------------")
|
|
For *i.TL=*L\F To *L\T
|
|
rs$=" "+*S\TS[*i+1]+" | "
|
|
rs$+*S\TS[AND3(*L\F,*i)+1]+" "+*S\TS[AND3(*L\M,*i)+1]+" "+*S\TS[AND3(*L\T,*i)+1]
|
|
rs$+" "
|
|
rs$+*S\TS[OR3(*L\F,*i)+1] +" "+*S\TS[OR3(*L\M,*i)+1] +" "+*S\TS[OR3(*L\T,*i)+1]
|
|
rs$+" "
|
|
rs$+*S\TS[EQV3(*L\F,*i)+1]+" "+*S\TS[EQV3(*L\M,*i)+1]+" "+*S\TS[EQV3(*L\T,*i)+1]
|
|
rs$+" "
|
|
rs$+*S\TS[IMP3(*L\F,*i)+1]+" "+*S\TS[IMP3(*L\M,*i)+1]+" "+*S\TS[IMP3(*L\T,*i)+1]
|
|
rs$+" "+*S\TS[NOT3(*i)+1]
|
|
PrintN(rs$)
|
|
Next
|
|
EndIf
|
|
Input()
|